Translation

To make our classifiers more language independent we are creating a translation API. The goal is to offer affordable (<$1/MB) machine translation supporting some of the major languages.

Demo

Translation API

We provide a simple and affordable REST API. Get your API key by signing up (free).

Pricing

This is very preliminary and may change. Each uClassify account is restricted to a maximum number of calls, e.g. the free account has 500 per day. For the translation API each 40 characters will use 1 call. This means that you have 0.6 MB free translations per month. The cheapest payed account (9€) gives you 6 MB per month. A professional small account (99€) gives you 180 MB per month. As comparison with other machine translation services this is about $0.55 per 1000000 characters.

Requests

You can either send GET or POST requests to the API endpoint. A JSON response is returned to each request.

GET/POST https://language.uclassify.com/translate/v1/
Name Type Description
keystringYour read key (found in your account).
sourcestringThe source language that is going to be translated. Must be set to 'sv', 'es' or 'fr' for now.
targetstringThe target language to translate to. Must be set to 'en' for now.
tstringThe text to translate, this parameter can be repeated for multiple texts. Max query length for GET is 2Kb and 1 MB for POST.

Examples

Example GET request
https://language.uclassify.com/translate/v1/?key=YOUR_READ_API_KEY_HERE&source=sv&target=en&t=hej+v%c3%a4rlden&t=hur+m%c3%a5r+du%3f
Example CURL POST request
curl -X POST -H "Content-Type: application/json" --data "{\"key\":\"YOUR_READ_API_KEY_HERE\",\"source\":\"sv\",\"target\":\"en\",\"quality\":null,\"t\":[\"hej allihopa\",\"att vara eller att inte vara\"]}" https://language.uclassify.com/translate/v1/
Python example
import requests
data = {
    'key': 'YOUR_READ_API_KEY_HERE',
    'source': 'sv',
    'target': 'en',
    't': ['hej världen', 'hur mår du?']
}
response = requests.post('https://language.uclassify.com/translate/v1/', json=data)
print(response.content)
Example response
{
  "source": "sv",
  "target": "en",
  "remaining": 0,
  "translations": [
    "hello world",
    "how are you?"
  ]
}
The remaining field indicates how many charactes are left of the daily qouta.

Supported languages

Initially we will only target English from a few requested languages. If you have specific language requests, please let me know.

SourceTargetStatus
Swedish (sv) English (en) Released
French (fr) English (en) Released
Spanish (es) English (en) Released

The translation algorithm learns by reading huge amounts of human translated texts and dictionaries. Those datasets have been collected from the following public sources:

  1. OPUS - a great source of parallel corpora by Jörg Tiedemann
  2. Wiktionary - a huge collection of multilingual dictionaries (CC BY-SA 3.0)
  3. OmegaWiki - a multilingual dictionary (CC BY 2.5)
  4. Google Books Ngrams - terrabytes of ngrams (CC BY 3.0)
  5. Folkets Lexicon - a Swedish-English dictionary (CC BY-SA 2.5)