mirror of
https://github.com/kennethreitz/instructor.git
synced 2026-06-05 22:50:18 +00:00
small fixes to tutorials (#168)
Co-authored-by: Jason Liu <jxnl@users.noreply.github.com>
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"We have a `name` field, which is a string, and an `age` field, which is an integer. However, if we were to load this into a dictionary, we would have no way of knowing if the data is valid. For example, we could have a string for the age, or we could have a float for the age. We could also have a string for the name, or we could have a list for the name. We have no way of knowing if the data is valid, and we have no way of knowing if the data is valid."
|
||||
"We have a `name` field, which is a string, and an `age` field, which is an integer. However, if we were to load this into a dictionary, we would have no way of knowing if the data is valid. For example, we could have a string for the age, or we could have a float for the age. We could also have a string for the name, or we could have a list for the name."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -486,7 +486,7 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Now you can see that when we set response_model create call will now return a pydantic model, and we can use that to validate the data. and work with it as if it was a python object."
|
||||
"Now you can see that when we set `response_model` create call will now return a pydantic model, and we can use that to validate the data. and work with it as if it was a python object."
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
"source": [
|
||||
"### Example 1) Improving Extractions\n",
|
||||
"\n",
|
||||
"One of the big limitations is that often times the query we embed and the text \n",
|
||||
"One of the big limitations is that often times the query we embed and the text that we want to retrieve are not sufficiently close in the semantic space.\n",
|
||||
"A common method of using structured output is to extract information from a document and use it to answer a question. Directly, we can be creative in how we extract, summarize and generate potential questions in order for our embeddings to do better. \n",
|
||||
"\n",
|
||||
"For example, instead of using just a text chunk we could try to:\n",
|
||||
@@ -511,9 +511,9 @@
|
||||
"source": [
|
||||
"### Example 4) Decomposing questions \n",
|
||||
"\n",
|
||||
"Lastly, a lightly more complex example of a problem that can be solved with structured output is decomposing questions. Where you ultimately want to decompose a question into a series of sub-questions that can be answered by a search backend. For example \n",
|
||||
"Lastly, a lightly more complex example of a problem that can be solved with structured output is decomposing questions. Where you ultimately want to decompose a question into a series of sub-questions that can be answered by a search backend. For example:\n",
|
||||
"\n",
|
||||
"\"Whats the difference in populations of jason's home country and canadata?\"\n",
|
||||
"\"Whats the difference in populations of jason's home country and canada?\"\n",
|
||||
"\n",
|
||||
"You'd ultimately need to know a few things\n",
|
||||
"\n",
|
||||
@@ -525,11 +525,6 @@
|
||||
"This would not be done correctly as a single query, nor would it be done in parallel, however there are some opportunities try to be parallel since not all of the sub-questions are dependent on each other."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 35,
|
||||
|
||||
Reference in New Issue
Block a user