TEAVE
Tools for Extraction, Analysis, Validation and Enrichment, from the National Archives
of Estonia. TEAVE is an offline-first Python library for indexing Estonian (et),
Finnish (fi), Latvian (lv) and Russian (ru) text. This is an alpha release.
python -m pip install TEAVE
# or, from this checkout, with a Rust toolchain:
python -m pip install .
TEAVE releases include a universal Python wheel and platform wheels with a
Rust-accelerated PII scanner. A matching native wheel is normally preferred for
the same release; other platforms can install the Python wheel with no compiler.
teave.PII_BACKEND reports "rust" or "python". The Python scanner preserves
offsets and batch ordering, but scans sequentially.
from dataclasses import asdict
from teave import Analyzer, recognize_datetimes, recognize_pii, redact
text = "Koosolek toimus 24. juunil 1947. Kirjuta aadressil info@example.org."
result = Analyzer().analyze(text, language="et")
print(asdict(result)["dates"][0]["normalized"]) # 1947-06-24
print(redact(text, result.pii))
dates = recognize_datetimes("24.–26. VI-47.", "et")
pii = recognize_pii("Yhteys: test@example.org", "fi")
batch = Analyzer(workers=4).analyze_many([text, text], "et", tasks=("pii",))
Omit the language to use seeded langdetect independently for each document.
Uncertain/unsupported detections raise LanguageError; explicitly set the language
for short, OCR-damaged or mixed-language texts. Offsets are half-open Unicode code
point indices into the original string (text[start:end]), not UTF-8 bytes or
JavaScript UTF-16 indices. Results are immutable dataclasses. Nothing sends text to
a service.
Named entities
python -m pip install 'TEAVE[ner]'
from teave import Analyzer, recognize_entities
text = "Mari Saar külastas Tallinna."
print(recognize_entities(text, "et"))
print(Analyzer().analyze(text, "et", tasks=("ner", "datetime", "pii")))
TEAVE downloads the selected original checkpoint on the first NER call and
runs it locally in FP32 with PyTorch on CPU. There is no quantised fallback.
Bare Analyzer().analyze(...) still selects only dates and PII. TEAVE uses
revision-pinned checkpoints from the original publishers, not the browser
demo's quantised artifacts:
| Languages | First download (approx.) | Model |
|---|---|---|
| Estonian, Latvian (shared checkpoint) | 2.25 GB | 51la5/roberta-large-NER |
| Finnish | 497 MB | Kansallisarkisto/finbert-ner |
| Russian | 713 MB | bond005/rubert-multiconer |
The Russian default is RuBERT MultiCoNER, rather than Rapido's custom model
architecture. Its corporation and group labels map to ORGANIZATION. This is a
different model, not an accuracy-equivalent conversion; Rapido remains an
option with a trusted local FP32 ONNX export.
The Hub cache holds one copy of each artifact. TEAVE verifies the checkpoint against its pinned SHA-256 digest and checks metadata against its pinned Git blob IDs. Requests retrieve public files without sending document text or a Hugging Face token. TEAVE does not fetch or execute remote model code, and loads legacy checkpoint files in PyTorch's weights-only mode. Weights are not included in the wheel; upstream model and training-data terms still apply.
from teave import TransformerNER, recognize_entities
TransformerNER().prepare_model("fi") # Optional: prefetch in the Hub cache.
ner = TransformerNER(local_files_only=True)
print(recognize_entities("Ilse Hammar syntyi Helsingissä.", "fi", backend=ner))
Pass cache_dir= to override the Hugging Face Hub cache location. Allow extra
space for transient downloads and enough RAM for the FP32 model plus runtime
buffers. For CPU-only deployments, install PyTorch from its CPU wheel index
before installing TEAVE[ner] if available for your platform.
For managed/offline deployments, install TEAVE[onnx] and use
OnnxNER(model_root=...) to skip the Hub entirely. Point it to a trusted
uncompressed FP32 TeXplorer model-export directory with
subfolders xlm-roberta-ner, finbert-ner, or rapido-ner. Each needs
tokenizer.json, config.json and onnx/model.onnx plus any external tensor
files; Rapido also needs crf.json. Applications can instead supply their own
NERBackend.
NER returns people, organisations and places; it does not link identities.
Dates, privacy and performance
- Datetime: source-aware calendar rules from TeXplorer, including supported historical spellings, partial dates, ranges, and clocks attached to a date. The four languages share numeric year rules, wrap boundaries and explicit year-list/range handling; year words and conjunctions are language-specific. Not a general time-zone or standalone time parser.
- PII: email, explicit HTTP(S)/WWW URLs, IP candidates, phone numbers, checksummed Estonian and Finnish personal IDs, selected IBAN countries and Luhn-valid card candidates. This is detection, not identity verification. Names are a separate NER task. The masking helper preserves punctuation and offsets; it is not a guarantee of effective anonymisation. Review omissions and protect all exports.
- Parallelism: Rust scans independent documents on a bounded reusable Rayon pool while releasing Python's GIL. The inference backends batch sliding windows when the model allows it and run tensor operations in their native runtimes. Language detection, phone matching, and the historical Python date grammar are not Rayon tasks. Reuse the model backend across bounded batches; loaded models can be large.
On one local ARM64 machine, a synthetic 1,200-document batch (3.38 million characters) took a median 232 ms on one Rust worker and 78 ms on four, across five warmed runs. Outputs matched exactly. This measures the native scanner and Python result conversion, not phone matching, date parsing or inference.
Why Rust for the native scanner?
Rust is not inherently faster than C or C++. The relevant comparison would use the same rules, data, thread budget and Python boundary; we have not benchmarked a C or C++ implementation. We chose Rust for memory-safety guarantees in the scanner and for the PyO3/Rayon/Cargo toolchain. Portability comes from building and testing the native wheels on the target platforms, not from the source language. The CPython stable ABI reduces the wheel count across Python versions but does not make one wheel work across different operating systems or CPUs.
The repository is Python-heavy mainly because the historical date grammar contains thousands of lines of language rules and was carried over intact to preserve its tested behaviour. Python also handles the public API, language detection, phone matching and inference orchestration. The heavy NER tensor operations are already native PyTorch or ONNX Runtime code, not Python loops. A future port should follow profiling of representative documents rather than targeting a source-language percentage.
Integration
Python servers can import TEAVE directly. Pyodide can use the universal wheel
for PII and dates without compiling Rust, but may need dependencies provisioned
explicitly: the demo already bundles langdetect (whose PyPI wheel is not tagged
for Python 3), and phonenumbers is available as a pure-Python wheel. TEAVE's
desktop native wheels and optional desktop inference runtimes are not browser
builds. This revision does not modify or redeploy TeXplorer.
See RELEASING.md for builds, CI and Trusted Publishing. TEAVE is licensed under GPL-3.0-only; see LICENSE.
Metadata
Release files for TEAVE 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| teave-0.1.1.tar.gz | 71.5 kB | With provenance | Details for teave-0.1.1.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| teave-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for teave-0.1.1-py3-none-any.whl |
| teave-0.1.1-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for teave-0.1.1-cp310-abi3-win_amd64.whl |
| teave-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details for teave-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl |
| teave-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ ARM64 | Details for teave-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl |
| teave-0.1.1-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for teave-0.1.1-cp310-abi3-macosx_11_0_arm64.whl |
| teave-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details for teave-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl |
Total release size: 5.1 MB
Release files / teave-0.1.1.tar.gz
| Download URL | teave-0.1.1.tar.gz |
|---|---|
| Size | 71.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
15e6d721bcfaa67a391f7f4403ddce516565a01e48ef2e4a9d58e66dad61222a
|
|
BLAKE2b-256 checksum How to use checksums |
001a5e81d066c19db6d18c8767d8983dc5d03220f67c15747c4eb61b11f111f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / teave-0.1.1-py3-none-any.whl
| Download URL | teave-0.1.1-py3-none-any.whl |
|---|---|
| Size | 60.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a5bfd854deaad4421ba9bf154364b3b7b7be3f1d088030c3bd57df4a76690044
|
|
BLAKE2b-256 checksum How to use checksums |
c1eff7bac61b545d314fdb46871b571623d10dfddaeb3c8f06d7641d4fe3afac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / teave-0.1.1-cp310-abi3-win_amd64.whl
| Download URL | teave-0.1.1-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 870.7 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c46072749ddde8628780649cfaa9052040eac0537fc6f404499332a08ae1f034
|
|
BLAKE2b-256 checksum How to use checksums |
45687a9adeab1cc5091336998af48195057c7a50109919ea5e1e0f1f7bceb42c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / teave-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | teave-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c625851e1b135023ea146a2bcdb42ad0c1746a80e55a4a20fcc82542a501cc0f
|
|
BLAKE2b-256 checksum How to use checksums |
6130e8d60c6298b9978a6743e265aab63375dd43d5c9328aa7b1b284378ac397
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / teave-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl
| Download URL | teave-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
fdefde7db4e20b7dddc7857e1c881de97e32fc4fe0c5a4c0b70cce52db110e6a
|
|
BLAKE2b-256 checksum How to use checksums |
1337b2482cd591fb4efaa9683098ea506041ca67f19fbfba959aea83cbd0e0ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / teave-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | teave-0.1.1-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 952.2 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e45b9b9868f65bfc25a7209afba36b3a8f7bf9e59e9afcb584b49868f107d3d2
|
|
BLAKE2b-256 checksum How to use checksums |
788fa5a98f3264060df5e9c944aa575b3f156c7e7a9d7e2a6795d50a9fc740a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / teave-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | teave-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 985.3 kB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
127a76ef6b7165b6c1facb8066178c27a3bf71757dc1996a4c9461253e18d18c
|
|
BLAKE2b-256 checksum How to use checksums |
b4acf06ecc9608fd1705e835cc05150e10be701f55e55116bbd2b0913faac4f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for TEAVE 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 7 files in this release have been uploaded with provenance metadata.
Attestation for teave-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.