-
Notifications
You must be signed in to change notification settings - Fork 10
add automated literature search module #49
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
base: master
Are you sure you want to change the base?
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 adds an automated literature search module that queries the Semantic Scholar API and integrates with grobid for processing literature PDFs.
- Added auto_literature_search function to fetch and download papers based on a topic.
- Updated LiteratureAgent to invoke the new search function and process the downloaded PDFs via grobid.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| hypothesis_agent/literature_review_agent/literature_search.py | Implements the automated literature search using Semantic Scholar API. |
| hypothesis_agent/literature_review_agent/literature_review.py | Integrates the literature search module and invokes grobid for PDF processing. |
| task_name: str = None, | ||
| num_papers_per_trial: int = 10, | ||
| max_trial: int = 5, | ||
| ): |
Copilot
AI
Jun 25, 2025
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.
The logger is used before it is defined (it is instantiated on line 20), which may result in a NameError. Consider moving the logger initialization to the beginning of the function.
| ): | |
| ): | |
| logger = LoggerConfig.get_logger("auto-literature-search") |
| ) | ||
| grobid_process.terminate() |
Copilot
AI
Jun 25, 2025
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.
The grobid process is terminated in the finally block earlier (lines 142-144) and then terminated again on line 151; remove the redundant termination to simplify the flow.
| ) | |
| grobid_process.terminate() | |
| ) |
Resolve #42
Instead of adding literature PDF, then running grobid and
literature_agent.summarize_papers(data_file=papers_dir_path,cache_seed=cache_seed, **generate_kwargs), simply addautomated_literature_search_topicin prompt yaml file, and runliterature_agent.auto_process_literature()in script. It works as long as a Semantic Scholar API Key is provided (os.environ["SS_API_KEY"] = ...)and grobid is already setup withmodules/setup_grobid.sh.