2023:GPT Integration (Concept): Difference between revisions
No edit summary |
|||
| Line 216: | Line 216: | ||
{|cellpadding=10 cellspacing=5 | {|cellpadding=10 cellspacing=5 | ||
|valign=top style="width:50%"| | |valign=top style="width:50%"| | ||
# | # Working with the same material as before, select the '''Data Field''' named "Full Summar". | ||
# | # Click the drop-down menu for the '''''Value Extractor''''' property. | ||
# | # Select ''GPT Complete'' from the drop-down menu. | ||
| | | | ||
[[Image:GPT Integration 019.png]] | [[Image:GPT Integration 019.png]] | ||
| Line 224: | Line 224: | ||
{|cellpadding=10 cellspacing=5 | {|cellpadding=10 cellspacing=5 | ||
|valign=top style="width:50%"| | |valign=top style="width:50%"| | ||
# <li value=4> | # <li value=4> With the '''''Value Extractor''''' set, click the ellipsis button to open its configuration window (if you prefer, you can instead click the drop-down arrow to the left of the property to edit its properties without a pop-up window). | ||
| | | | ||
[[Image:GPT Integration 020.png]] | [[Image:GPT Integration 020.png]] | ||
| Line 230: | Line 230: | ||
{|cellpadding=10 cellspacing=5 | {|cellpadding=10 cellspacing=5 | ||
|valign=top style="width:50%"| | |valign=top style="width:50%"| | ||
# <li value=5> | # <li value=5> Start by entering your API key into the '''''API Key''''' property. | ||
# | # Type <code>tldr</code> into the '''''Instructions''''' property. | ||
# | # Assuming you have automatic testing enabled, you will see a result returned in the "Results" list view. Click this result. | ||
# | # Click the "Inspect" button. | ||
| | | | ||
[[Image:GPT Integration 021.png]] | [[Image:GPT Integration 021.png]] | ||
| Line 239: | Line 239: | ||
{|cellpadding=10 cellspacing=5 | {|cellpadding=10 cellspacing=5 | ||
|valign=top style="width:50%"| | |valign=top style="width:50%"| | ||
# <li value=9> | # <li value=9> In the "Data Inspector" you will see the number of characters in the result. | ||
# | # You will also see the full text of the summary. | ||
# | # Right-click in a blank space to get a list of commands. | ||
# | # Make sure "Text Wrap" is enabled so that the text will wrap like it is in the screenshot. | ||
| | | | ||
[[Image:GPT Integration 022.png]] | [[Image:GPT Integration 022.png]] | ||
| Line 248: | Line 248: | ||
{|cellpadding=10 cellspacing=5 | {|cellpadding=10 cellspacing=5 | ||
|valign=top style="width:50%"| | |valign=top style="width:50%"| | ||
# <li value=13> | # <li value=13> After confirming the previous settings and closing windows, right-click the "Full Summary" '''Data Field''' to get a list of commands. | ||
# | # Select the "Clone..." command. | ||
| | | | ||
[[Image:GPT Integration 023.png]] | [[Image:GPT Integration 023.png]] | ||
| Line 255: | Line 255: | ||
{|cellpadding=10 cellspacing=5 | {|cellpadding=10 cellspacing=5 | ||
|valign=top style="width:50%"| | |valign=top style="width:50%"| | ||
# <li value=15> | # <li value=15> Name the clone "Brief Summary". | ||
# | # Confirm the clone by clicking the "Execute" button. | ||
| | | | ||
[[Image:GPT Integration 024.png]] | [[Image:GPT Integration 024.png]] | ||
| Line 262: | Line 262: | ||
{|cellpadding=10 cellspacing=5 | {|cellpadding=10 cellspacing=5 | ||
|valign=top style="width:50%"| | |valign=top style="width:50%"| | ||
# <li value=17> | # <li value=17> With the clone made, click the ellipsis button of the '''''Value Extractor''''' property to open its configuration window (if you prefer, you can instead click the drop-down arrow to the left of the property to edit its properties without a pop-up window). | ||
| | | | ||
[[Image:GPT Integration 025.png]] | [[Image:GPT Integration 025.png]] | ||
| Line 268: | Line 268: | ||
{|cellpadding=10 cellspacing=5 | {|cellpadding=10 cellspacing=5 | ||
|valign=top style="width:50%"| | |valign=top style="width:50%"| | ||
# <li value=18> | # <li value=18> Add <code> in 100 words or less</code> to the '''''Instructions''''' property. | ||
# | # A result will be returned in the "Results" list view. Select this result. | ||
# | # Click the "Inspect" button. | ||
| | | | ||
[[Image:GPT Integration 026.png]] | [[Image:GPT Integration 026.png]] | ||
| Line 276: | Line 276: | ||
{|cellpadding=10 cellspacing=5 | {|cellpadding=10 cellspacing=5 | ||
|valign=top style="width:50%"| | |valign=top style="width:50%"| | ||
# <li value=21> | # <li value=21> In the "Data Inspector" you will now notice this result's length is much shorter. | ||
# | # The summary given is much shorter than the previous due to the additional instruction given in the prompt. | ||
| | | | ||
[[Image:GPT Integration 027.png]] | [[Image:GPT Integration 027.png]] | ||
Revision as of 16:24, 17 April 2023

OpenAI GPT integration in Grooper allows users to leverage modern AI technology to enhance their document data integration needs.
OpenAI's GPT model has made waves in the world of computing. Our Grooper developers recognized the potential for this to grow Grooper's capabilities. Adding its funcionality will allow for users to explore and find creative solutions for processing their documents using this advanced technology.
ABOUT
GPT integration can be used for three things in Grooper:
- Extraction - Prompt the GPT model to return information it finds in a document.
- Classification - GPT has been trained against a massive corpus of information, which allows for a lot of potential when it comes to classifying documents. The idea here is that because it's seen so much, the amount of training required in Grooper should be less.
- Lookup - With a GPT lookup you can provide information collected from a model in Grooper as
@variables in a prompt to have GPT generate data.
In this article you will be shown how Grooper leverages GPT for the aforementioned methods. Some example use cases will be given to demonstrate a basic approach. Given the nature of the way this technology works, it will be up to the user to get creative about how this can be used for their needs.
Things to Consider
Before moving forward it would be prudent to mention a few things about GPT and how to use it.
Prompt Engineering
This first thing to consider is how to structure a good prompt so that you get the results you are expecting. There is a bit of an art to knowing how to do this. GPT can tell bad jokes and write accidentally hilarious poems about your life, but it can also help you do your job better. The catch: you need to help it do its job better, too. At its most basic level, OpenAI's GPT-3 and GPT-4 predict text based on an input called a prompt. But to get the best results, you need to write a clear prompt with ample context. Further on in this article when the GPT Complete Value Extractor is being demonstrated you will see an example of prompt engineering.
Follow this link, or perhaps even this one, for more information on prompt engineering.
Tokens and Pricing
Another consideration is the way GPT pricing works. You are going to be charged for the "tokens" used when interacting with GPT. To that end, the prompt that you write, the text that you leverage to get a result, and the result that is returned to you are all considered part of the token consumption. You will need to be considerate of this as you build and use GPT in your models.
Follow this link for more information on what tokens are.
Follow this link for more information on GPT pricing.
Location Data for Data Extraction
The final thing to consider is in regards to the GPT Complete Value Extractor type (more on this soon.) If you have used Grooper before then you are probably familiar with how a returned value is highlighted with a green box in the document viewer. One of the main strenghts of Grooper's text synthesis is that it collects location information for each character which allows this highlighting to occur. The GPT model does not consider location information when generating its results which means there will be no highlighting on the document for values collected with this method. The main impact this will have is on your ability to validate information returned by the GPT model.
How To
With the discussion of concepts out of the way, it is time to get into Grooper and see how and where to use the GPT integration.
Obtain an API Key
Grooper is able to integrate with OpenAI's GPT model because they have provided a web API. All we need in order use the Grooper GPT functionality is an API key. Here you will learn how to obtain an API key for yourself so you can start using GPT with Grooper.
|
|
|
Extraction - GPT Complete
GPT Complete is a type of Value Extractor that was added to Grooper 2023. It is the setting you choose to leverage GPT integration on an extractor. Below are some examples of configuration and use. You should be able to follow along using the GPT Integration zip files (Batch and Project are included) that are included in this article. Begin by following along with the instructions. The details of the properties will be explained after.
It is also worth noting that the examples given below ARE NOT a comprehensive list. Provided are only a few examples of prompts used in extraction to get you thinking about what can be done. It is highly recommended that you not only reference the materials linked above, but also spend time experimenting and testing. Good luck!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|



























