Skip to main content

Fast Rust/PyO3 semantic text segmentation

Project description

CharStreamer Python

charstreamer provides Python access to the Rust CharStreamer segmentation engine through a PyO3 extension module.

This package exposes the Rust model artifact loader and model-backed segmentation runtime. If no supported model is available, annotation fails instead of synthesizing semantic labels from hard-coded rules.

The vendored 0.1.4 bundle emits model-backed sentence, paragraph, metadata, section, and list_item spans. dialogue remains reserved until there is a balanced dialogue training set.

Install

pip install charstreamer

Example

import charstreamer

text = """# Background
The court reviewed the invoice. The shipment was late. Notice was timely."""

segmenter = charstreamer.Segmenter.default()
print(segmenter.model_info().runtime)
annotation = segmenter.annotate(text)

print(annotation.spans)
print(annotation.tagged)

The public Python wrapper returns typed immutable dataclasses: ModelInfo, Annotation, Span, and BenchmarkResult. For JSON output or legacy integrations, call .to_dict() or use methods such as segmenter.annotate_dict(text).

If a default model is vendored into the wheel, Segmenter.default() loads it from package data. If not, it checks the local cache and then the GitHub release model URL unless CHARSTREAMER_AUTO_DOWNLOAD=0 is set. To assert model availability during startup:

charstreamer.model_info(allow_download=False, require_model=True)
segmenter = charstreamer.Segmenter.default(require_model=True)

Model-backed release wheels must include charstreamer/models/default/manifest.json plus the referenced Burn payload.

The vendored 0.1.4 bundle combines a sentence-boundary model with a semantic structure model. It is an early model-backed release, not a final semantic span/IOB model, and quality should be evaluated against task-specific data before production use.

The project is an early development release. APIs may change before a stable 1.0 release.

Full documentation and Rust source are available at:

https://github.com/mjbommar/charstreamer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charstreamer-0.1.4.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

charstreamer-0.1.4-cp39-abi3-win_arm64.whl (2.5 MB view details)

Uploaded CPython 3.9+Windows ARM64

charstreamer-0.1.4-cp39-abi3-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.9+Windows x86-64

charstreamer-0.1.4-cp39-abi3-manylinux_2_38_x86_64.whl (15.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.38+ x86-64

charstreamer-0.1.4-cp39-abi3-manylinux_2_38_aarch64.whl (9.7 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.38+ ARM64

charstreamer-0.1.4-cp39-abi3-macosx_15_0_x86_64.whl (14.9 MB view details)

Uploaded CPython 3.9+macOS 15.0+ x86-64

charstreamer-0.1.4-cp39-abi3-macosx_15_0_arm64.whl (12.2 MB view details)

Uploaded CPython 3.9+macOS 15.0+ ARM64

File details

Details for the file charstreamer-0.1.4.tar.gz.

File metadata

  • Download URL: charstreamer-0.1.4.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for charstreamer-0.1.4.tar.gz
Algorithm Hash digest
SHA256 7818c4f13d55e22cb16b9ddab3dea4756dd70bf706e4f2dfd320e2801cb4beb2
MD5 b7660fede8884d4574989187d074909d
BLAKE2b-256 a129283f175d2ea2ac47b278fe84dae4300358899e04244d6c4d3682d866cc11

See more details on using hashes here.

File details

Details for the file charstreamer-0.1.4-cp39-abi3-win_arm64.whl.

File metadata

  • Download URL: charstreamer-0.1.4-cp39-abi3-win_arm64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.9+, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for charstreamer-0.1.4-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 44f17ceb041b8ebea4f06f6979d17eb8734d634595bfe3fbb7b62a241d137d22
MD5 fc54251dd9967ddbd49967f9522d2682
BLAKE2b-256 0e07e52c9fdd943cbef90c83145bbc273da9c7638e08c56e1deef65217ff803e

See more details on using hashes here.

File details

Details for the file charstreamer-0.1.4-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: charstreamer-0.1.4-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for charstreamer-0.1.4-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 eb56f4dde6d3b4a688b079c6e4880e9ec7349243c62d51447e4716518563eed5
MD5 9647820cf66fbf3d6b68b17fede2a1a1
BLAKE2b-256 08dc6829d47f039b4d7928a004fa462f5f0beb09909e2e7f87861794d746a97e

See more details on using hashes here.

File details

Details for the file charstreamer-0.1.4-cp39-abi3-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for charstreamer-0.1.4-cp39-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 13ad7e2ddb5eaf83582c83b8cf3b8b2a46a0a8b4877731bd4b41628e057cdda1
MD5 95d59fd56759914ced1802b70a7dfeb9
BLAKE2b-256 296d64e2f8ea0e1d0cf1c2fd707808a61471b1bfa2f49db8512bd537241d3e1a

See more details on using hashes here.

File details

Details for the file charstreamer-0.1.4-cp39-abi3-manylinux_2_38_aarch64.whl.

File metadata

File hashes

Hashes for charstreamer-0.1.4-cp39-abi3-manylinux_2_38_aarch64.whl
Algorithm Hash digest
SHA256 6a66930b5c319e4633310f89902c5d08ecba7b490923094feb2a0a64bc863838
MD5 9476de46a58487a5b0cc2b7ea13797cf
BLAKE2b-256 39ee0612ac8534a9e5c4fdcb5a4e1c152e0654e35e09d3d4d14c2ad393a3a215

See more details on using hashes here.

File details

Details for the file charstreamer-0.1.4-cp39-abi3-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for charstreamer-0.1.4-cp39-abi3-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 2215a4803271346acd4670b48b66ca81bba5185539452a55557d58ed9d043035
MD5 7c6748e59bcb24ef8a81d364f90dd57a
BLAKE2b-256 56cb19ac93fdc1b24d72b200b1905d4a09704b73dd6d15eebcda4e26bab1c729

See more details on using hashes here.

File details

Details for the file charstreamer-0.1.4-cp39-abi3-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for charstreamer-0.1.4-cp39-abi3-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 53f4a8c391f7add5eba707297e4427a7baa9b393f8bd2c7d544de96567d58165
MD5 5e509142ea74d08094a0ab4fb47b4703
BLAKE2b-256 fbea5aba19f6ff117c43733e17154c4f3872b826f4e8b4b568a1cd7ccf7c1fbd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page