Using Claude for Data Analysis
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.
End of transcript · 778 words