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

Update data_extraction_llms.ipynb #1

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

Conversation

RaviKumarSingh-Mckinsey

in the below code section "From pydantic import Field was missing , I added that one line

from pydantic import Field

class AnswerWithSources(BaseModel):
"""An answer to the question, with sources and reasoning."""
answer: str = Field(description="Answer to question")
sources: str = Field(description="Full direct text chunk from the context used to answer the question")
reasoning: str = Field(description="Explain the reasoning of the answer based on the sources")

class ExtractedInfo(BaseModel):
"""Extracted information about the research article"""
paper_title: AnswerWithSources
paper_summary: AnswerWithSources
publication_year: AnswerWithSources
paper_authors: AnswerWithSources

in the below code section "From pydantic import Field was missing , I added that one line 

from pydantic import Field


class AnswerWithSources(BaseModel):
    """An answer to the question, with sources and reasoning."""
    answer: str = Field(description="Answer to question")
    sources: str = Field(description="Full direct text chunk from the context used to answer the question")
    reasoning: str = Field(description="Explain the reasoning of the answer based on the sources")
    
class ExtractedInfo(BaseModel):
    """Extracted information about the research article"""
    paper_title: AnswerWithSources
    paper_summary: AnswerWithSources
    publication_year: AnswerWithSources
    paper_authors: AnswerWithSources
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.

2 participants