Supported Languages
Text analysis is supported for the following languages:
English
Japanese
French
German
Spanish
Text Analysis Endpoints
The Verity text analysis endpoints are:
POST /text/classification
Initiates a new text analysis.
GET /text/classification/{uuid}/status
Returns the status of the text analysis.
GET /text/classification/{uuid}
Returns processed results.
The following example walks through an example text string analysis request.
Example Text Request
This example shows a request to analyze the following text string:
Kubernetes (also known as k8s or kube) is an open source container orchestration platform that automates many of the manual processes
Step 1 – Submit a POST request via curl to /text/classification
Submit a POST request with the text string to be analyzed, for example:
curl -H 'x-api-key: <YOUR_API_KEY_HERE>' -H 'Content-Type: application/json' -X POST -d '{"text":"Kubernetes (also known as k8s or kube) is an open source container orchestration platform that automates many of the manual processes", "languageCode": "en"}' https://verity-api.gumgum.com/text/classification
Verity API returns a JSON response of Content-Type: application/json; charset=UTF-8
with a uuid
for the request and current request status, for example:
Code Block | ||
---|---|---|
| ||
{ "uuid": "c7bcbe04-ea77-4808-8e91-28d325d1b1fc", "acceptedAt": "2020-06-25T23:09:41.729Z" } |
For a list of supported status messages, refer to Application Status Codes.
Step 2 – Submit a GET request to /text/classification/{uuid}/status
Submit a GET request to /text/classification/{uuid}/status, specifying the uuid returned in the previous step. Within a short period, once analysis of the text is complete, a status change occurs. For example:
curl -H 'x-api-key: <YOUR_API_KEY_HERE>' https://verity-api.gumgum.com/text/classification/c7bcbe04-ea77-4808-8e91-28d325d1b1fc/status
Verity API returns a JSON response with Content-Type: application/json; charset=UTF-8 showing the request has the following status:
Code Block | ||
---|---|---|
| ||
{ "uuid" : "c7bcbe04-ea77-4808-8e91-28d325d1b1fc", "status": "ANALYZING" } |
Step 3 – Submit a GET request to /text/classification/{uuid}
Submit a GET request to /text/classification/{uuid} , specifying the uuid returned in the response during Step 1. Within a short period, once analysis of the text is complete, a status change occurs. For example:
curl -H 'x-api-key: <YOUR_API_KEY_HERE>' https://verity-api.gumgum.com/text/classification/123e4567-e89b-12d3-a456-426655440000
Code Block | ||
---|---|---|
| ||
{ "uuid": "c7bcbe04-ea77-4808-8e91-28d325d1b1fc", "data": { "iab": { "v2": [ { "id": "596", "category": "Technology & Computing", "score": 0.69 }, { "id": "620", "category": "Cloud Computing", "score": 0.26, "parent": { "id": "619", "category": "Internet", "parent": { "id": "599", "category": "Computing", "parent": { "id": "596", "category": "Technology & Computing" } } } } ] }, "keywords": [ "kubernetes", "orchestration", "container" ], "safe": true, "threats": [ { "id": "GGT1", "category": "Violence and gore", "confidence": "LOW" } ], "sentiments": [ { "sentiment": "neutral", "score": 1 }, { "sentiment": "negative", "score": 0 }, { "sentiment": "positive", "score": 0 } ] } } |
The JSON response details the complete brand safety, keyword, and categorization analysis data for the text. See JSON Response for details about the fields included in the response.