Transcript · English → Spanish
Using Claude for Data Analysis
El resumen es claro, conciso y preciso.
Quiero asegurarme de que nada esté, de algún modo, interfiriendo en la evaluación de Claude,
eh, aparte de los datos que está analizando.
Y, por último, en cuanto al formato de salida,
en mi caso, solo
le voy a pedir a Claude que encierre su veredicto final.
Todo lo demás lo voy a ignorar desde mi aplicación y solo miraré lo que
realmente está evaluando. Es decir, puedo usar esto, eh,
si quiero crear
algún tipo de, eh, herramienta de análisis después también, o
si solo quiero una
determinación concluyente, esta es una forma de hacerlo.
Así que, si ejecuto esto, verán que e— está pasando por el mismo tipo de
proceso que hemos visto antes. En este caso,
es mucho más conciso porque le hemos
pedido que... que resuma sus hallazgos en una,
de forma mucho más directa
posible. Y, finalmente, hacia el final, verán que
envuelve mi resultado en estas etiquetas XML de veredicto final.
Como pueden ver, durante esta demostración, hemos pasado de un accidente
de esquí a resultados algo poco seguros,
quizá por un accidente de coche en la segunda versión, a
un resultado mucho más estrictamente formateado y seguro, sobre el que
podemos construir una aplicación de LLM y realmente
ayudar, ya saben, a una empresa real, eh,
de seguros de coche, por ejemplo.
Eh, finalmente, si volvemos a las, eh, diapositivas,
otra forma clave de dar forma al resultado de Claude es
ponerle palabras en la boca a Claude, o, como lo llamamos,
respuestas prellenadas. Pueden imaginar que analizar etiquetas XML
está muy bien, pero quizá quieran un resultado JSON estructurado
para hacer
que sea serializable en JSON, y puedes usarlo en una
llamada posterior, posterior, por ejemplo. Esto es bastante simple de hacer.
Podrías simplemente añadir que, Claude debe comenzar su
salida con un formato determinado. Esto podría ser, por ejemplo, un
corchete de apertura, un corchete, por ejemplo, o incluso en este caso
que vemos
ante nosotros, sería una etiqueta XML para itinerario.
En nuestro caso, también podría ser una etiqueta XML de veredicto final.
Y esta es una gran manera de, nuevamente, dar forma a cómo Claude debe
responder, sin todo el preámbulo si no quieres
eso, aunque eso también es clave para dar forma a su salida y asegurarse de
que Claude
razone los pasos que queríamos.
Así que, en nuestro caso, simplemente lo envolveríamos en el veredicto final
y luego analizarlo
después. Pero también puedes usar el prellenado.
Ahora, por último, un paso que me gustaría destacar aquí también
es que
tanto Claude 3.7 como, especialmente, Claude 4, por supuesto, son
eh, eh, una especie de modelo híbrido de razonamiento, lo que significa que hay pensamiento extendido a
tu disposición. Eh, y esto es algo que queremos destacar porque
puedes
usar el pensamiento extendido como apoyo para tu ingeniería de prompts.
Básicamente, puedes activarlo para asegurarte de que
Claude realmente tenga tiempo para pensar.
Añade estas etiquetas de pensamiento en el bloc de notas.
Eh, y lo bueno de eso es que en realidad puedes analizar
esa transcripción para
entender cómo Claude aborda esos datos.
Así que, como mencionamos, tenemos estas casillas que recorre
paso a paso
del escenario que se produjo en el accidente.
Y, en muchos sentidos, de hecho pueden intentar ayudar a Claude a
incorporar esto
en el propio prompt del sistema. No solo es más eficiente en términos de tokens,
sino que es una buena forma
de entender cómo estos modelos inteligentes que no tienen nuestra
intuición abordan los datos que les proporcionamos.
Y por eso, es clave para analizar
cómo su
prompt del sistema puede mejorar mucho.
Eh, y dicho esto, creo que, eh, me gustaría agradecerles a todos por venir
hoy. También estaremos por aquí, así que si tienen alguna pregunta sobre
los prompts,
por favor, eh, no duden en preguntar. Sé que hay algo de prompting—
Si quieren aprender más sobre prompts, dentro de una hora tenemos prompts para agentes,
y ahora mismo tenemos una increíble demo de Claude jugando a Pokémon, así que no se
vayan a ninguna parte. Y como dijo Christian,
estaremos aquí todo el día, así que sé que
no tuvimos tiempo para preguntas y respuestas en esta sesión, pero, eh, vengan a buscarnos si quieren
charlar. Y gracias por venir.
Muchas gracias.
Muchas gracias.
Ajá.
End of transcript · 725 words · machine translated
Original transcript (English)
Summary is clear, concise, and accurate. Wanna make sure that nothing is sort of impeding in, in, in Claude's assessment, uh, apart from the data it's analyzing. And then finally, when it comes to output formatting, in my case here, I'm just
gonna ask Claude to wrap its final verdict. All other stuff I'm actually gonna ignore from my application and just look at what it's actually assessing. And that is, I can, I can use this, uh, if I wanna build some sort of, uh, analytics tool afterwards as well, or
if I just want a clear-cut, um, uh, determination, this is a way I can do so. So if I just run this here, you'll see w- it's going through the same sort of process that we've seen before. In this case, it's much more succinct 'cause we've
asked it to be-- to summarize its findings in a, in a much more straightforward manner. And then finally, towards the end, you'll see that it'll wrap my output in these final verdict XML tags. So you can see that during this demo, we've gone from a skiing
accident to sort of unconfident, insecure outputs from perhaps a car accident in the second version, to now a much more strictly formatted, confident output that we can actually build an LLM app- application ar- around, and actually help, you know, a real-world, um,
car insurance company, for example. Uh, finally, if we transition back to the, um, slides, another key way of shaping Claude's output is actually putting words in Claude's mouth, or as we call it, pre-filled responses. You can imagine that parsing XML tags
is nice and all, but maybe you want a structured JSON output to make sure that, uh, it's JSON serializable, and you can use this in a subsequent, subsequent call, for example. Um, this is quite simple to do. You could just add that, um, Claude needs to begin its
output with a certain format. This could be, for example, a, uh, open square bracket, square bracket, for example, or even in this case that we see in front of us, this would be an XML tag for itinerary. In our case, it could also be a final verdict XML tag.
Um, and this is just a great way of, again, shaping how Claude is supposed to respond, um, uh, without all the preamble if you don't want that, even though that is also key in shaping its output to make sure that Claude is reasoning through the steps that we wanted.
So in our case here, we would just wrap it in the final verdict and then parse it afterwards. But you can use pre-fill as well. Now, finally, one step that I would like to highlight here as well is that
both Claude 3.7 and especially Claude 4, of course, is, uh, uh, a sort of hybrid reasoning model, meaning that there's extended thinking at your disposal. Um, and this is something we wanna highlight because you can use extended thinking as a crutch for your prompt engineering.
Basically, you can enable this to make sure that Claude actually has time to think. It adds these thinking tags in the scratchpad. Um, and the beauty of that is that you can actually analyze that transcript to
understand how Claude is going about that data. So as we mentioned, we have these checkboxes where it goes through step-by-step of the scen- scenario that transpired for the accident. And in many ways there, you can actually try to help Claude in
building this into the system prompt itself. It's not only more token efficient, but it's a good way of understanding how these intelligent models that don't have our intuition actually go about the data that we provide them.
And because of that, it's quite key in actually trying to break down how your system prompt can get a lot better. Um, and with that said, I think, uh, I'd like to thank all you for coming today. We'll be around as well, so if you have any questions around
prompting, please, uh, please go ahead. I know there's a prompting- You wanna learn more about prompting, in an hour we have prompting for agents, and right now we have an amazing demo of Claude plays Pokémon, so don't go anywhere for that. And as Christian said,
we'll be around all day, so I know we didn't have time for Q&A in this session, but, uh, please come find us if you wanna chat. And thank you guys for coming. Thank you so much.
Mm-hmm.