Skip to content

Commit

Permalink
Update Entity_Extraction_JSON.ipynb (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
pitmonticone committed Jun 25, 2024
1 parent 7f40861 commit 3116367
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/json_capabilities/Entity_Extraction_JSON.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
},
"outputs": [],
"source": [
"entity_recongnition_text = \"John Johnson, the CEO of the Oil Inc. and Coal Inc. companies, has unveiled plans to build a new factory in Houston, Texas.\"\n",
"entity_recognition_text = \"John Johnson, the CEO of the Oil Inc. and Coal Inc. companies, has unveiled plans to build a new factory in Houston, Texas.\"\n",
"prompt = f\"\"\"\n",
"Generate list of entities in text based on the following Python class structure:\n",
"\n",
Expand All @@ -147,7 +147,7 @@
"class Entities(TypedDict):\n",
" entities: list[Entity]\n",
"\n",
"{entity_recongnition_text}\"\"\"\n",
"{entity_recognition_text}\"\"\"\n",
"model = genai.GenerativeModel(model_name='gemini-1.5-flash-latest', generation_config={\"temperature\": 0})\n",
"response = model.generate_content(prompt, generation_config={\"response_mime_type\": \"application/json\"})"
]
Expand Down Expand Up @@ -201,7 +201,7 @@
},
"source": [
"## Summary\n",
"You have used the Gemini API to extract entities of predifined categories with their labels. You extracted every person, company, state, and country. You are not limited to these categories, as this should work with any category of your choice.\n",
"You have used the Gemini API to extract entities of predefined categories with their labels. You extracted every person, company, state, and country. You are not limited to these categories, as this should work with any category of your choice.\n",
"\n",
"Please see the other notebooks in this directory to learn more about how you can use the Gemini API for other JSON related tasks.\n"
]
Expand Down

0 comments on commit 3116367

Please sign in to comment.