Abstract
Traditional document alignment for parallel corpora relies on sentence-based segmentation (SBS), which often fails in the presence of noisy web data and inconsistent punctuation. This paper proposes Overlapping Fixed-Length Segmentation (OFLS), a sliding-window approach that partitions text into fixed-token segments. By decoupling alignment from linguistic sentence boundaries, the method achieves significant improvements in recall and F1 scores across standard benchmarks and a new Japanese-English dataset.
Introduction
To train robust Neural Machine Translation (NMT) models, researchers require massive parallel corpora—collections of documents that are direct translations of each other. Harvesting these from the web involves matching a page in Language A to its counterpart in Language B. Most existing pipelines utilize Sentence-Based Segmentation (SBS), converting sentences into embedding vectors for comparison. However, web-crawled data is notoriously noisy, containing boilerplate text and irregular punctuation that disrupts sentence splitters. Furthermore, extremely long sentences can lose critical information when compressed into a single vector. This research explores moving away from the "sentence" as the fundamental unit of alignment in favor of fixed-length segments.
Methodology: Overlapping Fixed-Length Segmentation (OFLS)
The core innovation is the use of a sliding window to partition text into segments of a fixed number of tokens, with a specified percentage of overlap between adjacent segments. This approach offers several technical advantages:
- Language-Pair Dependent Scaling: Different languages require different token counts to convey the same meaning. The authors introduce a proportion parameter ($\rho$) to scale window lengths between language pairs (e.g., Japanese vs. English).
- Contextual Redundancy: Overlapping windows ensure that context at the edges of a segment is preserved, allowing embedding models to capture more robust features.
- Algorithmic Flexibility: OFLS was tested against three alignment methods: Mean-Pool (averaging embeddings), TK-PERT (a weighted windowing approach), and Optimal Transport (OT) (calculating the minimum cost to transform one set of embeddings into another).
Experimental Results
The researchers evaluated OFLS on the WMT16 Document Alignment Shared Task (French-English) and a new high-quality Japanese-English dataset called MnRN, which includes 263 "gold" pairs across four domains.
Performance and Efficiency
As shown in the results below, replacing SBS with OFLS consistently improved performance. On the MnRN dataset, the combination of Optimal Transport and OFLS achieved an F1 score of 0.9267, significantly outperforming the Machine Translation-based baseline of 0.7880.
Beyond accuracy, OFLS proved surprisingly efficient. For the Mean-Pool method, OFLS reduced the time required for document embedding by more than half (from ~277 seconds to ~120 seconds) compared to sentence-based methods. This is largely because fixed-length segments allow for more predictable and streamlined computational processing than sentences of varying lengths.
Comparison with State-of-the-Art
On the WMT16 benchmark, the OFLS strategy provided a recall boost of 1% to 10% across various methods. When compared to previous state-of-the-art work, the proposed TK-PERT method using LASER embeddings and SBS already showed high recall, but the transition to OFLS further stabilized these gains.
Conclusion
The findings suggest that linguistic sentence boundaries are not the "gold standard" for document alignment. Fixed-length segments provide a more uniform representation that is less sensitive to the noise of web-crawled HTML. While Optimal Transport remains computationally expensive for massive datasets, the efficiency gains in the embedding phase and the significant boost in alignment accuracy make OFLS a superior alternative for building high-quality parallel corpora.
Summary updated