Lucidworks AI
chunkingId
received from the POST request. The API then returns the results of the chunking request associated with that chunkingId
.
APPLICATION_ID
for your Lucidworks AI application. For more information, see credentials to use APIs.machinelearning.predict
. For more information, see Authentication API.CHUNKER
and MODEL_ID
fields for the use case request. The path is: /ai/async-chunking/CHUNKER/MODEL_ID
. A list of supported models is returned in the Lucidworks AI Use Case API./ai/async-chunking/CHUNKER/MODEL_ID
request are common to all of the Async Chunking API requests, 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.
"modelConfig": "vectorQuantizationMethod"
field to ensure that as much of the text as possible is chunked, even for large inputs.
Quantized vectors are less resource intensive to store and compute, which decreases index and query processing time.
In addition, due to their size, more quantized vectors can be used to reach the same amount of memory as typical vectors.
For example, if the quantized vector sizes are [1,0,2], [2,3,1], [6,0,0], [0,0,2]
and typical vectors are [0.012341,0.23434,0.01334], [0.5434,0.02134,0.05434], [0.76534,0.0953,0.1334], [0.398,0.38574,0.01384]
, and the amount of memory is 5MB:
The quantized vector can have 5000 vectors that reach 5MB because they are smaller. But typical vectors can only have 500 because they have more numerical values to save in memory. In this example, the numbers 5MB, 5000, and 500 are random numbers.
The following table specifies the number of chunks returned for a single request based on vector dimension and the setting of vector quantization.
Vector Dimension Size | Maximum Chunks Returned if Quantized Vector = true | Maximum Chunks if Quantized Vector = false |
---|---|---|
32 | 40000 | 11000 |
64 | 22500 | 5800 |
128 | 12000 | 3000 |
256 | 6500 | 1500 |
384 | 4500 | 1000 |
512 | 3250 | 750 |
768 | 2250 | 500 |
1024 | 1700 | 380 |
1536 | 250 | 250 |
2048 | 850 | 190 |
"useCaseConfig": "dataType": "string"
parameter is common to all of the Async Chunking API chunkers in the /ai/async-chunking/CHUNKER/MODEL_ID
request. If you do not enter the value, the default of query
is used.
This optional parameter enables model-specific handling in the Async Chunking API to help improve model accuracy. Use the most applicable fields based on available dataTypes and the dataType value that best aligns with the text sent to the Async Chunking API.
The string values to use are:
"dataType": "query"
for the query."dataType": "passage"
for fields searched at query time."chunkerConfig": "maxChunkSize"
- This integer field defines the maximum token limit for a chunker. The default is 512 tokens, which matches the maximum context size of the Lucidworks-hosted embedding models.
maxChunkSize
. If overlapSize
is provided, adjacent chunks overlap by that many sentences.
Example:
"chunkerConfig": "maxChunkSize"
- This integer field defines the maximum token limit for a chunker. The default is 512 tokens, which matches the maximum context size of the Lucidworks-hosted embedding models.
"chunkerConfig": "overlapSize"
- This integer field sets the number of sentences that can overlap between consecutive chunks. The default is 1 sentence for most configurations.
"chunkerConfig": "regex"
- This field sets the regular expression used to split the provided text. For example, \\n
.
"chunkerConfig": "maxChunkSize"
- This integer field defines the maximum token limit for a chunker. The default is 512 tokens, which matches the maximum context size of the Lucidworks-hosted embedding models.
"chunkerConfig": "overlapSize"
- This integer field sets the number of sentences that can overlap between consecutive chunks. The default is 1 sentence for most configurations.
"chunkerConfig": "cosineThreshold"
- This decimal field controls how similar a sentence must be to a chunk (based on cosine similarity), in order for the sentence to be merged into the chunk. This value is a decimal between 0 and 1. The default threshold is 0.5.
"chunkerConfig": "approximate"
- If this boolean field is set to true, the semantic chunker does not encode the split text to get its vector to compare with the next sentence vector. This greatly increases processing time with no loss in the result quality. However, even with the ability to specify true in the approximate field, the semantic chunker is the slowest of all the chunkers. If this field is set to false, the semantic chunking is, on average, 5 times slower than when set to true, with very minimal or no precision increase.
"chunkerConfig": "chunkSize"
- This integer field sets the maximum number of sentences per chunk. The default is 5.
"chunkerConfig": "overlapSize"
- This integer field sets the number of sentences that can overlap between consecutive chunks. The default is 1 sentence for most configurations.
status
of a request:
chunkingId
and status
that is used by the GET request.chunkingId
are available and ready to be retrieved.chunkingId
are returned successfully when the GET request was sent.chunkingId
from the POST response in a GET request.
The following is an example of the GET request used by every chunker.