Skip to main content

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  # once the first release has been published
# or, from this checkout, with a Rust toolchain:
python -m pip install .
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 and a future Python-backed Hugging Face Space can import TEAVE directly. The existing browser-only TeXplorer cannot install native CPython wheels. Its current Python date adapter and browser ONNX model transport can stay in place. A future browser port can expose the Rust scanner through WebAssembly and keep Transformers.js for inference; use the same Unicode span contract and shared golden fixtures. This revision does not modify or redeploy the demo.

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

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TEAVE 0.1.0
File Size Uploaded Provenance Actions
teave-0.1.0.tar.gz 67.4 kB With provenance Details for teave-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for TEAVE 0.1.0
File Actions
teave-0.1.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for teave-0.1.0-cp310-abi3-win_amd64.whl
teave-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for teave-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl
teave-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details for teave-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl
teave-0.1.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for teave-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
teave-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for teave-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 5.0 MB

Release files / teave-0.1.0.tar.gz

Download URL teave-0.1.0.tar.gz
Size 67.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c48f29b0f0da49cc6b3d852b385837a40b988305df6e797ec23538417b4c7b63
BLAKE2b-256 checksum
How to use checksums
97ae39c9997a653bf23cf63a59c7e85f0b3c8dc89ce1ed46891393b0e847d1fd
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 log

Release files / teave-0.1.0-cp310-abi3-win_amd64.whl

Download URL teave-0.1.0-cp310-abi3-win_amd64.whl
Size 867.5 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3dfd9a42c16f0261b230defdb06406bf40a6ab0d77f2911e89b6cb86ea06aab6
BLAKE2b-256 checksum
How to use checksums
ba632b159636928e32107a4ece7a137b58053159f167b21d3a88b60b3979149f
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 log

Release files / teave-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL teave-0.1.0-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
4488a65c8320a69836c6341163bad47efe9c79809a4b013582c1a7e5adc5d828
BLAKE2b-256 checksum
How to use checksums
a3402e026a567119a6b30c30f3bf4bb0e6d3dcea4c27fef45dddb6aceb2c50e9
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 log

Release files / teave-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL teave-0.1.0-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
88daedeaa0f03ef0d54f8c06e9da057f3176f1fef161828fa83410f5a636f680
BLAKE2b-256 checksum
How to use checksums
0dca43bd3e3dee9074bfe053b31afad77a1abc3c754bc926f0b2f1ef91a37dcd
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 log

Release files / teave-0.1.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL teave-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Size 949.4 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5b363244464011810fcad8c0e00a15fb8dc9cc806312e11f905465634ffc8095
BLAKE2b-256 checksum
How to use checksums
666a82f3f1bbffa1c3ed4244d63584910b2483a91622cdbbd86632213e1e6efc
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 log

Release files / teave-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL teave-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 982.7 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b9dc7875c187b1f97a22acc5edbb39723377b85f138e01eecfe03c5019b3fd2b
BLAKE2b-256 checksum
How to use checksums
bda051f4a4202e569cc86cb33cbc603c4be8c8387bddd3e99c502f2ff36018a0
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 log

Security for TEAVE 0.1.0

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 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for teave-0.1.0.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 log

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

6 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page