Translate French to English with Deep Learning AI in Python

Parlez-vous français? I certainly don’t, but luckily there’s an API for that. The /nlp-v2/translate/language/fra/to/eng may not teach you French, but it can help you understand French text quickly using Deep Learning and Neural NLP to automatically translate it into English. It’s simple & easy to use. Let’s walk through how to leverage this in Python.

As a first step, you can copy the below code snippet to install the Python SDK for this API:

pip install cloudmersive-nlp-api-clientfrom __future__ import print_function
import time
import cloudmersive_nlp_api_client
from cloudmersive_nlp_api_client.rest import ApiException
from pprint import pprint

After that you’ll need to copy the below code to authorize your Cloudmersive API Key:

# Configure API key authorization: Apikey
configuration = cloudmersive_nlp_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'

Finally, all that’s left is to copy & paste the callback function code snippet:

# create an instance of the API class
api_instance = cloudmersive_nlp_api_client.LanguageTranslationApi(cloudmersive_nlp_api_client.ApiClient(configuration))
input = cloudmersive_nlp_api_client.LanguageTranslationRequest() # LanguageTranslationRequest | Input translation request
try:
# Translate French to English text with Deep Learning AI
api_response = api_instance.language_translation_translate_fra_to_eng(input)
pprint(api_response)
except ApiException as e:
print("Exception when calling LanguageTranslationApi->language_translation_translate_fra_to_eng: %s\n" % e)

--

--

--

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Machine learning aids discovery of new, improved inorganic phosphors

Ethical Machine Learning: An Insight for a VUCA World Challenge

Cool Computer Vision Projects to land your dream job

JoJoGAN — Style Transfer on Faces Using StyleGAN — Create JoJo Faces (with codes)

The Good, The Great, and The Ugly of “Learning Machine Learning with Personal Data”

K-means Clustering and its use case in the Security Domain

An Overview of Speaker Recognition With Sincnet

Sequence 2 Sequence model with Attention Mechanism

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

Translate German to English text with Deep Learning AI in Python

Python — Reading Credentials from Windows Credential Manager (Generic Creds)

Compiling video clips using python.

File is too big? Make it chunks.