API Reference
Predict
All
Requests FPT.AI to predict for both intents of and entities in the given text.
Example request
curl -X POST \
https://v3-api.fpt.ai/api/v3/predict \
-H 'Authorization: Bearer your_application_token' \
-d '{
"content": "Shop bán iPhone không?",
"save_history": false
}'
Example response
{
"status": {
"code": 200,
"message": "Predict All successful",
"module": "",
"api_code": 0,
"err_code": 0
},
"data": {
"intents": [
{
"label": "ask_product",
"confidence": 0.92
},
{
"label": "ask_general_information",
"confidence": 0.04
},
{
"label": "ask_inventory",
"confidence": 0.03
}
],
"entities": [
{
"start": 9,
"end": 15,
"value": "iPhone",
"real_value": "apple-iphone",
"entity": "filter_brand",
"subentities": null
}
]
},
"history_id": 0
}
Request
POST https://v3-api.fpt.ai/api/v3/predict
Parameters
Parameter | Required | Description |
---|---|---|
content | yes | text to predict |
save_history | no | save to history |
Response
Returns a JSON object that contains predicted intents and entities with confidence values.
Intent
Requests FPT.AI to predict for intents of the given text.
Example request
curl -X POST \
https://v3-api.fpt.ai/api/v3/predict/intent \
-H 'Authorization: Bearer your_application_token' \
-d '{
"content": "do you have fresh chicken eggs?"
}'
Example response
{
"status": {
"code": 200,
"message": "Predict Intents successful",
"module": "",
"api_code": 0,
"err_code": 0
},
"data": {
"intents": [
{
"label": "product_info",
"confidence": 0.99
},
{
"label": "purchase",
"confidence": 0.005
}
]
}
}
Request
POST https://v3-api.fpt.ai/api/v3/predict/intent
Paramenters
Parameter | Required | Description |
---|---|---|
content | yes | text to predict |
save_history | no | save to history |
Response
Returns a JSON object that contains predicted intents with confidence values.
Entity
Requests FPT.AI to predict for entities in the given text.
Example request
curl -X POST \
https://v3-api.fpt.ai/api/v3/predict/entity \
-H 'Authorization: Bearer your_application_token' \
-d '{
"content": "I'd like to purchase some fresh vegetable",
"save_history": false
}'
Example response
{
"status": {
"code": 200,
"message": "Recognize Entities successful",
"module": "",
"api_code": 0,
"err_code": 0
},
"data": {
"entities": [
{
"start": 32,
"end": 41,
"value": "vegetable",
"real_value": "vegetable",
"entity": "product_name",
"subentities": []
}
]
}
}
Request
POST https://v3-api.fpt.ai/api/v3/predict/entity
Paramenters
Parameter | Required | Description |
---|---|---|
content | yes | text to predict |
Response
Returns a JSON object that contains predicted entities with confidence values.