---
title: "onenlp"
url: https://recursiveai.org/onenlp/
description: "Natural language processing for .NET 10 in C#: tokens, sentences, tags, lemmas, parses and entities, recognizers in ten languages, language ID for 75, classification and sentence embeddings. No native code; nothing downloaded at runtime. Open source, MIT or Apache-2.0. 1.0.0."
---

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

```sh
dotnet add package RecursiveAI.OneNlp
```

- [Getting started](https://recursiveai.org/onenlp/docs/getting-started/)
- [Docs](https://recursiveai.org/onenlp/docs/)
- [GitHub](https://github.com/recursive-ai-oss/onenlp-csharp)
- [NuGet](https://www.nuget.org/packages/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](https://recursiveai.org/onenlp/docs/getting-started/)

*Program.cs · C#*

```
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
```

### 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](https://recursiveai.org/onenlp/docs/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](https://recursiveai.org/onenlp/docs/recognizers/)

### Language ID

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

[Language identification](https://recursiveai.org/onenlp/docs/language-id/)

### 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](https://recursiveai.org/onenlp/docs/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](https://recursiveai.org/onenlp/docs/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](https://recursiveai.org/onenlp/docs/training/)

## 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](https://recursiveai.org/onenlp/docs/results-table/)

## 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](https://recursiveai.org/onenlp/docs/overview/#known-gaps) 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](https://recursiveai.org/onenlp/docs/overview/#known-gaps)

## Status and packages

- **Core**: `RecursiveAI.OneNlp`: `Doc`, `Token`, `Span` and `Pipeline`, the tokenizers, segmentation, rule matching, the recognizers and language ID. It depends on the .NET base class library and [onefont](https://recursiveai.org/onefont/) only.
- **Neural**: `RecursiveAI.OneNlp.Neural`: the encoders, the heads, `Train` and the sentence embedder, on [onemodel](https://recursiveai.org/onemodel/).
- **Fast tier**: One package per language: English, French, German, Spanish, Portuguese, Dutch, Italian, Chinese, Turkish and Hindi. Add the package and `Nlp.Analyze` and `Nlp.Entities` use it.
- **Accurate tiers**: `.Models.Multilingual` is the distilled accurate tier for nine languages, with open-type entities. `.Models.Multilingual.Large` is 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](https://recursiveai.org/onenlp/docs/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.Embeddings.Multilingual`, with `.Shard1` to `.Shard3` (reference the root package)
- **Distilled accurate tier**: `RecursiveAI.OneNlp.Models.Multilingual`, with `.Encoder`, `.FrozenEncoder` and `.Segmenters`
- **Base-size accurate tier**: `RecursiveAI.OneNlp.Models.Multilingual.Large`, with `.Chinese`, `.Encoder1` and `.Encoder2`, `.Heads1` to `.Heads11` and `.TokenTable1` to `.TokenTable4` (reference the root package)

## Go further

- [GitHub](https://github.com/recursive-ai-oss/onenlp-csharp)
- [NuGet](https://www.nuget.org/packages/RecursiveAI.OneNlp)
- [Getting started](https://recursiveai.org/onenlp/docs/getting-started/)
- [All docs](https://recursiveai.org/onenlp/docs/)
- [Model packages](https://recursiveai.org/onenlp/docs/model-packages/)
- [Coming from Catalyst](https://recursiveai.org/onenlp/docs/migrate-catalyst/)
- [Changelog](https://recursiveai.org/onenlp/docs/changelog/)
