Recursive AI
LibraryC#Available

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.

dotnet add package RecursiveAI.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.OneNlp.Models.English added. Getting started has the whole program.

Getting started
Program.csC#
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

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.

The fast tier

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.

Recognizers

Language ID

Language identification for 75 languages, in the core package (3.6 MB), with no model package to add.

Language identification

Tokenizers

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.

Tokenizer parity

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.

Sentence embeddings

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.

Training and recipes
Measured against

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.OneNlp.Models.Multilingual.Large, 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.”
  • 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 tokenizers and tiktoken on twelve model families, and at least as fast as Microsoft.ML.Tokenizers on all 47 timed rows.”
The results table
Limits

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.Lemma is 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.”
Every known gap

Status and packages

Every package on NuGet

Go further