API Reference
Train
All
Requests FPT.AI to train/re-retrain for both intent model and entity model for the application.
Note: You MUST have at least 2 intents and 2 samples to train.
Example request
curl -X POST \
  https://v3-api.fpt.ai/api/v3/train \
  -H 'Authorization: Bearer your_application_token' \
Example response
{
    "message": "training request is accepted",
    "status": [
        {
            "code": "mlne8hmzfy4jmgvpn3itoh7w8jyks1ut",
            "app_code": "dfd6908df08cf9d825f9ca9d38bf4677",
            "type": 1,
            "state": 0,
            "message": "",
            "model_file": "",
            "accuracy": 0,
            "precision": 0,
            "recall": 0,
            "f1": 0,
            "created_time": "2018-10-08T03:33:09Z",
            "finished_time": "2018-10-08T03:33:10Z",
            "started_time": "2018-10-08T03:33:10Z"
        },
        {
            "code": "g0a50948j6dd0asshcgszrhtaeeg807h",
            "app_code": "dfd6908df08cf9d825f9ca9d38bf4677",
            "type": 2,
            "state": 1,
            "message": "training",
            "model_file": "",
            "accuracy": 0,
            "precision": 0,
            "recall": 0,
            "f1": 0,
            "created_time": "2018-10-08T03:33:09Z",
            "finished_time": "2018-10-08T03:33:10Z",
            "started_time": "2018-10-08T03:33:10Z"
        }
    ]
}
Request
POST https://v3-api.fpt.ai/api/v3/train
Parameters
| Parameter | Required | Description | 
|---|---|---|
| n/a | n/a | n/a | 
Response
Returns a JSON message represents the training status.
Training status
Requests FPT.AI get current train status of the application.
Example request
curl -X POST \
  https://v3-api.fpt.ai/api/v3/train/status \
  -H 'Authorization: Bearer your_application_token' \
Example response
{
    "last_success_time": "0001-01-01T00:00:00Z",
    "status": 1,
    "trainable": false
}
Request
POST https://v3-api.fpt.ai/api/v3/train/status
Parameters
| Parameter | Required | Description | 
|---|---|---|
| n/a | n/a | n/a | 
Response
Returns a JSON message represents the training status.
| Status value | Description | 
|---|---|
| 0 | Waiting to train | 
| 1 | Training | 
| 2 | Train Success | 
| 3 | Train Failed | 
Intent
Requests FPT.AI to train/re-retrain intent model for the application.
Note: You MUST have at least 2 intents to train.
Example request
curl -X POST \
  https://v3-api.fpt.ai/api/v3/train/intent \
  -H 'Authorization: Bearer your_application_token' \
Example response
{
    "message": "training request is accepted",
    "status": [
        {
            "code": "cxx6gfj2pypbp8s2ohxyiufw807bl34r",
            "app_code": "dfd6908df08cf9d825f9ca9d38bf4677",
            "type": 1,
            "state": 0,
            "message": "",
            "model_file": "",
            "accuracy": 0,
            "precision": 0,
            "recall": 0,
            "f1": 0,
            "created_time": "2018-10-08T04:02:04Z",
            "finished_time": "2018-10-08T04:02:05Z",
            "started_time": "2018-10-08T04:02:05Z"
        },
        {
            "code": "g0a50948j6dd0asshcgszrhtaeeg807h",
            "app_code": "dfd6908df08cf9d825f9ca9d38bf4677",
            "type": 2,
            "state": 2,
            "message": "Model trained successfully with engine v2_entity and took 1034 seconds.",
            "model_file": "2018-10-08_10-33-17__v2_entity",
            "accuracy": 100,
            "precision": 100,
            "recall": 100,
            "f1": 100,
            "created_time": "2018-10-08T03:33:09Z",
            "finished_time": "2018-10-08T03:50:35Z",
            "started_time": "2018-10-08T03:33:10Z"
        }
    ]
}
Request
POST https://v3-api.fpt.ai/api/v3/train/intent
Parameters
| Parameter | Required | Description | 
|---|---|---|
| n/a | n/a | n/a | 
Response
Returns a JSON message represents the training status.
Entity
Requests FPT.AI to train/re-retrain entity model for the application.
Example request
curl -X POST \
  https://v3-api.fpt.ai/api/v3/train/entity \
  -H 'Authorization: Bearer your_application_token' \
Example response
{
    "message": "training request is accepted",
    "status": [
        {
            "code": "cxx6gfj2pypbp8s2ohxyiufw807bl34r",
            "app_code": "dfd6908df08cf9d825f9ca9d38bf4677",
            "type": 1,
            "state": 1,
            "message": "training",
            "model_file": "",
            "accuracy": 0,
            "precision": 0,
            "recall": 0,
            "f1": 0,
            "created_time": "2018-10-08T04:02:04Z",
            "finished_time": "2018-10-08T04:02:05Z",
            "started_time": "2018-10-08T04:02:29Z"
        },
        {
            "code": "pxkaxumjdkqkr6ojd73a3upsvwfkvbg5",
            "app_code": "dfd6908df08cf9d825f9ca9d38bf4677",
            "type": 2,
            "state": 0,
            "message": "",
            "model_file": "",
            "accuracy": 0,
            "precision": 0,
            "recall": 0,
            "f1": 0,
            "created_time": "2018-10-08T04:03:40Z",
            "finished_time": "2018-10-08T04:03:41Z",
            "started_time": "2018-10-08T04:03:41Z"
        }
    ]
}
Request
POST https://v3-api.fpt.ai/api/v3/train/entity
Parameters
| Parameter | Required | Description | 
|---|---|---|
| n/a | n/a | n/a | 
Response
Returns a JSON message represents the training status.
