API
We provide APIs to use our models in your own apps. Start with a demo key today. Plans for commercial use are also available.
Spell Checker
Find spelling mistakes in text and suggest corrections.
Spell Checker
Find spelling mistakes in text and suggest corrections.
POST
https://api.aipanjab.com/v1/models/spell-checkerRequest body (JSON)
text
string
Required
1 to 500 words, at most 20,000 characters
The text to check. It may mix Panjabi with other text, such as English words or numbers: only the Panjabi words are checked, everything else is left as it is.
top-k
integer
Optional
1 to 3, default 2
How many suggestions to return for each word found.
Response
normalized_text
string
Your text in one standard form: Panjabi alphabets and signs in their standard Unicode order, and spaces tidied. The positions in corrections and tags refer to this text.
corrected_text
string
normalized_text with every correction applied.
corrections
array
One item for each word that is probably misspelled, in the order of the text. Empty when no mistakes are found.
start, end
integer
Where the word is in normalized_text, as character positions (end not included): normalized_text[start:end] in Python, normalized_text.slice(start, end) in JavaScript.
original
string
The word as written.
suggestion
string
The best correction, the one used in corrected_text.
confidence
number
0 to 1
How likely the suggestion is the right correction.
suggestions
array
Up to top-k corrections, best first, each with its text and confidence.
error_confidence
number
0 to 1
How likely the word is misspelled.
certainty
string
high or low
high when the word is almost certainly wrong; low when it is only suspected, for example a rare name. You may want to show low ones more softly.
tags
array
Words recognised as valid that are never corrected, each with its start, end, word and tag: gurbani (a Gurbani spelling), foreign (an English or other word written in Panjabi) or gurbani_quote (a whole line of Gurbani).
stats
object
For information only: windows, the number of words checked, and decoded_windows, how many of them the model looked at closely.
Errors
An error answers with an HTTP status and a short message,
{"message": "..."} (a 500 has an empty body).400
invalid payloadThe body is not a JSON object, text is missing or empty or has more than 500 words or 20,000 characters, or top-k is not 1, 2 or 3.
401
invalid API keyThe Authorization header is missing, or the key is wrong or no longer active.
403
access deniedYour key does not include the spell checker.
415
unsupported media typeThe Content-Type header is not application/json.
500
Something went wrong on our side. Please try again later.
503
prediction not availableThe model is not available at the moment. Please try again later.
curl --request POST \
--url https://api.aipanjab.com/v1/models/spell-checker \
--header "Authorization: Bearer $AIPANJAB_API_KEY" \
--header "Content-Type: application/json" \
--data '{"text": "ਪੰਜਾਬ ਪੰਜ ਦਰਿਆਵਾ ਦਾ ਦੇਸ਼ ਹੈ।", "top-k": 2}'{
"normalized_text": "ਪੰਜਾਬ ਪੰਜ ਦਰਿਆਵਾ ਦਾ ਦੇਸ਼ ਹੈ।",
"corrected_text": "ਪੰਜਾਬ ਪੰਜ ਦਰਿਆਵਾਂ ਦਾ ਦੇਸ਼ ਹੈ।",
"corrections": [
{
"start": 10,
"end": 16,
"original": "ਦਰਿਆਵਾ",
"suggestion": "ਦਰਿਆਵਾਂ",
"confidence": 0.908,
"suggestions": [
{
"text": "ਦਰਿਆਵਾਂ",
"confidence": 0.908
}
],
"error_confidence": 1,
"certainty": "high"
}
],
"tags": [],
"stats": {
"windows": 4,
"decoded_windows": 1
}
}Digit Recognition
Recognise a handwritten digit in an image.
Digit Recognition
Recognise a handwritten digit in an image.
POST
https://api.aipanjab.com/v1/models/digit-recognitionRequest body (multipart/form-data)
file
file
Required
PNG or JPEG, the whole request at most 15 KB
An image of one handwritten digit. It works best like the drawings on our website: dark on a light or transparent background, filling most of the image. The image is resized to a small square, so a square image keeps its shape.
top-k
integer
Optional
1 to 5, default 3
How many predictions to return.
Response
predictions
array
The most likely digits, most likely first.
label
string
The digit: one of the 10 Panjabi digits, ੦ to ੯.
score
number
0 to 1
How likely the image shows this digit.
Errors
An error answers with an HTTP status and a short message,
{"message": "..."} (a 500 has an empty body).400
invalid payloadThe file is missing, or top-k is not between 1 and 5.
401
invalid API keyThe Authorization header is missing, or the key is wrong or no longer active.
403
access deniedYour key does not include Digit Recognition.
413
payload too largeThe request is larger than 15 KB.
415
unsupported media typeThe request is not multipart/form-data, or the file is not a PNG or JPEG image.
422
unable to process payload fileThe file is a PNG or JPEG that cannot be read, for example a damaged one.
500
Something went wrong on our side. Please try again later.
503
prediction not availableThe model is not available at the moment. Please try again later.
curl --request POST \
--url https://api.aipanjab.com/v1/models/digit-recognition \
--header "Authorization: Bearer $AIPANJAB_API_KEY" \
--form file=@digit.png \
--form top-k=3{
"predictions": [
{
"label": "੨",
"score": 0.9928627836
},
...
]
}Alphabet Recognition
Recognise a handwritten alphabet in an image.
Alphabet Recognition
Recognise a handwritten alphabet in an image.
POST
https://api.aipanjab.com/v1/models/alphabet-recognitionRequest body (multipart/form-data)
file
file
Required
PNG or JPEG, the whole request at most 15 KB
An image of one handwritten alphabet. It works best like the drawings on our website: dark on a light or transparent background, filling most of the image. The image is resized to a small square, so a square image keeps its shape.
top-k
integer
Optional
1 to 5, default 3
How many predictions to return.
Response
predictions
array
The most likely alphabets, most likely first.
label
string
The alphabet: one of the 57 Panjabi alphabets the model knows.
score
number
0 to 1
How likely the image shows this alphabet.
Errors
An error answers with an HTTP status and a short message,
{"message": "..."} (a 500 has an empty body).400
invalid payloadThe file is missing, or top-k is not between 1 and 5.
401
invalid API keyThe Authorization header is missing, or the key is wrong or no longer active.
403
access deniedYour key does not include Alphabet Recognition.
413
payload too largeThe request is larger than 15 KB.
415
unsupported media typeThe request is not multipart/form-data, or the file is not a PNG or JPEG image.
422
unable to process payload fileThe file is a PNG or JPEG that cannot be read, for example a damaged one.
500
Something went wrong on our side. Please try again later.
503
prediction not availableThe model is not available at the moment. Please try again later.
curl --request POST \
--url https://api.aipanjab.com/v1/models/alphabet-recognition \
--header "Authorization: Bearer $AIPANJAB_API_KEY" \
--form file=@alphabet.png \
--form top-k=3{
"predictions": [
{
"label": "ਸ",
"score": 0.9824657626
},
...
]
}Speech Recognition
Transcribe speech from an audio file.
Speech Recognition
Transcribe speech from an audio file.
POST
https://api.aipanjab.com/v1/models/speech-recognitionRequest body (multipart/form-data)
file
file
Required
MP3 or WAV, at most 2 MB
The audio file with the speech.
Response
transcription
string
What was said.
timestamps
array
The speech in timed pieces, in order.
start, end
number
When the piece starts and ends, in seconds from the start of the audio.
transcription
string
What was said in this piece.
Errors
An error answers with an HTTP status and a short message,
{"message": "..."} (a 500 has an empty body).400
invalid payloadThe file is missing.
401
invalid API keyThe Authorization header is missing, or the key is wrong or no longer active.
403
access deniedYour key does not include Speech Recognition.
413
payload too largeThe file is larger than 2 MB.
415
unsupported media typeThe request is not multipart/form-data, or the file is not an MP3 or WAV.
422
unable to process payload fileThe file is an MP3 or WAV that cannot be read, for example a damaged one.
500
Something went wrong on our side. Please try again later.
503
prediction not availableThe model is not available at the moment. Please try again later.
curl --request POST \
--url https://api.aipanjab.com/v1/models/speech-recognition \
--header "Authorization: Bearer $AIPANJAB_API_KEY" \
--form file=@audio.mp3{
"transcription": "ਏਆਈ ਪੰਜਾਬ ਉੱਤੇ ਤੁਹਾਡਾ ਸਵਾਗਤ ਹੈ...",
"timestamps": [
{
"start": 0.304,
"end": 5.904,
"transcription": "ਏਆਈ ਪੰਜਾਬ ਉੱਤੇ ਤੁਹਾਡਾ ਸਵਾਗਤ ਹੈ..."
},
...
]
}