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.3 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())
annotation = segmenter.annotate(text)

print(annotation["spans"])
print(annotation["tagged"])

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.3 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.3.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.3-cp39-abi3-win_arm64.whl (2.5 MB view details)

Uploaded CPython 3.9+Windows ARM64

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

Uploaded CPython 3.9+Windows x86-64

charstreamer-0.1.3-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.3-cp39-abi3-manylinux_2_38_aarch64.whl (9.7 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.38+ ARM64

charstreamer-0.1.3-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.3-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.3.tar.gz.

File metadata

  • Download URL: charstreamer-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 acb28fa87e77ef29b700642358543c851cafb9e404c249d34ccfd643773064c4
MD5 e639aaa4f1bbb148e40c5cc1dd29e14d
BLAKE2b-256 2f4f8e3b4b05a5dfe46d29b69a0a2d2aab22ad5271255077905668894fb52138

See more details on using hashes here.

File details

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

File metadata

  • Download URL: charstreamer-0.1.3-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.3-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 c6dbe60f85997ce4d7e5de9b09ff1bdc4428b15f4432b9cf8c7bf5eaa9e4f3f3
MD5 cf8b4e2fe022ab42d16a3558fa4565d8
BLAKE2b-256 3c659274afb8ce049fe8200d56e4f5b76a69f1c35375ef0014e7e25eed0294cf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: charstreamer-0.1.3-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.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2b31660fc6087aeb56468bed5fffe071201e2242dc6ce871b4ef1b8a1d78d879
MD5 84625adf1217dbe11e92e0a7387f9d10
BLAKE2b-256 3482c811b6151543073fcff48965d3317f419cb0722e987f8e26f2ed458c6432

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for charstreamer-0.1.3-cp39-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 b52c439521d7ab7c7e3bcc69a53098ac65ab314e40a4957944b429a19957308d
MD5 bf25a5e135c7247cac994544359340ec
BLAKE2b-256 aad81829ef58ceb0945366097c5362b494f8eb998eacef87e08a8a68b113a33d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for charstreamer-0.1.3-cp39-abi3-manylinux_2_38_aarch64.whl
Algorithm Hash digest
SHA256 36558449611c3149c6a6ef0071848ab2d1d6fcfce07cdc4bf28972a4c9e200af
MD5 fa9be6dc044db6cd647ff5adb3d75a77
BLAKE2b-256 0cab02ca3b8ec14277eb46d270444f4287de7e8c3258fb0a78c543d47e024eda

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for charstreamer-0.1.3-cp39-abi3-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 ae42b738c792d3542816beb9270f76acef35144ce5b0622e5d6e8cd3e1881547
MD5 9d087ef9a1ea989b618cab3cd9673058
BLAKE2b-256 33aa7d9d0288cdb0605349abbc18e8d100e8bc1c58b3b3265ed59eb16ba74e2b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for charstreamer-0.1.3-cp39-abi3-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 68d8d62b2e9d485007eaad76a093bbf1dcc2d91b6b77d98a4e3b09dc251393b3
MD5 3f3f71305232f71bcb460ffcb4b8ade6
BLAKE2b-256 5a2953a5c641792ea7741ff5498a5e418262553777cc7707e374ea97db78535e

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