-
Notifications
You must be signed in to change notification settings - Fork 5
normalization guide
This page ports Java wiki/content around text normalization to ZemberekDotNet usage.
Related code:
In this repository, normalization-related workflows include:
- Word spell-checking (
TurkishSpellChecker.Check) - Word-level correction suggestions (
TurkishSpellChecker.SuggestForWord) - Noisy sentence normalization (
TurkishSentenceNormalizer.Normalize)
TurkishMorphology morphology = TurkishMorphology.CreateWithDefaults();
TurkishSpellChecker spellChecker = new TurkishSpellChecker(morphology);
bool ok = spellChecker.Check("okuyabileceğimden");List<string> suggestions = spellChecker.SuggestForWord("okuyablirim");Context-aware ranking variant is also available and can improve ranking quality when an LM/context is supplied.
TurkishSentenceNormalizer combines multiple candidate-generation strategies (lookup tables, informal/ascii-tolerant morphology, spell checker candidates) and applies LM-based sequence decoding.
Constructor:
TurkishSentenceNormalizer normalizer = new TurkishSentenceNormalizer(
morphology,
dataRoot: @"C:\zemberek-data\normalization",
languageModelPath: @"C:\zemberek-data\lm\lm.2gram.slm");Usage:
string normalized = normalizer.Normalize("Yrn okua gidicem");Sentence-level normalization needs external resources:
- Normalization lookup files (
dataRootfolder) - Compressed language model file (
languageModelPath)
Java docs reference a downloadable baseline package with these assets. The same concept applies here: sentence normalizer quality depends heavily on domain-appropriate data.
- Word-level spell-checking and suggestions are demonstrated directly in:
- Some normalization tests/resources in this repository are lightweight or test-focused and may not replace full production normalization data.
- For best noisy-text results, build or curate domain-specific lookup/LM resources.
The underlying normalization pipeline follows the same high-level approach documented on Java side:
- Build vocabularies from clean/noisy corpora.
- Generate candidate corrections from lookup tables and analysis heuristics.
- Add contextual scoring with language model.
- Select best token sequence with dynamic search/decoding.
- Automatic normalization may still produce incorrect edits.
- Casing/punctuation may change depending on processing path.
- Domain mismatch can reduce correction quality.
- Results depend on quality of lookup and LM resources.
Use normalization as a pipeline component with evaluation:
- Start with a baseline dataset and measure precision/recall of corrections.
- Add domain-specific corpora and regenerate resources.
- Keep user-facing safeguards for critical workflows (for example, review mode rather than silent rewrite).
Getting Started
Module Reference
- Morphology Notes
- Additions and Release Notes
- Morphemes Reference
- Classification Training Guide
- Normalization Guide
- Proper Nouns and Named Entities
- Text Dictionary Rules
API Parity & Migration
Reference
Roadmap