title: Text processing app v0.1.0
language_tabs:
> Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Base URLs:
> Code samples
const headers = {
'Accept':'application/json'
};
fetch('/text/',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/text/', headers = headers)
print(r.json())
GET /
Desc
Get application description.
Returns a simple response containing the description of the application.
Returns:
Example Response:
{
"data": {
"app": "text"
}
}
> Example responses
> 200 Response
{
"error": "string",
"data": null
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | ApiResponse |
> Code samples
const inputBody = '[
{
"text": "string"
}
]';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/text/classifier',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/text/classifier', headers = headers)
print(r.json())
POST /classifier
Classifier
Text classification.
Classify a list of texts using a text classification model.
Parameters:
Returns:
Example Request:
POST /classifier
[
{
"text": "This is a positive review."
},
{
"text": "This is a negative review."
}
]
Example Response:
{
"data": [
{"label": "positive", "score": 0.85},
{"label": "negative", "score": 0.73}
]
}
> Body parameter
[
{
"text": "string"
}
]
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | TextRequest | true | none |
> Example responses
> 200 Response
{
"error": "string",
"data": [
null
]
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | ApiResponseList |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
> Code samples
const inputBody = '[
{
"text": "string"
}
]';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/text/sentiment-analyzer',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/text/sentiment-analyzer', headers = headers)
print(r.json())
POST /sentiment-analyzer
Sentiment Analyzer
Sentiment analysis.
Analyze sentiment for a list of texts.
Parameters:
Returns:
Example Request:
POST /sentiment-analyzer
[
{
"text": "I love this product!"
},
{
"text": "I'm not satisfied with the service."
}
]
Example Response:
{
"error": null,
"data": [
{
"label": "love",
"score": 0.9471527338027954
},
{
"label": "disapproval",
"score": 0.6938314437866211
}
]
}
> Body parameter
[
{
"text": "string"
}
]
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | TextRequest | true | none |
> Example responses
> 200 Response
{
"error": "string",
"data": [
null
]
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | ApiResponseList |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
> Code samples
const inputBody = '{
"text": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/text/summarizer',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/text/summarizer', headers = headers)
print(r.json())
POST /summarizer
Summarizer
Text summarization.
Summarize the input text.
Parameters:
Returns:
Example Request:
POST /summarizer
{
"text": "This is a long piece of text..."
}
Example Response:
{
"data": {
"summary_text": "This is a summarized version of the input text..."
}
}
> Body parameter
{
"text": "string"
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | TextRequest | true | none |
> Example responses
> 200 Response
{
"error": "string",
"data": null
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | ApiResponse |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
> Code samples
const inputBody = '{
"text": "string",
"questions": [
"string"
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/text/question-answering',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/text/question-answering', headers = headers)
print(r.json())
POST /question-answering
Question Answering
Question answering.
Answer a list of questions based on the input text.
Parameters:
Returns:
Example Request:
POST /question-answering
{
"text": "The capital of France is Paris and that city has a population of 2m people",
"questions": ["What is the capital of France?", "What is the population of Paris?"]
}
Example Response:
{
"error": null,
"data": [
{
"question": "What is the capital of France?",
"answer": {
"score": 0.9588838815689087,
"start": 20,
"end": 25,
"answer": "Paris"
}
},
{
"question": "What is the population of Paris?",
"answer": {
"score": 0.6355919241905212,
"start": 60,
"end": 62,
"answer": "2m"
}
}
]
}
> Body parameter
{
"text": "string",
"questions": [
"string"
]
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | QuestionAnswerRequest | true | none |
> Example responses
> 200 Response
{
"error": "string",
"data": [
{
"question": "string",
"answer": {
"score": 0,
"start": 0,
"end": 0,
"answer": "string"
}
}
]
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | QuestionAnswerResponse |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
> Code samples
const inputBody = '{
"text": "string",
"labels": [
"string"
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/text/labelizer',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/text/labelizer', headers = headers)
print(r.json())
POST /labelizer
Labelizer
Text labeling.
Label the input text with specified labels.
Parameters:
Returns:
Example Request:
POST /labelizer
{
"text": "This is an example sentence.",
"labels": ["positive", "negative"]
}
Example Response:
{
"data": {
"sequence": "This is an example sentence.",
"labels": ["positive", "neutral"],
"scores": [0.75, 0.2]
}
}
> Body parameter
{
"text": "string",
"labels": [
"string"
]
}
Name | In | Type | Required | Description |
---|---|---|---|---|
multi_label | query | any | false | none |
body | body | LabelRequest | true | none |
> Example responses
> 200 Response
{
"error": "string",
"data": {
"sequence": "string",
"labels": [
"string"
],
"scores": [
0
]
}
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | LabelResponse |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
> Code samples
const inputBody = '{
"text": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/text/mask-filler',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/text/mask-filler', headers = headers)
print(r.json())
POST /mask-filler
Mask Filler
Mask filling.
Fill in masked values in the input text.
Parameters:
Returns:
Example Request:
POST /mask-filler
{
"text": "Please buy [MASK] from the store."
}
Example Response:
{
"error": null,
"data": [
{
"score": 0.17938034236431122,
"token": 2505,
"token_str": "anything",
"sequence": "please buy anything from this store"
},
{
"score": 0.11332187056541443,
"token": 2242,
"token_str": "something",
"sequence": "please buy something from this store"
},
{
"score": 0.05946308374404907,
"token": 3688,
"token_str": "products",
"sequence": "please buy products from this store"
},
{
"score": 0.04591205716133118,
"token": 5167,
"token_str": "items",
"sequence": "please buy items from this store"
},
{
"score": 0.04386703670024872,
"token": 2009,
"token_str": "it",
"sequence": "please buy it from this store"
}
]
}
> Body parameter
{
"text": "string"
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | TextRequest | true | none |
> Example responses
> 200 Response
{
"error": "string",
"data": [
{
"score": 0,
"token": 0,
"token_str": "string",
"sequence": "string"
}
]
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful Response | MaskFillerResponse |
422 | Unprocessable Entity | Validation Error | HTTPValidationError |
{
"score": 0,
"start": 0,
"end": 0,
"answer": "string"
}
Answer
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
score | number | true | none | none |
start | integer | true | none | none |
end | integer | true | none | none |
answer | string | true | none | none |
{
"error": "string",
"data": null
}
ApiResponse
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | string | false | none | none |
data | any | false | none | none |
{
"error": "string",
"data": [
null
]
}
ApiResponseList
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | string | false | none | none |
data | [any] | false | none | none |
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}
HTTPValidationError
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
detail | [ValidationError] | false | none | none |
{
"sequence": "string",
"labels": [
"string"
],
"scores": [
0
]
}
LabelOutput
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
sequence | string | true | none | none |
labels | [string] | true | none | none |
scores | [number] | true | none | none |
{
"text": "string",
"labels": [
"string"
]
}
LabelRequest
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
text | string | true | none | none |
labels | [string] | true | none | none |
{
"error": "string",
"data": {
"sequence": "string",
"labels": [
"string"
],
"scores": [
0
]
}
}
LabelResponse
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | string | false | none | none |
data | LabelOutput | true | none | none |
{
"score": 0,
"token": 0,
"token_str": "string",
"sequence": "string"
}
MaskFillerOutput
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
score | number | true | none | none |
token | integer | true | none | none |
token_str | string | true | none | none |
sequence | string | true | none | none |
{
"error": "string",
"data": [
{
"score": 0,
"token": 0,
"token_str": "string",
"sequence": "string"
}
]
}
MaskFillerResponse
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | string | false | none | none |
data | [MaskFillerOutput] | true | none | none |
{
"question": "string",
"answer": {
"score": 0,
"start": 0,
"end": 0,
"answer": "string"
}
}
QuestionAnswer
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
question | string | true | none | none |
answer | Answer | true | none | none |
{
"text": "string",
"questions": [
"string"
]
}
QuestionAnswerRequest
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
text | string | true | none | none |
questions | [string] | true | none | none |
{
"error": "string",
"data": [
{
"question": "string",
"answer": {
"score": 0,
"start": 0,
"end": 0,
"answer": "string"
}
}
]
}
QuestionAnswerResponse
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | string | false | none | none |
data | [QuestionAnswer] | true | none | none |
{
"text": "string"
}
TextRequest
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
text | string | true | none | none |
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
ValidationError
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
loc | [anyOf] | true | none | none |
anyOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ยป anonymous | string | false | none | none |
or
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ยป anonymous | integer | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
msg | string | true | none | none |
type | string | true | none | none |