Understand EmotionsBehind Every Word
Three specialized engines working together: SentimentAnalysis for polarity detection, EmotionDetection for nuanced feelings, and SarcasmDetection for ironic undertones. Run 100% on-device with 99.5% accuracy. Fine-tune with your domain data. Ship to production in hours.
Why Sentiment Analysis Matters
Every customer interaction generates unstructured text data. Reviews, support tickets, social mentions, survey responses. Without intelligent analysis, critical insights remain buried. Cloud APIs introduce latency, privacy concerns, and unpredictable costs.
Three-Engine Precision
Combine SentimentAnalysis, EmotionDetection, and SarcasmDetection for nuanced understanding that catches what others miss.
100% On-Device Privacy
All processing happens locally. No data leaves your infrastructure. Perfect for healthcare, finance, and regulated industries.
Fine-Tune With Your Data
Generate LoRA adapters using your domain data. Custom models that understand your industry's unique language and context.
Dynamic Sampling Technology
Our proprietary sampling delivers 99.5% accuracy even with smaller models running on CPU. Enterprise performance, edge deployment.
Three Engines, Complete Understanding
Each engine specializes in a different dimension of text analysis. Use them individually or combine them for comprehensive emotional intelligence.
SentimentAnalysis
Classify text polarity with industry-leading accuracy. Enable NeutralSupport for three-way classification of objective content.
EmotionDetection
Identify six primary emotions with confidence scores. Understand not just if content is negative, but why: anger vs. sadness vs. fear.
SarcasmDetection
Detect ironic and sarcastic undertones that would otherwise mislead analysis. Essential for social media and customer feedback.
SentimentAnalysis Class
The foundation of emotional intelligence in your .NET applications. SentimentAnalysis delivers production-grade polarity detection with multilingual support, neutral classification, and fine-tuning capabilities. Powered by LM-Kit's Dynamic Sampling for maximum accuracy on any hardware.
- NeutralSupport property enables three-way classification for objective content
- GetSentimentCategory returns Positive, Negative, or Neutral
- GetConfidenceScores returns probability distribution across categories
- Multilingual support with automatic language detection
- CreateTrainingObject for custom fine-tuning with LoRA adapters
- Pre-built training datasets for rapid domain customization
using LMKit.TextAnalysis; var model = LM.LoadFromModelID( "lm-kit-sentiment-analysis-2.0-1b"); var sentiment = new SentimentAnalysis(model) { NeutralSupport = true }; // Single classification var result = sentiment.GetSentimentCategory( "This product exceeded all my expectations!"); Console.WriteLine($"Sentiment: {result}"); // Output: Positive // Get detailed confidence scores var scores = sentiment.GetConfidenceScores( "The delivery was acceptable."); Console.WriteLine($"Positive: {scores.Positive:P1}"); Console.WriteLine($"Negative: {scores.Negative:P1}"); Console.WriteLine($"Neutral: {scores.Neutral:P1}"); // Output: Positive: 23.4% // Negative: 12.1% // Neutral: 64.5%
EmotionDetection Class
Go beyond polarity to understand why content feels a certain way. EmotionDetection identifies six primary emotions based on Ekman's model: joy, anger, sadness, fear, surprise, and disgust. Essential for nuanced customer experience analysis and mental health applications.
- GetEmotionCategory returns the primary emotion detected
- GetEmotionScores returns confidence for all six emotions
- Distinguish angry customers from disappointed ones for better routing
- Detect fear and surprise for crisis detection in social media
- Fine-tune with domain-specific emotional expressions
using LMKit.TextAnalysis; var model = LM.LoadFromModelID("phi-3.5-mini"); var emotions = new EmotionDetection(model); // Detect primary emotion var emotion = emotions.GetEmotionCategory( "I can't believe they cancelled my order!"); Console.WriteLine($"Emotion: {emotion}"); // Output: Anger // Get full emotion distribution var scores = emotions.GetEmotionScores( "The news left me speechless and worried."); foreach (var score in scores.OrderByDescending(s => s.Value)) { Console.WriteLine($"{score.Key}: {score.Value:P1}"); } // Output: Fear: 42.3% // Surprise: 38.7% // Sadness: 12.1% // ...
SarcasmDetection Class
The missing piece in sentiment analysis. SarcasmDetection identifies ironic undertones that would otherwise mislead polarity classifiers. "Oh great, another meeting" reads as positive to basic sentiment analysis but negative to humans. Sarcasm detection bridges that gap.
- IsSarcastic returns boolean detection result
- GetSarcasmScore returns confidence level (0.0 to 1.0)
- Essential for social media monitoring where sarcasm is prevalent
- Combine with SentimentAnalysis to adjust polarity based on irony
- Fine-tune for platform-specific sarcasm patterns (Twitter, Reddit, etc.)
using LMKit.TextAnalysis; var model = LM.LoadFromModelID("phi-3.5-mini"); var sarcasm = new SarcasmDetection(model); // Quick boolean check bool isSarcastic = sarcasm.IsSarcastic( "Oh wonderful, another Monday morning meeting."); Console.WriteLine($"Sarcastic: {isSarcastic}"); // Output: Sarcastic: True // Get confidence score float score = sarcasm.GetSarcasmScore( "Best customer service experience ever!"); Console.WriteLine($"Sarcasm confidence: {score:P1}"); // Output: Sarcasm confidence: 78.4% // Combined analysis workflow var sentiment = new SentimentAnalysis(model); string text = "Sure, I just love waiting 2 hours."; var sentimentResult = sentiment.GetSentimentCategory(text); var sarcasmResult = sarcasm.IsSarcastic(text); // Adjust interpretation based on sarcasm var actualSentiment = sarcasmResult ? InvertSentiment(sentimentResult) : sentimentResult;
Fine-Tune With Your Data
Generic models struggle with industry-specific language. Medical sentiment differs from e-commerce. Financial news has unique emotional signals. LM-Kit's fine-tuning system lets you generate custom LoRA adapters that understand your domain's unique vocabulary and context.
- CreateTrainingObject method on all sentiment classes
- Generate LoRA adapters for efficient, targeted model updates
- Pre-built training datasets for common domains: e-commerce, support, social
- Train on-device without sending data to external services
- Hot-swap adapters without reloading the base model
E-Commerce Reviews
Train on product reviews with star ratings. Understand "runs small" as negative for clothing, neutral for equipment.
Customer Support
Learn your ticket language. Recognize urgency signals, escalation indicators, and resolution satisfaction.
Financial News
Interpret market sentiment from earnings calls, analyst reports, and news. "Beat expectations" vs. "met expectations."
Healthcare Feedback
Understand patient sentiment with medical terminology. Detect emotional distress signals in clinical notes.
Benchmark Results
Industry-leading accuracy powered by Dynamic Sampling technology. Tested on standard sentiment analysis benchmarks.
Benchmarked on SST-2, IMDB, and Yelp datasets. Results with lm-kit-sentiment-analysis-2.0-1b model.
View full benchmark methodology
Real-World Use Cases
Organizations across industries leverage LM-Kit's sentiment engines to automate workflows, detect issues early, and understand their customers.
Customer Support Triage
Route angry customers to senior agents. Detect frustration early in conversations. Prioritize tickets by emotional urgency, not just keywords.
Social Media Monitoring
Track brand sentiment in real-time. Detect emerging crises before they go viral. Identify sarcastic mentions that skew sentiment metrics.
Review Analysis
Extract actionable insights from product reviews. Understand what drives positive vs. negative feedback. Identify feature requests hidden in complaints.
Voice of Customer
Aggregate sentiment across all channels: email, chat, surveys, calls. Build unified dashboards showing customer happiness trends over time.
Market Research
Analyze competitor sentiment. Track public opinion on industry topics. Measure campaign effectiveness through emotional response.
Employee Engagement
Analyze internal survey responses. Detect morale issues in team communications. Track sentiment changes after organizational changes.
Integrate in Minutes
From NuGet install to production sentiment analysis in under 10 minutes. No cloud keys, no API limits, no surprises.
Quick Start
dotnet add package LMKit.NET
LM.LoadFromModelID("lm-kit-sentiment-analysis-2.0-1b")
new SentimentAnalysis(model)
sentiment.GetSentimentCategory(text)
Production Checklist
NeutralSupport if classifying objective content
API Reference
Complete documentation for all sentiment analysis classes, methods, and properties.
SentimentAnalysis
Core sentiment classification with positive, negative, and optional neutral categories. Includes confidence scores and fine-tuning support.
View DocsEmotionDetection
Six-emotion classification: joy, anger, sadness, fear, surprise, disgust. Full probability distribution for multi-emotion analysis.
View DocsSarcasmDetection
Binary sarcasm classification with confidence scores. Essential for accurate social media and review sentiment analysis.
View DocsSentimentCategory
Enumeration of sentiment categories: Positive, Negative, Neutral. Returned by GetSentimentCategory method.
View DocsEmotionCategory
Enumeration of emotion categories: Joy, Anger, Sadness, Fear, Surprise, Disgust. Based on Ekman's emotion model.
View DocsTrainingObject
Object for creating fine-tuning datasets. Used with CreateTrainingObject to generate LoRA adapters for custom models.
View DocsReady to Understand Your Customers?
Three powerful engines. 99.5% accuracy. 100% on-device privacy. Fine-tunable with your data. Start building intelligent .NET applications today.