How to translate French to English Text in Node.JS using Deep Learning AI

Today we are going over how to translate French to English with our Deep Learning AI in Node.JS. This process helps cut the extra work that is normally wasted traditionally. Training of the AI can take weeks to learn translations, but now the wait is over because we already did it for you!

Now let’s get started.

First, all you have to do is run this command for NPM install:

npm install cloudmersive-nlp-api-client --save

Now, we are going to call the French to English translation function with this code:

var CloudmersiveNlpApiClient = require('cloudmersive-nlp-api-client');var defaultClient = CloudmersiveNlpApiClient.ApiClient.instance;// Configure API key authorization: Apikeyvar Apikey = defaultClient.authentications['Apikey'];Apikey.apiKey = 'YOUR API KEY';// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)//Apikey.apiKeyPrefix = 'Token';var apiInstance = new CloudmersiveNlpApiClient.LanguageTranslationApi();var input = new CloudmersiveNlpApiClient.LanguageTranslationRequest(); // LanguageTranslationRequest | Input translation requestvar callback = function(error, data, response) {if (error) {console.error(error);} else {console.log('API called successfully. Returned data: ' + data);}};apiInstance.languageTranslationTranslateFraToEng(input, callback);

Did it work? Of course it did! Now you can spend that extra time on something else you hopefully get to enjoy.

Image for post
Image for post

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

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