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.4.tar.gz (63.6 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.4-py3-none-any.whl (54.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: combo_seg-0.1.4.tar.gz
  • Upload date:
  • Size: 63.6 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.4.tar.gz
Algorithm Hash digest
SHA256 fdd75a1e654c58e7fff342b83223d9d8a0a8887bbc9f1178ef113f65b100ae95
MD5 cc350bd7b704616295d44aa469ba990f
BLAKE2b-256 fb4d64a20cce34c473fb14c791733769fb2c8fd46dd39c0e0e2b2aafa29d2822

See more details on using hashes here.

File details

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

File metadata

  • Download URL: combo_seg-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 54.0 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0b8fbf142382982d3916ec20f18ae514499cb12ac472bafd04ace15b69194f77
MD5 054ba87e517b10d27403064826f75fa7
BLAKE2b-256 57c0360b76e8b972730060594b0db95e30d90c965b0265e5a4d3446257c63d48

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