(Türkçe açıklama için aşağıya kaydırın / Scroll down for the Turkish version)
nMerge is an NLP-supported preprocessing automation developed to prepare subtitle (.srt) files not for traditional viewing experiences, but for Large Language Model (LLM) based AI translation engines.
Modern Speech-to-Text (STT) software references speakers' breathing patterns and scene silence durations (timestamps) rather than grammar rules when transcribing speech. This causes single sentences to be split at meaningless points and distributed across multiple subtitle lines.
When these half-sentences — with their contexts broken and subjects disconnected from verbs — are sent line by line to LLM translation engines, translation quality collapses. The engine loses contextual continuity and begins producing hallucinations.
nMerge adopts the philosophy:
"Respect grammatical integrity, not physical timing."
Using the spaCy NLP library, nMerge extracts the grammatical anatomy of sentences, overrides fake punctuation fabricated by STT systems, and tears down time barriers to stitch fragmented subtitle lines back together — ensuring that the translation engine sees the text as one complete semantic context.
At its core, nMerge uses spaCy’s pre-trained NLP model:
en_core_web_sm (English Core Web Small)
This lightweight yet highly efficient Convolutional Neural Network (CNN), trained on the OntoNotes dataset, performs:
- Part-of-Speech tagging
- Syntactic dependency analysis
- Conjunction/adposition detection
- Incomplete sentence structure detection
Unlike giant LLM pipelines, nMerge intentionally avoids API latency and heavyweight inference costs.
As a result:
- Thousands of subtitle lines can be processed in milliseconds
- Fully offline execution
- Extremely low CPU usage
- Deterministic preprocessing behavior
Unlike traditional synchronization tools, nMerge completely ignores the time gap between subtitle lines.
If the end of one subtitle and the beginning of the next form a grammatical continuation, the lines are merged regardless of elapsed time.
Binding punctuation marks intentionally left by STT systems or translators are treated as absolute merge commands.
Supported merge-trigger punctuation:
,;:...-----
If one of these appears at the end of a line, merging occurs immediately regardless of capitalization.
STT systems frequently place erroneous periods (.) or exclamation marks (!) in the middle of unfinished sentences during speaker pauses.
nMerge temporarily ignores trailing punctuation and analyzes the last meaningful token.
If the final word belongs to one of these grammatical classes:
ADP(Adposition)CCONJ(Coordinating Conjunction)SCONJ(Subordinating Conjunction)AUX(Auxiliary Verb)PART(Particle)
the sentence is classified as incomplete and forced to merge with the next subtitle line.
If the next subtitle line begins with a single dash (-), nMerge interprets this as a speaker transition and refuses merging.
Incorrect isolated periods trapped between merged fragments are surgically removed.
Residual ellipses and double dashes are cleaned to smooth sentence flow.
Meaningless standalone emotional fillers such as:
"Mmm.""Ah!""Uh-huh"
are completely removed when isolated on their own subtitle line.
However, embedded usages such as:
"Oh, I see."
are preserved safely.
STT systems frequently capitalize words incorrectly in the middle of sentences.
Using grammatical state awareness:
- If the previous subtitle did not genuinely terminate,
- The first word of the next line is forced to lowercase
Exceptions:
- Proper nouns
- The pronoun
"I"
- Python 3.8+
- PyQt5
- pysubs2
- spaCy
- en_core_web_sm (spaCy English Model)
pip install PyQt5 pysubs2 spacypython -m spacy download en_core_web_smpython nMergeGUI.pyStandalone executable (Portable Windows version) can be downloaded from the Releases section of this repository.
nMerge, altyazı (.srt) dosyalarını geleneksel izleme deneyimi için değil, Büyük Dil Modeli (LLM) tabanlı yapay zeka çeviri motorlarına hazırlamak amacıyla geliştirilmiş NLP destekli bir ön işlem otomasyonudur.
Modern Speech-to-Text (STT) yazılımları, konuşma metnini yazıya dökerken gramer kurallarını değil; konuşmacının nefes alışlarını ve sahnelerdeki sessizlik sürelerini referans alır.
Bu nedenle tek bir cümle anlamsız noktalardan bölünür ve farklı altyazı satırlarına dağılır.
Bağlamı parçalanmış, öznesi ve yüklemi ayrılmış bu yarım cümleler LLM tabanlı çeviri motorlarına satır satır gönderildiğinde:
- Çeviri kalitesi çöker
- Bağlam kaybolur
- Halüsinasyon üretimi başlar
nMerge şu felsefeyi benimser:
"Fiziksel zamanlamaya değil, gramatikal bütünlüğe saygı duy."
spaCy NLP kütüphanesi kullanılarak:
- Cümlelerin dilbilgisel anatomisi çıkarılır
- STT’nin ürettiği sahte noktalama işaretleri ezilir
- Zaman bariyerleri yıkılır
- Parçalanmış altyazılar tekrar tek bir semantik bağlama dönüştürülür
nMerge’in merkezinde spaCy’nin şu modeli bulunur:
en_core_web_sm (English Core Web Small)
Bu model:
- OntoNotes veri setiyle eğitilmiş
- Hızlı ve hafif bir CNN mimarisine sahip
- POS tagging ve sentaktik analiz konusunda oldukça başarılıdır
Devasa LLM altyapılarının hantallığından bilinçli şekilde kaçınan nMerge:
- Binlerce satırı milisaniyeler içinde işler
- Tamamen offline çalışır
- İşlemciyi zorlamaz
- Deterministik sonuç üretir
nMerge, altyazılar arasındaki zaman farkını tamamen görmezden gelir.
Eğer iki satır dilbilgisel olarak birbirinin devamıysa, aradan ne kadar süre geçmiş olursa olsun tek blok halinde birleştirilir.
Aşağıdaki işaretler mutlak birleştirme komutu kabul edilir:
,;:...-----
Alt satırın büyük/küçük harfle başlaması önemsenmez.
STT yazılımları konuşma duraksamalarında cümlenin ortasına yanlışlıkla:
.!
yerleştirebilir.
nMerge:
- Son noktalama işaretini geçici olarak yok sayar
- Son anlamlı kelimeyi analiz eder
Eğer kelime şu türlerden biriyse:
ADPCCONJSCONJAUXPART
cümlenin tamamlanmadığı kabul edilir ve zorunlu birleştirme uygulanır.
Alt satır tek bir tire (-) ile başlıyorsa farklı konuşmacı kabul edilir ve birleştirme reddedilir.
Birleştirme sırasında ortada kalan hatalı tekil noktalar temizlenir.
Artık üç noktalar ve çift tireler temizlenerek metin akıcı hale getirilir.
Şu tür anlamsız tekil ifadeler:
"Mmm.""Ah!""Uh-huh"
tamamen silinir.
Ancak:
"Oh, I see."
gibi anlam taşıyan yapılar korunur.
STT sistemlerinin cümle ortasında yanlışlıkla büyük harfle başlattığı kelimeler düzeltilir.
Eğer önceki satır gerçekten bitmemişse:
- Yeni satırın ilk harfi küçültülür
İstisnalar:
- Özel isimler
"I"zamiri
- Python 3.8+
- PyQt5
- pysubs2
- spaCy
- en_core_web_sm
pip install PyQt5 pysubs2 spacypython -m spacy download en_core_web_smpython nMergeGUI.pyPortable Windows sürümü, repository’nin sağ tarafındaki Releases bölümünden indirilebilir.
Developed by nutuzar
nMerge Automation v1.0
