Skip to content

Rerank with lower threshold + back to map if length = 0#1086

Merged
nickscamara merged 3 commits intomainfrom
rafa/reranker-removing-all-links
Jan 24, 2025
Merged

Rerank with lower threshold + back to map if length = 0#1086
nickscamara merged 3 commits intomainfrom
rafa/reranker-removing-all-links

Conversation

@rafaelsideguide
Copy link
Collaborator

FIR-666

@rafaelsideguide rafaelsideguide changed the title Rerank with lower threshold + back to map if lenght = 0 Rerank with lower threshold + back to map if length = 0 Jan 24, 2025
Copy link
Member

@mogery mogery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! Might extend the logging a bit afterwards. How does it do on the relevant cases in the Excel? And the benchmark?


export function buildRerankerUserPrompt(searchQuery: string): string {
return `Given these URLs and their content, identify which ones are relevant to the user's extraction request: "${searchQuery}". Return an array of relevant links with their relevance scores (0-1). Higher scores should be given to URLs that directly address the user's extraction request. Be very mindful with the links you select, as if they are not that relevant it may affect the quality of the extraction. Only include URLs that have a relvancy score of 0.6+.`;
return `Given these URLs and their content, identify which ones are relevant to the user's extraction request: "${searchQuery}". Return an array of relevant links with their relevance scores (0-1). Higher scores should be given to URLs that directly address the user's extraction request. Be very mindful with the links you select, as if they are not that relevant it may affect the quality of the extraction.`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth rewriting the prompt a little to have it just assign a score instead of selecting? Would give us more control of what we include.

@nickscamara
Copy link
Member

Evals look good. Around ~4% better in most cases.

@nickscamara nickscamara merged commit d547192 into main Jan 24, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants