Predict
Predict the language of a text
Predict the language of a text using a neural model. Use this POST version for long texts, as the GET version has a limit on the length of the text that can be provided in the query string.
textstring
The text to predict language of
k?integer
The number of predictions to return
Default
10Range
1 <= valuethreshold?number
The minimum probability for a language to be returned
Default
0.01Range
0 <= value <= 1Response Body
curl -X POST "https://robotoff.openfoodfacts.org/api/v1/predict/lang" \ -H "Content-Type: application/json" \ -d '{ "text": "hello world" }'{
"predictions": [
{
"lang": "en",
"confidence": 0.9
}
]
}Empty