Amazon Translate Samples for .NET Core using C#
- Dotnet Core 2.2
- AWS CLI for running AWS CLI commands after configuring a default or named profile
After downloading the sample, run the following command from the downloaded folder
dotnet run
Result of execution
Source: Amazon Translate is a text translation service that uses advanced machine learning technologies to provide high-quality translation on demand.
Translation: अमेज़ॅन अनुवाद एक पाठ अनुवाद सेवा है जो मांग पर उच्च गुणवत्ता वाले अनुवाद प्रदान करने के लिए उन्नत मशीन सीखने की तकनीकों का उपयोग करती है।
Result after applying custom Terminology that helps retain the keywords "Amazon Translate", and "Machine Learning" with help of a csv terminology file
After applying custom terminology:
Preserve_Amazon_Translate
Translation: Amazon Translate एक पाठ अनुवाद सेवा है जो मांग पर उच्च गुणवत्ता वाले अनुवाद प्रदान करने के लिए उन्नत Machine Learning की तकनीकों का उपयोग करती है।
appsettings.json file uses your default AWS profile so that you don't have to set AWS credentials in clear text
{
"AWS": {
"Profile": "default",
"Region": "us-west-2"
}
}
.csproj file: required .NET libraries - these libraries will be auto-installed as part of the build process
<ItemGroup>
<PackageReference Include="AWSSDK.Translate" Version="3.3.100.32" />
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.3.100.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
</ItemGroup>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="custom-terminology.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>