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.1.tar.gz (49.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.1-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: combo_seg-0.1.1.tar.gz
  • Upload date:
  • Size: 49.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.1.tar.gz
Algorithm Hash digest
SHA256 4cfbc98a3db786a1024996750d6f9b012777a9546d868b3751a5177a95707ec1
MD5 bbd6d68edf8f5adcaba684c31badfa78
BLAKE2b-256 6b3fca72747ecea0e801edf5bb070a5ae3c997cc64414f423f70f0b97091ceef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: combo_seg-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 39.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e148c6928327c40b57c9a58951c984a63dfd299e8658173c90c19bece3082f3c
MD5 75ec88469dcc3b54c3828fd1e97287ae
BLAKE2b-256 451fa97c5ac06ff187bae2c0e3aceef8df27c975b8c29f81a02a14b7c596e1aa

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