Skip to content

Commit 8d3c94c

Browse files
authored
docs: Fix classification tutorial schema (#7883)
1 parent 09aec00 commit 8d3c94c

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/core_docs/docs/tutorials/classification.ipynb

+15-15
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
},
5050
{
5151
"cell_type": "code",
52-
"execution_count": 2,
52+
"execution_count": 1,
5353
"id": "6a4371c8-b1cd-4a61-a474-819204f2a1b1",
5454
"metadata": {},
5555
"outputs": [],
@@ -73,7 +73,7 @@
7373
},
7474
{
7575
"cell_type": "code",
76-
"execution_count": 3,
76+
"execution_count": 2,
7777
"id": "39f3ce3e",
7878
"metadata": {},
7979
"outputs": [],
@@ -93,7 +93,7 @@
9393
"\n",
9494
"const classificationSchema = z.object({\n",
9595
" sentiment: z.string().describe(\"The sentiment of the text\"),\n",
96-
" aggressiveness: z.number().int().min(1).max(10).describe(\n",
96+
" aggressiveness: z.number().int().describe(\n",
9797
" \"How aggressive the text is on a scale from 1 to 10\"\n",
9898
" ),\n",
9999
" language: z.string().describe(\"The language the text is written in\"),\n",
@@ -105,15 +105,15 @@
105105
},
106106
{
107107
"cell_type": "code",
108-
"execution_count": 4,
108+
"execution_count": 3,
109109
"id": "5509b6a6",
110110
"metadata": {},
111111
"outputs": [
112112
{
113113
"name": "stdout",
114114
"output_type": "stream",
115115
"text": [
116-
"{ sentiment: \u001b[32m'contento'\u001b[39m, aggressiveness: \u001b[33m1\u001b[39m, language: \u001b[32m'es'\u001b[39m }\n"
116+
"{ sentiment: 'positive', aggressiveness: 1, language: 'Spanish' }\n"
117117
]
118118
}
119119
],
@@ -162,7 +162,7 @@
162162
},
163163
{
164164
"cell_type": "code",
165-
"execution_count": 5,
165+
"execution_count": 4,
166166
"id": "6a5f7961",
167167
"metadata": {},
168168
"outputs": [],
@@ -171,16 +171,16 @@
171171
"\n",
172172
"const classificationSchema2 = z.object({\n",
173173
" sentiment: z.enum([\"happy\", \"neutral\", \"sad\"]).describe(\"The sentiment of the text\"),\n",
174-
" aggressiveness: z.number().int().min(1).max(5).describe(\n",
175-
" \"describes how aggressive the statement is, the higher the number the more aggressive\"\n",
174+
" aggressiveness: z.number().int().describe(\n",
175+
" \"describes how aggressive the statement is on a scale from 1 to 5. The higher the number the more aggressive\"\n",
176176
" ),\n",
177177
" language: z.enum([\"spanish\", \"english\", \"french\", \"german\", \"italian\"]).describe(\"The language the text is written in\"),\n",
178178
"});"
179179
]
180180
},
181181
{
182182
"cell_type": "code",
183-
"execution_count": 6,
183+
"execution_count": 5,
184184
"id": "e5a5881f",
185185
"metadata": {},
186186
"outputs": [],
@@ -208,15 +208,15 @@
208208
},
209209
{
210210
"cell_type": "code",
211-
"execution_count": 7,
211+
"execution_count": 6,
212212
"id": "d9b9d53d",
213213
"metadata": {},
214214
"outputs": [
215215
{
216216
"name": "stdout",
217217
"output_type": "stream",
218218
"text": [
219-
"{ sentiment: \u001b[32m'happy'\u001b[39m, aggressiveness: \u001b[33m1\u001b[39m, language: \u001b[32m'spanish'\u001b[39m }\n"
219+
"{ sentiment: 'happy', aggressiveness: 1, language: 'spanish' }\n"
220220
]
221221
}
222222
],
@@ -229,15 +229,15 @@
229229
},
230230
{
231231
"cell_type": "code",
232-
"execution_count": 8,
232+
"execution_count": 7,
233233
"id": "1c12fa00",
234234
"metadata": {},
235235
"outputs": [
236236
{
237237
"name": "stdout",
238238
"output_type": "stream",
239239
"text": [
240-
"{ sentiment: \u001b[32m'sad'\u001b[39m, aggressiveness: \u001b[33m5\u001b[39m, language: \u001b[32m'spanish'\u001b[39m }\n"
240+
"{ sentiment: 'sad', aggressiveness: 5, language: 'spanish' }\n"
241241
]
242242
}
243243
],
@@ -250,15 +250,15 @@
250250
},
251251
{
252252
"cell_type": "code",
253-
"execution_count": 9,
253+
"execution_count": 8,
254254
"id": "0bdfcb05",
255255
"metadata": {},
256256
"outputs": [
257257
{
258258
"name": "stdout",
259259
"output_type": "stream",
260260
"text": [
261-
"{ sentiment: \u001b[32m'neutral'\u001b[39m, aggressiveness: \u001b[33m1\u001b[39m, language: \u001b[32m'english'\u001b[39m }\n"
261+
"{ sentiment: 'neutral', aggressiveness: 1, language: 'english' }\n"
262262
]
263263
}
264264
],

0 commit comments

Comments
 (0)