Segment Any Text: A Universal Approach for Robust, Efficient and Adaptable Sentence Segmentation

Markus Frohmann, Igor Sterner, Ivan Vulic, Benjamin Minixhofer, Markus Schedl

Abstract

Segmenting text into sentences plays an early and crucial role in many NLP systems. This is commonly achieved by using rule-based or statistical methods relying on lexical features such as punctuation. Although some recent works no longer exclusively rely on punctuation, we find that no prior method achieves all of (i) robustness to missing punctuation, (ii) effective adaptability to new domains, and (iii) high efficiency. We introduce a new model — Segment any Text (SaT) — to solve this problem. To enhance robustness, we propose a new pretraining scheme that ensures less reliance on punctuation. To address adaptability, we introduce an extra stage of parameter-efficient fine-tuning, establishing state-of-the-art performance in distinct domains such as verses from lyrics and legal documents. Along the way, we introduce architectural modifications that result in a threefold gain in speed over the previous state of the art and solve spurious reliance on context far in the future. Finally, we introduce a variant of our model with fine-tuning on a diverse, multilingual mixture of sentence-segmented data, acting as a drop-in replacement and enhancement for existing segmentation tools. Overall, our contributions provide a universal approach for segmenting any text. Our method outperforms all baselines — including strong LLMs — across 8 corpora spanning diverse domains and languages, especially in practically relevant situations where text is poorly formatted.

Introduction

Sentence segmentation—the task of deciding where one sentence ends and the next begins—is often treated as a solved problem using simple rules or punctuation marks. However, these methods frequently fail when faced with "in the wild" data such as automatic speech recognition (ASR) transcripts (which lack punctuation), social media posts with chaotic casing, or specialized domains like legal text and song lyrics.

Existing neural segmenters like WTP (Where’s the Point?) improved robustness but were computationally slow and required specific language codes at inference time. Meanwhile, Large Language Models (LLMs), despite their general capabilities, are expensive for this task and prone to hallucinating changes in the input text. The authors introduce Segment Any Text (SaT), a "universal" segmenter designed to be robust to noise, highly efficient, and easily adaptable to new domains with minimal data.

Methodology

The SaT framework utilizes a multi-stage training approach to achieve its goals:

  1. Self-Supervised Pre-training: A Transformer model (based on XLM-RoBERTa) is trained to predict naturally occurring newlines in web-scale text (mC4). By using subword tokenization instead of character-level processing, SaT achieves significant efficiency gains.
  2. Supervised Fine-tuning (SaT+SM): The model is refined on a diverse mixture of human-segmented data. Heavy data augmentation—randomly removing casing, punctuation, and adding noise—ensures the model learns semantic boundaries rather than relying on surface-level punctuation cues.
  3. Limited Lookahead Mechanism: To address issues with short texts, a novel attention mask restricts how far into the "future" the model can look, preventing reliance on irrelevant distant context.
  4. Domain Adaptation via LoRA: For specialized domains, Low-Rank Adaptation (LoRA) allows the model to be tuned to specific styles (like legal jargon or lyrics) by training only ~1% of its parameters.

Experimental Setup

The study evaluates SaT across 85 languages and 8 distinct corpora, covering a wide range of text types including clean text (Universal Dependencies, OPUS100), noisy/short text (TED talk transcripts, Tweets), and specialized domains (legal documents and song lyrics).

Results and Discussion

Performance and Efficiency

SaT+SM achieved an average F1 score of 91.6 across 81 languages on clean text benchmarks, significantly outperforming the previous state-of-the-art (WtP) at 84.2. Crucially, this performance comes with a massive efficiency boost.

SaT variants achieve higher F1 scores while being significantly faster than the previous state-of-the-art, WtP.

As shown in Figure 1, the 3-layer SaT model segments 1,000 sentences in approximately 0.5 seconds on a consumer-grade GPU, representing a 3x speedup over WtP.

Domain Adaptability

One of SaT's strongest features is its sample efficiency during domain adaptation. Using LoRA, the model can adapt to a new domain with as few as 16 example sentences.

SaT+LoRA demonstrates extreme sample efficiency, outperforming baselines with as few as 16 training sentences.

In the lyrics domain, SaT+LoRA outperformed previous domain-specific models by 10% F1, particularly on difficult, low-repetitiveness genres like Rap. This makes it feasible for researchers to build custom segmenters for niche dialects or highly specific document types in minutes.

Comparison with LLMs

Specialized, smaller models like SaT+SM consistently outperformed Llama 3 8B and Command R. LLMs often struggle with the "verbatim" requirement of segmentation, sometimes altering input text or missing boundaries in non-English languages. By forcing the model to train on "corrupted" text, SaT understands the underlying structure of a sentence, making it a robust "drop-in" solution for ASR pipelines where punctuation is absent.

Conclusion

SaT provides a robust, efficient, and adaptable solution for universal sentence segmentation. While limitations exist regarding tokenizer bias and theoretical subword boundary constraints, SaT sets a new standard for the field. Future work may involve scaling pre-training data to even larger multilingual datasets to further enhance performance.

Reference: Frohmann, M., Sterner, I., Vulić, I., Minixhofer, B., & Schedl, M. (2024). Segment Any Text: A Universal Approach for Robust, Efficient and Adaptable Sentence Segmentation. Proceedings of EMNLP 2024.

Summary updated

BibTeX
@inproceedings{frohmann2024segment,
  author = {Markus Frohmann and Igor Sterner and Ivan Vulic and Benjamin Minixhofer and Markus Schedl},
  title = {{Segment Any Text: A Universal Approach for Robust, Efficient and Adaptable Sentence Segmentation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  url = {https://openreview.net/forum?id=4eITVcKUy6},
}
Figure