Gibberish
We define as gibberish any text that has the particularity of not being intelligible in the target language of the reader.
Unintelligible can be anything from a random sequence of characters, like asdasqweqdaczc
, to a series of words that may be valid when analyzed one by one, but that in combination make no sense. For example: dog boat the yes
.
The former is somewhat more easily detectable by computers but the latter is much harder as they are existing words that just happen to make no sense in combination.
Because of this, we introduced the concept of mild-gibberish
, which covers the case of sentences having valid words with occurrences of gibberish
in it.
Prediction labels
Input length
The longer the input, the better the model performs but we recommend paragraphs to be split into sentences of medium length.
Limits
The maximum length accepted is 512 characters.
Label | Meaning | Example |
---|---|---|
normal | The model was not able to detect any gibberish inside the input text | This is a text being used as example |
mild-gibberish | Some gibberish was detected in the input, either by obvious garbage inside the text or by having erratic writing that makes little sense | Text that somewhat ?>! makes sense 123123asdad |
gibberish | The text was evaluated as being completely unintelligible | qweqwe1!@@DAs vbxc? |
Invokation
- cURL
- Python
- PHP
curl -L -G 'http://api.textkit.ai/detect/gibberish' \
--data-urlencode 'text=this is just a random text' \
--header 'X-API-Key: your_api_key_here'
import requests
url = "https://api.textkit.ai/detect/gibberish?text=how can I contact you?"
payload={}
headers = {
'X-API-Key': 'your_api_key_here'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
<?php
$curl = curl_init();
$url = "https://api.textkit.ai/detect/language?text=" . urlencode("how can I contact you?");
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'X-API-Key: your_api_key_here'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response
{
"prediction": "normal",
"confidence": "0.998",
"time_ms": 1409
}
Field | Meaning |
---|---|
prediction | The predicted label. See above for reference |
confidence | Value between 0 and 1 that indicates how confident the model is |
time_ms | Time in milliseconds the model took to predict the label. It does not account for the network round trip time between request and response |