Analyzing register variation in web texts through automatic segmentation (2025)

Abstract: This study introduces a novel method for analyzing register variation in web texts through classification-based register segmentation. While traditional text-linguistic register analysis treats web documents as single units, we present a recursive binary segmentation approach that automatically identifies register shifts within web documents without labeled segment data, using a ModernBERT classifier fine-tuned on full web documents. Manual evaluation shows our approach to be reliable, and our experimental results reveal that register segmentation leads to more accurate register classification, helps models learn more distinct register categories, and produces text units with more consistent linguistic characteristics. The approach offers new insights into documentinternal register variation in online discourse.

## introduction text-linguistic analysis of registers-text varieties with shared situational characteristics and functionally related linguistic features-has greatly advanced our understanding of language variation in different situations and domains @xcite @xcite . in the domain of online discourse, recent advances in nlp techniques such as transformer models @xcite have enabled automatic classification of web texts into registers across various languages with near-human level performance @xcite . these automatic web register classifiers now serve valuable roles in many research areas, from large-scale linguistic analyses of online discourse @xcite to the curation of webcrawled datasets for large language model (llm) training @xcite . despite recent progress in web register classification schemes @xcite @xcite , web registers remain relatively fuzzy categories with substantial internal variation @xcite . as @xcite have recently suggested, at least part of this unexplained variance may stem from the definition of text, the fundamental unit of observation. critically, in all previous studies on web registers, this unit has always been defined as the full document. however, web documents are often too diverse in content to fit neatly into a single register category. for example, news texts (belonging to the narrative register) are frequently followed by comments (interactive discussion register) @xcite ; similarly, narrative blogs often contain family recipes (instructional register) @xcite . registers can also appear blended, as in sports reports that incorporate detailed sports data, combining elements of the narrative and informational registers @xcite . in this article, we investigate whether an automatic register classifier, trained on full web documents, can be used to detect register shifts within documents, and assess whether segmenting documents based on these shifts produces more distinct web register categories. specifically, we finetune a modernbert @xcite register classifier and develop a segmentation algorithm that leverages the predicted probabilities from the classifier to detect document-internal register units. using recursive binary splitting, our algorithm analyzes potential boundary points within web documents and selects segmentations with maximally distinct register predictions. we evaluate this method on the english corpus of online registers (core) @xcite , which includes eight main register classes. as a preliminary step, we use cleanlab @xcite to remove noisy and ambiguous labels from the data, aiming for an enhanced model suitable for segmentation. to evaluate our register segmentation approach, we assess it manually and compare segment-based and document-based analyses through classification performance, clustering, and linguistic feature analysis. our results show that segmentbased analysis produces more consistent register units. additionally, we examine register distributions within documents, revealing patterns of register shifts in online discourse. the code and data used in this study are available at https: //github.com/turkunlp/core-segmentation . existing approaches to text segmentation fall into two main categories: unsupervised and supervised. unsupervised methods measure coherence between segments using features such as term co-occurrences @xcite , topic vector shifts @xcite , or semantic embedding similarities @xcite . supervised approaches learn segmentation from labeled data (e.g. @xcite @xcite @xcite @xcite . fine-tuned transformer models @xcite generally achieve higher accuracy than unsupervised methods @xcite , although unsupervised approaches can still perform well in contexts where labeled data is scarce or not available @xcite . register-labeled web datasets (e.g. @xcite ) are annotated at the document level, with no finer-grained register datasets available. while these often include hybrid texts-documents annotated with multiple register labels-they do not specify whether these labels correspond to separate sections or mixed content (see section 1). this means we cannot directly use hybrid documents to inform segmentation models. moreover, in contrast to structured platforms like wikipedia, where documents have clear structural markers indicating content shifts @xcite , web texts in general lack explicit register indicators in their html structure, complicating automatic boundary detection. figure 1: register distribution in the core dataset after filtering out texts exceeding 8,192 tokens (@xmath0,319). our approach to register segmentation combines elements of both supervised and unsupervised methods: we first fine-tune an encoder model on full documents, then use the fine-tuned model in an unsupervised manner to segment texts. additionally, our algorithm employs recursive segmentation, which repeatedly divides text into smaller parts. this recursive approach creates a tree-like structure of segments and sub-segments, making it more similar to hierarchical segmentation approaches (e.g. @xcite than to linear segmentation methods (e.g. @xcite which simply divide text into a flat sequence of adjacent segments. ## data we use data from the english core corpus @xcite , a manually register-annotated collection of unrestricted english web content comprising 48,435 documents. the corpus was collected via google searches based on frequent english 3-grams @xcite and annotated through amazon mechanical turk. each document was labeled by four coders, with a register assigned if at least two chose the same label. in cases of an even split between two registers, both labels were assigned. when all four annotators selected different labels, no label was assigned. the core scheme @xcite ) defines eight main register categories and 47 subcategories. in this study, we focus on the main classes: how-to/instructional (hi), informational description (in), informational persuasion (ip), interactive discussion (id), lyrical (ly), narrative (na), opinion (op), and spoken (sp). due to our model's token limit of 8,192 (see section 4.1) and our goal to segment entire documents, we exclude documents exceeding this limit, removing 1,116 documents (2.30%) from the dataset. figure 1 shows the register distribution within the remaining documents: narrative (36%), informational (19%), and opinion (16%) are the most common categories, with hybrid cases being mostly different combinations of these three registers. ## web register segmentation model our approach to web register segmentation consists of two stages: (1) fine-tuning a supervised register classifier on labeled core data and (2) recursively splitting documents into binary segments, using the classifier's output to find optimal bounds. ## evaluation and results in this section, we evaluate our segmentation approach and present the results. we begin with a manual evaluation of a sample of segmented core documents, followed by descriptive statistics of the segmented corpus. next, we assess the produced register segments by comparing them to full-document registers in terms of classification distinctiveness, embedding-space separation, and linguistic cohesion. finally, we explore documentinternal register structures using the segmentations. ## conclusion this paper has introduced a new way to analyze register variation within web texts by segmenting documents rather than treating them as single units. we combined a modernbert classifier with a recursive binary segmentation algorithm that detects document-internal register shifts without requiring pre-labeled segment data. our results show that segmentation improves register analysis in several ways. models trained on segments outperform those trained on full documents, with micro-f1 scores rising from 0.86 to 0.89 and macro-f1 from 0.83 to 0.86. registers cluster more closely in embedding space when analyzed as segments, and they have more consistent linguistic characteristics. by segmenting texts, we uncovered patterns that document-level analyses miss. different registers tend to occur in specific positions within documents: narrative and informational persuasion texts typically appear at the beginning, howto/instructional content is favored in the middle, and interactive discussion and lyrical content usually appear at the end. our approach opens up new possibilities for studying online discourse. by examining texts at a more granular level than full documents, we get a more detailed view of how registers are used in web communication. this could benefit not only register studies but also applications like summarization systems and web corpus curation.