Multilingual Support

One AI has the capability to work and process text in many languages, automatically

Our APIs are capable of processing content in 97 languages, including English, Spanish, German, French, Japanese, Hebrew, Arabic, and more (see list at https://oneai.com/languages)

By default non-English inputs will be rejected.
To enable multilingual inputs use the "multilingual" configuration object in your pipeline:

  "multilingual":
  {
    "enabled": true
    }

Additional Multilingual parameters:

NameTypeDescription
enabledbooleanMark true if the input is not in English. The default is false.
allowed_input_languageslistLimit processing to specific languages, if the input is detected as another language it will be blocked and the error "40001 Language not supported" will be returned. For example, ["es","fr"].
expected_languageslistTo improve language detection specify your expected input languages in a 2-letter ISO-639 language code format. For example,["es","fr"].
override_language_detectionbooleanTo disable language detection set to true, the system will then use the language from expected_languages field.
This is useful in cases where the input language is known or in edge cases where language detection fails.
translate_output_tostringLanguage to translate the output into. For example,"en".

Pro-tip: To enable multilingual support with default behavior use multilingual:true.

To analyze multi-lingual audio, use the our Whisper powered transcription skill: https://docs.oneai.com/docs/transcribe-audio

Request

curl -X POST \
'https://api.oneai.com/api/v0/pipeline' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'api-key: <YOUR-API-KEY-HERE>' \
-d '{
    "input": "Después de prohibir de forma permanente las fiestas y eventos en todos los listados de Airbnb en junio, la compañía está endureciendo su postura contra las fiestas al lanzar nuevas herramientas de detección en los EE. UU. y Canadá.",
    "multilingual": {
        "enabled": true,
        "allowed_input_languages": ["es"],
        "expected_languages":["es"],
        "override_language_detection": true,
        "translate_output_to": "en"   
    },
    "steps": [
      {
        "skill": "article-topics"
      }
    ]
}'


import requests

url = 'https://api.oneai.com/api/v0/pipeline'
headers = {
    'accept': 'application/json',
    'Content-Type': 'application/json',
    'api-key': '<YOUR-API-KEY-HERE>'
}

data = {
    "input": "Después de prohibir de forma permanente las fiestas y eventos en todos los listados de Airbnb en junio, la compañía está endureciendo su postura contra las fiestas al lanzar nuevas herramientas de detección en los EE. UU. y Canadá.",
    "steps": [
        {
            "skill": "article-topics"
        },
        {
            "multilingual": {
                "enabled": True,
                "allowed_input_languages": ["es"],
                "expected_languages": ["es"],
                "override_language_detection": True,
                "translate_output_to": "en"
            }
        }
    ]
}

response = requests.post(url, headers=headers, json=data)
print(response.json())