Table of Contents

AI Language Translation & Detection for C# .NET Applications


🎯 Purpose of the Sample

The Text Translator Demo demonstrates how to use the LM-Kit.NET SDK for text translation tasks. This sample showcases the integration of large language models (LLMs) into a .NET application to translate text between languages, highlighting the flexibility and power of advanced AI models in facilitating multilingual communication.


👥 Industry Target Audience

This sample is particularly beneficial for developers and organizations in the following sectors:

  • 🌍 Global Businesses: Enable seamless communication across different languages, enhancing collaboration and customer service.
  • 📝 Content Creation: Automatically translate articles, blogs, and other written content to reach a wider audience.
  • 📚 Education: Assist in language learning by providing accurate translations of texts.
  • ✈️ Tourism: Offer translation services for travelers to help them navigate and understand foreign languages.

🚀 Problem Solved

Manual translation of text is time-consuming and requires fluency in multiple languages. The Text Translator Demo addresses this problem by leveraging LLMs to automate the translation process, ensuring consistent and accurate translations across various languages. This automation improves productivity and facilitates multilingual communication.


💻 Sample Application Description

The Text Translator Demo is a console application that allows users to translate text using various AI models and detect the language of the input text.

✨ Key Features

  • 📈 Model Selection: Users can choose from predefined models or provide a custom model URI.
  • 📊 Progress Tracking: The application displays download and loading progress for the selected model.
  • 🔄 Dynamic Translation: The application translates user-provided text into the specified destination language.
  • 🌍 Language Detection: Automatically detects the language of the input text before translating.
  • 📈 Performance Metrics: Displays progress and status of the translation process.

🧠 Supported Models

The sample supports several state-of-the-art models:

  • Mistral Nemo 2407 12.2B
  • Meta Llama 3.1 8B
  • Google Gemma2 9B Medium
  • Microsoft Phi-3 3.82B Mini
  • Alibaba Qwen-2 7.6B

🛠️ Getting Started

📋 Prerequisites

  • .NET Framework 4.6.2 or .NET 6.0

📥 Download the Project

▶️ Running the Application

  1. 📂 Clone the repository:

    git clone https://github.com/LM-Kit/lm-kit-net-samples.git
    
  2. 📁 Navigate to the project directory:

    cd lm-kit-net-samples/console_framework_4.62/text_translator
    

    or

    cd lm-kit-net-samples/console_net6/text_translator
    
  3. 🔨 Build and run the application:

    dotnet build
    dotnet run
    
  4. 📝 Follow the on-screen prompts to select a model and start translating text.

💡 Example Usage

  1. Select a Model: Choose from the available models or enter a custom model URI.
  2. Enter Text for Translation: Provide the text you want to be translated.
  3. Language Detection: The application will detect the language of the input text.
  4. Receive Translated Text: The application will process the text and display the translated version.
  5. Continue or Exit: Enter another text for translation or end the program by submitting an empty input.

By following these steps, developers can explore the functionalities of LM-Kit.NET and integrate advanced text translation capabilities into their applications, enhancing multilingual communication through automated, AI-driven translation processes.