Translate English to French Text with Deep Learning AI in Python

Cloudmersive
1 min readJan 19, 2022

--

If you’re looking to add common-language translation capabilities to your application’s arsenal, Cloudmersive’s NLP API v2 might just have you covered. If you’re looking for English to French translations, definitely look no further. The /nlp-v2/translate/eng/to/fra iteration of the NLP API v2 uses Deep Learning and Neural NLP to translate your English input into French.

To get started in Python, the first thing you’ll have to do is install the Python SDK:

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 authorize your API Key (which you can get by making a free account on the Cloudmersive home page):

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

Last but not least, it’s time to bring in the API callback function:

# 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 English to French text with Deep Learning AI
api_response = api_instance.language_translation_translate_eng_to_fra(input)
pprint(api_response)
except ApiException as e:
print("Exception when calling LanguageTranslationApi->language_translation_translate_eng_to_fra: %s\n" % e)

--

--

Cloudmersive

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