How to translate English to German Text in C# .NET Framework using Deep Learning AI
1 min readJul 24, 2020
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.