Table of Contents

🏷️ Classify Text in .NET Application using AI


🎯 Purpose of the Sample

The Custom Classification Demo illustrates how to utilize the LM-Kit.NET SDK for text classification tasks. This sample demonstrates the integration of large language models (LLMs) into a .NET application to classify text into predefined categories effectively. It highlights the flexibility and efficiency of using advanced AI models for text analysis.


👥 Industry Target Audience

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

  • 📑 Content Management: Automatically categorize articles, blogs, and documents for better organization and retrieval.
  • 📰 News Aggregation: Classify news articles into relevant topics for targeted dissemination.
  • 💬 Customer Feedback Analysis: Sort customer feedback and reviews into specific categories for more efficient processing and analysis.
  • 📱 Social Media Monitoring: Categorize social media posts to identify trends and sentiments within specific topics.

🚀 Problem Solved

Manual classification of text data is time-consuming and prone to errors. The Custom Classification Demo addresses this problem by leveraging LLMs to automate the text classification process, ensuring accuracy and saving valuable time. This automation enhances the ability to manage and analyze large volumes of textual information effectively.


💻 Sample Application Description

The Custom Classification Demo is a console application that allows users to classify text into predefined categories using various AI models.

✨ 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 Classification: The application classifies user-provided text into one of the predefined categories.
  • 📈 Performance Metrics: Displays elapsed time and confidence level for each classification.

🧠 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

🗂️ Categories

The text can be classified into the following categories:

  • Food and Recipes
  • Technology
  • Health
  • Sport
  • Politics
  • Business
  • Environment
  • Movies and TV Shows
  • Books and Literature

🛠️ 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/custom_classification
    

    or

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

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

By following these steps, developers can explore the functionalities of LM-Kit.NET and integrate advanced text classification capabilities into their applications, enhancing their ability to manage and analyze textual data through automated, AI-driven classification processes.