From 9300a8b80a66559489dd8478c0c6977c3915b448 Mon Sep 17 00:00:00 2001 From: RaviKumarSingh-Mckinsey <68860408+RaviKumarSingh-Mckinsey@users.noreply.github.com> Date: Wed, 23 Oct 2024 17:49:33 +0530 Subject: [PATCH] Update data_extraction_llms.ipynb 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 --- data_extraction_llms.ipynb | 1 + 1 file changed, 1 insertion(+) diff --git a/data_extraction_llms.ipynb b/data_extraction_llms.ipynb index 5ffe4b85b..2fb703161 100644 --- a/data_extraction_llms.ipynb +++ b/data_extraction_llms.ipynb @@ -475,6 +475,7 @@ "metadata": {}, "outputs": [], "source": [ + "from pydantic import Field" "class AnswerWithSources(BaseModel):\n", " \"\"\"An answer to the question, with sources and reasoning.\"\"\"\n", " answer: str = Field(description=\"Answer to question\")\n",