NLP
Configures the full prompt for all LLM-based methods in a config. For information about configuring the full prompt, see Advanced LLM prompt configuration.
Parameters
The following parameters are available both on the config level and for each individual field through the method's parameters. Setting a parameter at the method level overrides it at the config level.
key | value | description |
---|---|---|
type (required) | nlp | |
nlpTable | object | Parameters: - rewriteTable - pageSpanThreshold - detectTableStructureOnly - annotateSuperscriptAndSubscript - (Deprecated) promptIntroduction For information about these parameters, see NLP Table. |
list | object | Parameters: - llmEngine - (Deprecated) promptIntroduction For information about these parameters, see List. |
(Deprecated) query | object | For information about this deprecated parameter see Query. |
contextDescription | For information about this parameter, see Advanced LLM prompt configuration. | |
pageHinting | For information about this parameter, see Advanced LLM prompt configuration. | |
chunkCount | For information about this parameter, see Advanced LLM prompt configuration. | |
chunkSize | For information about this parameter, see Advanced LLM prompt configuration. | |
chunkOverlapPercentage | For information about this parameter, see Advanced LLM prompt configuration. | |
pageRange | For information about this parameter, see Advanced LLM prompt configuration. |
Examples
Example 1
The following example shows using the NLP preprocessor to describe the context for each field in the config.
Config
{
"preprocessors": [
{
"type": "nlp",
"contextDescription": "The following context is an excerpt from an ID card for a presidential pet.",
/* since the ID cards are always a single page, you can omit page information
for more information, see the Advanced prompt configuration topic */
"pageHinting": false,
}
],
"fields": [
{
"method": {
"id": "queryGroup",
"queries": [
{
"id": "pet_name",
"description": "pet's name",
},
{
"id": "pet_owner",
"description": "full name of the usa president who owned this pet",
}
]
}
},
]
}
Example document
The following image shows the example document used with this example config:
Example document | Download link |
---|
Output
{
"pet_name": {
"value": "Fala",
"type": "string"
},
"pet_owner": {
"value": "Franklin D Roosevelt",
"type": "string"
}
}
Updated 1 day ago