Translate English to German Text with Deep Learning AI in C#
1 min readMar 1, 2022
Pair this iteration with our German to English translation API to create a fluid translation service in your application. Below, we’ll run through code you can use to connect to this API in C#.
The first step is installing the .NET SDK:
Install-Package Cloudmersive.APIClient.NET.NLP -Version 4.1.0using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NET.NLP.Api;
using Cloudmersive.APIClient.NET.NLP.Client;
using Cloudmersive.APIClient.NET.NLP.Model;
Or the .NET Core SDK:
Install-Package Cloudmersive.APIClient.NETCore.NLP -Version 2.1.3using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NETCore.NLP.Api;
using Cloudmersive.APIClient.NETCore.NLP.Client;
using Cloudmersive.APIClient.NETCore.NLP.Model;
Then, use the below code snippets to call the API. Include your API key & English text string where indicated. If you don’t have an API key, head to Cloudmersive.com and create a free account (with zero financial commitments) to receive a key and 800 API calls per month.
namespace Example
{
public class LanguageTranslationTranslateEngToDeuExample
{
public void main()
{
// Configure API key authorization: Apikey
Configuration.Default.AddApiKey("Apikey", "YOUR_API_KEY");var apiInstance = new LanguageTranslationApi();
var input = new LanguageTranslationRequest(); // LanguageTranslationRequest | Input translation requesttry
{
// Translate English to German text with Deep Learning AI
LanguageTranslationResponse result = apiInstance.LanguageTranslationTranslateEngToDeu(input);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LanguageTranslationApi.LanguageTranslationTranslateEngToDeu: " + e.Message );
}
}
}
}