-
Notifications
You must be signed in to change notification settings - Fork 777
Dropping irrelevant contexts #1113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves evidence management in the PQA (Paper Question Answering) system by filtering out irrelevant evidence contexts early and updating the evidence display format for better clarity.
- Filters contexts with score ≤ 0 at collection time instead of repeatedly filtering during processing
- Updates evidence display to use bullet points instead of numbered lists and clarifies scope with "for the current question"
- Removes test code that artificially manipulated context scores with random values
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/paperqa/docs.py | Adds filtering to exclude contexts with score ≤ 0 during evidence collection |
src/paperqa/agents/tools.py | Updates evidence display format and removes score filtering (now handled upstream) |
tests/test_paperqa.py | Removes random import and updates tests to work with new evidence filtering behavior |
tests/test_agents.py | Updates test assertions to expect bullet point format instead of numbered lists |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
top_contexts = "\n".join( | ||
top_contexts = "\n\n".join( | ||
[ | ||
f"{n + 1}. {sc.context}\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note there was trailing whitespace here previously, now there's not
This PR clears up some fuzziness in our evidence accounting:
PQASession
Best evidence(s)
message for clarity