Introduction: On this article, I current a high-performance, cross-platform Arabic Sentiment Evaluation library constructed on high of the AraBERT mannequin utilizing ONNX Runtime and C#. The aim was to deliver Arabic NLP capabilities into trendy .NET ecosystems whereas maintaining deployment mild and developer-friendly.
Why I Constructed This: Working with Arabic sentiment information is difficult. Out there instruments had been both too heavy, Python-exclusive, or lacked multi-platform .NET assist. This package deal solves that by permitting builders to:
- Run sentiment evaluation on Arabic textual content regionally with out web dependency.
- Goal a number of .NET platforms (netstandard2.0, net6.0, net8.0, net9.0).
- Simply combine into net APIs, Blazor, desktop apps, and extra.
- Introduction: On this article, I current a high-performance, cross-platform Arabic Sentiment Evaluation library constructed on high of the AraBERT mannequin utilizing ONNX Runtime and C#. The aim was to deliver Arabic NLP capabilities into trendy .NET ecosystems whereas maintaining deployment mild and developer-friendly.
How It Works: The package deal wraps a pre-trained AraBERT sentiment mannequin (transformed to ONNX format) together with tokenization logic right into a clear C# API.
- Underneath the hood, it makes use of Microsoft.ML.OnnxRuntime for inference and Microsoft.ML.Tokenizers for preprocessing.
- You merely present the trail to the mannequin listing, and the package deal handles the remaining.
- Instance utilization:
var analyzer = new OnnxSentimentAnalyzer("./Sources");
await analyzer.InitializeAsync();
var end result = await analyzer.AnalyzeAsync("التجربة كانت ممتازة");
Console.WriteLine($"Sentiment: {end result.Label}, Confidence: {end result.Confidence:P2}");
Set up:
dotnet add package deal AraBertSentiment.OnnxModel
However you should obtain the mannequin individually from this GitHub launch: ➡ https://github.com/Elhady7/AraBertSentimentModel/releases/tag/v1.0.0
Then extract it and move its path to the constructor.
Options:
- 🔁 Async & sync APIs
- 🌍 Multi-framework assist
- 💡 Works offline (no API calls)
- 🧠 Pretrained AraBERT ONNX mannequin
- ✅ Clear structure (SOLID-ready)
You Can Discover All Issues Right here