paper-qa
paper-qa copied to clipboard
PaperQA for clinical trials Query does not give right results
Paper QA2 for clinical trials does not revert any answers for questions like this : What are the major adverse events observed in case of wegovy drug?
Hey @lk4ml! 👋 I'm here to help you tackle any bugs, answer your questions, and guide you on your journey as a contributor. While you wait for a human maintainer, feel free to share more details, and let's figure this out together! 😄
If PaperQA is not returning results for queries about adverse events related to the Wegovy drug, there could be several reasons for this:
-
Data Availability: The
clinicaltrials.govAPI, which PaperQA uses, might not have relevant data for Wegovy's adverse events. Ensure that the clinical trials data for Wegovy is available and accessible through the API. -
Query Configuration: Verify that the
clinical_trials_searchtool is correctly configured in your settings. You can useSettings.from_name("search_only_clinical_trials")to ensure that the query is focused solely on clinical trials [1]. -
Parsing Settings: Check if the parsing settings are configured to interpret clinical trial data correctly. The
ParsingSettingsclass provides options likeuse_human_readable_clinical_trials, which can be set toTrueto parse clinical trial JSONs into human-readable text [2]. -
Specificity of Query: Ensure that the query is specific enough to match the data available. Sometimes, rephrasing the query or using different keywords can yield better results.
-
Error Handling: If no results are returned, check for any error messages or logs that might indicate issues with the query or data retrieval process. This can help troubleshoot and refine the query [3].
If these steps do not resolve the issue, consider reviewing the configuration and settings in your script to ensure they align with the requirements for querying clinical trial data.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
Can you tell me how your search is done when someone asks a questions like this. I can clearly see some trials with Wegovy drug on Clinical.gov Infact i see around 54 trials with wegovy drug mentioned in the trials. See the curl below : curl -X GET "https://clinicaltrials.gov/api/v2/studies?query.term=wegovy"
-H "accept: application/json"
Also, see the snapshot. I think we are not handling the questions properly and not parsing the user query accurately. There is some scope to improve that as we can breakdwon the query better to retrieve these results.
See below the snapshot :
Hi @lk4ml, thanks for the issue! Happy to see you using our clinical trials code.
For how it works:
- Here is the tool the agent LLM uses: https://github.com/Future-House/paper-qa/blob/v5.20.0/paperqa/agents/tools.py#L448
- Here is the function we use to call
clinicaltrials.gov: https://github.com/Future-House/paper-qa/blob/v5.20.0/paperqa/sources/clinical_trials.py#L90
To better help you based on your original post, can you paste the full text output printed (not just a screenshot that truncates the output)?