Skip to content
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

feat: integrate RAG into hypothesis generation #267

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Xisen-Wang
Copy link
Collaborator

@Xisen-Wang Xisen-Wang commented Sep 17, 2024

Description

This PR integrates Retrieval-Augmented Generation (RAG) into the hypothesis generation process for Kaggle scenarios. It enhances the KGHypothesisGen class to leverage relevant information from a knowledge base when generating hypotheses.

Key changes:

  • Added PDVectorBase initialization in KGHypothesisGen
  • Modified prepare_context method to perform RAG search
  • Incorporated RAG results into the context for hypothesis generation

Motivation and Context

This change improves the quality and relevance of generated hypotheses by providing additional context from a knowledge base. It allows the model to consider a broader range of information when formulating hypotheses, potentially leading to more insightful and accurate proposals.

Related issue: #[Issue number if applicable]

How Has This Been Tested?

  • Pass the test by running: pytest qlib/tests/test_all_pipeline.py under upper directory of qlib.
  • Added new test cases in tests/test_kg_hypothesis_gen.py to verify RAG integration.

Screenshots of Test Results (if appropriate):

  1. Pipeline test: [Insert screenshot or log snippet]
  2. New RAG integration tests: [Insert screenshot or log snippet]

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

📚 Documentation preview 📚: https://RDAgent--267.org.readthedocs.build/en/267/

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.

1 participant