Google api translate


Cloud Translation | Google Cloud

Dynamically translate between languages using Google machine learning

Get started keyboard_arrow_down
  • AutoML Translation
  • Translation API

Developers, translators, and localization experts with limited machine learning expertise can quickly create high-quality, production-ready models. Just upload translated language pairs and AutoML Translation will train a custom model that you can scale and adapt to meet your needs.

Want your website and apps to instantly translate texts into more than one hundred languages? Translation API uses Google’s pre-trained neural machine translation to deliver fast, dynamic results. Within Translation API, you can now even choose to use custom model translations, streamlining your workflow within the same client library.

Translation API’s pre-trained model supports more than one hundred languages, from Afrikaans to Zulu. AutoML Translation lets you build custom models in more than fifty language pairs.

When you don’t know your source text language — for instance, in user-generated content that doesn’t include a language code — our translation products automatically identify languages with high accuracy.

Translation API’s glossary can help you maintain your brand in translated content. Simply define the vocabulary you want prioritized, then save the glossary file to your translation project, and those words and phrases will be included in your copy.

Our translation products scale seamlessly. We provide a generous daily quota and let you set lower limits. And you can use batch translation with Google Cloud Storage to reduce the workflow complexity of translating long or multiple text files.

Translation’s easy-to-use Google REST API means you don’t have to extract text from your document; just send the HTML and you’ll get back translated text.

Translation charges on a per-character basis, even if the character is multiple bytes. AutoML Translation charges for training, per-character prediction usage, and storage. You only pay for what you use, so our products are usually more affordable than other options.

Use AutoML Translation for custom model creation, training, and management. For all of your other translation needs, use Translation API and its new sophisticated features, including glossary and batch translation. With Translation API, you now have the ability to request translations from your own custom model or Google’s pre-trained models so that you can streamline your workflow within the same client library.

Supported Features By product Translation API features by model type AutoML Translation Translation API Custom Pre-trained
Maintain and control your brand by defining the vocabulary and terminology you want to override within translations and then integrating these company-specific terms into your translation workflows.
Translate larger volumes of content in one translation request for text and HTML files stored on Google Cloud Storage.
Train custom machine learning models with minimal effort and machine learning expertise.
Custom translation models are supported in more than 50 language pairs. Once created with AutoML Translation, you can use custom models with Translation API by selecting the model at the time of prediction.
Choose the best model to suit your translation needs and streamline your workflows.
Detect a document’s language and translate it with high accuracy using our REST API.
Translation is accessible via our REST API. See sample code for different programming languages, including Python, Objective C, and Ruby.
You can send in HTML and get back HTML with translated text. No need to extract your source text or reassemble the translated content.
Affordable pricing-by-character Pricing is based on usage calculated in millions of characters sent, so you only pay for what you use. Just getting started? Enjoy our free tier for less than .5M characters per month.
Translate unlimited characters Up to 1 billion characters available per day, or set your quota to unlimited.
Fully integrated with other Google Cloud services, providing a consistent and secure method of access and the ability to store your training data, glossary, or translated files in Google Cloud Storage.
More than 100 languages supported Supports more than 100 languages and thousands of language pairs.

The advantages of Cloud Translation API are not only the number of languages available, but the quality of the translation. An API with more languages that doesn’t have accurate translation wouldn’t interest us, because we want to provide users with the most efficient service.

— Álvaro González, COO, Talkao See case study  arrow_forward

See how Welocalize is using glossary to maintain client-specific terminology in their translations.

Find out how Hyperconnect is leveraging Translation API to break down language barriers in video chats.

Discover how DPD UK is using Translation API to identify parcel data in different languages to quickly respond to customer queries.

Learn how ELEX is rapidly growing and scaling their global chat communities in Clash of Kings using Translation API.

See how Google Cloud Translation is helping Bloomberg bring the latest global updates to customers in 40 languages and over 170 countries.

Translation API pricing is based on usage. Translation usage is calculated in millions of characters.You’re billed per character, so you only pay for what you use.

1–500,000 characters 500,001–1 billion characters
Text translation (pre-trained) Free* $20 per million characters
Text translation (custom model) Free* $80 per million characters
Language detection $20 per million characters

*Conditions apply. For details, see our affordable and easy-to-understand pricing schedule for Translation API.

If you are requesting translation or language detection for over a billion characters per month, then contact a sales representative to discuss discount pricing.

AutoML Translation pricing is based on training and prediction usage and storage.

Training 3+ hours
$76 per hour
Prediction 1–500,000 characters 500,001–5,000,000 characters*
Free $80 per million characters

*Contact us for pricing above 5,000,000 characters.

See our affordable and easy-to-understand pricing schedule for AutoML Translation.

Create a custom machine learning model to scale and adapt to your translation needs.

Create a pre-trained machine learning model to dynamically translate between languages.

Products or features listed on this page are in beta. For more information on our product launch stages, see here.

Cloud AI products comply with the SLA policies listed here. They may offer different latency or availability guarantees from other Google Cloud services.

cloud.google.com

google-translate-api

A free and unlimited API for Google Translate 💵🚫

Features

  • Auto language detection
  • Spelling correction
  • Language correction
  • Fast and reliable – it uses the same servers that translate.google.com uses

Install

npm install --save google-translate-api

Usage

From automatic language detection to English:

From English to Dutch with a typo:

Sometimes, the API will not use the auto corrected text in the translation:

API

translate(text, options)

text

Type: string

The text to be translated

options

Type: object

from

Type: string Default: auto

The text language. Must be auto or one of the codes/names (not case sensitive) contained in languages.js

to

Type: string Default: en

The language in which the text should be translated. Must be one of the codes/names (not case sensitive) contained in languages.js.

raw

Type: boolean Default: false

If true, the returned object will have a raw property with the raw response (string) from Google Translate.

Returns an object:

  • text (string) – The translated text.
  • from (object)
    • language (object)
      • didYouMean (boolean) - true if the API suggest a correction in the source language
      • iso (string) - The code of the language that the API has recognized in the text
    • text (object)
      • autoCorrected (boolean) – true if the API has auto corrected the text
      • value (string) – The auto corrected text or the text with suggested corrections
      • didYouMean (booelan) – true if the API has suggested corrections to the text
  • raw (string) - If options.raw is true, the raw response from Google Translate servers. Otherwise, ''.

Note that res.from.text will only be returned if from.text.autoCorrected or from.text.didYouMean equals to true. In this case, it will have the corrections delimited with brackets ([ ]):

Otherwise, it will be an empty string ('').

Related

  • vertaler – CLI for this module

License

MIT © Matheus Fernandes

www.npmjs.com

Generate Google API Key

In order to create a Google Translate API Key you need a paid account. Through their terms and services, Google doesn’t allow for non-paid usage of their Translation API.

https://cloud.google.com/translate/

To create your application’s API key:

Go to the Cloud Platform Console.

1. Create a new Project from the top bar.

2. With the new project selected, go to the hamburger menu to the left and visit API & Services

From Dashboard enable Google Translate API

Search for translate API and enable it

3. From the credentials interface create a new API Key.

4. Restrict your API Key to a particular website

In Google Dashboard, use the HTTP Referrer provided in the description of the Google Translate API Key field in Settings -> TranslatePress, as shown in the following screenshot.

5. Restrict Usage of API

In order to have control over the cost of Google Translate API, it is highly recommended to set quotas to limit the usage.

Go to Google API’s & Services → Dashboard → Cloud Translation API → Quotas and set up quotas as shown in the following screenshot.

6. Copy your API Key for use in TranslatePress

7. Enable Google Translate and add the API Key in TranslatePress

Set Google Translate field to Yes. This will uncover the Google Translate API key field. Place the API key in this field and Save Changes.

translatepress.com

Language support | Cloud Translation | Google Cloud

The Translation API's recognition engine supports a wide variety of languages for the Phrase-Based Machine Translation (PBMT) and Neural Machine Translation (NMT) models.

These languages are specified within a recognition request using language code parameters as noted on this page. Most language code parameters conform to ISO-639-1 identifiers, except where noted.

Translations from any language to any language in this list are supported. The list is updated as new languages are added.

Language ISO-639-1 Code
Afrikaans af
Albanian sq
Amharic am
Arabic ar
Armenian hy
Azerbaijani az
Basque eu
Belarusian be
Bengali bn
Bosnian bs
Bulgarian bg
Catalan ca
Cebuano ceb (ISO-639-2)
Chinese (Simplified) zh-CN or zh (BCP-47)
Chinese (Traditional) zh-TW (BCP-47)
Corsican co
Croatian hr
Czech cs
Danish da
Dutch nl
English en
Esperanto eo
Estonian et
Finnish fi
French fr
Frisian fy
Galician gl
Georgian ka
German de
Greek el
Gujarati gu
Haitian Creole ht
Hausa ha
Hawaiian haw (ISO-639-2)
Hebrew he or iw
Hindi hi
Hmong hmn (ISO-639-2)
Hungarian hu
Icelandic is
Igbo ig
Indonesian id
Irish ga
Italian it
Japanese ja
Javanese jw
Kannada kn
Kazakh kk
Khmer km
Korean ko
Kurdish ku
Kyrgyz ky
Lao lo
Latin la
Latvian lv
Lithuanian lt
Luxembourgish lb
Macedonian mk
Malagasy mg
Malay ms
Malayalam ml
Maltese mt
Maori mi
Marathi mr
Mongolian mn
Myanmar (Burmese) my
Nepali ne
Norwegian no
Nyanja (Chichewa) ny
Pashto ps
Persian fa
Polish pl
Portuguese (Portugal, Brazil) pt
Punjabi pa
Romanian ro
Russian ru
Samoan sm
Scots Gaelic gd
Serbian sr
Sesotho st
Shona sn
Sindhi sd
Sinhala (Sinhalese) si
Slovak sk
Slovenian sl
Somali so
Spanish es
Sundanese su
Swahili sw
Swedish sv
Tagalog (Filipino) tl
Tajik tg
Tamil ta
Telugu te
Thai th
Turkish tr
Ukrainian uk
Urdu ur
Uzbek uz
Vietnamese vi
Welsh cy
Xhosa xh
Yiddish yi
Yoruba yo
Zulu zu
Note: The following languages are not supported by the Neural Machine Translation (NMT) model: Belarusian (be), Kyrgyz (ky), Latin (la), Maltese (mt) for Maltese to English translations only, Myanmar (my), and Sundanese (su). If you request one of theses translation pairs using the NMT model, then the Translation API defaults to the PBMT model to translate your text.

cloud.google.com

matheuss/google-translate-api

A free and unlimited API for Google Translate 💵🚫

Features

  • Auto language detection
  • Spelling correction
  • Language correction
  • Fast and reliable – it uses the same servers that translate.google.com uses

Install

npm install --save google-translate-api

Usage

From automatic language detection to English:

const translate = require('google-translate-api'); translate('Ik spreek Engels', {to: 'en'}).then(res => { console.log(res.text); //=> I speak English console.log(res.from.language.iso); //=> nl }).catch(err => { console.error(err); });

From English to Dutch with a typo:

translate('I spea Dutch!', {from: 'en', to: 'nl'}).then(res => { console.log(res.text); //=> Ik spreek Nederlands! console.log(res.from.text.autoCorrected); //=> true console.log(res.from.text.value); //=> I [speak] Dutch! console.log(res.from.text.didYouMean); //=> false }).catch(err => { console.error(err); });

Sometimes, the API will not use the auto corrected text in the translation:

translate('I spea Dutch!', {from: 'en', to: 'nl'}).then(res => { console.log(res); console.log(res.text); //=> Ik spea Nederlands! console.log(res.from.text.autoCorrected); //=> false console.log(res.from.text.value); //=> I [speak] Dutch! console.log(res.from.text.didYouMean); //=> true }).catch(err => { console.error(err); });

API

translate(text, options)

text

Type: string

The text to be translated

options

Type: object

from

Type: string Default: auto

The text language. Must be auto or one of the codes/names (not case sensitive) contained in languages.js

to

Type: string Default: en

The language in which the text should be translated. Must be one of the codes/names (not case sensitive) contained in languages.js.

raw

Type: boolean Default: false

If true, the returned object will have a raw property with the raw response (string) from Google Translate.

Returns an object:

  • text (string) – The translated text.
  • from (object)
    • language (object)
      • didYouMean (boolean) - true if the API suggest a correction in the source language
      • iso (string) - The code of the language that the API has recognized in the text
    • text (object)
      • autoCorrected (boolean) – true if the API has auto corrected the text
      • value (string) – The auto corrected text or the text with suggested corrections
      • didYouMean (booelan) – true if the API has suggested corrections to the text
  • raw (string) - If options.raw is true, the raw response from Google Translate servers. Otherwise, ''.

Note that res.from.text will only be returned if from.text.autoCorrected or from.text.didYouMean equals to true. In this case, it will have the corrections delimited with brackets ([ ]):

translate('I spea Dutch').then(res => { console.log(res.from.text.value); //=> I [speak] Dutch }).catch(err => { console.error(err); });

Otherwise, it will be an empty string ('').

Related

  • vertaler – CLI for this module

License

MIT © Matheus Fernandes

Page 2

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

github.com

150 Translation APIs: Google Translate, Merriam-Webster and Microsoft Translator

Our API directory now includes 150 translation APIs. The newest is the Lingotek APITrack this API. The most popular, in terms of user click-throughs to the provider site, is the Google Translate API. Below you'll find some more stats from the directory, including a list of the most popular translation APIs.

Figure 1- Architectural Styles used in Translation APIs

Figure 2 - API Types used in Translation APIs

In terms of the technical details, REST as the architectural style and Web/Internet as the API type lead the way.There are 129 RESTful APIs in the translation category and 29 marked as Web/Internet.

Figure 3 - Request Formats Used in Translation APIs

Figure 4 - Response Formats Used in Translation APIs

It’s no surprise to see that URI Query is the most common request format with 95 APIs using it. XML with 17 and SOAP with 16 come next. As for response formats, JSON leads the way, being used in 96 APIs, while XML appears in 56.

Figure 5- Related Categories Used in Translation APIs

The most common related categories within the translation category are 76 language translation APIs and 50 tools translation APIs.

We currently list 91 SDKs in the translation category. Of those the most popular by way of user click-throughs is the Google Translate PHP SDK.

For reference here is a list of the most popular Translation APIs measured by user click-throughs to the provider site.

Google Translate - The Google Translate API is now in its second version. As part of Google's larger Cloud Machine Learning API family, the Translate API can translate text between thousands of language pairs. The Cloud Translation API lets developers programmatically integrate the service with third party sites and applications.

Merriam-Webster DictionaryTrack this API - Merriam-Webster has been producing language information including dictionaries, thesauri, and translation materials for over 150 years. The Merriam-Webster collection of APIs provide developer access to a variety of the company's most prominent reference works. Free access is provided to non-commercial websites and applications. Free access is limited to two reference works with a maximum of 1000 queries a day per reference work. Full access is available for commercial use.

ThesaurusTrack this API - Thesaurus is a web service providing search capability for synonyms in different languages. Thesaurus can be used by third party applications to retrieve the list of synonyms in English, Italian, French, German, Spanish and Portuguese.

SYSTRAN DictionaryTrack this API - The SYSTRAN Dictionary API enables users to search for the translation of words, with additional contextual information such as grammatical information, frequency of the meanings, domains and contexts, expressions and examples. Users can also create personal dictionaries and search within them.

ABBYY LingvoTrack this API - The ABBYY Lingvo API provides users with access to the largest collection of Russian dictionaries including 140 dictionaries across 15 languages. Categories include general, professional, thematic dictionaries and thesauruses. The API can be used to develop vocabulary games and quizzes, mobile apps and websites for language learning and eBooks. Additional use cases include collocations and pronunciation.

Microsoft TranslatorTrack this API - The Microsoft Translator API is a cloud based machine translation service. It lets users translate text, pictures, websites, documents and full conversations in over 60 languages within their websites and applications. Microsoft Translator Text API is part of the Microsoft Cognitive Services API collection of machine learning and AI algorithms in the cloud.

www.programmableweb.com


Смотрите также