Translate German to English Text with Deep learning AI in C#
1 min readMar 1, 2022
If you’re dealing with both German and English text in your current application/project, take advantage of our NLP API and make translations easy. Connect in C# using ready-to-run code examples from the Cloudmersive API Console.
Use the below to install 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;
If you’re working in .NET Core, use this instead:
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;
After that, copy the remaining code below. Ensure you enter in your Cloudmersive API key where indicated (and if you don’t have a key, head to the Cloudmersive website and create a free account with zero commitments to receive one).
namespace Example
{
public class LanguageTranslationTranslateDeuToEngExample
{
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 German to English text with Deep Learning AI
LanguageTranslationResponse result = apiInstance.LanguageTranslationTranslateDeuToEng(input);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LanguageTranslationApi.LanguageTranslationTranslateDeuToEng: " + e.Message );
}
}
}
}