translation

translation / GoogleTranslate / 0.1.1

README.md

Introduction

This is a wrapper to the Google Translation API.

The Google Cloud Translation API can dynamically translate text between thousands of language pairs. The Cloud Translation API lets websites and programs integrate with the translation service programmatically. The Google Translation API is part of the larger Cloud Machine Learning API family.

For supported languages, please refer to the ISO-639-1 identifiers.

NOTE: Please read the pricing section below to understand how pricing works.

Input:

For language detection:

  • (Required): Language detection action. ("action"="detect_language")
  • (Required): Text. ("text"="bla bla bla...")

For translation

  • (Required): Translation action. ("action"="translate")
  • (Required): Text. ("text"="bla bla bla...")
  • (Optional): Source language. ("source_language"="lang_code") (automatically detected when not given)
  • (Optional): Target language. ("target_language"="lang_code") (it's English by default)
  • (Optional): Model used for translation. ("model"="base" or "model"="nmt")

Output:

For language detection:

  • Detected language ("language"="lang_code")
  • Confidence value ("confidence"=0.98) (between 0 and 1)
  • Given text ("text"="bla bla bla...")

For translation

  • Given text ("text"="bla bla bla...")
  • Translated text ("translation": "bla bla bla translated...")

Example(s)

Example 1.

  • Parameter 1: Language detection action.
  • Parameter 2: Text given for detection.
{
  "action": "detect_language",
  "text": "人工智慧低谷是人工智慧史上一段資金及學術界研究興趣都大幅減少的時期。這個稱呼源自核冬天這個術語的使用。人工智慧領域經歷過好幾個技術成熟度曲線,緊接著是失望及批評,以及研究資金斷絕,緊接著在幾十年後重燃的研究興趣。1974-80及1987-93是兩個主要的低谷時期,其他還有幾個較小的低谷,包括"
}

Output:

{
  "confidence": 1,
  "language": "zh-TW",
  "text": "人工智慧低谷是人工智慧史上一段資金及學術界研究興趣都大幅減少的時期。這個稱呼源自核冬天這個術語的使用。人工智慧領域經歷過好幾個技術成熟度曲線,緊接著是失望及批評,以及研究資金斷絕,緊接著在幾十年後重燃的研究興趣。1974-80及1987-93是兩個主要的低谷時期,其他還有幾個較小的低谷,包括"
}

Example 2.

  • Parameter 1: Translation action.
  • Parameter 2: Text given for translation.
{
  "action": "translate",
  "text": "人工智慧低谷是人工智慧史上一段資金及學術界研究興趣都大幅減少的時期。這個稱呼源自核冬天這個術語的使用。人工智慧領域經歷過好幾個技術成熟度曲線,緊接著是失望及批評,以及研究資金斷絕,緊接著在幾十年後重燃的研究興趣。1974-80及1987-93是兩個主要的低谷時期,其他還有幾個較小的低谷,包括"
}

Output:

{
  "text": "人工智慧低谷是人工智慧史上一段資金及學術界研究興趣都大幅減少的時期。這個稱呼源自核冬天這個術語的使用。人工智慧領域經歷過好幾個技術成熟度曲線,緊接著是失望及批評,以及研究資金斷絕,緊接著在幾十年後重燃的研究興趣。1974-80及1987-93是兩個主要的低谷時期,其他還有幾個較小的低谷,包括",
  "translation": "Artificial wisdom is the history of artificial intelligence in the history of a period of money and academic research interests are significantly reduced period. This term is derived from the use of the term nuclear winter. Artificial intelligence has experienced several technical maturity curves, followed by disappointment and criticism, as well as research funding cut off, followed by a few years after the rekindle of research interest. 1974-80 and 1987-93 are two major trough periods, and others have several smaller troughs, including"
}

Example 3.

  • Parameter 1: Translation action.
  • Parameter 2: Text given for translation.
  • Parameter 3: Target language for translation.
{
  "action": "translate",
  "target_language": "nl",
  "text": "人工智慧低谷是人工智慧史上一段資金及學術界研究興趣都大幅減少的時期。這個稱呼源自核冬天這個術語的使用。人工智慧領域經歷過好幾個技術成熟度曲線,緊接著是失望及批評,以及研究資金斷絕,緊接著在幾十年後重燃的研究興趣。1974-80及1987-93是兩個主要的低谷時期,其他還有幾個較小的低谷,包括"
}

Output:

{
  "text": "人工智慧低谷是人工智慧史上一段資金及學術界研究興趣都大幅減少的時期。這個稱呼源自核冬天這個術語的使用。人工智慧領域經歷過好幾個技術成熟度曲線,緊接著是失望及批評,以及研究資金斷絕,緊接著在幾十年後重燃的研究興趣。1974-80及1987-93是兩個主要的低谷時期,其他還有幾個較小的低谷,包括",
  "translation": "AI Artificial Intelligence is de geschiedenis van een periode van lage financiering en academisch onderzoek belangen zijn aanzienlijk verminderd periode. Deze naam is afgeleid van het gebruik van de term nucleaire winter. Kunstmatige intelligentie veld hebben ervaren verschillende hype cycle, gevolgd door teleurstelling en kritiek, evenals middelen voor onderzoek afgesneden, gevolgd door hernieuwde na tientallen jaren van onderzoek belang. 1974-1980 en 1987-1993 zijn de twee belangrijkste lage periode, zijn er verschillende andere kleinere valleien, met inbegrip"
}

Pricing

For both language detection and text translation, you are charged 25 credits for every 100 characters you pass to the input.

You also get charged for the running time for your algorithm, which is 1 credit per second.

For example, if you passed a text that is 949 characters long, you'll get charged 10 x 25 = 250 credits and for the running time. If the algorithm returned within a second, you'll be charged 250 + 1 = 251 credits for this call.

Credits

Google Cloud Translate is an API provided Google. This algorithm is a wrapper for an easier integration of the Google Cloud Translate API within the Algorithmia ecosystem.