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

Deep learning technology has come a very long way in recent years, particularly when it comes to language translations. The results that can be achieved with this technique are so accurate that they often cannot be told apart from human translations. Generally, however, it is the training process for creating such an AI that is the barrier to entry, taking weeks even with a cutting-edge GPU. Today, I will be showing you how to set up an API that will allow you to immediately gain access to such an AI and start performing translations immediately.

First we need to install our API client package:

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

Following that, we can proceed with calling our translation function:

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

And that’s all there is to it!

Image for post

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