Integrate Text Analysis AI into your .NET Applications
Unlock Insights with LM-Kit’s Powerful Text Analysis Engines
Elevate .NET Applications with On-Device AI Text Analysis
LM-Kit.NET brings cutting-edge AI-driven text analysis directly to your .NET applications. Unlock unparalleled precision in understanding, categorizing, and interpreting text data—whether it’s gauging sentiment, detecting emotions, classifying content, or extracting key insights from extensive text sources. By leveraging compact Large Language Models (LLMs) that run entirely on-device, LM-Kit ensures fast, secure, and private processing without the need for cloud services.
Sentiment & Emotion Analysis
Understand the emotions and sentiments across multiple languages with LM-Kit’s multilingual engines. Sentiment Analysis detects positive, negative, or neutral content; Emotion Detection identifies specific emotions like happiness, anger, sadness, and fear; and Sarcasm Detection captures ironic tones. These tools are essential for customer support, social media monitoring, and brand sentiment analysis.
Benefits
Deepen Customer Insights for Personalized Interactions
Understand your customers' emotions across multiple languages, allowing you to tailor interactions and improve customer satisfaction.
Improved Decision-Making
Identify trends in customer sentiment to guide product development, marketing, and support strategies.
Proactive Issue Resolution
Detect negative sentiment early to address potential issues before they escalate.
Targeted Marketing Campaigns
Tailor messaging based on emotional cues, leading to more relevant and impactful marketing efforts.
Social Media Monitoring
Track public sentiment and emotional reactions to your brand, products, or services in real-time for better brand management.
Explore Usage Examples
Sentiment Analysis
using LMKit;
namespace YourNamespace
{
class Program
{
static void Main(string[] args)
{
// Load the model
var model = new LMKit.Model.LLM("https://huggingface.co/lm-kit/lm-kit-sentiment-analysis-2.0-1b-gguf/resolve/main/lm-kit-sentiment-analysis-2.0-1b-q4.gguf?download=true");
// Create a classifier
var classifier = new LMKit.TextAnalysis.SentimentAnalysis(model)
{
NeutralSupport = true
};
// Ask the model for its hot take on our brilliance
var sentiment = classifier.GetSentimentCategory("LM-Kit is so convenient, it practically runs on sunshine and good karma!");
// Drumroll, please... the model's about to flatter us
Console.WriteLine($"Sentiment: {sentiment}"); // Positive! Just like our developer optimism after 10 cups of coffee.
}
}
}
Emotion Detection
using LMKit;
namespace YourNamespace
{
class Program
{
static void Main(string[] args)
{
// Load the model
var model = new LMKit.Model.LLM("https://huggingface.co/lm-kit/phi-3.5-mini-3.8b-instruct-gguf/resolve/main/Phi-3.5-mini-Instruct-Q4_K_M.gguf?download=true");
// Create a classifier
var classifier = new LMKit.TextAnalysis.EmotionDetection(model)
{
NeutralSupport = true// Because sometimes you just feel "meh"
};
// Ask the model for its hot take on our brilliance
var emotion = classifier.GetEmotionCategory("I just tried to make spaghetti, and somehow ended up with a culinary masterpiece!");
Console.WriteLine($"Emotion: {emotion}");
}
}
}
The Emotion Detection Demo demonstrates the use of the LM-Kit.NET SDK for identifying emotions in text. This example integrates large language models (LLMs) into a .NET application to categorize text by emotions, highlighting the accuracy and efficiency of advanced AI models in emotion detection
Sarcasm Detection
The Sarcasm Detection Demo illustrates the use of the LM-Kit.NET SDK to identify sarcasm in text. This example integrates large language models (LLMs) within a .NET application to distinguish between sarcastic and sincere expressions, showcasing the ability of advanced AI models to grasp subtle nuances in human language.
Custom Text Classification
Customize Text Classification to Fit Your Unique Needs
Leverage LM-Kit’s advanced AI to build custom text classification models tailored to your specific requirements. Effortlessly categorize and label text data for applications ranging from content filtering and spam detection to topic-based document classification. Experience lightning-fast classification speeds, with each result providing a confidence score for reliable, precise insights you can depend on.
Benefits
Tailored Content Organization
Categorize and organize data specific to your business needs, improving data management and retrieval.
Improved Automation
Automate repetitive tasks like email filtering, document categorization, and content tagging, saving time and reducing manual effort.
Enhanced Search Capabilities
Enable more accurate and relevant search results by classifying content according to custom criteria.
Personalized User Experience
Deliver personalized content to users by classifying information based on their preferences and behavior.
Better Decision-Making
Gain valuable insights from categorized data, allowing for more informed and strategic decisions.
Fine-Tune with Your Own Data
With LM-Kit’s built-in fine-tuning capabilities, you can easily tailor classification models using your own data. Each classification engine includes a CreateTrainingObject method that lets you define categories and supply training samples, producing a LoraFinetuning instance. This instance can then be used to fine-tune your model or generate reusable LoRA adapters for future use.
Explore Demo and Examples
Custom Classification Example Code
using LMKit;
namespace YourNamespace
{
class Program
{
static void Main(string[] args)
{
// Initialize the LLM model by providing the URL to the model file
var model = new LMKit.Model.LLM("https://huggingface.co/lm-kit/phi-3.5-mini-3.8b-instruct-gguf/resolve/main/Phi-3.5-mini-Instruct-Q4_K_M.gguf?download=true");
// Create a text classifier using the loaded model
var classifier = new LMKit.TextAnalysis.Categorization(model);
// Define a list of categories that the classifier can choose from
var categories = new string[]
{
"sport", "finance", "technology", "entertainment",
"health", "education", "science", "travel",
"lifestyle", "food", "gaming"
};
// Input text for classification
var inputText = "Physical activity helps build strength, endurance, and promotes a sense of camaraderie among participants";
// Get the most appropriate category for the input text from the list of categories
int category = classifier.GetBestCategory(categories, inputText);
// Output the predicted category to the console
if (category != -1)
{
Console.WriteLine($"Category: {categories[category]}");
}
else
{
Console.WriteLine("No match");
}
}
}
}
Custom Classification Video
Custom Classification Demo
The Custom Classification Demo showcases the use of the LM-Kit.NET SDK for text classification. This example integrates large language models (LLMs) into a .NET application to accurately categorize text into predefined groups, emphasizing the flexibility and efficiency of advanced AI models for text analysis.
Text Embeddings
Unlock Semantic Understanding with Text Embeddings
Generate dense vector representations that capture the semantic essence of words, sentences, or entire documents. LM-Kit’s Text Embeddings enable advanced search, clustering, recommendation systems, and similarity analysis by focusing on the meaning behind the text—not just the words. Enhance your .NET applications with precise content understanding for intelligent data analysis and personalized user experiences. Learn more…
Benefits
Semantic Search
Improve search accuracy by leveraging embeddings to understand the contextual meaning of queries, delivering more relevant results.
Data Clustering
Group similar data points together based on semantic similarity, aiding in trend analysis, data visualization, and recommendation systems.
Enhanced Text Classification
Boost classification accuracy by representing text in a high-dimensional space, capturing subtle differences in meaning.
Topic Modeling
Identify underlying topics in large datasets by grouping related content, streamlining content analysis and information retrieval.
Content Recommendation
Provide personalized content recommendations by understanding user preferences through embeddings, enhancing user engagement.
Explore Demo and Examples
Text Embedding Similarity
using LMKit.Embeddings;
using LMKit.Model;
using System.Diagnostics;
namespace ConsoleApp5
{
internal class Program
{
static async Task Main(string[] args)
{
LLM model = new LLM("https://huggingface.co/lm-kit/nomic-embed-text-1.5/resolve/main/nomic-embed-text-1.5-F16.gguf?download=true");
Embedder embedder = new Embedder(model);
Stopwatch sw = Stopwatch.StartNew();
string input = "How do I bake a chocolate cake?";
string[] examples = new string[]
{
"How do I bake a chocolate cake?",
"What is the recipe for chocolate cake?",
"I want to make a chocolate cake.",
"Chocolate cake is delicious.",
"How do I cook pasta?",
"I need instructions to bake a cake.",
"Baking requires precise measurements.",
"I like vanilla ice cream.",
"The weather is sunny today.",
"What is the capital of France?",
"Paris is a beautiful city.",
"How can I improve my coding skills?",
"Programming requires practice."
};
float[] inputEmbedding = await embedder.GetEmbeddingsAsync(input);
float[][] exampleEmbeddings = await embedder.GetEmbeddingsAsync(examples);
sw.Stop();
Console.WriteLine($"Elapsed (ms): {Math.Round(sw.Elapsed.TotalMilliseconds)} - Similarities:");
for (int index = 0; index < examples.Length; index++)
{
float similarity = Embedder.GetCosineSimilarity(inputEmbedding, exampleEmbeddings[index]);
Console.WriteLine($"{similarity} {examples[index]}");
}
}
}
}
Why Choose LM-Kit for Your Text Analysis Needs?
LM-Kit provides a robust and flexible toolkit to seamlessly integrate state-of-the-art text analysis into your .NET applications.
Our innovative Dynamic Sampling technology delivers faster, more accurate results—even with lightweight models running on CPU—ensuring optimal performance without heavy resource demands. Leverage cutting-edge AI to gain deeper insights from your text data, customize solutions to your specific needs, and maintain full control over your information with on-device processing.
High Accuracy & Precision
Built on cutting-edge language models, LM-Kit includes tiny models specifically trained for text analysis, benchmarked against large datasets to ensure both accuracy and nuance.
Customizable & Flexible
Adapt pre-built models or design custom ones to match specific business needs. Built-in fine-tuning capabilities provide flexibility, enabling precise adjustments to existing models or the creation of new ones tailored to unique requirements.
On-Device Processing
Keep your data secure with LM-Kit’s on-device inference, avoiding cloud-related privacy concerns. Experience rapid response times, optimized for both CPU and GPU environments
Multilingual
Analyze text data in multiple languages effortlessly—no configuration needed, capturing accurate insights instantly.
Gen. AI-Powered Text Analysis in Action
Organizations across industries are using LM-Kit’s Text Analysis to boost efficiency, enhance decision-making, and unlock the hidden value in their text data. From customer sentiment tracking to intelligent content filtering, the possibilities are vast.
Get Started Today
Integrate advanced Text Analysis into your .NET applications. Explore the free trial—no registration required—and discover the power of LM-Kit firsthand. Download the SDK via NuGet and start transforming your application with cutting-edge AI technology.
Contact Us
For questions or guidance, speak with our experts to see how LM-Kit can revolutionize your Text Analysis strategy.