LokingAI-Text

FREEMIUM
By josuebrunel | Updated ะผะตััั† ะฝะฐะทะฐะด | Artificial Intelligence/Machine Learning
Health Check

N/A

README


title: Text processing app v0.1.0
language_tabs:

  • javascript: Javascript
  • python: Python
    toc_footers: []
    includes: []
    search: true
    highlight_theme: darkula
    headingLevel: 2

Text processing app v0.1.0

> 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:

Default

desc__get

> 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:

  • ApiResponse: A response containing the application description.

Example Response:

{
    "data": {
        "app": "text"
    }
}

> Example responses

> 200 Response

{
  "error": "string",
  "data": null
}

Responses

Status Meaning Description Schema
200 OK Successful Response ApiResponse

classifier_classifier_post

> 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:

  • payload: List of TextRequest objects containing the input texts.

Returns:

  • ApiResponseList: A list of responses containing classification results for each input text.

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"
  }
]

Parameters

Name In Type Required Description
body body TextRequest true none

> Example responses

> 200 Response

{
  "error": "string",
  "data": [
    null
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful Response ApiResponseList
422 Unprocessable Entity Validation Error HTTPValidationError

sentiment_analyzer_sentiment_analyzer_post

> 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:

  • payload: List of TextRequest objects containing the input texts.

Returns:

  • ApiResponseList: A list of responses containing sentiment analysis results for each input text.

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"
  }
]

Parameters

Name In Type Required Description
body body TextRequest true none

> Example responses

> 200 Response

{
  "error": "string",
  "data": [
    null
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful Response ApiResponseList
422 Unprocessable Entity Validation Error HTTPValidationError

summarizer_summarizer_post

> 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:

  • payload: TextRequest object containing the input text.

Returns:

  • ApiResponse: A response containing the summarized text.

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"
}

Parameters

Name In Type Required Description
body body TextRequest true none

> Example responses

> 200 Response

{
  "error": "string",
  "data": null
}

Responses

Status Meaning Description Schema
200 OK Successful Response ApiResponse
422 Unprocessable Entity Validation Error HTTPValidationError

question_answering_question_answering_post

> 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:

  • payload: QuestionAnswerRequest object containing the input text and list of questions.

Returns:

  • QuestionAnswerResponse: A response containing the answers to the questions.

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"
  ]
}

Parameters

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"
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful Response QuestionAnswerResponse
422 Unprocessable Entity Validation Error HTTPValidationError

labelizer_labelizer_post

> 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:

  • payload: LabelRequest object containing the input text and list of labels.

Returns:

  • LabelResponse: A response containing the labeled text and label scores.

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"
  ]
}

Parameters

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
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Successful Response LabelResponse
422 Unprocessable Entity Validation Error HTTPValidationError

mask_filler_mask_filler_post

> 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:

  • payload: TextRequest object containing the input text with masked values.

Returns:

  • MaskFillerResponse: A response containing the filled-in masked values.

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"
}

Parameters

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"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful Response MaskFillerResponse
422 Unprocessable Entity Validation Error HTTPValidationError

Schemas

Answer




{
  "score": 0,
  "start": 0,
  "end": 0,
  "answer": "string"
}

Answer

Properties

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

ApiResponse




{
  "error": "string",
  "data": null
}

ApiResponse

Properties

Name Type Required Restrictions Description
error string false none none
data any false none none

ApiResponseList




{
  "error": "string",
  "data": [
    null
  ]
}

ApiResponseList

Properties

Name Type Required Restrictions Description
error string false none none
data [any] false none none

HTTPValidationError




{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

HTTPValidationError

Properties

Name Type Required Restrictions Description
detail [ValidationError] false none none

LabelOutput




{
  "sequence": "string",
  "labels": [
    "string"
  ],
  "scores": [
    0
  ]
}

LabelOutput

Properties

Name Type Required Restrictions Description
sequence string true none none
labels [string] true none none
scores [number] true none none

LabelRequest




{
  "text": "string",
  "labels": [
    "string"
  ]
}

LabelRequest

Properties

Name Type Required Restrictions Description
text string true none none
labels [string] true none none

LabelResponse




{
  "error": "string",
  "data": {
    "sequence": "string",
    "labels": [
      "string"
    ],
    "scores": [
      0
    ]
  }
}

LabelResponse

Properties

Name Type Required Restrictions Description
error string false none none
data LabelOutput true none none

MaskFillerOutput




{
  "score": 0,
  "token": 0,
  "token_str": "string",
  "sequence": "string"
}

MaskFillerOutput

Properties

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

MaskFillerResponse




{
  "error": "string",
  "data": [
    {
      "score": 0,
      "token": 0,
      "token_str": "string",
      "sequence": "string"
    }
  ]
}

MaskFillerResponse

Properties

Name Type Required Restrictions Description
error string false none none
data [MaskFillerOutput] true none none

QuestionAnswer




{
  "question": "string",
  "answer": {
    "score": 0,
    "start": 0,
    "end": 0,
    "answer": "string"
  }
}

QuestionAnswer

Properties

Name Type Required Restrictions Description
question string true none none
answer Answer true none none

QuestionAnswerRequest




{
  "text": "string",
  "questions": [
    "string"
  ]
}

QuestionAnswerRequest

Properties

Name Type Required Restrictions Description
text string true none none
questions [string] true none none

QuestionAnswerResponse




{
  "error": "string",
  "data": [
    {
      "question": "string",
      "answer": {
        "score": 0,
        "start": 0,
        "end": 0,
        "answer": "string"
      }
    }
  ]
}

QuestionAnswerResponse

Properties

Name Type Required Restrictions Description
error string false none none
data [QuestionAnswer] true none none

TextRequest




{
  "text": "string"
}

TextRequest

Properties

Name Type Required Restrictions Description
text string true none none

ValidationError




{
  "loc": [
    "string"
  ],
  "msg": "string",
  "type": "string"
}

ValidationError

Properties

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
Followers: 1
API Creator:
Rapid account: Josuebrunel
josuebrunel
josuebrunel
Log In to Rate API
Rating: 5 - Votes: 1