Skip to content

Commit 410afa6

Browse files
authored
Merge pull request #52 from jinyichao/patch-1
Update Expert Structured Output (Using Kor).ipynb
2 parents dc7f9f8 + e3a7001 commit 410afa6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

data_generation/Expert Structured Output (Using Kor).ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
" My sister's name is Rachel.\n",
188188
" My brother's name Joe. My dog's name is Spot\n",
189189
"\"\"\"\n",
190-
"output = chain.predict_and_parse(text=(text))[\"data\"]\n",
190+
"output = chain.run(text=(text))[\"data\"]\n",
191191
"\n",
192192
"printOutput(output)\n",
193193
"# Notice how there isn't \"spot\" in the results list because it's the name of a dog, not a person."
@@ -218,7 +218,7 @@
218218
}
219219
],
220220
"source": [
221-
"output = chain.predict_and_parse(text=(\"The dog went to the park\"))[\"data\"]\n",
221+
"output = chain.run(text=(\"The dog went to the park\"))[\"data\"]\n",
222222
"printOutput(output)"
223223
]
224224
},
@@ -300,7 +300,7 @@
300300
"text=\"Palm trees are brown with a 6 rating. Sequoia trees are green\"\n",
301301
"\n",
302302
"chain = create_extraction_chain(llm, plant_schema)\n",
303-
"output = chain.predict_and_parse(text=text)['data']\n",
303+
"output = chain.run(text=text)['data']\n",
304304
"\n",
305305
"printOutput(output)"
306306
]
@@ -402,7 +402,7 @@
402402
"\n",
403403
"# Changed the encoder to json\n",
404404
"chain = create_extraction_chain(llm, cars_schema, encoder_or_encoder_class=\"json\")\n",
405-
"output = chain.predict_and_parse(text=text)['data']\n",
405+
"output = chain.run(text=text)['data']\n",
406406
"\n",
407407
"printOutput(output)"
408408
]
@@ -529,7 +529,7 @@
529529
],
530530
"source": [
531531
"chain = create_extraction_chain(llm, schema, encoder_or_encoder_class='json')\n",
532-
"output = chain.predict_and_parse(text=\"please add 15 more units sold to 2023\")['data']\n",
532+
"output = chain.run(text=\"please add 15 more units sold to 2023\")['data']\n",
533533
"\n",
534534
"printOutput(output)"
535535
]
@@ -891,7 +891,7 @@
891891
}
892892
],
893893
"source": [
894-
"output = chain.predict_and_parse(text=text)[\"data\"]\n",
894+
"output = chain.run(text=text)[\"data\"]\n",
895895
"\n",
896896
"printOutput(output)"
897897
]
@@ -1027,7 +1027,7 @@
10271027
],
10281028
"source": [
10291029
"chain = create_extraction_chain(llm, salary_range)\n",
1030-
"output = chain.predict_and_parse(text=text)[\"data\"]\n",
1030+
"output = chain.run(text=text)[\"data\"]\n",
10311031
"\n",
10321032
"printOutput(output)"
10331033
]
@@ -1070,7 +1070,7 @@
10701070
],
10711071
"source": [
10721072
"with get_openai_callback() as cb:\n",
1073-
" result = chain.predict_and_parse(text=text)\n",
1073+
" result = chain.run(text=text)\n",
10741074
" print(f\"Total Tokens: {cb.total_tokens}\")\n",
10751075
" print(f\"Prompt Tokens: {cb.prompt_tokens}\")\n",
10761076
" print(f\"Completion Tokens: {cb.completion_tokens}\")\n",

0 commit comments

Comments
 (0)