📊 AI Based Sentiment Analysis using C# in .NET Applications
🎯 Purpose of the Sample
The Sentiment Analysis Demo illustrates how to utilize the LM-Kit.NET SDK for sentiment analysis tasks. This sample demonstrates the integration of large language models (LLMs) into a .NET application to classify text as having positive or negative sentiment, showcasing the effectiveness and efficiency of using advanced AI models for sentiment analysis.
👥 Industry Target Audience
This sample is particularly beneficial for developers and organizations in the following sectors:
- 🛠️ Customer Support: Analyze customer feedback and reviews to understand sentiment and improve service quality.
- 📈 Marketing: Monitor social media and other platforms to gauge public sentiment towards products or campaigns.
- ✍️ Content Creation: Assess the sentiment of written content to ensure it aligns with the desired tone and message.
- 🏥 Healthcare: Analyze patient feedback to understand their sentiment and improve patient care.
🚀 Problem Solved
Manual sentiment analysis is time-consuming and prone to subjectivity. The Sentiment Analysis Demo addresses this problem by leveraging LLMs to automate the sentiment analysis process, ensuring consistent and accurate sentiment classification. This automation improves productivity and provides valuable insights into textual data.
💻 Sample Application Description
The Sentiment Analysis Demo is a console application that allows users to classify text as having positive or negative sentiment using an AI model.
✨ Key Features
- 📦 Model Selection: The application uses a predefined model specifically fine-tuned for the English language.
- 📊 Progress Tracking: The application displays download and loading progress for the selected model.
- 🔍 Dynamic Sentiment Analysis: The application classifies user-provided text into positive or negative sentiment categories.
- 📈 Performance Metrics: Displays elapsed time and confidence level for each sentiment analysis.
🧠 Supported Models
The sample uses the following state-of-the-art model:
- LM-Kit Sentiment Analysis TinyLlama 1.1B
🛠️ 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/sentiment_analysis
or
cd lm-kit-net-samples/console_net6/sentiment_analysis
🔨 Build and run the application:
dotnet build dotnet run
📜 Follow the on-screen prompts to start analyzing the sentiment of text.
💡 Example Usage
- 💬 Enter Text for Sentiment Analysis: Provide the text you want to analyze.
- 📊 Receive Sentiment Classification: The application will classify the text as positive or negative 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 sentiment analysis capabilities into their applications, gaining valuable insights into textual data through automated, AI-driven sentiment classification processes.