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

Using a Deep Learning AI for translation is a much cheaper alternative to hiring a professional translator, and with recent advances in this technology, it can often achieve the same level of accuracy. To avoid the week-long training period that is normally required to set one up ourselves, we will be using an API that already contains a trained AI. Let’s look at how this is done.

First, our client installation using this command for the package manager console.

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

Next comes our function call:

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 LanguageTranslationTranslateEngToDeuExample{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 English to German text with Deep Learning AILanguageTranslationResponse result = apiInstance.LanguageTranslationTranslateEngToDeu(input);Debug.WriteLine(result);}catch (Exception e){Debug.Print("Exception when calling LanguageTranslationApi.LanguageTranslationTranslateEngToDeu: " + e.Message );}}}}

And that’s all there is to it! Talk about 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