How to translate German to English Text in C# .NET Framework using Deep Learning AI

Translating between languages is an expensive affair when working with an interpreter, and a difficult and time-consuming one if you are trying to set up a Deep Learning AI yourself. The training time alone will eat up at least a week even with a high end GPU. Today, I am here to provide you with a reprieve, taking the form of an API. This will get you set up in but a few minutes.

First, install our package from NuGet:

Install-Package Cloudmersive.APIClient.NET.NLP -Version 4.0.9

Next comes our function call, like this example here:

using System;using System.Diagnostics;using Cloudmersive.APIClient.NET.NLP.Api;using Cloudmersive.APIClient.NET.NLP.Client;using Cloudmersive.APIClient.NET.NLP.Model;namespace Example{public class LanguageTranslationTranslateDeuToEngExample{public void main(){// Configure API key authorization: ApikeyConfiguration.Default.AddApiKey("Apikey", "YOUR_API_KEY");// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed// Configuration.Default.AddApiKeyPrefix("Apikey", "Bearer");var apiInstance = new LanguageTranslationApi();var input = new LanguageTranslationRequest(); // LanguageTranslationRequest | Input translation requesttry{// Translate German to English text with Deep Learning AILanguageTranslationResponse result = apiInstance.LanguageTranslationTranslateDeuToEng(input);Debug.WriteLine(result);}catch (Exception e){Debug.Print("Exception when calling LanguageTranslationApi.LanguageTranslationTranslateDeuToEng: " + e.Message );}}}}

And now you’re done! Easy.

Image for post
Image for post

Written by

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