From 83eea230f3f0a3b21caba9917f6e2750445db9f5 Mon Sep 17 00:00:00 2001 From: Francisco Ingham <24279597+fpingham@users.noreply.github.com> Date: Sat, 17 Jun 2023 04:05:48 -0300 Subject: [PATCH] changed height in the nb example (#6327) changed height in the example to a more reasonable number (from 9 feet to 6 feet) --- .../chains/additional/extraction.ipynb | 55 ++++++++++++------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/docs/extras/modules/chains/additional/extraction.ipynb b/docs/extras/modules/chains/additional/extraction.ipynb index a23a475b..3f7b4f51 100644 --- a/docs/extras/modules/chains/additional/extraction.ipynb +++ b/docs/extras/modules/chains/additional/extraction.ipynb @@ -52,7 +52,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 3, "id": "4ac43eba", "metadata": {}, "outputs": [], @@ -71,20 +71,20 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 6, "id": "640bd005", "metadata": {}, "outputs": [], "source": [ "inp = \"\"\"\n", - "Alex is 5 feet tall. Claudia is 4 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.\n", + "Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.\n", "Alex's dog Frosty is a labrador and likes to play hide and seek.\n", " \"\"\"" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 7, "id": "64313214", "metadata": {}, "outputs": [], @@ -102,7 +102,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 8, "id": "cc5436ed", "metadata": {}, "outputs": [ @@ -115,13 +115,11 @@ " 'dog_name': 'Frosty',\n", " 'dog_breed': 'labrador'},\n", " {'person_name': 'Claudia',\n", - " 'person_height': 9,\n", - " 'person_hair_color': 'brunette',\n", - " 'dog_name': '',\n", - " 'dog_breed': ''}]" + " 'person_height': 6,\n", + " 'person_hair_color': 'brunette'}]" ] }, - "execution_count": 10, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -152,7 +150,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 9, "id": "6792866b", "metadata": {}, "outputs": [], @@ -163,7 +161,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 10, "id": "36a63761", "metadata": {}, "outputs": [], @@ -178,7 +176,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 11, "id": "8ffd1e57", "metadata": {}, "outputs": [], @@ -188,29 +186,46 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 12, "id": "24baa954", "metadata": { "scrolled": false }, + "outputs": [], + "source": [ + "inp = \"\"\"\n", + "Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.\n", + "Alex's dog Frosty is a labrador and likes to play hide and seek.\n", + " \"\"\"" + ] + }, + { + "cell_type": "markdown", + "id": "84e0a241", + "metadata": {}, + "source": [ + "As we can see, we extracted the required entities and their properties in the required format:" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "f771df58", + "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[Properties(person_name='Alex', person_height=5, person_hair_color='blonde', dog_breed='labrador', dog_name='Frosty'),\n", - " Properties(person_name='Claudia', person_height=9, person_hair_color='brunette', dog_breed=None, dog_name=None)]" + " Properties(person_name='Claudia', person_height=6, person_hair_color='brunette', dog_breed=None, dog_name=None)]" ] }, - "execution_count": 21, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "inp = \"\"\"\n", - "Alex is 5 feet tall. Claudia is 4 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.\n", - "Alex's dog Frosty is a labrador and likes to play hide and seek.\n", - " \"\"\"\n", "chain.run(inp)" ] }