onenlp
Natural language processing for .NET, in C#. Text in, structure out: tokens, sentences, tags, morphology, lemmas, parses and entities, recognizers in ten languages, language ID for 75, classification and sentence embeddings.
Open source, MIT or Apache-2.0, made by Recursive AI. Version 1.0.0 is on NuGet, for .NET 10. No native code, NativeAOT and trim clean, and nothing is downloaded at runtime: each model ships in its own package. OneNLP is unaffiliated with other projects named OneNLP.
A quick look
Static verbs, no options objects; the language is detected for you. Language ID, sentences and the recognizers are in the core package. Entities, lemmas and the parse use the model package for the text’s language.
The output shown is from a run on 1.0.0 from NuGet, with RecursiveAI. added. Getting started has the whole program.
string text = "Angela Merkel met Emmanuel Macron in Paris on 5 March 2026. The deal cost $5m."; Console.WriteLine(Nlp.DetectLanguage(text)); // en foreach (Quantity q in Nlp.Quantities(text)) Console.WriteLine($"{q.Kind} {q.Value} {q.Currency}"); // Money 5000000 USD foreach (Span e in Nlp.Entities(text)) Console.WriteLine($"{e.Label} {e.Text}"); // PER Angela Merkel // PER Emmanuel // LOC Paris Console.WriteLine(string.Join(" ", Nlp.Lemmas("The cats were running."))); // the cat be run . DateTimeOffset today = new(2026, 3, 18, 10, 30, 0, TimeSpan.Zero); DateRange? when = Nlp.ParseDate( "the first Monday after Easter 2027", today); // when.Start: 2027-03-29
What it does
Analysis
“Tokens, sentences, tags, morphology, lemmas, dependency parses and entities through fast and accurate model tiers.” Nlp.Analyze returns all of it in one call, with offsets into your string. Ten fast-tier languages, each its own package.
Recognizers
“Numbers, units, currency, e-mail and URLs, and dates and times resolved to values in ten languages”: English, French, German, Spanish, Portuguese, Italian, Dutch, Turkish, Hindi and Chinese, with rules as data. Relative dates take a reference date you pass.
RecognizersLanguage ID
Language identification for 75 languages, in the core package (3.6 MB), with no model package to add.
Language identificationTokenizers
Tokenizers that match Hugging Face tokenizers byte for byte: WordPiece, BPE, byte-level BPE, Unigram/SentencePiece and Tiktoken, from tokenizer.json, SentencePiece .model, vocab.txt and .tiktoken files. Plus UAX #29 word and sentence segmentation.
Classification and embeddings
“Text classification, span categorization and open-type entity recognition; sentence embeddings.” Nlp.Embed uses bge-small-en-v1.5, or multilingual-e5-small from its own package.
Train your own
“You can train every one of the neural parts yourself with the API that trained the shipped models.” Rule matching (Matcher, PhraseMatcher, EntityRuler) is in the core package.
What it is compared with
Every comparison below is a row in the project’s results table, with its reference, its interval and its verdict.
- The base-size accurate tier (
RecursiveAI., 84 languages) “is measured against spaCy 3.8.18 trained on the same data: 117 of 144 rows ahead, 14 within noise, 13 behind.” The 13 behind: Chinese UPOS, UFeats, lemmas, UAS and LAS; Spanish UPOS, UFeats and lemmas; Dutch WikiNER entity F1, precision and recall; German raw tokens; Turkish raw sentences. “Published research systems such as Stanza, UDPipe 2 and Trankit, which train a larger model per treebank, are ahead on most rows; their numbers are shown beside ours as information.”OneNlp. Models. Multilingual. Large - The fast tier “is within noise of spaCy 3.8.18 trained on the same data on the gated UD and entity rows, or ahead of it; the few rows behind are listed by name.”
- Language ID “is more accurate than Lingua on words, word pairs and sentences.” Speed: “at least 6.9x Lingua on every row (the minimum is arm64 word pairs against low accuracy; on x64 at least 7.8x).” In the README’s words, it “is below Lingua on some languages and short-text buckets (listed in the results).”
- Recognizers “score ahead of Microsoft.Recognizers.Text on our hand-labelled sets in ten languages, and are faster on English, the language the speed rows measure”: from 35.34x to 52.7x across the English release rows.
- Tokenizers “are byte-exact against Hugging Face
tokenizersandtiktokenon twelve model families, and at least as fast as Microsoft.ML.Tokenizers on all 47 timed rows.”
Known gaps at 1.0.0
- Hindi. In the README’s words: “It has UPOS, features, a parse and PER/ORG/LOC entities, no real lemmas (
Token.Lemmais the token text) and no XPOS, and its scores (UPOS 83.2, LAS 52.8 on Hindi-PUD, gold tokens) are below the other languages’.” “Hindi UD is not available for an accurate-tier model.” - Accurate-tier coverage. No accurate-tier model for 25 languages, among them Basque, Bulgarian, Estonian, Hungarian and Urdu: “Their available training data is non-commercial, platform-restricted or has unresolved terms.” The full list is in the README.
- Size. The base-size accurate tier is “about 3.5 GB across 19 packages; reference the root package.”
Status and packages
- Core
RecursiveAI.OneNlp:Doc,Token,SpanandPipeline, the tokenizers, segmentation, rule matching, the recognizers and language ID. It depends on the .NET base class library and onefont only. - Neural
RecursiveAI.OneNlp.Neural: the encoders, the heads,Trainand the sentence embedder, on onemodel. - Fast tier
One package per language: English, French, German, Spanish, Portuguese, Dutch, Italian, Chinese, Turkish and Hindi. Add the package and
Nlp.AnalyzeandNlp.Entitiesuse it. - Accurate tiers
.Models.Multilingualis the distilled accurate tier for nine languages, with open-type entities..Models.Multilingual.Largeis the base-size accurate tier: about 3.5 GB across 19 packages; reference the root package. - Model licences
Each is in the third-party notices. Among them: bge-small-en-v1.5 (MIT) and multilingual-e5-small (MIT), converted to ONNX; the English model, trained on CC BY-SA 4.0 treebank and NER data; the distilled encoder, trained to reproduce mmBERT-base (MIT) on training data that includes share-alike text, as the language-ID model’s does.
- Status
1.0.0, every package on one version: the first public release.
- .NET
.NET 10, C#. No native code, NativeAOT and trim clean. MIT or Apache-2.0.
Every package on NuGet
- Core
RecursiveAI.OneNlp,.Neural - Fast tier
RecursiveAI.,OneNlp. Models. English .French,.German,.Spanish,.Portuguese,.Dutch,.Italian,.Chinese,.Turkish,.Hindi - Embeddings
RecursiveAI.;OneNlp. Models. Embeddings .Models., withEmbeddings. Multilingual .Shard1to.Shard3(reference the root package) - Distilled accurate tier
RecursiveAI., withOneNlp. Models. Multilingual .Encoder,.FrozenEncoderand.Segmenters - Base-size accurate tier
RecursiveAI., withOneNlp. Models. Multilingual. Large .Chinese,.Encoder1and.Encoder2,.Heads1to.Heads11and.TokenTable1to.TokenTable4(reference the root package)