Metadata-Version: 2.4
Name: ortix-seg
Version: 0.1.0
Summary: Ortix Latvian sentence segmentation runtime.
Project-URL: Homepage, https://github.com/Baltrix-AI/ortix-runtime
Project-URL: Repository, https://github.com/Baltrix-AI/ortix-runtime
Project-URL: Models, https://huggingface.co/collections/Baltrix-AI/ortix
Author: Baltrix AI
License-Expression: Apache-2.0
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: huggingface-hub<2,>=0.23
Requires-Dist: pydantic<3,>=2
Requires-Dist: torch<3,>=2
Requires-Dist: transformers<6,>=4.40
Requires-Dist: typing-extensions>=4.9
Description-Content-Type: text/markdown

# ortix-seg

Runtime package for Ortix Latvian sentence segmentation models.

```bash
pip install ortix-seg
```

```python
from ortix.seg import SentenceSegmenter

segmenter = SentenceSegmenter.from_pretrained("Baltrix-AI/ortix-seg-lv-base")
spans = segmenter.segment("Pirmais teikums. Otrais teikums.")
# spans == [
#     SentenceSpan(start=0, end=16, text="Pirmais teikums."),
#     SentenceSpan(start=16, end=32, text=" Otrais teikums."),
# ]

for span in spans:
    print(span.text)
```

Ortix sentence-segmentation model repositories include
`sentence_segmentation_config.json`, which stores the calibrated threshold,
sliding-window settings, and post-processing defaults used at inference time.

The threshold can be adjusted when a project needs a different precision/recall
tradeoff:

```python
segmenter = SentenceSegmenter.from_pretrained(
    "Baltrix-AI/ortix-seg-lv-base",
    threshold=0.65,
)
```

Advanced post-processing switches can be overridden from Python:

```python
segmenter = SentenceSegmenter.from_pretrained(
    "Baltrix-AI/ortix-seg-lv-base",
    postprocessing_overrides={
        "suppress_latvian_abbreviation_continuations": False,
    },
)
```

The command line exposes the threshold override:

```bash
ortix-seg --model Baltrix-AI/ortix-seg-lv-base --threshold 0.65 input.txt
```
