Skip to content

Conversation

@itea1001
Copy link
Contributor

@itea1001 itea1001 commented May 6, 2025

Resolve #42

  • Added automated literature search module with Semantic Scholar API (and automatically run grobid)
  • To use:

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 add automated_literature_search_topic in prompt yaml file, and run literature_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 with modules/setup_grobid.sh.

@laoliu5280 laoliu5280 requested a review from Copilot June 25, 2025 18:42
Copy link

Copilot AI left a 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,
):
Copy link

Copilot AI Jun 25, 2025

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.

Suggested change
):
):
logger = LoggerConfig.get_logger("auto-literature-search")

Copilot uses AI. Check for mistakes.
Comment on lines +150 to +151
)
grobid_process.terminate()
Copy link

Copilot AI Jun 25, 2025

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.

Suggested change
)
grobid_process.terminate()
)

Copilot uses AI. Check for mistakes.
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.

Automated literature search module for HypoRefine

2 participants