Emotion Detection with AI in .NET Applications
🎯 Purpose of the Sample
The Emotion Detection Demo illustrates how to utilize the LM-Kit.NET SDK for emotion detection tasks. This sample demonstrates the integration of large language models (LLMs) into a .NET application to classify text into various emotional categories, showcasing the effectiveness and efficiency of using advanced AI models for emotion detection.
👥 Industry Target Audience
This sample is particularly beneficial for developers and organizations in the following sectors:
- 🛠️ Customer Support: Analyze customer feedback and interactions to understand emotional tone and improve service responses.
- 📢 Marketing: Monitor social media and other platforms to gauge public emotions towards products or campaigns.
- ✍️ Content Creation: Assess the emotional impact of written content to ensure it aligns with the desired emotional tone.
- 🩺 Healthcare: Analyze patient feedback and communications to understand their emotions and improve patient care and support.
🚀 Problem Solved
Manual emotion detection is time-consuming and prone to subjectivity. The Emotion Detection Demo addresses this problem by leveraging LLMs to automate the emotion detection process, ensuring consistent and accurate classification. This automation improves productivity and provides valuable insights into textual data.
💻 Sample Application Description
The Emotion Detection Demo is a console application that allows users to classify text into emotional categories using an AI model.
✨ Key Features
- 📦 Model Selection: The application uses predefined models fine-tuned for emotion detection.
- 📊 Progress Tracking: The application displays download and loading progress for the selected model.
- 🔍 Dynamic Emotion Detection: The application classifies user-provided text into emotional categories such as neutral, happiness, anger, sadness, or fear.
- 📈 Performance Metrics: Displays elapsed time and confidence level for each emotion detection.
🧠 Supported Models
The sample uses the following 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
📂 Clone the repository:
git clone https://github.com/LM-Kit/lm-kit-net-samples.git
📁 Navigate to the project directory:
cd lm-kit-net-samples/console_framework_4.62/emotion_detection
or
cd lm-kit-net-samples/console_net6/emotion_detection
🔨 Build and run the application:
dotnet build dotnet run
📜 Follow the on-screen prompts to start analyzing the emotions in text.
💡 Example Usage
- Select a Model: Choose one of the predefined models or provide a custom model URI.
- Enter Text for Emotion Detection: Provide the text you want to analyze.
- Receive Emotion Classification: The application will classify the text into one of the emotional categories (neutral, happiness, anger, sadness, or fear) and display the result along with the confidence level and elapsed time.
- Continue or Exit: Enter another text for analysis 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 emotion detection capabilities into their applications, gaining valuable insights into textual data through automated, AI-driven emotion classification processes.