Skip to main content

Character-level segmentation model

Project description

COMBO-SEG

Character-level segmentation model for natural language text.

COMBO-SEG segments raw text into turns, sentences, tokens, and words using a transformer-based character-level classifier. Supports 80+ languages.

Output hierarchy: Document → Turn[] → Sentence[] → Token[] (matches LAMBO). Turns are produced by regexp separators (by default double newline \n\n and <turn>) before the neural model splits each turn into sentences and tokens.

Installation

pip install combo-seg

Usage

from combo_seg import ComboSeg, Language, SplitLevel

segmenter = ComboSeg(language=Language.POLISH)
doc = segmenter("Ala ma kota. Kot ma Alę.\n\nDrugi akapit.")

for turn in doc.turns:
    for sentence in turn.sentences:
        print(sentence.text)
        for token in sentence.tokens:
            print(f"  {token.text}")

# Pass split_level=SplitLevel.TURN to collapse each turn into one Sentence.

License

GPL-3.0

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

combo_seg-0.1.2.tar.gz (63.2 kB view details)

Uploaded Source

Built Distribution

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

combo_seg-0.1.2-py3-none-any.whl (53.8 kB view details)

Uploaded Python 3

File details

Details for the file combo_seg-0.1.2.tar.gz.

File metadata

  • Download URL: combo_seg-0.1.2.tar.gz
  • Upload date:
  • Size: 63.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for combo_seg-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2ff2b00610fe81deb2f8eb4e15ea6b6fdc3c41f4be5b23e303a409b67e557acc
MD5 96be290631bbe0fdcab5e8eb60d71d95
BLAKE2b-256 f53984646a1fffd8cfa08bbe45daca17e07f96e1a49136993f8cce24a984bacc

See more details on using hashes here.

File details

Details for the file combo_seg-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: combo_seg-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 53.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for combo_seg-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 210425137a77456ee75f11596cce0950be833a9517a32356c29f712f5f09d62d
MD5 0f3a00c72bd715b1c29caf4f776577dd
BLAKE2b-256 19e5044aa29ed661a4d30830aa8842ff7015ce09daff63c725ba6ee948bd1dea

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