2023:GPT Integration (Concept): Difference between revisions

From Grooper Wiki
No edit summary
 
(46 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[File:OpenAI Logo.svg.png|right|thumb|500px|Enhancing Grooper with modern AI technology.]]
__NOINDEX__
{|class="important-box"
|
'''!!'''
|
'''LEGACY TECHNOLOGY DETECTED!!'''


<blockquote style="font-size:125%">
"GPT Integration" refers to Grooper's early attempts at integrating OpenAI's GPT models into the product. The information in this article is largely obsolete.
[https://openai.com/ OpenAI GPT] integration in '''Grooper''' allows users to leverage modern AI technology to enhance their document data integration needs.
</blockquote>


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.
For more current information on Grooper's integration with AI technologies, refer to the following resources:
* [[Grooper and AI]] - An overview of Grooper's AI integrations.
* [[Ask AI]] - An LLM-based extractor.
* [[AI Extract]] - A "Fill Method" using LLMs for large scale data extraction with minimal setup.
* [[Clause Detection]] - An LLM embeddings based Data Section extract method.
|}
[[File:OpenAI Logo.svg.png|right|thumb|500px|Enhancing Grooper by integrating with modern AI technology.]]


<blockquote>{{#lst:Glossary|GPT Integration}}</blockquote>
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 functionality will allow for users to explore and find creative solutions for processing their documents using this advanced technology.
{|class="download-box"
|
[[File:Asset 22@4x.png]]
|
You may download the ZIP(s) below and upload it into your own Grooper environment (version 2023). The first contains one or more '''Batches''' of sample documents.  The second contains one or more '''Projects''' with resources used in examples throughout this article.
* [[Media:2023_Wiki_GPT-Integration_Batch.zip]]
* [[Media:2023_Wiki_GPT-Integration_Project.zip]]
|}


== ABOUT ==
== ABOUT ==
GPT (Generative Pre-trained Transformer) integration can be used for three things in '''Grooper''':
* '''[[#GPT Complete (Value Extractor)|Extraction]]''' - Prompt the GPT model to return information it finds in a document.
* '''[[#GPT Embeddings (Classify Method)|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.
* '''[[#GPT Lookup (Lookup Specification)|Lookup]]''' - With a GPT lookup you can provide information collected from a model in '''Grooper''' as <code><span style="color:#ff00ff">@</span></code> variables in a prompt to have GPT generate data.


{|cellpadding="10" cellspacing="5"
|-
|style="font-size:14pt; color:#f89420; border: 2px solid #f89420; width:40px"|[[File:Asset 22@4x.png]]
|style="border: 2px solid #f89420"|
You may download and import the files below into your own Grooper environment (version 2023).  The first contains a '''Project''' with several '''Content Models''' used as examples throughout this article.  The second contains some example '''Batches''' of sample documents.
* GPT Integration - Project.zip
* GPT Integration - Batches.zip
|}
<br>
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 <code><span style="color:#ff00ff">@</span></code> variables in a prompt to have GPT generate data.
<br>
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.
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.


Line 42: Line 53:


=== Location Data for Data Extraction ===
=== 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.
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 strengths 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 ==
== How To ==
Line 50: Line 61:
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.
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.


{|cellpadding=10 cellspacing=5
|valign=top style="width:50%"|
# The first thing you should do is visit [https://platform.openai.com/ OpenAI API site] and login or create an account.
# The first thing you should do is visit [https://platform.openai.com/ OpenAI API site] and login or create an account.
# Once logged in, click the "Personal" menu in the top right.
# Once logged in, click the "Personal" menu in the top right.
# Within in this menu click the "View API Keys" option, which will take you to the "API keys" page.
# Within in this menu click the "View API Keys" option, which will take you to the "API keys" page.
|
 
[[Image:GPT Integration 001.png]]
[[Image:GPT Integration 001.png]]
|}


{|cellpadding=10 cellspacing=5
 
|valign=top style="width:50%"|
# <li value=4> On the "API keys" page, click the "+ Create new secret key" button, which will make an "API key generated" pop-up.
# <li value=4> On the "API keys" page, click the "+ Create new secret key" button, which will make an "API key generated" pop-up.
|
 
[[Image:GPT Integration 002.png]]
[[Image:GPT Integration 002.png]]
|}


{|cellpadding=10 cellspacing=5
 
|valign=top style="width:50%"|
# <li value=5> Highlight and copy, or click the copy button to copy the key string to your clipboard.
# <li value=5> Highlight and copy, or click the copy button to copy the key string to your clipboard.
#* A word of warning here. You '''WILL NOT''' get another chance to copy this string. You can always create a new one, but once you close this pop-up, you will not have another chance to copy the key string out.
#* A word of warning here. You '''WILL NOT''' get another chance to copy this string. You can always create a new one, but once you close this pop-up, you will not have another chance to copy the key string out.
|
 
[[Image:GPT Integration 003.png]]
[[Image:GPT Integration 003.png]]
|}
=== 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.
<tabs style="margin:20px">
<tab name="Basic Configuration" style="margin:25px">
{|cellpadding=10 cellspacing=5
|valign=top style="width:50%"|
# After importing the '''Grooper''' ZIP files provided with this course, expand the Node Tree out and select the '''Data Field''' named "Lessor".
# Click the drop-down menu for the '''''Value Extractor''''' property.
# Select the ''GPT Complete'' option from the menu.
|
[[Image:GPT Integration 004.png]]
|}
{|cellpadding=10 cellspacing=5
|valign=top style="width:50%"|
# <li value=4> With the '''''Value Extractor''''' property 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 005.png]]
|}


{|cellpadding=10 cellspacing=5
=== GPT Complete (Value Extractor) ===
|valign=top style="width:50%"|
{{#lst:Glossary|GPT Complete}}
# <li value=5> Start by entering your API key into the '''''API Key''''' property.
Please visit the '''''[[GPT Complete]]''''' article for more information.
# Click the "Browse Batches" button.
# Select "GPT Complete Examples" '''Batch''' in the "GPT Integration - Batches" folder from the menu.
|
[[Image:GPT Integration 006.png]]
|}


{|cellpadding=10 cellspacing=5
=== GPT Embeddings (Classification Method) ===
|valign=top style="width:50%"|
{{#lst:Glossary|GPT Embeddings}}
# <li value=8> Select "Lease (1)" from the '''Batch Viewer'''.
Please visit the '''''[[GPT Embeddings (Classification Method)|GPT Embeddings]]''''' article for more information.
# Click the ellipsis button for the '''''Instructions''''' property to open its configuration window (if you prefer, you can insted simply type into the entry field of the property.)
|
[[Image:GPT Integration 007.png]]
|}


{|cellpadding=10 cellspacing=5
=== GPT Lookup (Lookup Specification) ===
|valign=top style="width:50%"|
{{#lst:Glossary|GPT Lookup}}
# <li value=10> Type the string value "Who is the lessor?" into the editor.
Please visit the '''''[[GPT Lookup]]''''' article for more information.
# Click the "OK" button to accept and close this window.
|
[[Image:GPT Integration 008.png]]
|}
 
{|cellpadding=10 cellspacing=5
|valign=top style="width:50%"|
# <li value=12> When the previous window closes the extractor will immediately fire (assuming you have automatic testing enabled), and you will see a result returned in the "Results" list view.
<br>
From a "prompt engineering" perspective the input we gave it is as basic as you can get. A result is returned, which is great, but it may not be the exact result that is desired. The value supplied is very conversational, which isn't necessarily a bad thing and is typical of an AI that's trained to emulate language, but considering how data is typically constructed in Grooper, it's not quite right. If you break it down, the result given is really four values: the lessor's name, their marital status, their gender, and their location.  Ideally, the name of the lessor only will suffice.
<br>
The next thing to tackle will be using some prompt engineering to get a more specific result.
|
[[Image:GPT Integration 009.png]]
|}
<br>
<span style="font-size:14pt">'''[[GPT Integration#Extraction - GPT Complete|Back to top to continue to next tab]]'''</span>
</tab>
<tab name="Getting a More Specific Result with Prompt Engineering" style="margin:25px">
</tab>
</tabs>

Latest revision as of 16:43, 27 August 2025

!!

LEGACY TECHNOLOGY DETECTED!!

"GPT Integration" refers to Grooper's early attempts at integrating OpenAI's GPT models into the product. The information in this article is largely obsolete.

For more current information on Grooper's integration with AI technologies, refer to the following resources:

  • Grooper and AI - An overview of Grooper's AI integrations.
  • Ask AI - An LLM-based extractor.
  • AI Extract - A "Fill Method" using LLMs for large scale data extraction with minimal setup.
  • Clause Detection - An LLM embeddings based Data Section extract method.
Enhancing Grooper by integrating with modern AI technology.

Grooper's GPT Integration is refers to the usage of OpenAI's GPT models within Grooper to enhance the capabilities of data extractors, classification, and lookups.

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 functionality will allow for users to explore and find creative solutions for processing their documents using this advanced technology.

You may download the ZIP(s) below and upload it into your own Grooper environment (version 2023). The first contains one or more Batches of sample documents. The second contains one or more Projects with resources used in examples throughout this article.

ABOUT

GPT (Generative Pre-trained Transformer) 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 strengths 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.

  1. The first thing you should do is visit OpenAI API site and login or create an account.
  2. Once logged in, click the "Personal" menu in the top right.
  3. Within in this menu click the "View API Keys" option, which will take you to the "API keys" page.


  1. On the "API keys" page, click the "+ Create new secret key" button, which will make an "API key generated" pop-up.


  1. Highlight and copy, or click the copy button to copy the key string to your clipboard.
    • A word of warning here. You WILL NOT get another chance to copy this string. You can always create a new one, but once you close this pop-up, you will not have another chance to copy the key string out.

GPT Complete (Value Extractor)

GPT Complete is a Value Extractor that leverages Open AI's GPT models to generate chat completions for inputs, returning one hit for each result choice provided by the model's response.

PLEASE NOTE: GPT Complete is a deprecated Value Extractor. It uses an outdated method to call the OpenAI API. Please use the Ask AI extractor going forward.

Please visit the GPT Complete article for more information.

GPT Embeddings (Classification Method)

BE AWARE: GPT Embeddings is obsolete as of version 2025. The LLM Classifier and Search Classifier methods are the new and improved AI-enabled classification methods. GPT Embeddings is a Classify Method that uses an OpenAI embeddings model and trained document samples to tell one document from another. Please visit the GPT Embeddings article for more information.

GPT Lookup (Lookup Specification)

PLEASE NOTE: GPT Lookup is obsolete as of version 2025. Much of its functionality was replaced by newer and better LLM-based extraction methods, such as AI Extract. If absolutely necessary, its functionality could also be replicated with a Web Service Lookup implementation. GPT Lookup is a Lookup Specification that performs a lookup using an OpenAI GPT model. Please visit the GPT Lookup article for more information.