Language Identification via Compositional Data Analysis: A Linear-Time Classifier Based on Log-Ratio Geometry
Abstract
Language identification is commonly addressed using either neural architectures or statistical n-gram models. Neural approaches typically require substantial computational resources, whereas classical frequency-based methods offer efficient linear-time performance, but rely on distance metrics that are not always appropriate for compositional data. This work models character and bigram frequency distributions as compositional vectors constrained to the simplex and mapped via the centered log-ratio (CLR) transformation bijectively onto the -dimensional zero-sum subspace of , where Euclidean distances correspond to Aitchison distances. A pipeline is proposed, combining CLR-transformed unigram and bigram features with Laplace smoothing to address sparsity. The method is evaluated on six languages. Experimental results show that the proposed approach achieves robust accuracy across different text lengths, with strong performance for longer sequences. These findings indicate that compositional representations provide a deterministic and computationally efficient alternative for language identification, particularly in settings where interpretability and low resource consumption are essential.
Create a lesson
Related papers
Scaling Model and Data for Multilingual Machine Translation with Open Large Language Models
Shared title terminologycs.CLYuzhe Shang, Pengzhi Gao, Wei Liu et al.
Scaling Point-in-Time Language Models: Enabling Economic Evaluation of Embeddings
Shared title terminologycs.CLBryan Kelly, Semyon Malamud, Johannes Schwab et al.
Linear representations of grammaticality in neural language models
Shared title terminologycs.CLJane Li, Najoung Kim
Exploring Post-Training Alignment of Small Language Models for Biomedical Data-to-Text Generation: A Case Study of Medication Leaflet
Shared title terminologycs.CLXi Yang, Guodong Liu, Chuqin Li et al.
Repairing the Trustworthiness of Distilled Language Models
Shared title terminologycs.CLKumar Shubham, Devendra Vyas, Vidushi Agarwal et al.
The Linguistic Knowledge Benchmark: Do Language Models Know the Foundations of Early-Grade Literacy?
Shared title terminologycs.CLMaxime Lelièvre, Alasdair Mackintosh, Dominic Andrews et al.