- To extract keywords to create new facets
- To extract keywords from each document:
- To write the keyword into a new field that subsequently searches large content documents more efficiently
- To boost specific keyword content
- For document clustering
- POST request - submits a prediction task for a specific
useCaseandmodelId. The API responds with the following information:predictionId. A unique UUID for the submitted prediction task that can be used later to retrieve the results.status. The current state of the prediction task.
- GET request - uses the
predictionIdyou submit from a previously-submitted POST request and returns the results associated with that previous request.
For detailed API specifications in Swagger/OpenAPI format, see Platform APIs.
Prerequisites
To use this API, you need:- The unique
APPLICATION_IDfor your Lucidworks AI application. For more information, see credentials to use APIs. - A bearer token generated with a scope value of
machinelearning.predict. For more information, see Authentication API. - The
USE_CASEandMODEL_IDfields in the/async-predictionfor the POST request. The path is/ai/async-prediction/USE_CASE/MODEL_ID. A list of supported modes is returned in the Lucidworks AI Use Case API. For more information about supported models, see Generative AI models.
Common POST request parameters and fields
Some parameters in the/ai/async-prediction/USE_CASE/MODEL_ID POST request are common to all of the generative AI (Gen-AI) use cases, such as the modelConfig parameter.
Also referred to as hyperparameters, these fields set certain controls on the response.
Refer to the API spec for more information.
Unique values for the keyword extraction use case
Some parameter values available in thekeyword extraction use case are unique to this use case, such as the useCaseConfig parameter.
Refer to the API spec for more information.
Example POST request
This example does not includemodelConfig parameters, but you can submit requests that include parameters described in Common POST request parameters and fields.
Example GET request
Learn more
LWAI pipeline with async sum keyword extraction
LWAI pipeline with async sum keyword extraction
This pipeline uses the following stages:
- Field Mapping
- Solr Dynamic Field Name Mapping
- LWAI: Summarization
- LWAI: Keyword Extraction
- Solr Partial Update Indexer
Add the pipeline
- Navigate to Indexing > Index Pipelines.
- Click Add+.
- Enter the Pipeline ID, for example
LWAI-async-summarization-and-keyword-extraction. - Select the Solr Indexer stage and click on Remove stage.
Field Mapping
Configure the Field Mapping stage as follows.- Make sure that Unmapped Fields is checked.
- Make sure that Keep is checked.
- Save the pipeline.
Solr Dynamic Field Name Mapping
Configure the Solr Dynamic Field Name Mapping stage as follows.- Enter a Max Length for Advanced Indexing of Text Fields, such as
100. - Save the pipeline.
LWAI: Summarization
Summarization is set up via the LWAI Prediction stage.- Click Add a new pipeline stage > LWAI Prediction.
- Enter a Label, such as
LWAI: Summarization. - Select the Account Name as defined in Lucidworks AI Gateway.
- Select the Use Case as
summarization. - Select the Model to use.
- Enter the Input context variable, for example,
<doc.body_t>. - Enter the Destination Field Name & Context Output, for example,
body_summarization. - Enter values for the Use Case Configuration:
- Enter the Parameter Name, such as
maxWords. - Enter a Parameter Value, for example,
250.
- Enter the Parameter Name, such as
- Make sure Call Asynchronously? is checked.
- Enter the Maximum Asynchronous Call Tries, such as
1. - Save the pipeline.
LWAI: Keyword Extraction
Keyword extraction is set up using the LWAI Prediction stage.- Click Add a new pipeline stage > LWAI Prediction.
- Enter a Label, such as
LWAI: Keyword Extraction. - Select the Account Name as defined in Lucidworks AI Gateway.
- Select the Use Case as
keyword-extraction. - Select the Model to use.
- Enter the Input context variable, for example,
<doc.body_t>. - Enter the Destination Field Name & Context Output, for example,
body_extracted_keywords. - Enter values for the Use Case Configuration:
- Enter the Parameter Name, such as maxKeywo`rds.
- Enter the Parameter Value, for example,
50.
- Make sure Call Asynchronously? is checked.
- Enter the Maximum Asynchronous Call Tries, such as
1. - Save the pipeline.
Solr Partial Update Indexer
Configure the Solr Partial Update Indexer stage as follows.- Click Add a new pipeline stage > Solr Partial Update Indexer.
- Make sure Map to Solr Schema is checked.
- Make sure Process All Pipeline Doc Fields is checked.
- Enter the Solr Document ID Field Value as
<doc.id>. - Enter values under Updates:
- Enter the Update Type as
increment. - Enter the Field Name as
increment_i. - Enter a Value, such as
1.
- Enter the Update Type as
- Make sure Allow reserved fields is checked.
- Save the pipeline.
Order the stages
- Make sure the stages are in the following order:
- Field Mapping
- Solr Dynamic Field Name Mapping
- LWAI: Summarization
- LWAI: Keyword Extraction
- Solr Partial Update Indexer
- Save the pipeline.