Get Free Community License
Sentiment Analysis Engine

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.

99.5% Accuracy Fine-Tunable 100% On-Device Multilingual
Live Analysis Preview
Three engines, one unified result
"This product is absolutely amazing! Best purchase I've ever made. Though I'm sure the next version will be even more 'revolutionary'..."
Sentiment Positive (94.2%)
Primary Emotion Joy (87.8%)
Sarcasm Detected Yes (76.3%)
3
Specialized Engines
99.5%
Accuracy
<50ms
Inference Time

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.

Missed signals: Sarcasm and irony mislead basic sentiment classifiers
Privacy concerns: Cloud APIs require sending sensitive data off-premise
Cost unpredictability: Per-call pricing makes volume processing expensive
Domain mismatch: Generic models struggle with industry-specific language

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.

Positive Negative Neutral
API Reference

EmotionDetection

Identify six primary emotions with confidence scores. Understand not just if content is negative, but why: anger vs. sadness vs. fear.

Joy Anger Sadness Fear Surprise Disgust
API Reference

SarcasmDetection

Detect ironic and sarcastic undertones that would otherwise mislead analysis. Essential for social media and customer feedback.

Sarcastic Sincere
API Reference
Core Engine

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
SentimentAnalysis.cs
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%
Emotion Engine

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
EmotionDetection.cs
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%
//         ...
Sarcasm Engine

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.)
SarcasmDetection.cs
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;
Domain Customization

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.

99.5%
Classification Accuracy
<50ms
Average Inference Time
75%
Error Reduction vs. Baseline
2x
Faster Than Cloud APIs

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

1 Install via NuGet: dotnet add package LMKit.NET
2 Load a model: LM.LoadFromModelID("lm-kit-sentiment-analysis-2.0-1b")
3 Create analyzer: new SentimentAnalysis(model)
4 Analyze text: sentiment.GetSentimentCategory(text)

Production Checklist

1 Choose model size based on hardware: 1B for CPU, 3B+ for GPU
2 Enable NeutralSupport if classifying objective content
3 Add SarcasmDetection for social media and review analysis
4 Fine-tune with domain data for maximum accuracy

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 Docs
EmotionDetection

Six-emotion classification: joy, anger, sadness, fear, surprise, disgust. Full probability distribution for multi-emotion analysis.

View Docs
SarcasmDetection

Binary sarcasm classification with confidence scores. Essential for accurate social media and review sentiment analysis.

View Docs
SentimentCategory

Enumeration of sentiment categories: Positive, Negative, Neutral. Returned by GetSentimentCategory method.

View Docs
EmotionCategory

Enumeration of emotion categories: Joy, Anger, Sadness, Fear, Surprise, Disgust. Based on Ekman's emotion model.

View Docs
TrainingObject

Object for creating fine-tuning datasets. Used with CreateTrainingObject to generate LoRA adapters for custom models.

View Docs

Ready 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.