Skip to content

Instantly share code, notes, and snippets.

@peckjon
Created July 31, 2018 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peckjon/0ec007bcbb66a5caad29a8ea0f6d8e77 to your computer and use it in GitHub Desktop.
Save peckjon/0ec007bcbb66a5caad29a8ea0f6d8e77 to your computer and use it in GitHub Desktop.
pre-translation in NLP
import Algorithmia
client = Algorithmia.client("your_api_key")
algo_input = {
"action": "translate",
"text": "Me gustan los aguacates"
}
translated_text = client.algo("translation/GoogleTranslate/0.1.1").pipe(algo_input).result["translation"]
# Prints: I like avocados
print translated_text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment