Text annotation and entity extraction
11
stars
520
commits
Rust
primary language
Sep 1, 2026
updated
Text annotation and entity extraction.
anno extracts entity spans, resolves coreference, and finds common forms of
personally identifiable information. Model-backed extractors are optional; the
rule-based extractors work offline.
[dependencies]
anno = "0.11"
let entities = anno::extract("Sophie Wilson designed the ARM processor.")?;
for entity in entities {
println!(
"{} [{}] {}..{}",
entity.text,
entity.entity_type,
entity.start(),
entity.end()
);
}
# Ok::<(), anno::Error>(())
Offsets are character offsets, not UTF-8 byte offsets. Confidence scores depend on the selected backend and are not calibrated across backends.
Pattern-based PII redaction covers values such as email addresses, phone numbers, and identification numbers:
use anno::pii;
let text = "John Smith's SSN is 123-45-6789.";
let redacted = pii::redact_patterns(text);
assert_eq!(redacted, "John Smith's SSN is [ID_NUMBER_1].");
cargo install anno-cli
$ anno extract --text "Lynn Conway worked at IBM and Xerox PARC in California."
PER:1 "Lynn Conway"
ORG:2 "IBM" "Xerox PARC"
LOC:1 "California"
anno extract --format json emits JSON. Run anno help <command> for command
options.
The default onnx feature may download model weights on first use. Set
ANNO_NO_DOWNLOADS=1 to allow only cached or local models; extraction then
falls back to pattern and heuristic backends when those models are unavailable.
Other optional features include candle, GPU support, discourse analysis,
metrics, graph export, and JSON Schema. Their requirements and model identifiers
are listed in the backend guide.
This crate provides inference and annotation utilities, not model training. The minimum supported Rust version is 1.88.
Further documentation:
MIT or Apache-2.0.
Rust
91.5%
Python
5.8%
Shell
2.2%
Text annotation and entity extraction
11
stars
520
commits
Rust
primary language
Sep 1, 2026
updated
Text annotation and entity extraction.
anno extracts entity spans, resolves coreference, and finds common forms of
personally identifiable information. Model-backed extractors are optional; the
rule-based extractors work offline.
[dependencies]
anno = "0.11"
let entities = anno::extract("Sophie Wilson designed the ARM processor.")?;
for entity in entities {
println!(
"{} [{}] {}..{}",
entity.text,
entity.entity_type,
entity.start(),
entity.end()
);
}
# Ok::<(), anno::Error>(())
Offsets are character offsets, not UTF-8 byte offsets. Confidence scores depend on the selected backend and are not calibrated across backends.
Pattern-based PII redaction covers values such as email addresses, phone numbers, and identification numbers:
use anno::pii;
let text = "John Smith's SSN is 123-45-6789.";
let redacted = pii::redact_patterns(text);
assert_eq!(redacted, "John Smith's SSN is [ID_NUMBER_1].");
cargo install anno-cli
$ anno extract --text "Lynn Conway worked at IBM and Xerox PARC in California."
PER:1 "Lynn Conway"
ORG:2 "IBM" "Xerox PARC"
LOC:1 "California"
anno extract --format json emits JSON. Run anno help <command> for command
options.
The default onnx feature may download model weights on first use. Set
ANNO_NO_DOWNLOADS=1 to allow only cached or local models; extraction then
falls back to pattern and heuristic backends when those models are unavailable.
Other optional features include candle, GPU support, discourse analysis,
metrics, graph export, and JSON Schema. Their requirements and model identifiers
are listed in the backend guide.
This crate provides inference and annotation utilities, not model training. The minimum supported Rust version is 1.88.
Further documentation:
MIT or Apache-2.0.
Rust
91.5%
Python
5.8%
Shell
2.2%