- The Prompt Engineer
- Posts
- #5: Data extraction with few-shot prompting
#5: Data extraction with few-shot prompting
Alright, this is the last issue for the week - let’s make sure we end this week strong.
For today we have an advanced tutorial that you can use if you’re a developer to write applications with large language models as well as a no-coder.
One macro-trend that’s happening right now is that we interact with software through natural language.
In the near future, we’ll edit videos, file our taxes and do our banking with natural language instead of clicking through interfaces manually.
So it’s important to be able to extract data from natural language that we can use later to automate our day to day tasks.
But how do we do this?
We could of course start coding and creating all sorts of rules, or we could just use few-shot prompting and large language models.
Let’s see how we do this…
Data extraction with
few-shot prompting
in ChatGPT
In the previous two issues we introduced and used the few-shot prompting technique.
In this tutorial we’ll use few-shot prompting for data extraction.
Let’s break it down.
First we need to provide input/output pairs so the model can understand our pattern.
Then, the prompt will end with and input sentence and “Output:”.
If ChatGPT/GPT-3 learnt our pattern successfully it generates the correct output.
This is a very powerful technique when it comes to data extraction and turning unstructured data to structured data.
Hope you liked this tutorial, have a great weekend!
Best,
Gabor Soter, PhD
A little about me:
did my PhD in Europe’s largest AI and robotics research lab
worked as software engineer and CTO at Y-combinator-backed and AI startups
in my previous startup my team worked with OpenAI