|
49 | 49 | },
|
50 | 50 | {
|
51 | 51 | "cell_type": "code",
|
52 |
| - "execution_count": 2, |
| 52 | + "execution_count": 1, |
53 | 53 | "id": "6a4371c8-b1cd-4a61-a474-819204f2a1b1",
|
54 | 54 | "metadata": {},
|
55 | 55 | "outputs": [],
|
|
73 | 73 | },
|
74 | 74 | {
|
75 | 75 | "cell_type": "code",
|
76 |
| - "execution_count": 3, |
| 76 | + "execution_count": 2, |
77 | 77 | "id": "39f3ce3e",
|
78 | 78 | "metadata": {},
|
79 | 79 | "outputs": [],
|
|
93 | 93 | "\n",
|
94 | 94 | "const classificationSchema = z.object({\n",
|
95 | 95 | " 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", |
97 | 97 | " \"How aggressive the text is on a scale from 1 to 10\"\n",
|
98 | 98 | " ),\n",
|
99 | 99 | " language: z.string().describe(\"The language the text is written in\"),\n",
|
|
105 | 105 | },
|
106 | 106 | {
|
107 | 107 | "cell_type": "code",
|
108 |
| - "execution_count": 4, |
| 108 | + "execution_count": 3, |
109 | 109 | "id": "5509b6a6",
|
110 | 110 | "metadata": {},
|
111 | 111 | "outputs": [
|
112 | 112 | {
|
113 | 113 | "name": "stdout",
|
114 | 114 | "output_type": "stream",
|
115 | 115 | "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" |
117 | 117 | ]
|
118 | 118 | }
|
119 | 119 | ],
|
|
162 | 162 | },
|
163 | 163 | {
|
164 | 164 | "cell_type": "code",
|
165 |
| - "execution_count": 5, |
| 165 | + "execution_count": 4, |
166 | 166 | "id": "6a5f7961",
|
167 | 167 | "metadata": {},
|
168 | 168 | "outputs": [],
|
|
171 | 171 | "\n",
|
172 | 172 | "const classificationSchema2 = z.object({\n",
|
173 | 173 | " 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", |
176 | 176 | " ),\n",
|
177 | 177 | " language: z.enum([\"spanish\", \"english\", \"french\", \"german\", \"italian\"]).describe(\"The language the text is written in\"),\n",
|
178 | 178 | "});"
|
179 | 179 | ]
|
180 | 180 | },
|
181 | 181 | {
|
182 | 182 | "cell_type": "code",
|
183 |
| - "execution_count": 6, |
| 183 | + "execution_count": 5, |
184 | 184 | "id": "e5a5881f",
|
185 | 185 | "metadata": {},
|
186 | 186 | "outputs": [],
|
|
208 | 208 | },
|
209 | 209 | {
|
210 | 210 | "cell_type": "code",
|
211 |
| - "execution_count": 7, |
| 211 | + "execution_count": 6, |
212 | 212 | "id": "d9b9d53d",
|
213 | 213 | "metadata": {},
|
214 | 214 | "outputs": [
|
215 | 215 | {
|
216 | 216 | "name": "stdout",
|
217 | 217 | "output_type": "stream",
|
218 | 218 | "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" |
220 | 220 | ]
|
221 | 221 | }
|
222 | 222 | ],
|
|
229 | 229 | },
|
230 | 230 | {
|
231 | 231 | "cell_type": "code",
|
232 |
| - "execution_count": 8, |
| 232 | + "execution_count": 7, |
233 | 233 | "id": "1c12fa00",
|
234 | 234 | "metadata": {},
|
235 | 235 | "outputs": [
|
236 | 236 | {
|
237 | 237 | "name": "stdout",
|
238 | 238 | "output_type": "stream",
|
239 | 239 | "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" |
241 | 241 | ]
|
242 | 242 | }
|
243 | 243 | ],
|
|
250 | 250 | },
|
251 | 251 | {
|
252 | 252 | "cell_type": "code",
|
253 |
| - "execution_count": 9, |
| 253 | + "execution_count": 8, |
254 | 254 | "id": "0bdfcb05",
|
255 | 255 | "metadata": {},
|
256 | 256 | "outputs": [
|
257 | 257 | {
|
258 | 258 | "name": "stdout",
|
259 | 259 | "output_type": "stream",
|
260 | 260 | "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" |
262 | 262 | ]
|
263 | 263 | }
|
264 | 264 | ],
|
|
0 commit comments