Skip to main content
POST
/
ai
/
tokenization
/
{MODEL_ID}
Tokenization by MODEL_ID
import requests

url = "https://application_id.applications.lucidworks.com/ai/tokenization/{MODEL_ID}"

payload = {
    "batch": [{ "text": "Mr. and Mrs. Dursley and O'\''Malley, of number four, Privet Drive, were proud to say that they were perfectly normal, thank you very much" }],
    "useCaseConfig": { "dataType": "passage" },
    "modelConfig": {
        "vectorQuantizationMethod": "max-scale",
        "dimReductionSize": 256
    }
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

Headers

Authorization: Bearer ACCESS_TOKEN
string

The authentication and authorization access token.

Content-Type
string

application/json

Example:

"application/json"

Path Parameters

MODEL_ID
string
required

The name of the pre-trained or custom embedding model.

Example:

"e5-small-v2"

Body

application/json
batch
object[]

The text used as the input for the request.

useCaseConfig
UseCaseConfig · object
modelConfig
ModelConfig · object

Response

200 - application/json

OK

generatedTokens
object[]
tokensUsed
object