![]() |
VOOZH | about |
dotnet add package Mostlylucid.OcrNer --version 1.1.0
NuGet\Install-Package Mostlylucid.OcrNer -Version 1.1.0
<PackageReference Include="Mostlylucid.OcrNer" Version="1.1.0" />
<PackageVersion Include="Mostlylucid.OcrNer" Version="1.1.0" />Directory.Packages.props
<PackageReference Include="Mostlylucid.OcrNer" />Project file
paket add Mostlylucid.OcrNer --version 1.1.0
#r "nuget: Mostlylucid.OcrNer, 1.1.0"
#:package Mostlylucid.OcrNer@1.1.0
#addin nuget:?package=Mostlylucid.OcrNer&version=1.1.0Install as a Cake Addin
#tool nuget:?package=Mostlylucid.OcrNer&version=1.1.0Install as a Cake Tool
Local-first OCR, Named Entity Recognition, and Vision captioning for .NET
One line of setup, zero model downloads. Everything auto-downloads on first use.
AddOcrNer() registers everything as singletonsdotnet add package Mostlylucid.OcrNer
// Register services
builder.Services.AddOcrNer(builder.Configuration);
// Use the pipeline
var pipeline = serviceProvider.GetRequiredService<IOcrNerPipeline>();
var result = await pipeline.ProcessImageAsync("invoice.png");
foreach (var entity in result.NerResult.Entities)
{
// entity.Label: "PER", "ORG", "LOC", "MISC"
// entity.Text: "John Smith"
// entity.Confidence: 0.9996
}
{
"OcrNer": {
"EnableOcr": true,
"TesseractLanguage": "eng",
"MinConfidence": 0.5,
"MaxSequenceLength": 512,
"ModelDirectory": "models/ocrner",
"Preprocessing": "Default",
"EnableAdvancedPreprocessing": false,
"EnableRecognizers": false,
"RecognizerCulture": "en-us"
}
}
All settings have sensible defaults. The entire section can be omitted.
| Service | What it does | Use when... |
|---|---|---|
INerService |
BERT NER from text | You already have text |
IOcrService |
Tesseract OCR from images | You need text from scans/screenshots |
IOcrNerPipeline |
OCR then NER in one call | You have images and want entities |
ITextRecognizerService |
Dates, phones, URLs, etc. | You want structured data alongside NER |
IVisionService |
Florence-2 captioning + OCR | You need image understanding |
A companion CLI is available at Mostlylucid.OcrNer.CLI:
ocrner "John Smith works at Microsoft in Seattle"
ocrner ocr invoice.png -o results.json
ocrner caption photo.jpg --ocr --ner
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0 | 130 | 2/9/2026 |
| 1.0.0 | 117 | 2/9/2026 |
| 0.0.1-alpha0 | 111 | 2/9/2026 |
1.0.0
Initial release of Mostlylucid.OcrNer.
Features:
- Tesseract OCR with ImageSharp preprocessing (grayscale, contrast, sharpen, upscale)
- BERT NER via ONNX Runtime (PER, ORG, LOC, MISC entities)
- Florence-2 vision model for image captioning and scene-text OCR
- OpenCV advanced preprocessing: deskew, denoise, binarization (opt-in via EnableAdvancedPreprocessing)
- Microsoft.Recognizers.Text: rule-based date, number, URL, phone, email, IP extraction (opt-in via EnableRecognizers)
- Automatic model download from HuggingFace/GitHub on first use
- Full DI integration via AddOcrNer() extension method
- All services registered as thread-safe singletons with lazy initialization
- Targets net9.0 and net10.0