rain1024 commited on
Commit
73173ad
·
1 Parent(s): 27e6434

Add external dictionary features for VLSP 2013 word segmentation

Browse files

External Viet74K dictionary (63K multi-syllable entries) improves word F1
from 97.36% to 97.62% (+0.26%), narrowing gap to SOTA from 0.70% to 0.44%.
Includes configurable dictionary source, error analysis, and annotation
consistency analysis of 4+ syllable compounds.

CLAUDE.md CHANGED
@@ -80,7 +80,7 @@ Models stored at `models/{task}/{version}/` with `model.crfsuite` + `metadata.ya
80
 
81
  ## Key Constraints
82
 
83
- - CRF hyperparams: c1=1.0 (L1), c2=0.001 (L2), max_iterations=100
84
  - POS input must be pre-tokenized (whitespace-separated Vietnamese tokens)
85
  - WS input goes through `underthesea.regex_tokenize` first
86
  - Dataset: `undertheseanlp/UDD-1` from Hugging Face
 
80
 
81
  ## Key Constraints
82
 
83
+ - CRF hyperparams: POS: c1=1.0, WS: c1=0.5 (L1), c2=0.001 (L2), POS: max_iterations=100, WS: max_iterations=300
84
  - POS input must be pre-tokenized (whitespace-separated Vietnamese tokens)
85
  - WS input goes through `underthesea.regex_tokenize` first
86
  - Dataset: `undertheseanlp/UDD-1` from Hugging Face
TECHNICAL_REPORT.md CHANGED
@@ -6,7 +6,7 @@ This report documents the development of **TRE-1**, a Vietnamese NLP pipeline us
6
 
7
  | Task | Method | Status | Performance |
8
  |------|--------|--------|-------------|
9
- | Word Segmentation | CRF (BIO tagging) | Implemented | 98.01% word F1 (UDD-1), 97.17% word F1 (VLSP 2013) |
10
  | POS Tagging | CRF (27 features) | Implemented | 95.89% accuracy |
11
  | Chunking | CRF (BIO tagging) | Planned | -- |
12
  | Dependency Parsing | Non-neural (transition/graph-based) | Planned | -- |
@@ -45,9 +45,10 @@ TRE-1 adopts a **CPU-first, no deep learning** approach:
45
 
46
  ### 1.4 Contributions
47
 
48
- - **TRE-1 Word Segmentation**: CRF-based syllable-level BIO tagger achieving 98.01% word F1 on UDD-1 and 97.17% word F1 on VLSP 2013
49
  - **TRE-1 POS Tagger**: CRF with 27 handcrafted feature templates achieving 95.89% accuracy on UDD-1, matching VnMarMoT (95.88% on VLSP 2013)
50
  - **Feature ablation study**: Systematic analysis of 7 feature groups showing bigrams (-2.86% when removed) and left context (-1.21%) are critical, while type features provide zero benefit
 
51
  - **Pipeline architecture design** for chunking and dependency parsing based on literature review of 41 papers
52
  - **Open-source release** at [undertheseanlp/tre-1](https://huggingface.co/undertheseanlp/tre-1)
53
 
@@ -125,7 +126,7 @@ Input text (raw Vietnamese)
125
  v
126
  +---------------------+
127
  | Word Segmentation | CRF (BIO tagging) 98.01% word F1
128
- | (syllable -> word) | 21 feature templates, ~1.1 MB model
129
  +---------+-----------+
130
  |
131
  v
@@ -168,7 +169,7 @@ This is formulated as a syllable-level sequence labeling task using BIO tags:
168
 
169
  ### 4.2 Feature Engineering
170
 
171
- The word segmentation model uses **20 feature templates** at the syllable level, organized into 7 groups (see Section 4.4 for ablation analysis):
172
 
173
  #### G1: Form (2 templates)
174
  ```
@@ -214,6 +215,14 @@ S[0,1] - Bigram (current, next)
214
  S[-1,0,1] - Trigram (previous, current, next)
215
  ```
216
 
 
 
 
 
 
 
 
 
217
  Boundary tokens (`__BOS__`, `__EOS__`) are used for sentence edges.
218
 
219
  ### 4.3 Results
@@ -232,13 +241,13 @@ Boundary tokens (`__BOS__`, `__EOS__`) are used for sentence edges.
232
 
233
  | Level | Metric | Score |
234
  |-------|--------|-------|
235
- | Syllable | Accuracy | 98.51% |
236
- | Syllable | F1 (weighted) | 98.51% |
237
- | Word | Precision | 96.64% |
238
- | Word | Recall | 97.70% |
239
- | Word | **F1** | **97.17%** |
240
 
241
- Trained with `underthesea-core` (Rust CRF, L-BFGS) on 75,389 sentences (2.19M syllables). Training time: 6m 28s on CPU.
242
 
243
  The lower performance on VLSP 2013 compared to UDD-1 is expected: the VLSP 2013 test set has significantly more multi-syllable words (42.3% vs ~25%) and longer sentences (45.5 vs ~29 avg syllables).
244
 
@@ -300,6 +309,8 @@ Starting from form-only and progressively adding groups:
300
 
301
  6. **Comparison with prior Vietnamese ablation studies**: Nguyen et al. (2006) found dictionary features contributed +3.49 F1 for Vietnamese WS — our bigram features provide a comparable +4.50% gain without requiring external dictionaries. UITws-v1 (Nguyen et al., 2019) reported +0.04% from their full feature combination over baseline, consistent with our finding that incremental improvements beyond core features are small.
302
 
 
 
303
  ### 4.5 Comparison with Prior Work
304
 
305
  | Model | Dataset | F1 | Method | Neural? |
@@ -307,11 +318,208 @@ Starting from form-only and progressively adding groups:
307
  | UITws-v1 | VLSP 2013 | 98.06% | SVM + ambiguity reduction | No |
308
  | RDRsegmenter | VLSP 2013 | 97.90% | Rule-based decision trees | No |
309
  | jPTDP-v2 | VLSP 2013 | 97.90% | Joint neural | Yes |
310
- | **TRE-1 WS** | **VLSP 2013** | **97.17%** | **CRF (BIO)** | **No** |
311
  | **TRE-1 WS** | **UDD-1** | **98.01%** | **CRF (BIO)** | **No** |
312
  | JVnSegmenter | VLSP 2013 | 97.06% | CRF + SVM | No |
313
 
314
- **Note**: On the standard VLSP 2013 benchmark, TRE-1 achieves 97.17% word F1, surpassing JVnSegmenter (97.06%) but trailing UITws-v1 (98.06%) by 0.9%. On UDD-1, TRE-1 achieves 98.01% word F1.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
 
316
  ---
317
 
@@ -524,13 +732,13 @@ Zhang & Nivre (2011) demonstrated that rich feature engineering (72 templates) a
524
 
525
  All CRF models use the same training configuration:
526
 
527
- | Parameter | Value | Description |
528
- |-----------|-------|-------------|
529
- | Algorithm | lbfgs | Limited-memory BFGS optimization |
530
- | c1 | 1.0 | L1 regularization coefficient |
531
- | c2 | 0.001 | L2 regularization coefficient |
532
- | max_iterations | 100 | Maximum training iterations |
533
- | feature.possible_transitions | True | Include all possible transitions |
534
 
535
  ### 8.2 Trainer Backends
536
 
@@ -565,7 +773,8 @@ tre-1/
565
  +-- scripts/
566
  | +-- train.py # POS training script
567
  | +-- train_word_segmentation.py # WS training script
568
- | +-- evaluate.py # Evaluation with metrics & plots
 
569
  | +-- predict.py # POS inference CLI
570
  | +-- predict_word_segmentation.py # WS inference CLI
571
  +-- results/
@@ -600,9 +809,13 @@ tre-1/
600
  3. **Context Limitation**: CRF window size (+-2 tokens) may miss long-range dependencies
601
  4. **Domain Variation**: Legal and news domains have different vocabulary distributions
602
 
603
- ### 9.3 Error Propagation in Pipeline
 
 
604
 
605
- Word segmentation errors propagate downstream. A segmentation error (e.g., splitting "bảo hành" into two words) causes cascading POS errors and would affect chunking and parsing. TRE-1 WS achieves 98.01% word F1, limiting this propagation effect.
 
 
606
 
607
  ---
608
 
@@ -610,7 +823,7 @@ Word segmentation errors propagate downstream. A segmentation error (e.g., split
610
 
611
  | Task | Best Non-Neural | Best Neural | Gap | CPU Viability |
612
  |------|----------------|-------------|-----|---------------|
613
- | Word Segmentation | 98.06% F1 (SVM) | 97.90% F1 (jPTDP) | **+0.16%** (TRE-1: 97.17%) | Excellent |
614
  | POS Tagging | 95.88% acc (CRF) | 97.2% acc (DeBERTa) | -1.32% | Good |
615
  | Chunking (English) | 95.23% F1 (HMM) | 94.46% F1 (BiLSTM) | **+0.77%** | Excellent |
616
  | Dep Parsing (Vietnamese) | 76.58% UAS (MST) | 85.47% UAS (PhoBERT) | -8.89% | Moderate |
@@ -690,7 +903,7 @@ Conditional Random Fields (CRF), introduced by Lafferty et al. (2001), are discr
690
 
691
  ### 12.2 Vietnamese Word Segmentation
692
 
693
- Nguyen et al. (2006) established the CRF approach for Vietnamese word segmentation using syllable-level features. UITws-v1 (Nguyen et al., 2019) achieved the current SOTA (98.06% F1 on VLSP 2013) using SVM with ambiguity reduction and suffix features. RDRsegmenter (Vu et al., 2018) achieves 97.90% with rule-based decision trees. TRE-1 follows the CRF BIO tagging approach of Nguyen et al. (2006), achieving 98.01% word F1 on UDD-1.
694
 
695
  ### 12.3 Vietnamese POS Tagging
696
 
@@ -746,12 +959,14 @@ CRF-based methods remain competitive when combined with well-designed feature te
746
 
747
  7. **Vietnamese Chunking Data**: Very limited annotated corpora for Vietnamese chunking makes evaluation difficult.
748
 
 
 
749
  ---
750
 
751
  ## 14. Future Work
752
 
753
  ### 14.1 Implemented Tasks
754
- 1. **VLSP 2013 POS Evaluation**: Evaluate POS tagging on the standard VLSP 2013 benchmark for direct comparison (WS evaluation completed: 97.17% word F1)
755
  2. **Manual Annotation Verification**: Sample-based quality assessment of UDD-1 annotations
756
  3. **Multi-domain Training**: Include social media, conversational, and literary data
757
 
@@ -847,7 +1062,7 @@ uv run scripts/predict.py --format json "Hà Nội là thủ đô"
847
 
848
  TRE-1 is a Vietnamese NLP pipeline using CRF and non-neural methods designed for CPU inference. The implemented components achieve competitive results:
849
 
850
- - **Word Segmentation**: 98.01% word F1 on UDD-1; 97.17% word F1 on VLSP 2013 (within 0.9% of non-neural SOTA)
851
  - **POS Tagging**: 95.89% accuracy (matching the best CRF-based Vietnamese tagger)
852
 
853
  The pipeline architecture (WS -> POS -> Chunk -> DP) is validated by prior work and designed for modularity, interpretability, and efficiency. Chunking and dependency parsing are planned as next steps, with CRF for chunking and transition/graph-based methods for parsing.
@@ -944,6 +1159,7 @@ All models and code are publicly available at [undertheseanlp/tre-1](https://hug
944
  | `S[-1,0,1]` | Trigram |
945
  | `.ispunct` | Is punctuation |
946
  | `.len` | Syllable length |
 
947
 
948
  ### B. Universal POS Tags
949
 
@@ -981,10 +1197,12 @@ Example: `Thoi han bao hanh san pham` -> `B I B I B I` (3 compound words)
981
  | 1.0 | 2025-01-31 | UDD-v0.1 (3K) | POS | Accuracy | 95.57% |
982
  | **1.1** | **2026-01-31** | **UDD-1 (20K)** | **POS** | **Accuracy** | **95.89%** |
983
  | **1.1** | **2026-01-31** | **UDD-1 (20K)** | **WS** | **Word F1** | **98.01%** |
984
- | **1.2** | **2026-02-08** | **VLSP 2013 (75K)** | **WS** | **Word F1** | **97.17%** |
 
 
985
 
986
  ---
987
 
988
  *Report generated: February 8, 2026*
989
  *Model: undertheseanlp/tre-1*
990
- *Version: 1.2*
 
6
 
7
  | Task | Method | Status | Performance |
8
  |------|--------|--------|-------------|
9
+ | Word Segmentation | CRF (BIO tagging) | Implemented | 98.01% word F1 (UDD-1), 97.62% word F1 (VLSP 2013) |
10
  | POS Tagging | CRF (27 features) | Implemented | 95.89% accuracy |
11
  | Chunking | CRF (BIO tagging) | Planned | -- |
12
  | Dependency Parsing | Non-neural (transition/graph-based) | Planned | -- |
 
45
 
46
  ### 1.4 Contributions
47
 
48
+ - **TRE-1 Word Segmentation**: CRF-based syllable-level BIO tagger achieving 98.01% word F1 on UDD-1 and 97.62% word F1 on VLSP 2013
49
  - **TRE-1 POS Tagger**: CRF with 27 handcrafted feature templates achieving 95.89% accuracy on UDD-1, matching VnMarMoT (95.88% on VLSP 2013)
50
  - **Feature ablation study**: Systematic analysis of 7 feature groups showing bigrams (-2.86% when removed) and left context (-1.21%) are critical, while type features provide zero benefit
51
+ - **Hyperparameter tuning**: Reducing L1 regularization (c1=0.5) and increasing iterations (300) improved VLSP 2013 word F1 from 97.17% to 97.36%; external dictionary features (Viet74K) further improved to 97.62%
52
  - **Pipeline architecture design** for chunking and dependency parsing based on literature review of 41 papers
53
  - **Open-source release** at [undertheseanlp/tre-1](https://huggingface.co/undertheseanlp/tre-1)
54
 
 
126
  v
127
  +---------------------+
128
  | Word Segmentation | CRF (BIO tagging) 98.01% word F1
129
+ | (syllable -> word) | 22 feature templates, ~1.1 MB model
130
  +---------+-----------+
131
  |
132
  v
 
169
 
170
  ### 4.2 Feature Engineering
171
 
172
+ The word segmentation model uses **22 feature templates** at the syllable level, organized into 8 groups (see Section 4.4 for ablation analysis and Section 4.6 for dictionary experiments):
173
 
174
  #### G1: Form (2 templates)
175
  ```
 
215
  S[-1,0,1] - Trigram (previous, current, next)
216
  ```
217
 
218
+ #### G8: Dictionary (2 templates)
219
+ ```
220
+ S[-1,0].in_dict - Longest dictionary match ending at current position (including prev syllable)
221
+ S[0,1].in_dict - Longest dictionary match starting at current position (including next syllable)
222
+ ```
223
+
224
+ Dictionary features use longest-match lookups against an external dictionary (Viet74K, 63,725 multi-syllable entries). The matched word string is used as the feature value, enabling the CRF to learn word-specific patterns. See Section 4.6 for dictionary source experiments.
225
+
226
  Boundary tokens (`__BOS__`, `__EOS__`) are used for sentence edges.
227
 
228
  ### 4.3 Results
 
241
 
242
  | Level | Metric | Score |
243
  |-------|--------|-------|
244
+ | Syllable | Accuracy | 98.78% |
245
+ | Syllable | F1 (weighted) | 98.78% |
246
+ | Word | Precision | 97.29% |
247
+ | Word | Recall | 97.94% |
248
+ | Word | **F1** | **97.62%** |
249
 
250
+ Trained with `python-crfsuite` (L-BFGS, c1=0.5, c2=0.001, 300 iterations) on 75,389 sentences (2.19M syllables) with external dictionary features (Viet74K, 63,725 multi-syllable entries). Training time: ~19 min on CPU.
251
 
252
  The lower performance on VLSP 2013 compared to UDD-1 is expected: the VLSP 2013 test set has significantly more multi-syllable words (42.3% vs ~25%) and longer sentences (45.5 vs ~29 avg syllables).
253
 
 
309
 
310
  6. **Comparison with prior Vietnamese ablation studies**: Nguyen et al. (2006) found dictionary features contributed +3.49 F1 for Vietnamese WS — our bigram features provide a comparable +4.50% gain without requiring external dictionaries. UITws-v1 (Nguyen et al., 2019) reported +0.04% from their full feature combination over baseline, consistent with our finding that incremental improvements beyond core features are small.
311
 
312
+ **Note**: Ablation results above use the initial hyperparameters (c1=1.0, 100 iterations). After hyperparameter tuning (c1=0.5, 300 iterations), word F1 improved from 97.17% to 97.36%, and with external dictionary features to **97.62%** (see Section 4.6).
313
+
314
  ### 4.5 Comparison with Prior Work
315
 
316
  | Model | Dataset | F1 | Method | Neural? |
 
318
  | UITws-v1 | VLSP 2013 | 98.06% | SVM + ambiguity reduction | No |
319
  | RDRsegmenter | VLSP 2013 | 97.90% | Rule-based decision trees | No |
320
  | jPTDP-v2 | VLSP 2013 | 97.90% | Joint neural | Yes |
321
+ | **TRE-1 WS** | **VLSP 2013** | **97.62%** | **CRF (BIO) + ext dict** | **No** |
322
  | **TRE-1 WS** | **UDD-1** | **98.01%** | **CRF (BIO)** | **No** |
323
  | JVnSegmenter | VLSP 2013 | 97.06% | CRF + SVM | No |
324
 
325
+ **Note**: On the standard VLSP 2013 benchmark, TRE-1 achieves 97.62% word F1 with external dictionary features, surpassing JVnSegmenter (97.06%) and approaching UITws-v1 (98.06%) with a gap of only 0.44%. On UDD-1, TRE-1 achieves 98.01% word F1.
326
+
327
+ ### 4.6 Hyperparameter Tuning and Dictionary Feature Experiments
328
+
329
+ #### Hyperparameter Tuning
330
+
331
+ The initial model used default hyperparameters (c1=1.0, c2=0.001, 100 iterations). We explored alternative settings:
332
+
333
+ | c1 | c2 | Iterations | Trainer | Word F1 | Delta |
334
+ |----|-----|-----------|---------|---------|-------|
335
+ | 1.0 | 0.001 | 100 | underthesea-core | 97.17% | baseline |
336
+ | 1.0 | 0.001 | 100 | python-crfsuite | 97.17% | 0.00% |
337
+ | **0.5** | **0.001** | **300** | **python-crfsuite** | **97.36%** | **+0.19%** |
338
+ | 0.3 | 0.001 | 500 | python-crfsuite | 97.31% | +0.14% |
339
+
340
+ Reducing L1 regularization from 1.0 to 0.5 and increasing iterations from 100 to 300 produced the best result (+0.19% word F1). Further reducing c1 to 0.3 with 500 iterations showed diminishing returns. The final model uses c1=0.5, c2=0.001, 300 iterations with python-crfsuite.
341
+
342
+ #### Dictionary Feature Experiments
343
+
344
+ Motivated by Nguyen et al. (2006), who found dictionary features contributed +3.49 F1 for Vietnamese WS, we experimented with dictionary lookup features across two dimensions: **feature design** and **dictionary source**.
345
+
346
+ ##### Phase 1: Training-Data Dictionary (Negative Result)
347
+
348
+ Initial experiments used a word dictionary built from training data (26,447 multi-syllable entries) with various feature designs:
349
+
350
+ | Feature Design | Dictionary | Word F1 | Delta |
351
+ |---------------|-----------|---------|-------|
352
+ | *(no dictionary — baseline)* | — | **97.17%** | — |
353
+ | Boolean per n-gram window (6 features) | All 2-syl+ (26.4K) | 96.72% | **-0.45%** |
354
+ | Max forward/backward match length (2 features) | All 2-syl+ (26.4K) | 96.71% | **-0.46%** |
355
+ | Max forward/backward match length (2 features) | 3-syl+ only (6.6K) | 97.10% | -0.07% |
356
+ | Begin/inside/end role (3 features) | All 2-syl+ (26.4K) | 97.03% | -0.14% |
357
+ | Begin/inside/end role (3 features) | 3-syl+ only (6.6K) | 97.15% | -0.02% |
358
+ | Matched word as value (2 features) | All 2-syl+ (26.4K) | 96.72% | **-0.45%** |
359
+
360
+ All training-data dictionary designs consistently hurt or were neutral. The CRF's bigram features already encode the same co-occurrence patterns from training data, making explicit dictionary lookups redundant.
361
+
362
+ ##### Phase 2: External Dictionary (Positive Result)
363
+
364
+ We hypothesized that **external dictionaries** would succeed where training-data dictionaries failed, because they provide genuinely novel vocabulary that bigrams cannot learn from training data alone. We tested three dictionary sources using the matched-word-value feature design (2 templates: S[-1,0].in_dict, S[0,1].in_dict) with tuned hyperparameters (c1=0.5, 300 iterations):
365
+
366
+ | Dictionary Source | Size | Syl Acc | Word F1 | Delta |
367
+ |-------------------|------|---------|---------|-------|
368
+ | *(none — tuned baseline)* | — | 98.62% | **97.36%** | — |
369
+ | **External (Viet74K)** | **63,725** | **98.78%** | **97.62%** | **+0.26%** |
370
+ | Combined (external + training) | ~74,172 | 98.68% | 97.42% | +0.06% |
371
+ | Training only | 26,447 | 98.33% | 96.81% | -0.55% |
372
+
373
+ The external dictionary (Viet74K from the underthesea package, 63,725 multi-syllable entries) improved word F1 by **+0.26%** to **97.62%**, a new best result. This narrows the gap to UITws-v1 SOTA (98.06%) from 0.70% to **0.44%**.
374
+
375
+ **Why external dictionaries work**: Unlike training-data dictionaries, external dictionaries provide ~48K words not seen in training data, giving the CRF genuinely new information that bigram features cannot learn. The combined dictionary (external + training) performed worse than external-only, confirming that training-data entries add noise by duplicating information already captured by bigrams.
376
+
377
+ **Why training-data dictionaries still hurt**: With tuned hyperparameters (c1=0.5, 300 iter), training-data dictionary features cause an even larger degradation (-0.55%) compared to the pre-tuned baseline (-0.45% with c1=1.0, 100 iter). The lower regularization allows the model to fit more to the redundant dictionary features, amplifying the noise effect.
378
+
379
+ ### 4.7 Error Analysis (VLSP 2013)
380
+
381
+ We performed detailed error analysis on the VLSP 2013 test set (2,120 sentences, 96,457 syllables, 66,241 words) using the final model with external dictionary features (97.62% word F1).
382
+
383
+ #### Summary Statistics
384
+
385
+ | Metric | Value | vs Baseline (97.36%) |
386
+ |--------|-------|---------------------|
387
+ | Total syllable errors | 1,180 / 96,457 (1.22%) | -148 (-11.1%) |
388
+ | Word Precision | 97.29% | +0.39% |
389
+ | Word Recall | 97.94% | +0.11% |
390
+ | Word F1 | 97.62% | +0.26% |
391
+ | Missed true words (FN) | 1,364 | -71 |
392
+ | False positive words (FP) | 1,806 | -267 |
393
+
394
+ The external dictionary reduced false positives by 267 (12.9%) and false negatives by 71 (4.9%), with the majority of improvement coming from reduced over-segmentation. The model still produces more false positives than false negatives, but the gap narrowed from 638 to 442.
395
+
396
+ #### Syllable-Level Confusion Matrix
397
+
398
+ | | Pred B | Pred I |
399
+ |--|--------|--------|
400
+ | **True B** | 65,872 | 369 |
401
+ | **True I** | 811 | 29,405 |
402
+
403
+ - **False splits (I→B)**: 811 / 30,216 I-labels (2.68%) — down from 3.25% without dictionary
404
+ - **False joins (B→I)**: 369 / 66,241 B-labels (0.56%) — slightly up from 0.52% without dictionary
405
+
406
+ The dictionary reduced false splits by 172 (17.5%), the primary source of improvement. False joins increased slightly by 24 (7.0%), a minor trade-off: the dictionary encourages joining syllables into compound words, which occasionally over-joins.
407
+
408
+ #### Error Rate by Word Length
409
+
410
+ | Length | Total | Errors | Accuracy | vs Baseline |
411
+ |--------|-------|--------|----------|-------------|
412
+ | 1-syl | 38,213 | 384 | 99.00% | +0.08% |
413
+ | 2-syl | 26,813 | 487 | 98.18% | +0.09% |
414
+ | 3-syl | 581 | 149 | 74.35% | +2.41% |
415
+ | 4-syl | 487 | 219 | 55.03% | -1.23% |
416
+ | 5+ syl | 147 | 125 | 14.97% | +6.13% |
417
+
418
+ The dictionary improved accuracy across most word lengths. The largest absolute gains are on 5+ syllable words (+6.13%), where external vocabulary helps the most, and 3-syllable words (+2.41%). The slight regression on 4-syllable words (-1.23%) reflects the false-join trade-off: some 4-syllable sequences are over-merged.
419
+
420
+ #### Top False Split Patterns
421
+
422
+ The most common false splits remain domain-specific legal terms:
423
+
424
+ | Word | Count | Example context |
425
+ |------|-------|-----------------|
426
+ | chủ nghĩa hợp hiến | 64 | "tiếp thu **chủ nghĩa hợp hiến** ở Việt" |
427
+ | Uỷ ban Thường vụ Quốc hội | 32 | "của **Uỷ ban Thường vụ Quốc hội** về bồi" |
428
+ | hình sự hoá | 28 | "Vấn đề **hình sự hoá** , phi" |
429
+ | Bộ luật hình sự | 24 | "so với **Bộ luật hình sự** năm 1985" |
430
+ | Hiến pháp 1946 | 24 | "khi **Hiến pháp 1946** đã được" |
431
+ | phi hình sự hoá | 18 | "hoá , **phi hình sự hoá** trong chính" |
432
+
433
+ Notable: "luật hình sự" (38 errors in baseline) no longer appears in the top false splits — the external dictionary successfully resolved this pattern. The remaining top errors are 4+ syllable legal compounds ("chủ nghĩa hợp hiến", "Uỷ ban Thường vụ Quốc hội") and words with digits ("Hiến pháp 1946") that dictionary features cannot easily capture.
434
+
435
+ #### Top False Join Patterns
436
+
437
+ | Merged as | Count | Should be | Example |
438
+ |-----------|-------|-----------|---------|
439
+ | loại hình phạt | 22 | loại \| hình phạt | "loại **hình phạt** này" |
440
+ | như vậy | 17 | như \| vậy | "hoàn toàn **như vậy** ." |
441
+ | trước đây | 17 | trước \| đây | "Nam Tư **trước đây** , ngoại" |
442
+ | pháp luật hình sự | 15 | pháp luật \| hình sự | "Trong **pháp luật hình sự** thực định" |
443
+ | nghĩa là | 9 | nghĩa \| là | "cũng có **nghĩa là** người đó" |
444
+
445
+ A new false join pattern emerged: "pháp luật hình sự" (15 errors) — the dictionary contains "pháp luật" and "hình sự" as separate entries, but the model over-eagerly joins them. This is the flip side of the dictionary's benefit: it occasionally joins words that share dictionary-matchable subsequences.
446
+
447
+ #### Error Causes
448
+
449
+ 1. **Annotation inconsistency**: The dominant error source for 4+ syllable words. 81.7% of 4+ syllable test occurrences are either absent from training or have conflicting annotations (see Section 4.8 for detailed analysis). The CRF learns training patterns faithfully, but those patterns contradict the test gold standard.
450
+
451
+ 2. **Domain-specific vocabulary**: The VLSP 2013 test set contains dense legal terminology (constitutional law, criminal law) with specialized multi-syllable compounds. Many errors concentrate on a small set of recurring legal terms not in the general-purpose Viet74K dictionary or absent from training data entirely (e.g., "chủ nghĩa hợp hiến", 68 test occurrences, zero in training).
452
+
453
+ 3. **Ambiguous syllable sequences**: Syllables like "hình" appear both as B (beginning of "hình phạt" = punishment) and I (inside "luật hình sự" = criminal law), creating systematic confusion. The dictionary exacerbates this for "hình sự" by encouraging joining in all contexts.
454
+
455
+ 4. **Asymmetric error distribution**: False splits (I→B: 2.68%) still outnumber false joins (B→I: 0.56%) by 2.2:1, improved from 2.8:1 in the baseline. The dictionary shifted the balance by reducing false splits more than it increased false joins.
456
+
457
+ 5. **Position is not a factor**: Syllable error rate is nearly uniform: start (1.02%), end (1.12%), middle (1.25%).
458
+
459
+ ### 4.8 Annotation Consistency Analysis (4+ Syllable Words)
460
+
461
+ The steep accuracy drop for 4+ syllable words (55% for 4-syl, 15% for 5+ syl) prompted investigation into whether these errors stem from model limitations or from annotation inconsistencies in the training data.
462
+
463
+ #### Methodology
464
+
465
+ We extracted all 155 unique 4+ syllable words from the VLSP 2013 test gold standard (634 total occurrences), then searched for each syllable sequence in the training data to compare how it is segmented. Words were classified into three categories:
466
+
467
+ - **Consistent**: Same segmentation in both train and test
468
+ - **Inconsistent**: Multiple segmentations in training, or train majority differs from test
469
+ - **Not in training**: The syllable sequence never appears in training data
470
+
471
+ #### Results
472
+
473
+ | Category | Unique words | Test occurrences | % of occurrences |
474
+ |----------|-------------|-----------------|-----------------|
475
+ | **Inconsistent** | 44 | 318 | **50.2%** |
476
+ | **Not in training** | 73 | 200 | **31.5%** |
477
+ | Consistent | 38 | 116 | 18.3% |
478
+ | **Total** | **155** | **634** | |
479
+
480
+ **81.7% of 4+ syllable test word occurrences are either absent from training or have conflicting annotations.** Only 18.3% have consistent, learnable segmentation patterns.
481
+
482
+ Among the 44 inconsistent words:
483
+ - **26 words** (99 occurrences): Training majority segmentation **differs** from test majority — the model learns the opposite of what the test expects
484
+ - **23 words** (269 occurrences): The **test set itself** has multiple segmentations for the same phrase
485
+
486
+ #### Representative Examples
487
+
488
+ **Not in training** — the top error word "chủ nghĩa hợp hiến" (constitutionalism) appears 68 times in the test set as a single 4-syllable word but has zero occurrences in training. The model has no way to learn this segmentation:
489
+
490
+ | Source | Segmentation | Count |
491
+ |--------|-------------|-------|
492
+ | Test | chủ nghĩa hợp hiến (B I I I) | 68x |
493
+ | Test | chủ nghĩa \| hợp hiến (B I B I) | 3x |
494
+ | Train | *(not found)* | 0x |
495
+
496
+ **Train/test disagreement** — "Uỷ ban Thường vụ Quốc hội" (Standing Committee of the National Assembly) is segmented as three 2-syllable words in 72% of training occurrences, but as a single 6-syllable word in the test gold standard:
497
+
498
+ | Source | Segmentation | Count | % |
499
+ |--------|-------------|-------|---|
500
+ | Train | Uỷ ban \| Thường vụ \| Quốc hội (split) | 50x | 72% |
501
+ | Train | Uỷ ban Thường vụ Quốc hội (joined) | 19x | 28% |
502
+ | Test | Uỷ ban Thường vụ Quốc hội (joined) | 32x | 60% |
503
+ | Test | Uỷ ban \| Thường vụ \| Quốc hội (split) | 21x | 40% |
504
+
505
+ **Law name convention mismatch** — the test set treats law titles as single compound words ("Bộ luật hình sự" = Criminal Code), but training data consistently splits them:
506
+
507
+ | Word | Train majority | Test majority |
508
+ |------|---------------|---------------|
509
+ | Bộ luật hình sự | Bộ \| luật hình sự (2x, 100%) | Bộ luật hình sự (24x) |
510
+ | Bộ luật tố tụng hình sự | Bộ \| luật tố tụng hình sự (9x, 90%) | Bộ luật tố tụng hình sự (1x) |
511
+ | Luật hợp tác xã | Luật \| hợp tác xã (4x, 100%) | Luật hợp tác xã (1x) |
512
+ | Luật ngân sách nhà nước | Luật \| ngân sách \| nhà nước (4x, 100%) | Luật ngân sách nhà nước (1x) |
513
+
514
+ #### Implications
515
+
516
+ 1. **The 45–55% error rate on 4+ syllable words is primarily an annotation consistency problem, not a model limitation.** The CRF faithfully learns training data patterns, but those patterns contradict the test gold standard for the majority of long compound words.
517
+
518
+ 2. **The test set itself is inconsistent** for 23 words (269 occurrences). Even a theoretically perfect model cannot achieve 100% accuracy on these sequences, as the gold standard labels the same phrase differently at different points.
519
+
520
+ 3. **Domain-specific legal terms** are the worst affected. The VLSP 2013 test set comes from a legal domain with specialized conventions for compound terms (law names, institutional names, legal concepts), while the training data — which covers broader domains — applies different segmentation rules to these same terms.
521
+
522
+ 4. **Improving model accuracy beyond ~98% word F1 on VLSP 2013 likely requires annotation cleanup** rather than feature engineering or model improvements. The theoretical ceiling for 4+ syllable words is constrained by annotation quality.
523
 
524
  ---
525
 
 
732
 
733
  All CRF models use the same training configuration:
734
 
735
+ | Parameter | POS | WS (VLSP 2013) | Description |
736
+ |-----------|-----|----------------|-------------|
737
+ | Algorithm | lbfgs | lbfgs | Limited-memory BFGS optimization |
738
+ | c1 | 1.0 | 0.5 | L1 regularization coefficient |
739
+ | c2 | 0.001 | 0.001 | L2 regularization coefficient |
740
+ | max_iterations | 100 | 300 | Maximum training iterations |
741
+ | feature.possible_transitions | True | True | Include all possible transitions |
742
 
743
  ### 8.2 Trainer Backends
744
 
 
773
  +-- scripts/
774
  | +-- train.py # POS training script
775
  | +-- train_word_segmentation.py # WS training script
776
+ | +-- evaluate.py # POS evaluation with metrics & plots
777
+ | +-- evaluate_word_segmentation.py # WS error analysis
778
  | +-- predict.py # POS inference CLI
779
  | +-- predict_word_segmentation.py # WS inference CLI
780
  +-- results/
 
809
  3. **Context Limitation**: CRF window size (+-2 tokens) may miss long-range dependencies
810
  4. **Domain Variation**: Legal and news domains have different vocabulary distributions
811
 
812
+ ### 9.3 Word Segmentation Errors
813
+
814
+ See Section 4.7 for detailed error analysis on VLSP 2013. Key findings: false splits (I→B) outnumber false joins (B→I) 2.2:1, error rate scales sharply with word length (99.00% accuracy for 1-syllable words but only 55.03% for 4-syllable words), and most errors concentrate on domain-specific legal compound words. The external dictionary reduced total syllable errors by 11.1% compared to the baseline.
815
 
816
+ ### 9.4 Error Propagation in Pipeline
817
+
818
+ Word segmentation errors propagate downstream. A segmentation error (e.g., splitting "bảo hành" into two words) causes cascading POS errors and would affect chunking and parsing. TRE-1 WS achieves 98.01% word F1 on UDD-1 and 97.62% on VLSP 2013, limiting this propagation effect.
819
 
820
  ---
821
 
 
823
 
824
  | Task | Best Non-Neural | Best Neural | Gap | CPU Viability |
825
  |------|----------------|-------------|-----|---------------|
826
+ | Word Segmentation | 98.06% F1 (SVM) | 97.90% F1 (jPTDP) | **+0.16%** (TRE-1: 97.62%) | Excellent |
827
  | POS Tagging | 95.88% acc (CRF) | 97.2% acc (DeBERTa) | -1.32% | Good |
828
  | Chunking (English) | 95.23% F1 (HMM) | 94.46% F1 (BiLSTM) | **+0.77%** | Excellent |
829
  | Dep Parsing (Vietnamese) | 76.58% UAS (MST) | 85.47% UAS (PhoBERT) | -8.89% | Moderate |
 
903
 
904
  ### 12.2 Vietnamese Word Segmentation
905
 
906
+ Nguyen et al. (2006) established the CRF approach for Vietnamese word segmentation using syllable-level features. UITws-v1 (Nguyen et al., 2019) achieved the current SOTA (98.06% F1 on VLSP 2013) using SVM with ambiguity reduction and suffix features. RDRsegmenter (Vu et al., 2018) achieves 97.90% with rule-based decision trees. TRE-1 follows the CRF BIO tagging approach of Nguyen et al. (2006), achieving 98.01% word F1 on UDD-1 and 97.62% on VLSP 2013 with external dictionary features.
907
 
908
  ### 12.3 Vietnamese POS Tagging
909
 
 
959
 
960
  7. **Vietnamese Chunking Data**: Very limited annotated corpora for Vietnamese chunking makes evaluation difficult.
961
 
962
+ 8. **VLSP 2013 Annotation Inconsistency**: The VLSP 2013 WTK dataset has significant annotation inconsistencies for 4+ syllable words — 81.7% of test occurrences are either absent from training or have conflicting segmentations between train and test (see Section 4.8). This limits achievable accuracy on long compound words regardless of model quality.
963
+
964
  ---
965
 
966
  ## 14. Future Work
967
 
968
  ### 14.1 Implemented Tasks
969
+ 1. **VLSP 2013 POS Evaluation**: Evaluate POS tagging on the standard VLSP 2013 benchmark for direct comparison (WS evaluation completed: 97.62% word F1)
970
  2. **Manual Annotation Verification**: Sample-based quality assessment of UDD-1 annotations
971
  3. **Multi-domain Training**: Include social media, conversational, and literary data
972
 
 
1062
 
1063
  TRE-1 is a Vietnamese NLP pipeline using CRF and non-neural methods designed for CPU inference. The implemented components achieve competitive results:
1064
 
1065
+ - **Word Segmentation**: 98.01% word F1 on UDD-1; 97.62% word F1 on VLSP 2013 (within 0.44% of non-neural SOTA)
1066
  - **POS Tagging**: 95.89% accuracy (matching the best CRF-based Vietnamese tagger)
1067
 
1068
  The pipeline architecture (WS -> POS -> Chunk -> DP) is validated by prior work and designed for modularity, interpretability, and efficiency. Chunking and dependency parsing are planned as next steps, with CRF for chunking and transition/graph-based methods for parsing.
 
1159
  | `S[-1,0,1]` | Trigram |
1160
  | `.ispunct` | Is punctuation |
1161
  | `.len` | Syllable length |
1162
+ | `.in_dict` | Longest dictionary match (external Viet74K) |
1163
 
1164
  ### B. Universal POS Tags
1165
 
 
1197
  | 1.0 | 2025-01-31 | UDD-v0.1 (3K) | POS | Accuracy | 95.57% |
1198
  | **1.1** | **2026-01-31** | **UDD-1 (20K)** | **POS** | **Accuracy** | **95.89%** |
1199
  | **1.1** | **2026-01-31** | **UDD-1 (20K)** | **WS** | **Word F1** | **98.01%** |
1200
+ | 1.2 | 2026-02-08 | VLSP 2013 (75K) | WS | Word F1 | 97.17% |
1201
+ | 1.3 | 2026-02-08 | VLSP 2013 (75K) | WS | Word F1 | 97.36% |
1202
+ | **1.4** | **2026-02-08** | **VLSP 2013 (75K)** | **WS** | **Word F1** | **97.62%** |
1203
 
1204
  ---
1205
 
1206
  *Report generated: February 8, 2026*
1207
  *Model: undertheseanlp/tre-1*
1208
+ *Version: 1.4*
models/word_segmentation/vlsp2013/dictionary.txt ADDED
The diff for this file is too large to render. See raw diff
 
models/word_segmentation/vlsp2013/metadata.yaml CHANGED
@@ -1,7 +1,7 @@
1
  model:
2
  name: Vietnamese Word Segmentation
3
  type: CRF (Conditional Random Field)
4
- framework: underthesea-core
5
  tagging_scheme: BIO
6
  training:
7
  dataset: VLSP-2013-WTK
@@ -12,9 +12,9 @@ training:
12
  test_sentences: 2120
13
  test_syllables: 96457
14
  hyperparameters:
15
- c1: 1.0
16
  c2: 0.001
17
- max_iterations: 100
18
  feature_groups:
19
  - form
20
  - type
@@ -23,7 +23,8 @@ training:
23
  - right
24
  - bigram
25
  - trigram
26
- num_feature_templates: 20
 
27
  feature_templates:
28
  - S[0]
29
  - S[0].lower
@@ -45,16 +46,18 @@ training:
45
  - S[-1,0]
46
  - S[0,1]
47
  - S[-1,0,1]
48
- duration_seconds: 412.7
 
 
49
  performance:
50
- syllable_accuracy: 0.9852
51
- syllable_f1: 0.9851
52
- word_precision: 0.9664
53
- word_recall: 0.977
54
- word_f1: 0.9717
55
  environment:
56
  platform: Linux
57
  cpu_model: Unknown
58
  python_version: 3.12.3
59
- created_at: '2026-02-08 01:00:36'
60
  author: undertheseanlp
 
1
  model:
2
  name: Vietnamese Word Segmentation
3
  type: CRF (Conditional Random Field)
4
+ framework: python-crfsuite
5
  tagging_scheme: BIO
6
  training:
7
  dataset: VLSP-2013-WTK
 
12
  test_sentences: 2120
13
  test_syllables: 96457
14
  hyperparameters:
15
+ c1: 0.5
16
  c2: 0.001
17
+ max_iterations: 300
18
  feature_groups:
19
  - form
20
  - type
 
23
  - right
24
  - bigram
25
  - trigram
26
+ - dictionary
27
+ num_feature_templates: 22
28
  feature_templates:
29
  - S[0]
30
  - S[0].lower
 
46
  - S[-1,0]
47
  - S[0,1]
48
  - S[-1,0,1]
49
+ - S[-1,0].in_dict
50
+ - S[0,1].in_dict
51
+ duration_seconds: 1115.14
52
  performance:
53
+ syllable_accuracy: 0.9878
54
+ syllable_f1: 0.9877
55
+ word_precision: 0.9729
56
+ word_recall: 0.9794
57
+ word_f1: 0.9762
58
  environment:
59
  platform: Linux
60
  cpu_model: Unknown
61
  python_version: 3.12.3
62
+ created_at: '2026-02-08 12:48:49'
63
  author: undertheseanlp
models/word_segmentation/vlsp2013/{model.crf → model.crfsuite} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:dac520463652e2fde942bb9ea4ce8661f8fb60c195f041d966cf453c88c59b90
3
- size 137434620
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a56555687a9682708d738d741f3d062583fec1ec1c1663a4500dcb408d0eca9a
3
+ size 4411636
results/word_segmentation/4syl_consistency_analysis.txt ADDED
@@ -0,0 +1,1151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ========================================================================================================================
2
+ ALL 4+ SYLLABLE TEST WORDS: TRAIN vs TEST SEGMENTATION
3
+ Total unique (case-insensitive): 155
4
+ ========================================================================================================================
5
+
6
+ ========================================================================================================================
7
+ 4-SYLLABLE WORDS (94 unique, 487 test occurrences)
8
+ ========================================================================================================================
9
+
10
+ [ INCONSISTENT] "xã hội chủ nghĩa" (4-syl)
11
+ Test as gold word: 70x | Sequence in test: 85x | Sequence in train: 50x
12
+ TRAIN segmentations:
13
+ 32x ( 64.0%) B I I I → [xã hội chủ nghĩa]
14
+ 17x ( 34.0%) I I I I → [xã hội chủ nghĩa]
15
+ 1x ( 2.0%) B I B I → [xã hội | chủ nghĩa]
16
+ TEST segmentations:
17
+ 70x ( 82.4%) B I I I → [xã hội chủ nghĩa]
18
+ 13x ( 15.3%) I I I I → [xã hội chủ nghĩa]
19
+ 2x ( 2.4%) B I B I → [xã hội | chủ nghĩa]
20
+
21
+ [ NOT_IN_TRAIN] "chủ nghĩa hợp hiến" (4-syl)
22
+ Test as gold word: 68x | Sequence in test: 71x | Sequence in train: 0x
23
+ TRAIN: *** NOT FOUND ***
24
+ TEST segmentations:
25
+ 68x ( 95.8%) B I I I → [chủ nghĩa hợp hiến]
26
+ 3x ( 4.2%) B I B I → [chủ nghĩa | hợp hiến]
27
+
28
+ [ INCONSISTENT] "quy phạm pháp luật" (4-syl)
29
+ Test as gold word: 46x | Sequence in test: 52x | Sequence in train: 23x
30
+ TRAIN segmentations:
31
+ 20x ( 87.0%) B I I I → [quy phạm pháp luật]
32
+ 3x ( 13.0%) I I I I → [quy phạm pháp luật]
33
+ TEST segmentations:
34
+ 46x ( 88.5%) B I I I → [quy phạm pháp luật]
35
+ 6x ( 11.5%) I I I I → [quy phạm pháp luật]
36
+
37
+ [ INCONSISTENT] "bộ luật hình sự" (4-syl)
38
+ Test as gold word: 29x | Sequence in test: 32x | Sequence in train: 2x
39
+ TRAIN segmentations:
40
+ 2x (100.0%) B B I I → [bộ | luật hình sự]
41
+ TEST segmentations:
42
+ 29x ( 90.6%) B I I I → [bộ luật hình sự]
43
+ 3x ( 9.4%) B I B I → [bộ luật | hình sự]
44
+
45
+ [ CONSISTENT] "kinh tế thị trường" (4-syl)
46
+ Test as gold word: 24x | Sequence in test: 25x | Sequence in train: 50x
47
+ TRAIN segmentations:
48
+ 50x (100.0%) B I I I → [kinh tế thị trường]
49
+ TEST segmentations:
50
+ 24x ( 96.0%) B I I I → [kinh tế thị trường]
51
+ 1x ( 4.0%) B I B I → [kinh tế | thị trường]
52
+
53
+ [ INCONSISTENT] "quản lí nhà nước" (4-syl)
54
+ Test as gold word: 22x | Sequence in test: 25x | Sequence in train: 21x
55
+ TRAIN segmentations:
56
+ 17x ( 81.0%) B I I I → [quản lí nhà nước]
57
+ 4x ( 19.0%) B I B I → [quản lí | nhà nước]
58
+ TEST segmentations:
59
+ 22x ( 88.0%) B I I I → [quản lí nhà nước]
60
+ 3x ( 12.0%) B I B I → [quản lí | nhà nước]
61
+
62
+ [ NOT_IN_TRAIN] "phi hình sự hoá" (4-syl)
63
+ Test as gold word: 22x | Sequence in test: 22x | Sequence in train: 0x
64
+ TRAIN: *** NOT FOUND ***
65
+ TEST segmentations:
66
+ 22x (100.0%) B I I I → [phi hình sự hoá]
67
+
68
+ [ CONSISTENT] "hội đồng nhân dân" (4-syl)
69
+ Test as gold word: 16x | Sequence in test: 16x | Sequence in train: 38x
70
+ TRAIN segmentations:
71
+ 38x (100.0%) B I I I → [hội đồng nhân dân]
72
+ TEST segmentations:
73
+ 16x (100.0%) B I I I → [hội đồng nhân dân]
74
+
75
+ [ INCONSISTENT] "cơ quan hành chính" (4-syl)
76
+ Test as gold word: 16x | Sequence in test: 16x | Sequence in train: 25x
77
+ TRAIN segmentations:
78
+ 14x ( 56.0%) B I I I → [cơ quan hành chính]
79
+ 11x ( 44.0%) B I B I → [cơ quan | hành chính]
80
+ TEST segmentations:
81
+ 16x (100.0%) B I I I → [cơ quan hành chính]
82
+
83
+ [ NOT_IN_TRAIN] "phi tội phạm hoá" (4-syl)
84
+ Test as gold word: 11x | Sequence in test: 11x | Sequence in train: 0x
85
+ TRAIN: *** NOT FOUND ***
86
+ TEST segmentations:
87
+ 11x (100.0%) B I I I → [phi tội phạm hoá]
88
+
89
+ [ INCONSISTENT] "sở hữu trí tuệ" (4-syl)
90
+ Test as gold word: 9x | Sequence in test: 10x | Sequence in train: 23x
91
+ TRAIN segmentations:
92
+ 19x ( 82.6%) B I I I → [sở hữu trí tuệ]
93
+ 4x ( 17.4%) I I B I → [sở hữu | trí tuệ]
94
+ TEST segmentations:
95
+ 9x ( 90.0%) B I I I → [sở hữu trí tuệ]
96
+ 1x ( 10.0%) I I I I → [sở hữu trí tuệ]
97
+
98
+ [ INCONSISTENT] "công nghệ thông tin" (4-syl)
99
+ Test as gold word: 7x | Sequence in test: 7x | Sequence in train: 98x
100
+ TRAIN segmentations:
101
+ 96x ( 98.0%) B I I I → [công nghệ thông tin]
102
+ 2x ( 2.0%) B I B I → [công nghệ | thông tin]
103
+ TEST segmentations:
104
+ 7x (100.0%) B I I I → [công nghệ thông tin]
105
+
106
+ [ NOT_IN_TRAIN] "trưng cầu dân ý" (4-syl)
107
+ Test as gold word: 6x | Sequence in test: 6x | Sequence in train: 0x
108
+ TRAIN: *** NOT FOUND ***
109
+ TEST segmentations:
110
+ 6x (100.0%) B I I I → [trưng cầu dân ý]
111
+
112
+ [ CONSISTENT] "chủ nghĩa xã hội" (4-syl)
113
+ Test as gold word: 6x | Sequence in test: 6x | Sequence in train: 10x
114
+ TRAIN segmentations:
115
+ 10x (100.0%) B I I I → [chủ nghĩa xã hội]
116
+ TEST segmentations:
117
+ 6x (100.0%) B I I I → [chủ nghĩa xã hội]
118
+
119
+ [ CONSISTENT] "uỷ ban nhân dân" (4-syl)
120
+ Test as gold word: 6x | Sequence in test: 6x | Sequence in train: 23x
121
+ TRAIN segmentations:
122
+ 23x (100.0%) B I I I → [uỷ ban nhân dân]
123
+ TEST segmentations:
124
+ 6x (100.0%) B I I I → [uỷ ban nhân dân]
125
+
126
+ [ CONSISTENT] "lực lượng sản xuất" (4-syl)
127
+ Test as gold word: 5x | Sequence in test: 5x | Sequence in train: 8x
128
+ TRAIN segmentations:
129
+ 8x (100.0%) B I I I → [lực lượng sản xuất]
130
+ TEST segmentations:
131
+ 5x (100.0%) B I I I → [lực lượng sản xuất]
132
+
133
+ [ INCONSISTENT] "cơ chế thị trường" (4-syl)
134
+ Test as gold word: 5x | Sequence in test: 6x | Sequence in train: 23x
135
+ TRAIN segmentations:
136
+ 21x ( 91.3%) B I I I → [cơ chế thị trường]
137
+ 2x ( 8.7%) B I B I → [cơ chế | thị trường]
138
+ TEST segmentations:
139
+ 5x ( 83.3%) B I I I → [cơ chế thị trường]
140
+ 1x ( 16.7%) B I B I → [cơ chế | thị trường]
141
+
142
+ [ CONSISTENT] "kinh tế hàng hoá" (4-syl)
143
+ Test as gold word: 5x | Sequence in test: 5x | Sequence in train: 5x
144
+ TRAIN segmentations:
145
+ 5x (100.0%) B I I I → [kinh tế hàng hoá]
146
+ TEST segmentations:
147
+ 5x (100.0%) B I I I → [kinh tế hàng hoá]
148
+
149
+ [ NOT_IN_TRAIN] "chuyên chính vô sản" (4-syl)
150
+ Test as gold word: 4x | Sequence in test: 4x | Sequence in train: 0x
151
+ TRAIN: *** NOT FOUND ***
152
+ TEST segmentations:
153
+ 4x (100.0%) B I I I → [chuyên chính vô sản]
154
+
155
+ [ CONSISTENT] "cải cách ruộng đất" (4-syl)
156
+ Test as gold word: 4x | Sequence in test: 4x | Sequence in train: 4x
157
+ TRAIN segmentations:
158
+ 4x (100.0%) B I I I → [cải cách ruộng đất]
159
+ TEST segmentations:
160
+ 4x (100.0%) B I I I → [cải cách ruộng đất]
161
+
162
+ [ INCONSISTENT] "uỷ ban pháp luật" (4-syl)
163
+ Test as gold word: 4x | Sequence in test: 9x | Sequence in train: 16x
164
+ TRAIN segmentations:
165
+ 15x ( 93.8%) B I B I → [uỷ ban | pháp luật]
166
+ 1x ( 6.2%) B I I I → [uỷ ban pháp luật]
167
+ TEST segmentations:
168
+ 5x ( 55.6%) B I B I → [uỷ ban | pháp luật]
169
+ 4x ( 44.4%) B I I I → [uỷ ban pháp luật]
170
+
171
+ [ INCONSISTENT] "hội đồng dân tộc" (4-syl)
172
+ Test as gold word: 4x | Sequence in test: 11x | Sequence in train: 9x
173
+ TRAIN segmentations:
174
+ 8x ( 88.9%) B I B I → [hội đồng | dân tộc]
175
+ 1x ( 11.1%) B I I I → [hội đồng dân tộc]
176
+ TEST segmentations:
177
+ 7x ( 63.6%) B I B I → [hội đồng | dân tộc]
178
+ 4x ( 36.4%) B I I I → [hội đồng dân tộc]
179
+
180
+ [ INCONSISTENT] "bộ luật dân sự" (4-syl)
181
+ Test as gold word: 3x | Sequence in test: 5x | Sequence in train: 10x
182
+ TRAIN segmentations:
183
+ 4x ( 40.0%) B I B I → [bộ luật | dân sự]
184
+ 4x ( 40.0%) B B I I → [bộ | luật dân sự]
185
+ 2x ( 20.0%) B I I I → [bộ luật dân sự]
186
+ TEST segmentations:
187
+ 3x ( 60.0%) B I I I → [bộ luật dân sự]
188
+ 2x ( 40.0%) B I B I → [bộ luật | dân sự]
189
+
190
+ [ CONSISTENT] "tam quyền phân lập" (4-syl)
191
+ Test as gold word: 3x | Sequence in test: 3x | Sequence in train: 1x
192
+ TRAIN segmentations:
193
+ 1x (100.0%) B I I I → [tam quyền phân lập]
194
+ TEST segmentations:
195
+ 3x (100.0%) B I I I → [tam quyền phân lập]
196
+
197
+ [ NOT_IN_TRAIN] "tuyên ngôn độc lập" (4-syl)
198
+ Test as gold word: 3x | Sequence in test: 4x | Sequence in train: 0x
199
+ TRAIN: *** NOT FOUND ***
200
+ TEST segmentations:
201
+ 3x ( 75.0%) B I I I → [tuyên ngôn độc lập]
202
+ 1x ( 25.0%) B I B I → [tuyên ngôn | độc lập]
203
+
204
+ [ CONSISTENT] "bất khả xâm phạm" (4-syl)
205
+ Test as gold word: 3x | Sequence in test: 3x | Sequence in train: 10x
206
+ TRAIN segmentations:
207
+ 10x (100.0%) B I I I → [bất khả xâm phạm]
208
+ TEST segmentations:
209
+ 3x (100.0%) B I I I → [bất khả xâm phạm]
210
+
211
+ [ NOT_IN_TRAIN] "đấu tranh giai cấp" (4-syl)
212
+ Test as gold word: 3x | Sequence in test: 3x | Sequence in train: 0x
213
+ TRAIN: *** NOT FOUND ***
214
+ TEST segmentations:
215
+ 3x (100.0%) B I I I → [đấu tranh giai cấp]
216
+
217
+ [ CONSISTENT] "cơ quan dân cử" (4-syl)
218
+ Test as gold word: 3x | Sequence in test: 3x | Sequence in train: 3x
219
+ TRAIN segmentations:
220
+ 3x (100.0%) B I I I → [cơ quan dân cử]
221
+ TEST segmentations:
222
+ 3x (100.0%) B I I I → [cơ quan dân cử]
223
+
224
+ [ NOT_IN_TRAIN] "tập trung dân chủ" (4-syl)
225
+ Test as gold word: 3x | Sequence in test: 3x | Sequence in train: 0x
226
+ TRAIN: *** NOT FOUND ***
227
+ TEST segmentations:
228
+ 3x (100.0%) B I I I → [tập trung dân chủ]
229
+
230
+ [ CONSISTENT] "hình thái kinh tế" (4-syl)
231
+ Test as gold word: 2x | Sequence in test: 2x | Sequence in train: 1x
232
+ TRAIN segmentations:
233
+ 1x (100.0%) B I I I → [hình thái kinh tế]
234
+ TEST segmentations:
235
+ 2x (100.0%) B I I I → [hình thái kinh tế]
236
+
237
+ [ INCONSISTENT] "cơ sở vật chất" (4-syl)
238
+ Test as gold word: 2x | Sequence in test: 3x | Sequence in train: 53x
239
+ TRAIN segmentations:
240
+ 38x ( 71.7%) B I B I → [cơ sở | vật chất]
241
+ 15x ( 28.3%) B I I I → [cơ sở vật chất]
242
+ TEST segmentations:
243
+ 2x ( 66.7%) B I I I → [cơ sở vật chất]
244
+ 1x ( 33.3%) B I B I → [cơ sở | vật chất]
245
+
246
+ [ INCONSISTENT] "dân tộc thiểu số" (4-syl)
247
+ Test as gold word: 2x | Sequence in test: 2x | Sequence in train: 48x
248
+ TRAIN segmentations:
249
+ 46x ( 95.8%) B I I I → [dân tộc thiểu số]
250
+ 2x ( 4.2%) B I B I → [dân tộc | thiểu số]
251
+ TEST segmentations:
252
+ 2x (100.0%) B I I I → [dân tộc thiểu số]
253
+
254
+ [ CONSISTENT] "xây dựng cơ bản" (4-syl)
255
+ Test as gold word: 2x | Sequence in test: 2x | Sequence in train: 66x
256
+ TRAIN segmentations:
257
+ 66x (100.0%) B I I I → [xây dựng cơ bản]
258
+ TEST segmentations:
259
+ 2x (100.0%) B I I I → [xây dựng cơ bản]
260
+
261
+ [ CONSISTENT] "chế độ quân chủ" (4-syl)
262
+ Test as gold word: 2x | Sequence in test: 7x | Sequence in train: 3x
263
+ TRAIN segmentations:
264
+ 3x (100.0%) B I I I → [chế độ quân chủ]
265
+ TEST segmentations:
266
+ 6x ( 85.7%) B I I I → [chế độ quân chủ]
267
+ 1x ( 14.3%) B I B I → [chế độ | quân chủ]
268
+
269
+ [ NOT_IN_TRAIN] "tinh thần pháp luật" (4-syl)
270
+ Test as gold word: 2x | Sequence in test: 2x | Sequence in train: 0x
271
+ TRAIN: *** NOT FOUND ***
272
+ TEST segmentations:
273
+ 2x (100.0%) B I I I → [tinh thần pháp luật]
274
+
275
+ [ NOT_IN_TRAIN] "khế ước xã hội" (4-syl)
276
+ Test as gold word: 2x | Sequence in test: 3x | Sequence in train: 0x
277
+ TRAIN: *** NOT FOUND ***
278
+ TEST segmentations:
279
+ 2x ( 66.7%) B I I I → [khế ước xã hội]
280
+ 1x ( 33.3%) B I B I → [khế ước | xã hội]
281
+
282
+ [ NOT_IN_TRAIN] "chế độ một viện" (4-syl)
283
+ Test as gold word: 2x | Sequence in test: 2x | Sequence in train: 0x
284
+ TRAIN: *** NOT FOUND ***
285
+ TEST segmentations:
286
+ 2x (100.0%) B I I I → [chế độ một viện]
287
+
288
+ [ CONSISTENT] "quốc kế dân sinh" (4-syl)
289
+ Test as gold word: 2x | Sequence in test: 2x | Sequence in train: 1x
290
+ TRAIN segmentations:
291
+ 1x (100.0%) B I I I → [quốc kế dân sinh]
292
+ TEST segmentations:
293
+ 2x (100.0%) B I I I → [quốc kế dân sinh]
294
+
295
+ [ INCONSISTENT] "cách mạng tháng tám" (4-syl)
296
+ Test as gold word: 2x | Sequence in test: 5x | Sequence in train: 39x
297
+ TRAIN segmentations:
298
+ 30x ( 76.9%) B I I I → [cách mạng tháng tám]
299
+ 9x ( 23.1%) B I B I → [cách mạng | tháng tám]
300
+ TEST segmentations:
301
+ 3x ( 60.0%) B I B B → [cách mạng | tháng | tám]
302
+ 2x ( 40.0%) B I I I → [cách mạng tháng tám]
303
+
304
+ [ NOT_IN_TRAIN] "cách mạng tư sản" (4-syl)
305
+ Test as gold word: 2x | Sequence in test: 2x | Sequence in train: 0x
306
+ TRAIN: *** NOT FOUND ***
307
+ TEST segmentations:
308
+ 2x (100.0%) B I I I → [cách mạng tư sản]
309
+
310
+ [ CONSISTENT] "trưng cầu ý dân" (4-syl)
311
+ Test as gold word: 2x | Sequence in test: 2x | Sequence in train: 3x
312
+ TRAIN segmentations:
313
+ 3x (100.0%) B I I I → [trưng cầu ý dân]
314
+ TEST segmentations:
315
+ 2x (100.0%) B I I I → [trưng cầu ý dân]
316
+
317
+ [ NOT_IN_TRAIN] "ăn miếng, trả miếng" (4-syl)
318
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
319
+ TRAIN: *** NOT FOUND ***
320
+ TEST segmentations:
321
+ 1x (100.0%) B I I I → [ăn miếng, trả miếng]
322
+
323
+ [ NOT_IN_TRAIN] "tồn tại xã hội" (4-syl)
324
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
325
+ TRAIN: *** NOT FOUND ***
326
+ TEST segmentations:
327
+ 1x (100.0%) B I I I → [tồn tại xã hội]
328
+
329
+ [ NOT_IN_TRAIN] "cộng sản nguyên thuỷ" (4-syl)
330
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
331
+ TRAIN: *** NOT FOUND ***
332
+ TEST segmentations:
333
+ 1x (100.0%) B I I I → [cộng sản nguyên thuỷ]
334
+
335
+ [ NOT_IN_TRAIN] "chế độ tư hữu" (4-syl)
336
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
337
+ TRAIN: *** NOT FOUND ***
338
+ TEST segmentations:
339
+ 1x (100.0%) B I I I → [chế độ tư hữu]
340
+
341
+ [ CONSISTENT] "quan hệ sản xuất" (4-syl)
342
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 1x
343
+ TRAIN segmentations:
344
+ 1x (100.0%) B I I I → [quan hệ sản xuất]
345
+ TEST segmentations:
346
+ 1x (100.0%) B I I I → [quan hệ sản xuất]
347
+
348
+ [ NOT_IN_TRAIN] "tư bản chủ nghĩa" (4-syl)
349
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
350
+ TRAIN: *** NOT FOUND ***
351
+ TEST segmentations:
352
+ 1x (100.0%) B I I I → [tư bản chủ nghĩa]
353
+
354
+ [ CONSISTENT] "tội phạm chiến tranh" (4-syl)
355
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 2x
356
+ TRAIN segmentations:
357
+ 2x (100.0%) B I I I → [tội phạm chiến tranh]
358
+ TEST segmentations:
359
+ 1x (100.0%) B I I I → [tội phạm chiến tranh]
360
+
361
+ [ CONSISTENT] "thượng tầng kiến trúc" (4-syl)
362
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 2x
363
+ TRAIN segmentations:
364
+ 2x (100.0%) B I I I → [thượng tầng kiến trúc]
365
+ TEST segmentations:
366
+ 1x (100.0%) B I I I → [thượng tầng kiến trúc]
367
+
368
+ [ CONSISTENT] "phổ thông trung học" (4-syl)
369
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 4x
370
+ TRAIN segmentations:
371
+ 4x (100.0%) B I I I → [phổ thông trung học]
372
+ TEST segmentations:
373
+ 1x (100.0%) B I I I → [phổ thông trung học]
374
+
375
+ [ NOT_IN_TRAIN] "giáo dục công dân" (4-syl)
376
+ Test as gold word: 1x | Sequence in test: 2x | Sequence in train: 0x
377
+ TRAIN: *** NOT FOUND ***
378
+ TEST segmentations:
379
+ 1x ( 50.0%) B I B I → [giáo dục | công dân]
380
+ 1x ( 50.0%) B I I I → [giáo dục công dân]
381
+
382
+ [ NOT_IN_TRAIN] "đe doạ xâm hại" (4-syl)
383
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
384
+ TRAIN: *** NOT FOUND ***
385
+ TEST segmentations:
386
+ 1x (100.0%) B I I I → [đe doạ xâm hại]
387
+
388
+ [ CONSISTENT] "hành lang pháp lí" (4-syl)
389
+ Test as gold word: 1x | Sequence in test: 2x | Sequence in train: 2x
390
+ TRAIN segmentations:
391
+ 2x (100.0%) B I I I → [hành lang pháp lí]
392
+ TEST segmentations:
393
+ 1x ( 50.0%) B I I I → [hành lang pháp lí]
394
+ 1x ( 50.0%) B I B I → [hành lang | pháp lí]
395
+
396
+ [ NOT_IN_TRAIN] "tâm địa thực dân" (4-syl)
397
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
398
+ TRAIN: *** NOT FOUND ***
399
+ TEST segmentations:
400
+ 1x (100.0%) B I I I → [tâm địa thực dân]
401
+
402
+ [ NOT_IN_TRAIN] "vực thẳm thuộc địa" (4-syl)
403
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
404
+ TRAIN: *** NOT FOUND ***
405
+ TEST segmentations:
406
+ 1x (100.0%) B I I I → [vực thẳm thuộc địa]
407
+
408
+ [ NOT_IN_TRAIN] "ưu thời mẫn thế" (4-syl)
409
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
410
+ TRAIN: *** NOT FOUND ***
411
+ TEST segmentations:
412
+ 1x (100.0%) B I I I → [ưu thời mẫn thế]
413
+
414
+ [ CONSISTENT] "chủ nghĩa cộng sản" (4-syl)
415
+ Test as gold word: 1x | Sequence in test: 2x | Sequence in train: 1x
416
+ TRAIN segmentations:
417
+ 1x (100.0%) B I I I → [chủ nghĩa cộng sản]
418
+ TEST segmentations:
419
+ 1x ( 50.0%) B I I I → [chủ nghĩa cộng sản]
420
+ 1x ( 50.0%) I I I I → [chủ nghĩa cộng sản]
421
+
422
+ [ CONSISTENT] "chế độ cộng hoà" (4-syl)
423
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 1x
424
+ TRAIN segmentations:
425
+ 1x (100.0%) B I I I → [chế độ cộng hoà]
426
+ TEST segmentations:
427
+ 1x (100.0%) B I I I → [chế độ cộng hoà]
428
+
429
+ [ NOT_IN_TRAIN] "vạn pháp tinh lí" (4-syl)
430
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
431
+ TRAIN: *** NOT FOUND ***
432
+ TEST segmentations:
433
+ 1x (100.0%) B I I I → [vạn pháp tinh lí]
434
+
435
+ [ NOT_IN_TRAIN] "đông kinh nghĩa thục" (4-syl)
436
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
437
+ TRAIN: *** NOT FOUND ***
438
+ TEST segmentations:
439
+ 1x (100.0%) B I I I → [đông kinh nghĩa thục]
440
+
441
+ [ NOT_IN_TRAIN] "quân chủ lập hiến" (4-syl)
442
+ Test as gold word: 1x | Sequence in test: 2x | Sequence in train: 0x
443
+ TRAIN: *** NOT FOUND ***
444
+ TEST segmentations:
445
+ 1x ( 50.0%) B I I I → [quân chủ lập hiến]
446
+ 1x ( 50.0%) I I I I → [quân chủ lập hiến]
447
+
448
+ [ CONSISTENT] "bất di bất dịch" (4-syl)
449
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 1x
450
+ TRAIN segmentations:
451
+ 1x (100.0%) B I I I → [bất di bất dịch]
452
+ TEST segmentations:
453
+ 1x (100.0%) B I I I → [bất di bất dịch]
454
+
455
+ [ NOT_IN_TRAIN] "quân trị chủ nghĩa" (4-syl)
456
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
457
+ TRAIN: *** NOT FOUND ***
458
+ TEST segmentations:
459
+ 1x (100.0%) B I I I → [quân trị chủ nghĩa]
460
+
461
+ [ NOT_IN_TRAIN] "dân trị chủ nghĩa" (4-syl)
462
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
463
+ TRAIN: *** NOT FOUND ***
464
+ TEST segmentations:
465
+ 1x (100.0%) B I I I → [dân trị chủ nghĩa]
466
+
467
+ [ CONSISTENT] "chế độ dân chủ" (4-syl)
468
+ Test as gold word: 1x | Sequence in test: 3x | Sequence in train: 1x
469
+ TRAIN segmentations:
470
+ 1x (100.0%) B I I I → [chế độ dân chủ]
471
+ TEST segmentations:
472
+ 2x ( 66.7%) B I I I → [chế độ dân chủ]
473
+ 1x ( 33.3%) I I I I → [chế độ dân chủ]
474
+
475
+ [ CONSISTENT] "xuất đầu lộ diện" (4-syl)
476
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 2x
477
+ TRAIN segmentations:
478
+ 2x (100.0%) B I I I → [xuất đầu lộ diện]
479
+ TEST segmentations:
480
+ 1x (100.0%) B I I I → [xuất đầu lộ diện]
481
+
482
+ [ CONSISTENT] "chủ nghĩa đế quốc" (4-syl)
483
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 1x
484
+ TRAIN segmentations:
485
+ 1x (100.0%) B I I I → [chủ nghĩa đế quốc]
486
+ TEST segmentations:
487
+ 1x (100.0%) B I I I → [chủ nghĩa đế quốc]
488
+
489
+ [ NOT_IN_TRAIN] "đại diện chính trị" (4-syl)
490
+ Test as gold word: 1x | Sequence in test: 2x | Sequence in train: 0x
491
+ TRAIN: *** NOT FOUND ***
492
+ TEST segmentations:
493
+ 1x ( 50.0%) B I B I → [đại diện | chính trị]
494
+ 1x ( 50.0%) B I I I → [đại diện chính trị]
495
+
496
+ [ NOT_IN_TRAIN] "chế độ đại nghị" (4-syl)
497
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
498
+ TRAIN: *** NOT FOUND ***
499
+ TEST segmentations:
500
+ 1x (100.0%) B I I I → [chế độ đại nghị]
501
+
502
+ [ NOT_IN_TRAIN] "hồi ký thanh nghị" (4-syl)
503
+ Test as gold word: 1x | Sequence in test: 2x | Sequence in train: 0x
504
+ TRAIN: *** NOT FOUND ***
505
+ TEST segmentations:
506
+ 1x ( 50.0%) B I B I → [hồi ký | thanh nghị]
507
+ 1x ( 50.0%) B I I I → [hồi ký thanh nghị]
508
+
509
+ [ NOT_IN_TRAIN] "tạp chí độc lập" (4-syl)
510
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
511
+ TRAIN: *** NOT FOUND ***
512
+ TEST segmentations:
513
+ 1x (100.0%) B I I I → [tạp chí độc lập]
514
+
515
+ [ NOT_IN_TRAIN] "nguyễn thị thục viên" (4-syl)
516
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
517
+ TRAIN: *** NOT FOUND ***
518
+ TEST segmentations:
519
+ 1x (100.0%) B I I I → [nguyễn thị thục viên]
520
+
521
+ [ CONSISTENT] "môi trường sinh thái" (4-syl)
522
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 14x
523
+ TRAIN segmentations:
524
+ 14x (100.0%) B I I I → [môi trường sinh thái]
525
+ TEST segmentations:
526
+ 1x (100.0%) B I I I → [môi trường sinh thái]
527
+
528
+ [ INCONSISTENT] "luật hợp tác xã" (4-syl)
529
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 4x
530
+ TRAIN segmentations:
531
+ 4x (100.0%) B B I I → [luật | hợp tác xã]
532
+ TEST segmentations:
533
+ 1x (100.0%) B I I I → [luật hợp tác xã]
534
+
535
+ [ CONSISTENT] "công ăn việc làm" (4-syl)
536
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 26x
537
+ TRAIN segmentations:
538
+ 26x (100.0%) B I I I → [công ăn việc làm]
539
+ TEST segmentations:
540
+ 1x (100.0%) B I I I → [công ăn việc làm]
541
+
542
+ [ CONSISTENT] "cơ quan chuyên môn" (4-syl)
543
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 9x
544
+ TRAIN segmentations:
545
+ 9x (100.0%) B I I I → [cơ quan chuyên môn]
546
+ TEST segmentations:
547
+ 1x (100.0%) B I I I → [cơ quan chuyên môn]
548
+
549
+ [ INCONSISTENT] "thị trường chứng khoán" (4-syl)
550
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 12x
551
+ TRAIN segmentations:
552
+ 11x ( 91.7%) B I I I → [thị trường chứng khoán]
553
+ 1x ( 8.3%) B I B I → [thị trường | chứng khoán]
554
+ TEST segmentations:
555
+ 1x (100.0%) B I I I → [thị trường chứng khoán]
556
+
557
+ [ INCONSISTENT] "văn phòng chính phủ" (4-syl)
558
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 48x
559
+ TRAIN segmentations:
560
+ 47x ( 97.9%) B I B I → [văn phòng | chính phủ]
561
+ 1x ( 2.1%) B I I I → [văn phòng chính phủ]
562
+ TEST segmentations:
563
+ 1x (100.0%) B I I I → [văn phòng chính phủ]
564
+
565
+ [ INCONSISTENT] "văn phòng quốc hội" (4-syl)
566
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 5x
567
+ TRAIN segmentations:
568
+ 5x (100.0%) B I B I → [văn phòng | quốc hội]
569
+ TEST segmentations:
570
+ 1x (100.0%) B I I I → [văn phòng quốc hội]
571
+
572
+ [ INCONSISTENT] "bộ luật lao động" (4-syl)
573
+ Test as gold word: 1x | Sequence in test: 2x | Sequence in train: 3x
574
+ TRAIN segmentations:
575
+ 3x (100.0%) B I B I → [bộ luật | lao động]
576
+ TEST segmentations:
577
+ 1x ( 50.0%) B I I I → [bộ luật lao động]
578
+ 1x ( 50.0%) B I B I → [bộ luật | lao động]
579
+
580
+ [ CONSISTENT] "xoá đói giảm nghèo" (4-syl)
581
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 60x
582
+ TRAIN segmentations:
583
+ 60x (100.0%) B I I I → [xoá đói giảm nghèo]
584
+ TEST segmentations:
585
+ 1x (100.0%) B I I I → [xoá đói giảm nghèo]
586
+
587
+ [ CONSISTENT] "chính sách xã hội" (4-syl)
588
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 8x
589
+ TRAIN segmentations:
590
+ 8x (100.0%) B I I I → [chính sách xã hội]
591
+ TEST segmentations:
592
+ 1x (100.0%) B I I I → [chính sách xã hội]
593
+
594
+ [ NOT_IN_TRAIN] "chủ nghĩa lập hiến" (4-syl)
595
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
596
+ TRAIN: *** NOT FOUND ***
597
+ TEST segmentations:
598
+ 1x (100.0%) B I I I → [chủ nghĩa lập hiến]
599
+
600
+ [ NOT_IN_TRAIN] "chủ nghĩa mác lê-nin" (4-syl)
601
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
602
+ TRAIN: *** NOT FOUND ***
603
+ TEST segmentations:
604
+ 1x (100.0%) B I I I → [chủ nghĩa mác lê-nin]
605
+
606
+ [ INCONSISTENT] "toà án nhân dân" (4-syl)
607
+ Test as gold word: 1x | Sequence in test: 26x | Sequence in train: 57x
608
+ TRAIN segmentations:
609
+ 50x ( 87.7%) B I B I → [toà án | nhân dân]
610
+ 7x ( 12.3%) B I I I → [toà án nhân dân]
611
+ TEST segmentations:
612
+ 23x ( 88.5%) B I B I → [toà án | nhân dân]
613
+ 3x ( 11.5%) B I I I → [toà án nhân dân]
614
+
615
+ [ CONSISTENT] "hội thẩm nhân dân" (4-syl)
616
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 18x
617
+ TRAIN segmentations:
618
+ 18x (100.0%) B I I I → [hội thẩm nhân dân]
619
+ TEST segmentations:
620
+ 1x (100.0%) B I I I → [hội thẩm nhân dân]
621
+
622
+ [ INCONSISTENT] "chế độ sở hữu" (4-syl)
623
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 2x
624
+ TRAIN segmentations:
625
+ 1x ( 50.0%) B I B I → [chế độ | sở hữu]
626
+ 1x ( 50.0%) B I I I → [chế độ sở hữu]
627
+ TEST segmentations:
628
+ 1x (100.0%) B I I I → [chế độ sở hữu]
629
+
630
+ [ INCONSISTENT] "quốc triều hình luật" (4-syl)
631
+ Test as gold word: 1x | Sequence in test: 3x | Sequence in train: 1x
632
+ TRAIN segmentations:
633
+ 1x (100.0%) B I B I → [quốc triều | hình luật]
634
+ TEST segmentations:
635
+ 2x ( 66.7%) B B B I → [quốc | triều | hình luật]
636
+ 1x ( 33.3%) B I I I → [quốc triều hình luật]
637
+
638
+ [ NOT_IN_TRAIN] "gạn đục khơi trong" (4-syl)
639
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
640
+ TRAIN: *** NOT FOUND ***
641
+ TEST segmentations:
642
+ 1x (100.0%) B I I I �� [gạn đục khơi trong]
643
+
644
+ [ CONSISTENT] "tư liệu sản xuất" (4-syl)
645
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 3x
646
+ TRAIN segmentations:
647
+ 3x (100.0%) B I I I → [tư liệu sản xuất]
648
+ TEST segmentations:
649
+ 1x (100.0%) B I I I → [tư liệu sản xuất]
650
+
651
+ [ NOT_IN_TRAIN] "phổ thông đầu phiếu" (4-syl)
652
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
653
+ TRAIN: *** NOT FOUND ***
654
+ TEST segmentations:
655
+ 1x (100.0%) B I I I → [phổ thông đầu phiếu]
656
+
657
+ [ NOT_IN_TRAIN] "đặc quyền đặc lợi" (4-syl)
658
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
659
+ TRAIN: *** NOT FOUND ***
660
+ TEST segmentations:
661
+ 1x (100.0%) B I I I → [đặc quyền đặc lợi]
662
+
663
+ [ CONSISTENT] "lã thị kim oanh" (4-syl)
664
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 28x
665
+ TRAIN segmentations:
666
+ 28x (100.0%) B I I I → [lã thị kim oanh]
667
+ TEST segmentations:
668
+ 1x (100.0%) B I I I → [lã thị kim oanh]
669
+
670
+ [ CONSISTENT] "lực lượng vũ trang" (4-syl)
671
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 29x
672
+ TRAIN segmentations:
673
+ 29x (100.0%) B I I I → [lực lượng vũ trang]
674
+ TEST segmentations:
675
+ 1x (100.0%) B I I I → [lực lượng vũ trang]
676
+
677
+ ========================================================================================================================
678
+ 5-SYLLABLE WORDS (19 unique, 37 test occurrences)
679
+ ========================================================================================================================
680
+
681
+ [ INCONSISTENT] "đảng cộng sản việt nam" (5-syl)
682
+ Test as gold word: 8x | Sequence in test: 9x | Sequence in train: 16x
683
+ TRAIN segmentations:
684
+ 11x ( 68.8%) B I I I I → [đảng cộng sản việt nam]
685
+ 2x ( 12.5%) B I I B I → [đảng cộng sản | việt nam]
686
+ 2x ( 12.5%) B B I B I → [đảng | cộng sản | việt nam]
687
+ 1x ( 6.2%) I I I I I → [đảng cộng sản việt nam]
688
+ TEST segmentations:
689
+ 8x ( 88.9%) B I I I I → [đảng cộng sản việt nam]
690
+ 1x ( 11.1%) B I I B I → [đảng cộng sản | việt nam]
691
+
692
+ [ NOT_IN_TRAIN] "quyền tự do dân chủ" (5-syl)
693
+ Test as gold word: 8x | Sequence in test: 8x | Sequence in train: 0x
694
+ TRAIN: *** NOT FOUND ***
695
+ TEST segmentations:
696
+ 8x (100.0%) B I I I I → [quyền tự do dân chủ]
697
+
698
+ [ NOT_IN_TRAIN] "phép vua thua lệ làng" (5-syl)
699
+ Test as gold word: 4x | Sequence in test: 4x | Sequence in train: 0x
700
+ TRAIN: *** NOT FOUND ***
701
+ TEST segmentations:
702
+ 4x (100.0%) B I I I I → [phép vua thua lệ làng]
703
+
704
+ [ NOT_IN_TRAIN] "một trăm năm mươi triệu" (5-syl)
705
+ Test as gold word: 2x | Sequence in test: 2x | Sequence in train: 0x
706
+ TRAIN: *** NOT FOUND ***
707
+ TEST segmentations:
708
+ 2x (100.0%) B I I I I → [một trăm năm mươi triệu]
709
+
710
+ [ NOT_IN_TRAIN] "hiệp định chung châu âu" (5-syl)
711
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
712
+ TRAIN: *** NOT FOUND ***
713
+ TEST segmentations:
714
+ 1x (100.0%) B I I I I → [hiệp định chung châu âu]
715
+
716
+ [ CONSISTENT] "luật biên giới quốc gia" (5-syl)
717
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 1x
718
+ TRAIN segmentations:
719
+ 1x (100.0%) B I I I I → [luật biên giới quốc gia]
720
+ TEST segmentations:
721
+ 1x (100.0%) B I I I I → [luật biên giới quốc gia]
722
+
723
+ [ NOT_IN_TRAIN] "pháp lệnh người cao tuổi" (5-syl)
724
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
725
+ TRAIN: *** NOT FOUND ***
726
+ TEST segmentations:
727
+ 1x (100.0%) B I I I I → [pháp lệnh người cao tuổi]
728
+
729
+ [ NOT_IN_TRAIN] "pháp lệnh người tàn tật" (5-syl)
730
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
731
+ TRAIN: *** NOT FOUND ***
732
+ TEST segmentations:
733
+ 1x (100.0%) B I I I I → [pháp lệnh người tàn tật]
734
+
735
+ [ NOT_IN_TRAIN] "cổng thông tin điện tử" (5-syl)
736
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
737
+ TRAIN: *** NOT FOUND ***
738
+ TEST segmentations:
739
+ 1x (100.0%) B I I I I → [cổng thông tin điện tử]
740
+
741
+ [ NOT_IN_TRAIN] "thông tấn xã việt nam" (5-syl)
742
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
743
+ TRAIN: *** NOT FOUND ***
744
+ TEST segmentations:
745
+ 1x (100.0%) B I I I I → [thông tấn xã việt nam]
746
+
747
+ [ NOT_IN_TRAIN] "luật tiếp cận thông tin" (5-syl)
748
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
749
+ TRAIN: *** NOT FOUND ***
750
+ TEST segmentations:
751
+ 1x (100.0%) B I I I I → [luật tiếp cận thông tin]
752
+
753
+ [ INCONSISTENT] "luật khiếu nại tố cáo" (5-syl)
754
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 1x
755
+ TRAIN segmentations:
756
+ 1x (100.0%) B B I B I → [luật | khiếu nại | tố cáo]
757
+ TEST segmentations:
758
+ 1x (100.0%) B I I I I → [luật khiếu nại tố cáo]
759
+
760
+ [ NOT_IN_TRAIN] "hội đồng bộ trưởng pháp" (5-syl)
761
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
762
+ TRAIN: *** NOT FOUND ***
763
+ TEST segmentations:
764
+ 1x (100.0%) B I I I I → [hội đồng bộ trưởng pháp]
765
+
766
+ [ NOT_IN_TRAIN] "việt nam yêu cầu ca" (5-syl)
767
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
768
+ TRAIN: *** NOT FOUND ***
769
+ TEST segmentations:
770
+ 1x (100.0%) B I I I I → [việt nam yêu cầu ca]
771
+
772
+ [ NOT_IN_TRAIN] "luật sở hữu trí tuệ" (5-syl)
773
+ Test as gold word: 1x | Sequence in test: 2x | Sequence in train: 0x
774
+ TRAIN: *** NOT FOUND ***
775
+ TEST segmentations:
776
+ 1x ( 50.0%) B B I I I → [luật | sở hữu trí tuệ]
777
+ 1x ( 50.0%) B I I I I → [luật sở hữu trí tuệ]
778
+
779
+ [ NOT_IN_TRAIN] "luật phá sản doanh nghiệp" (5-syl)
780
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
781
+ TRAIN: *** NOT FOUND ***
782
+ TEST segmentations:
783
+ 1x (100.0%) B I I I I → [luật phá sản doanh nghiệp]
784
+
785
+ [ INCONSISTENT] "luật doanh nghiệp nhà nước" (5-syl)
786
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 3x
787
+ TRAIN segmentations:
788
+ 2x ( 66.7%) B B I B I → [luật | doanh nghiệp | nhà nước]
789
+ 1x ( 33.3%) I B I B I → [luật | doanh nghiệp | nhà nước]
790
+ TEST segmentations:
791
+ 1x (100.0%) B I I I I → [luật doanh nghiệp nhà nước]
792
+
793
+ [ INCONSISTENT] "luật ngân sách nhà nước" (5-syl)
794
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 4x
795
+ TRAIN segmentations:
796
+ 4x (100.0%) B B I B I → [luật | ngân sách | nhà nước]
797
+ TEST segmentations:
798
+ 1x (100.0%) B I I I I → [luật ngân sách nhà nước]
799
+
800
+ [ INCONSISTENT] "luật tổ chức quốc hội" (5-syl)
801
+ Test as gold word: 1x | Sequence in test: 3x | Sequence in train: 3x
802
+ TRAIN segmentations:
803
+ 2x ( 66.7%) B I I I I → [luật tổ chức quốc hội]
804
+ 1x ( 33.3%) B B I B I → [luật | tổ chức | quốc hội]
805
+ TEST segmentations:
806
+ 1x ( 33.3%) B I I I I → [luật tổ chức quốc hội]
807
+ 1x ( 33.3%) B B I B I → [luật | tổ chức | quốc hội]
808
+ 1x ( 33.3%) I B I B I → [luật | tổ chức | quốc hội]
809
+
810
+ ========================================================================================================================
811
+ 6-SYLLABLE WORDS (23 unique, 73 test occurrences)
812
+ ========================================================================================================================
813
+
814
+ [ INCONSISTENT] "uỷ ban thường vụ quốc hội" (6-syl)
815
+ Test as gold word: 32x | Sequence in test: 53x | Sequence in train: 69x
816
+ TRAIN segmentations:
817
+ 50x ( 72.5%) B I B I B I → [uỷ ban | thường vụ | quốc hội]
818
+ 19x ( 27.5%) B I I I I I → [uỷ ban thường vụ quốc hội]
819
+ TEST segmentations:
820
+ 32x ( 60.4%) B I I I I I → [uỷ ban thường vụ quốc hội]
821
+ 21x ( 39.6%) B I B I B I → [uỷ ban | thường vụ | quốc hội]
822
+
823
+ [ CONSISTENT] "cơ quan quyền lực nhà nước" (6-syl)
824
+ Test as gold word: 7x | Sequence in test: 10x | Sequence in train: 5x
825
+ TRAIN segmentations:
826
+ 5x (100.0%) B I I I I I → [cơ quan quyền lực nhà nước]
827
+ TEST segmentations:
828
+ 7x ( 70.0%) B I I I I I → [cơ quan quyền lực nhà nước]
829
+ 3x ( 30.0%) B I B I B I → [cơ quan | quyền lực | nhà nước]
830
+
831
+ [ INCONSISTENT] "tổ chức thương mại thế giới" (6-syl)
832
+ Test as gold word: 4x | Sequence in test: 4x | Sequence in train: 22x
833
+ TRAIN segmentations:
834
+ 13x ( 59.1%) B I B I B I → [tổ chức | thương mại | thế giới]
835
+ 8x ( 36.4%) B I I I I I → [tổ chức thương mại thế giới]
836
+ 1x ( 4.5%) B I B I I I → [tổ chức | thương mại thế giới]
837
+ TEST segmentations:
838
+ 4x (100.0%) B I I I I I → [tổ chức thương mại thế giới]
839
+
840
+ [ CONSISTENT] "chế độ quân chủ chuyên chế" (6-syl)
841
+ Test as gold word: 3x | Sequence in test: 3x | Sequence in train: 2x
842
+ TRAIN segmentations:
843
+ 2x (100.0%) B I I I I I → [chế độ quân chủ chuyên chế]
844
+ TEST segmentations:
845
+ 3x (100.0%) B I I I I I → [chế độ quân chủ chuyên chế]
846
+
847
+ [ INCONSISTENT] "việt nam dân chủ cộng hoà" (6-syl)
848
+ Test as gold word: 3x | Sequence in test: 17x | Sequence in train: 5x
849
+ TRAIN segmentations:
850
+ 3x ( 60.0%) B I I I I I → [việt nam dân chủ cộng hoà]
851
+ 2x ( 40.0%) B I B I B I → [việt nam | dân chủ | cộng hoà]
852
+ TEST segmentations:
853
+ 14x ( 82.4%) B I B I B I → [việt nam | dân chủ | cộng hoà]
854
+ 3x ( 17.6%) B I I I I I → [việt nam dân chủ cộng hoà]
855
+
856
+ [ INCONSISTENT] "ban chấp hành trung ương đảng" (6-syl)
857
+ Test as gold word: 3x | Sequence in test: 5x | Sequence in train: 6x
858
+ TRAIN segmentations:
859
+ 5x ( 83.3%) B I I B I B → [ban chấp hành | trung ương | đảng]
860
+ 1x ( 16.7%) B I I I I I → [ban chấp hành trung ương đảng]
861
+ TEST segmentations:
862
+ 3x ( 60.0%) B I I I I I → [ban chấp hành trung ương đảng]
863
+ 1x ( 20.0%) B I I B I B → [ban chấp hành | trung ương | đảng]
864
+ 1x ( 20.0%) B B I B I B → [ban | chấp hành | trung ương | đảng]
865
+
866
+ [ INCONSISTENT] "mặt trận tổ quốc việt nam" (6-syl)
867
+ Test as gold word: 3x | Sequence in test: 3x | Sequence in train: 2x
868
+ TRAIN segmentations:
869
+ 2x (100.0%) B I B I B I → [mặt trận | tổ quốc | việt nam]
870
+ TEST segmentations:
871
+ 3x (100.0%) B I I I I I → [mặt trận tổ quốc việt nam]
872
+
873
+ [ INCONSISTENT] "phương tiện thông tin đại chúng" (6-syl)
874
+ Test as gold word: 2x | Sequence in test: 2x | Sequence in train: 23x
875
+ TRAIN segmentations:
876
+ 14x ( 60.9%) B I B I I I → [phương tiện | thông tin đại chúng]
877
+ 9x ( 39.1%) B I I I I I → [phương tiện thông tin đại chúng]
878
+ TEST segmentations:
879
+ 2x (100.0%) B I I I I I → [phương tiện thông tin đại chúng]
880
+
881
+ [ INCONSISTENT] "toà án nhân dân tối cao" (6-syl)
882
+ Test as gold word: 2x | Sequence in test: 12x | Sequence in train: 16x
883
+ TRAIN segmentations:
884
+ 9x ( 56.2%) B I B I B I → [toà án | nhân dân | tối cao]
885
+ 7x ( 43.8%) B I I I I I → [toà án nhân dân tối cao]
886
+ TEST segmentations:
887
+ 9x ( 75.0%) B I B I B I → [toà án | nhân dân | tối cao]
888
+ 2x ( 16.7%) B I I I I I → [toà án nhân dân tối cao]
889
+ 1x ( 8.3%) B I I I B I → [toà án nhân dân | tối cao]
890
+
891
+ [ NOT_IN_TRAIN] "răng đền răng, mạng đền mạng" (6-syl)
892
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
893
+ TRAIN: *** NOT FOUND ***
894
+ TEST segmentations:
895
+ 1x (100.0%) B I I I I I → [răng đền răng, mạng đền mạng]
896
+
897
+ [ NOT_IN_TRAIN] "công ti trách nhiệm hữu hạn" (6-syl)
898
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
899
+ TRAIN: *** NOT FOUND ***
900
+ TEST segmentations:
901
+ 1x (100.0%) B I I I I I → [công ti trách nhiệm hữu hạn]
902
+
903
+ [ NOT_IN_TRAIN] "luật khoa học và công nghệ" (6-syl)
904
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
905
+ TRAIN: *** NOT FOUND ***
906
+ TEST segmentations:
907
+ 1x (100.0%) B I I I I I → [luật khoa học và công nghệ]
908
+
909
+ [ NOT_IN_TRAIN] "pháp lệnh tín ngưỡng, tôn giáo" (6-syl)
910
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
911
+ TRAIN: *** NOT FOUND ***
912
+ TEST segmentations:
913
+ 1x (100.0%) B I I I I I → [pháp lệnh tín ngưỡng, tôn giáo]
914
+
915
+ [ INCONSISTENT] "bộ tài nguyên và môi trường" (6-syl)
916
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 11x
917
+ TRAIN segmentations:
918
+ 6x ( 54.5%) B B I B B I → [bộ | tài nguyên | và | môi trường]
919
+ 5x ( 45.5%) B I I I I I → [bộ tài nguyên và môi trường]
920
+ TEST segmentations:
921
+ 1x (100.0%) B I I I I I → [bộ tài nguyên và môi trường]
922
+
923
+ [ NOT_IN_TRAIN] "công cuộc khai hoá giết người" (6-syl)
924
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
925
+ TRAIN: *** NOT FOUND ***
926
+ TEST segmentations:
927
+ 1x (100.0%) B I I I I I → [công cuộc khai hoá giết người]
928
+
929
+ [ NOT_IN_TRAIN] "chế độ quân chủ lập hiến" (6-syl)
930
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
931
+ TRAIN: *** NOT FOUND ***
932
+ TEST segmentations:
933
+ 1x (100.0%) B I I I I I → [chế độ quân chủ lập hiến]
934
+
935
+ [ INCONSISTENT] "bộ luật tố tụng hình sự" (6-syl)
936
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 10x
937
+ TRAIN segmentations:
938
+ 9x ( 90.0%) B B I I I I → [bộ | luật tố tụng hình sự]
939
+ 1x ( 10.0%) B I B I B I → [bộ luật | tố tụng | hình sự]
940
+ TEST segmentations:
941
+ 1x (100.0%) B I I I I I → [bộ luật tố tụng hình sự]
942
+
943
+ [ NOT_IN_TRAIN] "luật hôn nhân và gia đình" (6-syl)
944
+ Test as gold word: 1x | Sequence in test: 2x | Sequence in train: 0x
945
+ TRAIN: *** NOT FOUND ***
946
+ TEST segmentations:
947
+ 1x ( 50.0%) B I I I I I → [luật hôn nhân và gia đình]
948
+ 1x ( 50.0%) B B I B B I → [luật | hôn nhân | và | gia đình]
949
+
950
+ [ INCONSISTENT] "bộ kế hoạch và đầu tư" (6-syl)
951
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 5x
952
+ TRAIN segmentations:
953
+ 4x ( 80.0%) B B I B B I → [bộ | kế hoạch | và | đầu tư]
954
+ 1x ( 20.0%) B I I I I I → [bộ kế hoạch và đầu tư]
955
+ TEST segmentations:
956
+ 1x (100.0%) B I I I I I → [bộ kế hoạch và đầu tư]
957
+
958
+ [ INCONSISTENT] "ngân hàng nhà nước việt nam" (6-syl)
959
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 1x
960
+ TRAIN segmentations:
961
+ 1x (100.0%) B I B I B I → [ngân hàng | nhà nước | việt nam]
962
+ TEST segmentations:
963
+ 1x (100.0%) B I I I I I → [ngân hàng nhà nước việt nam]
964
+
965
+ [ NOT_IN_TRAIN] "ăn cây nào rào cây ấy" (6-syl)
966
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
967
+ TRAIN: *** NOT FOUND ***
968
+ TEST segmentations:
969
+ 1x (100.0%) B I I I I I → [ăn cây nào rào cây ấy]
970
+
971
+ [ NOT_IN_TRAIN] "ở đình nào chúc đình ấy" (6-syl)
972
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
973
+ TRAIN: *** NOT FOUND ***
974
+ TEST segmentations:
975
+ 1x (100.0%) B I I I I I → [ở đình nào chúc đình ấy]
976
+
977
+ [ NOT_IN_TRAIN] "chế độ dân chủ nhân dân" (6-syl)
978
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
979
+ TRAIN: *** NOT FOUND ***
980
+ TEST segmentations:
981
+ 1x (100.0%) B I I I I I → [chế độ dân chủ nhân dân]
982
+
983
+ ========================================================================================================================
984
+ 7-SYLLABLE WORDS (11 unique, 12 test occurrences)
985
+ ========================================================================================================================
986
+
987
+ [ INCONSISTENT] "viện kiểm sát nhân dân tối cao" (7-syl)
988
+ Test as gold word: 2x | Sequence in test: 6x | Sequence in train: 13x
989
+ TRAIN segmentations:
990
+ 6x ( 46.2%) B I I B I B I → [viện kiểm sát | nhân dân | tối cao]
991
+ 6x ( 46.2%) B I I I I I I → [viện kiểm sát nhân dân tối cao]
992
+ 1x ( 7.7%) B B I B I B I → [viện | kiểm sát | nhân dân | tối cao]
993
+ TEST segmentations:
994
+ 4x ( 66.7%) B I I B I B I → [viện kiểm sát | nhân dân | tối cao]
995
+ 2x ( 33.3%) B I I I I I I → [viện kiểm sát nhân dân tối cao]
996
+
997
+ [ NOT_IN_TRAIN] "bàn về tinh thần của pháp luật" (7-syl)
998
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
999
+ TRAIN: *** NOT FOUND ***
1000
+ TEST segmentations:
1001
+ 1x (100.0%) B I I I I I I → [bàn về tinh thần của pháp luật]
1002
+
1003
+ [ NOT_IN_TRAIN] "bàn về tội phạm và hình phạt" (7-syl)
1004
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
1005
+ TRAIN: *** NOT FOUND ***
1006
+ TEST segmentations:
1007
+ 1x (100.0%) B I I I I I I → [bàn về tội phạm và hình phạt]
1008
+
1009
+ [ NOT_IN_TRAIN] "các nguyên tắc của luật hình sự" (7-syl)
1010
+ Test as gold word: 1x | Sequence in test: 2x | Sequence in train: 0x
1011
+ TRAIN: *** NOT FOUND ***
1012
+ TEST segmentations:
1013
+ 1x ( 50.0%) B B I B B I I → [các | nguyên tắc | của | luật hình sự]
1014
+ 1x ( 50.0%) B I I I I I I → [các nguyên tắc của luật hình sự]
1015
+
1016
+ [ INCONSISTENT] "luật bảo vệ và phát triển rừng" (7-syl)
1017
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 4x
1018
+ TRAIN segmentations:
1019
+ 4x (100.0%) B B I B B I B → [luật | bảo vệ | và | phát triển | rừng]
1020
+ TEST segmentations:
1021
+ 1x (100.0%) B I I I I I I → [luật bảo vệ và phát triển rừng]
1022
+
1023
+ [ NOT_IN_TRAIN] "luật phổ biến, giáo dục pháp luật" (7-syl)
1024
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
1025
+ TRAIN: *** NOT FOUND ***
1026
+ TEST segmentations:
1027
+ 1x (100.0%) B I I I I I I → [luật phổ biến, giáo dục pháp luật]
1028
+
1029
+ [ NOT_IN_TRAIN] "bản án chế độ thực dân pháp" (7-syl)
1030
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
1031
+ TRAIN: *** NOT FOUND ***
1032
+ TEST segmentations:
1033
+ 1x (100.0%) B I I I I I I → [bản án chế độ thực dân pháp]
1034
+
1035
+ [ NOT_IN_TRAIN] "về chế độ dân chủ ở mỹ" (7-syl)
1036
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
1037
+ TRAIN: *** NOT FOUND ***
1038
+ TEST segmentations:
1039
+ 1x (100.0%) B I I I I I I → [về chế độ dân chủ ở mỹ]
1040
+
1041
+ [ NOT_IN_TRAIN] "yêu sách của nhân dân an nam" (7-syl)
1042
+ Test as gold word: 1x | Sequence in test: 2x | Sequence in train: 0x
1043
+ TRAIN: *** NOT FOUND ***
1044
+ TEST segmentations:
1045
+ 1x ( 50.0%) B I B B I B I → [yêu sách | của | nhân dân | an nam]
1046
+ 1x ( 50.0%) B I I I I I I → [yêu sách của nhân dân an nam]
1047
+
1048
+ [ INCONSISTENT] "luật khuyến khích đầu tư trong nước" (7-syl)
1049
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 2x
1050
+ TRAIN segmentations:
1051
+ 2x (100.0%) B B I B I B B → [luật | khuyến khích | đầu tư | trong | nước]
1052
+ TEST segmentations:
1053
+ 1x (100.0%) B I I I I I I → [luật khuyến khích đầu tư trong nước]
1054
+
1055
+ [ INCONSISTENT] "luật thuế sử dụng đất nông nghiệp" (7-syl)
1056
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 4x
1057
+ TRAIN segmentations:
1058
+ 4x (100.0%) B B B I B B I → [luật | thuế | sử dụng | đất | nông nghiệp]
1059
+ TEST segmentations:
1060
+ 1x (100.0%) B I I I I I I → [luật thuế sử dụng đất nông nghiệp]
1061
+
1062
+ ========================================================================================================================
1063
+ 8-SYLLABLE WORDS (4 unique, 16 test occurrences)
1064
+ ========================================================================================================================
1065
+
1066
+ [ INCONSISTENT] "cộng hoà xã hội chủ nghĩa việt nam" (8-syl)
1067
+ Test as gold word: 13x | Sequence in test: 17x | Sequence in train: 18x
1068
+ TRAIN segmentations:
1069
+ 17x ( 94.4%) B I I I I I I I → [cộng hoà xã hội chủ nghĩa việt nam]
1070
+ 1x ( 5.6%) B I B I I I B I → [cộng hoà | xã hội chủ nghĩa | việt nam]
1071
+ TEST segmentations:
1072
+ 13x ( 76.5%) B I I I I I I I → [cộng hoà xã hội chủ nghĩa việt nam]
1073
+ 2x ( 11.8%) B I B I B I B I → [cộng hoà | xã hội | chủ nghĩa | việt nam]
1074
+ 2x ( 11.8%) B I B I I I B I → [cộng hoà | xã hội chủ nghĩa | việt nam]
1075
+
1076
+ [ NOT_IN_TRAIN] "pháp lệnh xử lí vi phạm hành chính" (8-syl)
1077
+ Test as gold word: 1x | Sequence in test: 2x | Sequence in train: 0x
1078
+ TRAIN: *** NOT FOUND ***
1079
+ TEST segmentations:
1080
+ 1x ( 50.0%) B I I I I I I I → [pháp lệnh xử lí vi phạm hành chính]
1081
+ 1x ( 50.0%) B I B I B I B I → [pháp lệnh | xử lí | vi phạm | hành chính]
1082
+
1083
+ [ NOT_IN_TRAIN] "pháp lệnh vệ sinh an toàn thực phẩm" (8-syl)
1084
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
1085
+ TRAIN: *** NOT FOUND ***
1086
+ TEST segmentations:
1087
+ 1x (100.0%) B I I I I I I I → [pháp lệnh vệ sinh an toàn thực phẩm]
1088
+
1089
+ [ NOT_IN_TRAIN] "những nguyên lí của chủ nghĩa cộng sản" (8-syl)
1090
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
1091
+ TRAIN: *** NOT FOUND ***
1092
+ TEST segmentations:
1093
+ 1x (100.0%) B I I I I I I I → [những nguyên lí của chủ nghĩa cộng sản]
1094
+
1095
+ ========================================================================================================================
1096
+ 9-SYLLABLE WORDS (1 unique, 6 test occurrences)
1097
+ ========================================================================================================================
1098
+
1099
+ [ INCONSISTENT] "luật ban hành văn bản quy phạm pháp luật" (9-syl)
1100
+ Test as gold word: 6x | Sequence in test: 8x | Sequence in train: 4x
1101
+ TRAIN segmentations:
1102
+ 3x ( 75.0%) B I I I I I I I I → [luật ban hành văn bản quy phạm pháp luật]
1103
+ 1x ( 25.0%) B B I B I B I I I → [luật | ban hành | văn bản | quy phạm pháp luật]
1104
+ TEST segmentations:
1105
+ 6x ( 75.0%) B I I I I I I I I → [luật ban hành văn bản quy phạm pháp luật]
1106
+ 2x ( 25.0%) B B I B I B I I I → [luật | ban hành | văn bản | quy phạm pháp luật]
1107
+
1108
+ ========================================================================================================================
1109
+ 10-SYLLABLE WORDS (1 unique, 1 test occurrences)
1110
+ ========================================================================================================================
1111
+
1112
+ [ NOT_IN_TRAIN] "luật bảo vệ, chăm sóc và giáo dục trẻ em" (10-syl)
1113
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
1114
+ TRAIN: *** NOT FOUND ***
1115
+ TEST segmentations:
1116
+ 1x (100.0%) B I I I I I I I I I → [luật bảo vệ, chăm sóc và giáo dục trẻ em]
1117
+
1118
+ ========================================================================================================================
1119
+ 12-SYLLABLE WORDS (1 unique, 1 test occurrences)
1120
+ ========================================================================================================================
1121
+
1122
+ [ NOT_IN_TRAIN] "trống làng nào làng ấy đánh, thánh làng nào, làng ấy thờ" (12-syl)
1123
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
1124
+ TRAIN: *** NOT FOUND ***
1125
+ TEST segmentations:
1126
+ 1x (100.0%) B I I I I I I I I I I I → [trống làng nào làng ấy đánh, thánh làng nào, làng ấy thờ]
1127
+
1128
+ ========================================================================================================================
1129
+ 16-SYLLABLE WORDS (1 unique, 1 test occurrences)
1130
+ ========================================================================================================================
1131
+
1132
+ [ NOT_IN_TRAIN] "pháp luật của tự nhiên hoặc tinh thần hợp chân lí tự nhiên của pháp luật" (16-syl)
1133
+ Test as gold word: 1x | Sequence in test: 1x | Sequence in train: 0x
1134
+ TRAIN: *** NOT FOUND ***
1135
+ TEST segmentations:
1136
+ 1x (100.0%) B I I I I I I I I I I I I I I I → [pháp luật của tự nhiên hoặc tinh thần hợp chân lí tự nhiên của pháp luật]
1137
+
1138
+ ========================================================================================================================
1139
+ SUMMARY
1140
+ ========================================================================================================================
1141
+ Category Unique words Test occurrences
1142
+ --------------- ------------ ----------------
1143
+ CONSISTENT 38 116 (18.3%)
1144
+ INCONSISTENT 44 318 (50.2%)
1145
+ NOT_IN_TRAIN 73 200 (31.5%)
1146
+ --------------- ------------ ----------------
1147
+ TOTAL 155 634
1148
+
1149
+ INCONSISTENCY BREAKDOWN:
1150
+ Train majority differs from test majority: 26 words (99 occ)
1151
+ Test set itself is also inconsistent: 23 words (269 occ)
results/word_segmentation/error_analysis.txt ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ======================================================================
2
+ Word Segmentation Error Analysis — VLSP 2013 Test Set
3
+ ======================================================================
4
+
5
+ 1. Summary
6
+ ----------------------------------------
7
+ Sentences: 2,120
8
+ Syllables: 96,457
9
+ True words: 66,241
10
+ Predicted words: 66,683
11
+ Correct words: 64,877
12
+ Word Precision: 0.9729 (97.29%)
13
+ Word Recall: 0.9794 (97.94%)
14
+ Word F1: 0.9762 (97.62%)
15
+ Syllable errors: 1,180 / 96,457 (1.22%)
16
+ Word errors (FN): 1,364
17
+ Word errors (FP): 1,806
18
+
19
+ 2. Syllable-Level Confusion (B/I)
20
+ ----------------------------------------
21
+ True B, Predicted I (false join): 369 / 66,241 (0.56%)
22
+ True I, Predicted B (false split): 811 / 30,216 (2.68%)
23
+
24
+ Confusion Matrix:
25
+ Pred B Pred I
26
+ True B 65,872 369
27
+ True I 811 29,405
28
+
29
+ 3. Top False Splits (compound words broken apart)
30
+ ----------------------------------------------------------------------
31
+ Total false splits: 651
32
+ Unique words affected: 267
33
+
34
+ Word Count Example context
35
+ ---- ----- ---------------
36
+ chủ nghĩa hợp hiến 64 tiếp thu chủ nghĩa hợp hiến ở Việt
37
+ Uỷ ban Thường vụ Quốc hội 32 2003 của Uỷ ban Thường vụ Quốc hội về bồi
38
+ hình sự hoá 28 Vấn đề hình sự hoá , phi
39
+ Bộ luật hình sự 24 so với Bộ luật hình sự năm 1985
40
+ Hiến pháp 1946 24 , khi Hiến pháp 1946 đã được
41
+ phi hình sự hoá 18 hoá , phi hình sự hoá trong chính
42
+ Bên cạnh 15 Bên cạnh đó ,
43
+ nào đó 14 phạm tội nào đó thì cũng
44
+ phi tội phạm hoá 11 hoá , phi tội phạm hoá .
45
+ nhà lập pháp 11 quyền của nhà lập pháp .
46
+ tội phạm hoá 8 hoá , tội phạm hoá những hành
47
+ quyền tự do dân chủ 8 hành các quyền tự do dân chủ cho dân
48
+ bên cạnh 8 này , bên cạnh việc lựa
49
+ tái áp dụng 7 bang lại tái áp dụng như Carôlin
50
+ cơ quan quyền lực nhà nước 7 , một cơ quan quyền lực nhà nước cao nhất
51
+ cùng với 6 tương ứng cùng với sự phát
52
+ trưng cầu dân ý 6 tiến hành trưng cầu dân ý về bãi
53
+ Bộ Tư pháp 6 Bộ trưởng Bộ Tư pháp làm Trưởng
54
+ vụ án 6 xảy ra vụ án hoặc nơi
55
+ nhất là 6 gắt , nhất là Nguyễn Ái
56
+
57
+ 4. Top False Joins (separate words merged)
58
+ ----------------------------------------------------------------------
59
+ Total false joins: 357
60
+ Unique words affected: 204
61
+
62
+ Merged as Count Should be Context
63
+ --------- ----- --------- -------
64
+ loại hình phạt 22 loại | hình phạt 18 , loại hình phạt này được
65
+ như vậy 17 như | vậy hoàn toàn như vậy .
66
+ trước đây 17 trước | đây Nam Tư trước đây , ngoại
67
+ pháp luật hình sự 15 pháp luật | hình sự Trong pháp luật hình sự thực định
68
+ nghĩa là 9 nghĩa | là cũng có nghĩa là người đó
69
+ nguy hiểm xã hội 7 nguy hiểm | xã hội tăng tính nguy hiểm xã hội , thì
70
+ tố tụng hình sự 6 tố tụng | hình sự hoạt động tố tụng hình sự gây ra
71
+ như thế 6 như | thế Tương tự như thế , vấn
72
+ hơn nữa 6 hơn | nữa tăng cường hơn nữa tính nhân
73
+ xã hội chủ nghĩa Việt Nam 6 xã hội chủ nghĩa | Việt Nam Nhà nước xã hội chủ nghĩa Việt Nam có hiến
74
+ luật hình sự 5 luật | hình sự ở việc luật hình sự giảm nhẹ
75
+ hương ước lệ làng 5 hương ước | lệ làng thi các hương ước lệ làng .
76
+ quy định hình phạt 4 quy định | hình phạt Kì vẫn quy định hình phạt tử hình
77
+ như thế nào 4 như | thế nào dân chủ như thế nào thì còn
78
+ dân chủ Cộng hoà 4 dân chủ | Cộng hoà Việt Nam dân chủ Cộng hoà , Nhà
79
+ mỗi một 3 mỗi | một nhiên là mỗi một cơ quan
80
+ cơ quan quyền lực 3 cơ quan | quyền lực hội là cơ quan quyền lực Nhà nước
81
+ Hội đồng Chính phủ 3 Hội đồng | Chính phủ trực thuộc Hội đồng Chính phủ .
82
+ người thân thích 2 người | thân thích cả những người thân thích của người
83
+ Bộ Chính trị 2 Bộ | Chính trị 2002 , Bộ Chính trị yêu cầu
84
+
85
+ 5. Error Rate by Word Length (syllables)
86
+ ----------------------------------------------------------------------
87
+ Length Total Correct Errors Accuracy Error Rate
88
+ ------ ----- ------- ------ -------- ----------
89
+ 1-syl 38,213 37,829 384 99.00% 1.00%
90
+ 2-syl 26,813 26,326 487 98.18% 1.82%
91
+ 3-syl 581 432 149 74.35% 25.65%
92
+ 4-syl 487 268 219 55.03% 44.97%
93
+ 5-syl 37 8 29 21.62% 78.38%
94
+ 6-syl 73 1 72 1.37% 98.63%
95
+ 7-syl 12 0 12 0.00% 100.00%
96
+ 8-syl 16 13 3 81.25% 18.75%
97
+ 9-syl 6 0 6 0.00% 100.00%
98
+ 10-syl 1 0 1 0.00% 100.00%
99
+ 12-syl 1 0 1 0.00% 100.00%
100
+ 16-syl 1 0 1 0.00% 100.00%
101
+
102
+ 6. Error Rate by Position in Sentence
103
+ ----------------------------------------
104
+ Start (first/last 3 syls) 65 / 6,358 (1.02%)
105
+ End (first/last 3 syls) 71 / 6,346 (1.12%)
106
+ Middle 1,044 / 83,753 (1.25%)
107
+
108
+ 7. Top Error Patterns (syllable in context)
109
+ ----------------------------------------------------------------------
110
+ Prev syl Current Next syl Error Count
111
+ -------- ------- -------- ----- -----
112
+ nghĩa hợp hiến I→B 68
113
+ ban Thường vụ I→B 32
114
+ vụ Quốc hội I→B 32
115
+ Bộ luật hình I→B 25
116
+ sự hoá , I→B 23
117
+ loại hình phạt B→I 22
118
+ luật hình sự B→I 22
119
+ phi tội phạm I→B 11
120
+ nhà lập pháp I→B 11
121
+ sự hoá các I→B 10
122
+ nghĩa Việt Nam B→I 10
123
+ như vậy , B→I 9
124
+ Bên cạnh đó I→B 8
125
+ phạm hoá những I→B 8
126
+ quyền tự do I→B 8
127
+ do dân chủ I→B 8
128
+ tái áp dụng I→B 7
129
+ tụng hình sự B→I 7
130
+ hiểm xã hội B→I 7
131
+ lực nhà nước I→B 7
132
+
133
+ ======================================================================
results/word_segmentation/error_by_length.csv ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ word_length_syllables,total,correct,errors,accuracy,error_rate
2
+ 1,38213,37829,384,0.9900,0.0100
3
+ 2,26813,26326,487,0.9818,0.0182
4
+ 3,581,432,149,0.7435,0.2565
5
+ 4,487,268,219,0.5503,0.4497
6
+ 5,37,8,29,0.2162,0.7838
7
+ 6,73,1,72,0.0137,0.9863
8
+ 7,12,0,12,0.0000,1.0000
9
+ 8,16,13,3,0.8125,0.1875
10
+ 9,6,0,6,0.0000,1.0000
11
+ 10,1,0,1,0.0000,1.0000
12
+ 12,1,0,1,0.0000,1.0000
13
+ 16,1,0,1,0.0000,1.0000
results/word_segmentation/false_joins.csv ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ merged_word,count,true_parts,context
2
+ loại hình phạt,22,loại | hình phạt,"18 , loại hình phạt này được"
3
+ như vậy,17,như | vậy,hoàn toàn như vậy .
4
+ trước đây,17,trước | đây,"Nam Tư trước đây , ngoại"
5
+ pháp luật hình sự,15,pháp luật | hình sự,Trong pháp luật hình sự thực định
6
+ nghĩa là,9,nghĩa | là,cũng có nghĩa là người đó
7
+ nguy hiểm xã hội,7,nguy hiểm | xã hội,"tăng tính nguy hiểm xã hội , thì"
8
+ tố tụng hình sự,6,tố tụng | hình sự,hoạt động tố tụng hình sự gây ra
9
+ như thế,6,như | thế,"Tương tự như thế , vấn"
10
+ hơn nữa,6,hơn | nữa,tăng cường hơn nữa tính nhân
11
+ xã hội chủ nghĩa Việt Nam,6,xã hội chủ nghĩa | Việt Nam,Nhà nước xã hội chủ nghĩa Việt Nam có hiến
12
+ luật hình sự,5,luật | hình sự,ở việc luật hình sự giảm nhẹ
13
+ hương ước lệ làng,5,hương ước | lệ làng,thi các hương ước lệ làng .
14
+ quy định hình phạt,4,quy định | hình phạt,Kì vẫn quy định hình phạt tử hình
15
+ như thế nào,4,như | thế nào,dân chủ như thế nào thì còn
16
+ dân chủ Cộng hoà,4,dân chủ | Cộng hoà,"Việt Nam dân chủ Cộng hoà , Nhà"
17
+ mỗi một,3,mỗi | một,nhiên là mỗi một cơ quan
18
+ cơ quan quyền lực,3,cơ quan | quyền lực,hội là cơ quan quyền lực Nhà nước
19
+ Hội đồng Chính phủ,3,Hội đồng | Chính phủ,trực thuộc Hội đồng Chính phủ .
20
+ người thân thích,2,người | thân thích,cả những người thân thích của người
21
+ Bộ Chính trị,2,Bộ | Chính trị,"2002 , Bộ Chính trị yêu cầu"
22
+ làm luật,2,làm | luật,của nhà làm luật vốn đại
23
+ Cùng với,2,Cùng | với,Cùng với sự phát
24
+ nhất là,2,nhất | là,phạt cao nhất là tử hình
25
+ ban hành Quyết định,2,ban hành | Quyết định,phủ đã ban hành Quyết định số 13
26
+ quy phạm luật,2,quy phạm | luật,dụng các quy phạm luật mang tính
27
+ phép nước,2,phép | nước,giữ nghiêm phép nước .
28
+ nghĩa rộng,2,nghĩa | rộng,", với nghĩa rộng là chế"
29
+ hành vi phạm pháp,2,hành vi | phạm pháp,một nhóm hành vi phạm pháp có liên
30
+ người thân,2,người | thân,của những người thân Pháp như
31
+ phải biết,2,phải | biết,", rồi phải biết nhượng quyền"
32
+ đọc Tuyên ngôn,2,đọc | Tuyên ngôn độc lập,sau khi đọc Tuyên ngôn độc lập
33
+ làm nên,2,làm | nên,lộ diện làm nên việc cũng
34
+ Hiến pháp quy định,2,Hiến pháp | quy định,70 của Hiến pháp quy định : “
35
+ án lệ,2,án | lệ,và các án lệ thương mại
36
+ Luật thương mại,2,Luật | thương mại,khi đó Luật thương mại Việt Nam
37
+ Luật Thương mại,2,Luật | Thương mại,Các Luật Thương mại và Luật
38
+ Cộng hoà Xã hội Chủ nghĩa Việt Nam,2,Cộng hoà | Xã hội | Chủ nghĩa | Việt Nam,mà nước Cộng hoà Xã hội Chủ nghĩa Việt Nam gia nhập
39
+ Ban Công tác,2,Ban | Công tác,"cáo của Ban Công tác , là"
40
+ cơ chế tạo,2,cơ chế | tạo,tố và cơ chế tạo khả năng
41
+ thành uỷ ban,2,thành | uỷ ban,ngân sách thành uỷ ban kinh tế
42
+ cơ chế pháp lí,2,cơ chế | pháp lí,dựng một cơ chế pháp lí vững chắc
43
+ Hai mặt,2,Hai | mặt,I . Hai mặt của một
44
+ thể chế pháp lí,2,thể chế | pháp lí,của một thể chế pháp lí ở làng
45
+ lưỡng tính,2,lưỡng | tính,pháp lí lưỡng tính phản ánh
46
+ cách mạng tháng Tám,2,cách mạng | tháng | Tám,"Sau cách mạng tháng Tám , chính"
47
+ Cộng hoà xã hội chủ nghĩa Việt Nam,2,Cộng hoà | xã hội chủ nghĩa | Việt Nam,"Ở nước Cộng hoà xã hội chủ nghĩa Việt Nam , tất"
48
+ nhân dân tối cao,2,nhân dân | tối cao,kiểm sát nhân dân tối cao chịu trách
49
+ thực định,1,thực | định,"hình sự thực định , so"
50
+ do đó,1,lí do | đó,"Bởi lí do đó , thông"
51
+ tính giai cấp,1,tính | giai cấp,đạo có tính giai cấp và tính
52
+ death penalty,1,death | penalty,"là “ death penalty ” ,"
53
+ capital punishment,1,capital | punishment,"là “ capital punishment ” ,"
54
+ thời kì Trung Cổ,1,thời kì | Trung Cổ,"Trong thời kì Trung Cổ , tử"
55
+ không thể,1,không | thể,điều kiện không thể thiếu của
56
+ toàn thị tộc,1,toàn | thị tộc,và được toàn thị tộc chấp nhận
57
+ đền mạng,1,đền | mạng,"“ mạng đền mạng ” ,"
58
+ Đạo luật Hămmurabi,1,Đạo luật | Hămmurabi,định của Đạo luật Hămmurabi ( thế
59
+ Đạo luật Manu,1,Đạo luật | Manu,và của Đạo luật Manu ( thế
60
+ nhà tư tưởng,1,nhà | tư tưởng,", nhiều nhà tư tưởng đã lên"
61
+ Tuyên ngôn Toàn,1,Tuyên ngôn | Toàn,từ khi Tuyên ngôn Toàn thế giới
62
+ Liên bang Nam Tư,1,Liên bang | Nam Tư,thổ của Liên bang Nam Tư trước đây
63
+ Trước đây,1,Trước | đây,"Trước đây , Liên"
64
+ xuất hiện tại,1,xuất hiện | tại,cũng đã xuất hiện tại những châu
65
+ Ban Bí thư,1,Ban | Bí thư,"tế , Ban Bí thư Trung ương"
66
+ tỉnh thành lập,1,tỉnh | thành lập,ngành cấp tỉnh thành lập Phòng pháp
67
+ luật Dân sự,1,Bộ luật | Dân sự,"như Bộ luật Dân sự , Luật"
68
+ loại hình sinh hoạt,1,loại hình | sinh hoạt,là các loại hình sinh hoạt văn hoá
69
+ ngâm thơ,1,ngâm | thơ,"kịch , ngâm thơ , dựng"
70
+ ban hành đạo luật,1,ban hành | đạo luật,"cứu , ban hành đạo luật riêng về"
71
+ đạo luật hình sự,1,đạo luật | hình sự,khỏi các đạo luật hình sự những quy
72
+ bản thân hành vi,1,bản thân | hành vi,hiểm như bản thân hành vi cố ý
73
+ Pháp luật hình sự,1,Pháp luật | hình sự,"Pháp luật hình sự , xét"
74
+ tồn tại khách quan,1,tồn tại | khách quan,điều kiện tồn tại khách quan đó .
75
+ khách thể loại,1,khách thể | loại,nói chung khách thể loại của nhóm
76
+ từ chương,1,từ | chương,được chuyển từ chương “ Các
77
+ quyền sở hữu,1,quyền | sở hữu,bảo hộ quyền sở hữu công nghiệp
78
+ ngày tháng,1,ngày | tháng,"XII , ngày tháng năm 2008"
79
+ Bộ Luật hình sự,1,Bộ Luật | hình sự,Vì Bộ Luật hình sự 1999 đã
80
+ Hạn chế áp dụng,1,Hạn chế | áp dụng,nhằm “ Hạn chế áp dụng hình phạt
81
+ số ít,1,số | ít,với một số ít loại tội
82
+ quy định Tội,1,quy định | Tội,bổ sung quy định Tội đầu cơ
83
+ Luật Bảo vệ,1,Luật | Bảo vệ,mới của Luật Bảo vệ môi trường
84
+ làm quà,1,làm | quà,"casino , làm quà tặng ,"
85
+ pháp luật tố tụng hình sự,1,pháp luật | tố tụng | hình sự,định của pháp luật tố tụng hình sự .
86
+ vốn Nhà nước,1,vốn | Nhà nước,lớn nguồn vốn Nhà nước của cơ
87
+ hạn chế áp dụng,1,hạn chế | áp dụng,tế ; hạn chế áp dụng hình phạt
88
+ cộng hoà Nghị viện,1,cộng hoà | Nghị viện,chính thể cộng hoà Nghị viện .
89
+ dấy lên,1,dấy | lên,pháp quyền dấy lên như một
90
+ lập hiến Nepal,1,lập hiến | Nepal,Quốc hội lập hiến Nepal đã quyết
91
+ chế độ quân chủ,1,chế độ | quân chủ,bãi bỏ chế độ quân chủ để xây
92
+ nước Nga,1,nước | Nga,"Đức , nước Nga …"
93
+ Nam triều,1,Nam | triều,pháp cho Nam triều : “
94
+ cải tổ thành,1,cải tổ | thành,phải được cải tổ thành chính quyền
95
+ dịch Montesquieu,1,dịch | Montesquieu,"Rousseau , dịch Montesquieu , Nguyễn"
96
+ Hội nghị Versailles,1,Hội nghị | Versailles,gửi đến Hội nghị Versailles vào đầu
97
+ thứ bảy,1,thứ | bảy,và điểm thứ bảy là :
98
+ Có điều,1,Có | điều,Có điều là dựng
99
+ Phàm nhân dân,1,Phàm | nhân dân,: “ Phàm nhân dân nước ta
100
+ sang hèn,1,sang | hèn,"không cứ sang hèn , giầu"
101
+ đuổi đi,1,đuổi | đi,thì nó đuổi đi cũng không
102
+ khuyên Bảo Đại,1,khuyên | Bảo Đại,chí còn khuyên Bảo Đại : “
103
+ bút mặc lòng,1,bút | mặc lòng,", quyền bút mặc lòng ."
104
+ đời tư,1,đời | tư,tự do đời tư .
105
+ bị án,1,bị | án,bản xứ bị án tù chính
106
+ pháp chính,1,pháp | chính,hai quyền pháp chính được ngang
107
+ Mặt khác,1,Mặt | khác,"Mặt khác , quyền"
108
+ Quyền hành chính,1,Quyền | hành chính,2 . Quyền hành chính cần phải
109
+ đánh đổ,1,đánh | đổ,nghị viện đánh đổ .
110
+ cải tổ quốc gia,1,cải tổ | quốc gia,lúc phải cải tổ quốc gia mà chính
111
+ địa diện,1,địa | diện,"chính quyền địa diện , phân"
112
+ bầu Nghị viên,1,bầu | Nghị viên,", việc bầu Nghị viên nhân dân"
113
+ thành Quốc hội,1,thành | Quốc hội,duy trì thành Quốc hội lập pháp
114
+ phúc quyết,1,phúc | quyết,toàn dân phúc quyết ” .
115
+ tư hữu tài sản,1,tư hữu | tài sản,; quyền tư hữu tài sản ( Điều
116
+ chương VI,1,chương | VI,riêng ( chương VI ) quy
117
+ mưu lợi,1,mưu | lợi,đó để mưu lợi cho giai
118
+ bản văn,1,bản | văn,là một bản văn trung lập
119
+ ngược lại,1,ngược | lại,được đi ngược lại ý chí
120
+ tiếng nói chung,1,tiếng nói | chung,để tìm tiếng nói chung trên con
121
+ Luật chứng khoán,1,Luật | chứng khoán,sửa đổi Luật chứng khoán trong 05
122
+ Luật ban hành,1,Luật | ban hành,của các Luật ban hành văn bản
123
+ pháp lí ra,1,pháp lí | ra,"tế , pháp lí ra thành “"
124
+ Cái Công,1,Cái | Công,giữa “ Cái Công ” (
125
+ Cái Tư,1,Cái | Tư,và “ Cái Tư ” (
126
+ mềm dẻo,1,mềm | dẻo,kết hợp mềm dẻo các phương
127
+ ngữ pháp lí,1,từ ngữ | pháp lí,", từ ngữ pháp lí trong các"
128
+ thực thi Công ước,1,thực thi | Công ước,Việt Nam thực thi Công ước Niu-Ước năm
129
+ kèm Biểu,1,kèm | Biểu,MFN đính kèm Biểu cam kết
130
+ kinh tế thị trường,1,kinh tế | thị trường,luật lệ kinh tế thị trường .
131
+ tư duy thực thi,1,tư duy | thực thi,đổi mới tư duy thực thi các cam
132
+ Ban Chấp hành,1,Ban | Chấp hành,2007 của Ban Chấp hành trung ương
133
+ hoạt động tác nghiệp,1,hoạt động | tác nghiệp,chặt chẽ hoạt động tác nghiệp liên quan
134
+ xã hội chủ nghĩa Việt Vam,1,xã hội chủ nghĩa | Việt Vam,pháp quyền xã hội chủ nghĩa Việt Vam .
135
+ vi phạm pháp luật,1,vi phạm | pháp luật,để chống vi phạm pháp luật ” .
136
+ Đại hội Đảng lần,1,Đại hội | Đảng | lần,Văn kiện Đại hội Đảng lần thứ VIII
137
+ Đảng lần thứ,1,Đảng | lần | thứ,quốc của Đảng lần thứ IX vào
138
+ quyền sở hữu tài sản,1,quyền sở hữu | tài sản,"bản như quyền sở hữu tài sản , quyền"
139
+ cạnh tranh công bằng,1,cạnh tranh | công bằng,"xử , cạnh tranh công bằng , minh"
140
+ hành lang pháp lí,1,hành lang | pháp lí,chính là hành lang pháp lí tạo điều
141
+ việc làm,1,việc | làm,chỉ từ việc làm hợp lí
142
+ trở thành công cụ,1,trở thành | công cụ,bước đầu trở thành công cụ chủ yếu
143
+ tuân thủ Hiến pháp,1,tuân thủ | Hiến pháp,tức là tuân thủ Hiến pháp và pháp
144
+ qua lại,1,qua | lại,thời gian qua lại tạo ra
145
+ Điều ước Quốc tế,1,Điều ước | Quốc tế,đến các Điều ước Quốc tế mà Việt
146
+ trình tự do,1,trình tự | do,xét theo trình tự do luật định
147
+ tố tụng dân sự,1,tố tụng | dân sự,"sự , tố tụng dân sự phải được"
148
+ dưới luật,1,dưới | luật,văn bản dưới luật . ”
149
+ có mặt,1,có | mặt,Quốc hội có mặt thuận lợi
150
+ Quốc hội thẩm quyền,1,Uỷ ban Thường vụ Quốc hội | thẩm quyền,Thường vụ Quốc hội thẩm quyền giải thích
151
+ Hội đồng Nhà nước,1,Hội đồng | Nhà nước,chế do Hội đồng Nhà nước ban hành
152
+ Quốc hội đồng ý,1,Quốc hội | đồng ý,đề mà Quốc hội đồng ý được ghi
153
+ ngày trước,1,ngày | trước,là 7 ngày trước ngày khai
154
+ tập hợp lưu,1,tập hợp | lưu,chỉ được tập hợp lưu vào hồ
155
+ bộ thuộc,1,bộ | thuộc,quan ngang bộ thuộc Chính phủ
156
+ Quốc hội thẩm tra,1,Quốc hội | thẩm tra,sách của Quốc hội thẩm tra các dự
157
+ thứ IX,1,thứ | IX,quốc lần thứ IX của Đảng
158
+ bản Tuyên ngôn,1,bản | Tuyên ngôn,"công , bản Tuyên ngôn độc lập"
159
+ Đông Nam Châu Á,1,Đông Nam | Châu Á,dân tộc Đông Nam Châu Á đã được
160
+ thuyết pháp quyền,1,học thuyết | pháp quyền,các học thuyết pháp quyền tư sản
161
+ xã hội chủ nghĩa là,1,xã hội chủ nghĩa | là,pháp quyền xã hội chủ nghĩa là nói tới
162
+ một cách,1,một | cách,nhận như một cách cai trị
163
+ Đảng cộng sản Việt Nam,1,Đảng cộng sản | Việt Nam,đạo của Đảng cộng sản Việt Nam trên nền
164
+ dân lập,1,dân | lập,"ta do dân lập nên ,"
165
+ đè đầu,1,đè | đầu,phải để đè đầu dân ...
166
+ Quốc hội họp,1,Quốc hội | họp,từ một Quốc hội họp theo định
167
+ quy định chế định,1,quy định | chế định,pháp 1992 quy định chế định Chủ tịch
168
+ cơ chế thị trường,1,cơ chế | thị trường,doanh trong cơ chế thị trường định hướng
169
+ liên hiệp hội,1,liên | hiệp hội,"hội , liên hiệp hội , tổ"
170
+ phản biện bác bỏ,1,phản biện | bác bỏ,ý kiến phản biện bác bỏ hoàn toàn
171
+ quản lí nhà nước,1,quản lí | nhà nước,hoạt động quản lí nhà nước và xã
172
+ tư duy trọng,1,tư duy | trọng,"Nam là tư duy trọng tình ,"
173
+ lực cản,1,lực | cản,lùi những lực cản ( nếu
174
+ triều Lý,1,triều | Lý,"Hình thư triều Lý , Hình"
175
+ Quốc triều,1,Quốc | triều,"Trần , Quốc triều Hình luật"
176
+ nhà nước hoá thân,1,nhà nước | hoá thân,chính quyền nhà nước hoá thân trong các
177
+ tổng Cự Linh,1,tổng | Cự Linh,"Khối , tổng Cự Linh , huyện"
178
+ bị trị tội,1,bị | trị tội,trên sẽ bị trị tội ... ”
179
+ lão quyền,1,lão | quyền,"công , lão quyền , nam"
180
+ không chỉ,1,không | chỉ,mâu thuẫn không chỉ giữa các
181
+ phép vua,1,phép | vua,quan niệm phép vua thua “
182
+ giới chức dịch,1,giới | chức dịch,đã được giới chức dịch trong làng
183
+ ngày càng,1,ngày | càng,một đi ngày càng nhiều các
184
+ cộng đồng cấp,1,cộng đồng | cấp,sinh hoạt cộng đồng cấp thôn nếu
185
+ Cách mạng tháng Tám,1,Cách mạng | tháng | Tám,tiếp của Cách mạng tháng Tám do nhân
186
+ căn cứ địa Cao-Bắc-Lạng,1,căn cứ địa | Cao-Bắc-Lạng,"mạng trong căn cứ địa Cao-Bắc-Lạng , từ"
187
+ dân cử,1,dân | cử,đều do dân cử ra ”
188
+ càng hay,1,càng | hay,càng sớm càng hay cuộc tổng
189
+ tổng tuyển cử,1,tổng | tuyển cử,hay cuộc tổng tuyển cử với chế
190
+ chậu cảnh,1,chậu | cảnh,là cái chậu cảnh để trang
191
+ bằng Sắc lệnh,1,bằng | Sắc lệnh,quy định bằng Sắc lệnh của Chính
192
+ hình thức Lệnh,1,hình thức | Lệnh,thế bằng hình thức Lệnh của Chủ
193
+ luật Hình sự,1,Bộ luật | Hình sự,"như Bộ luật Hình sự , Bộ"
194
+ luật tố tụng,1,Bộ luật | tố tụng,các Bộ luật tố tụng ) .
195
+ xa rời,1,xa | rời,công chức xa rời quần chúng
196
+ tạm chiếm,1,tạm | chiếm,dân vùng tạm chiếm ) và
197
+ giảm tức,1,giảm | tức,"tô , giảm tức và tiến"
198
+ Luật Về,1,Luật | Về,như : Luật Về chế độ
199
+ Luật Quyền,1,Luật | Quyền,"họp , Luật Quyền lập hội"
200
+ Luật Bảo đảm,1,Luật | Bảo đảm,"hội , Luật Bảo đảm quyền tự"
201
+ Luật Công đoàn,1,Luật | Công đoàn,"cấp , Luật Công đoàn , Luật"
202
+ Luật Hôn nhân,1,Luật | Hôn nhân,"đoàn , Luật Hôn nhân và gia"
203
+ Hội đồng Bộ trưởng,1,Hội đồng | Bộ trưởng,Hội đồng Bộ trưởng ( theo
204
+ phân quyền lực,1,phân | quyền lực,chức và phân quyền lực Nhà nước
205
+ chống án,1,chống | án,"nhiệm vụ chống án oan ,"
results/word_segmentation/false_splits.csv ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ word,count,predicted_parts,context
2
+ chủ nghĩa hợp hiến,64,chủ nghĩa | hợp hiến,tiếp thu chủ nghĩa hợp hiến ở Việt
3
+ Uỷ ban Thường vụ Quốc hội,32,Uỷ ban | Thường vụ | Quốc hội,2003 của Uỷ ban Thường vụ Quốc hội về bồi
4
+ hình sự hoá,28,hình sự | hoá,"Vấn đề hình sự hoá , phi"
5
+ Bộ luật hình sự,24,Bộ | luật hình sự,so với Bộ luật hình sự năm 1985
6
+ Hiến pháp 1946,24,Hiến pháp | 1946,", khi Hiến pháp 1946 đã được"
7
+ phi hình sự hoá,18,phi hình sự | hoá,"hoá , phi hình sự hoá trong chính"
8
+ Bên cạnh,15,Bên | cạnh,"Bên cạnh đó ,"
9
+ nào đó,14,nào | đó,phạm tội nào đó thì cũng
10
+ phi tội phạm hoá,11,phi | tội phạm hoá,"hoá , phi tội phạm hoá ."
11
+ nhà lập pháp,11,nhà | lập pháp,quyền của nhà lập pháp .
12
+ tội phạm hoá,8,tội phạm | hoá,"hoá , tội phạm hoá những hành"
13
+ quyền tự do dân chủ,8,quyền | tự do | dân chủ,hành các quyền tự do dân chủ cho dân
14
+ bên cạnh,8,bên | cạnh,"này , bên cạnh việc lựa"
15
+ tái áp dụng,7,tái | áp dụng,bang lại tái áp dụng như Carôlin
16
+ cơ quan quyền lực nhà nước,7,cơ quan quyền lực | nhà nước,", một cơ quan quyền lực nhà nước cao nhất"
17
+ cùng với,6,cùng | với,tương ứng cùng với sự phát
18
+ trưng cầu dân ý,6,trưng cầu | dân ý,tiến hành trưng cầu dân ý về bãi
19
+ Bộ Tư pháp,6,Bộ | Tư pháp,Bộ trưởng Bộ Tư pháp làm Trưởng
20
+ vụ án,6,vụ | án,xảy ra vụ án hoặc nơi
21
+ nhất là,6,nhất | là,"gắt , nhất là Nguyễn Ái"
22
+ người ta,6,người | ta,", mà người ta đã phải"
23
+ Chủ tịch nước,6,Chủ tịch | nước,đối của Chủ tịch nước ( giống
24
+ Luật ban hành văn bản quy phạm pháp luật,6,Luật | ban hành | văn bản | quy phạm pháp luật,thảo như Luật ban hành văn bản quy phạm pháp luật năm 1996
25
+ Hình sự hoá,5,Hình sự | hoá,Hình sự hoá và tội
26
+ nhà ở,5,nhà | ở,xâm phạm nhà ở và thư
27
+ nội luật hoá,5,nội | luật hoá,WTO để nội luật hoá các quy
28
+ Bộ luật,4,Bộ | luật Dân sự,( như Bộ luật Dân sự
29
+ Bộ luật Hình sự,4,Bộ | luật Hình sự,"( như Bộ luật Hình sự , các"
30
+ phép vua thua lệ làng,4,phép vua | thua lệ làng,lí “ phép vua thua lệ làng ” có
31
+ Chủ nghĩa hợp hiến,4,Chủ nghĩa | hợp hiến,Chủ nghĩa hợp hiến ở phương
32
+ chuyên chính vô sản,4,chuyên chính | vô sản,"thực hiện chuyên chính vô sản , tổ"
33
+ Hội đồng Dân tộc,4,Hội đồng | Dân tộc,gia của Hội đồng Dân tộc và Uỷ
34
+ làm chủ,3,làm | chủ,nhân dân làm chủ đất nước
35
+ Cùng với,3,Cùng | với,Cùng với việc khẳng
36
+ tam quyền phân lập,3,tam quyền | phân lập,"quyền , tam quyền phân lập , tinh"
37
+ Tuyên ngôn độc lập,3,đọc Tuyên ngôn | độc lập,"khi đọc Tuyên ngôn độc lập , trong"
38
+ Việt Nam dân chủ cộng hoà,3,Việt Nam | dân chủ | cộng hoà,"của nước Việt Nam dân chủ cộng hoà , Quốc"
39
+ đấu tranh giai cấp,3,đấu tranh | giai cấp,khi cuộc đấu tranh giai cấp đã dành
40
+ nhà làm luật,3,nhà | làm luật,"vậy , nhà làm luật khi xây"
41
+ Mặt trận Tổ quốc Việt Nam,3,Mặt trận | Tổ quốc | Việt Nam,"dân , Mặt trận Tổ quốc Việt Nam và các"
42
+ đạo dụ,3,đạo | dụ,"này , đạo dụ của Lê"
43
+ tập trung dân chủ,3,tập trung | dân chủ,nguyên tắc tập trung dân chủ ” (
44
+ trở về,2,trở | về,"thứ 18 trở về sau ,"
45
+ hình thái kinh tế,2,hình thái | kinh tế,trong từng hình thái kinh tế - xã
46
+ Thế nhưng,2,Thế | nhưng,"Thế nhưng , ý"
47
+ người dân,2,người | dân,đến với người dân
48
+ Luật PBGDPL,2,Luật | PBGDPL,Dự thảo Luật PBGDPL để sớm
49
+ Bộ luật Dân sự,2,Bộ | luật Dân sự,"pháp , Bộ luật Dân sự , Bộ"
50
+ cơ sở vật chất,2,cơ sở | vật chất,"người , cơ sở vật chất , kinh"
51
+ Ban Bí thư,2,Ban | Bí thư,2007 của Ban Bí thư về việc
52
+ Tổ chức thương mại thế giới,2,Tổ chức thương mại | thế giới,gia nhập Tổ chức thương mại thế giới ( WTO
53
+ niềm tin,2,niềm | tin,cơ sở niềm tin nội tâm
54
+ quy phạm pháp luật,2,quy phạm pháp | luật hình sự,dụng các quy phạm pháp luật hình sự
55
+ quyền tác giả,2,quyền | tác giả,"xâm phạm quyền tác giả , tội"
56
+ một trăm năm mươi triệu,2,một | trăm | năm mươi | triệu,lượng dưới một trăm năm mươi triệu đồng ”
57
+ rửa tiền,2,rửa | tiền,hành vi rửa tiền xảy ra
58
+ như là,2,như | là,và Mỹ như là sự bảo
59
+ danh từ,2,danh | từ,trong khi danh từ hiến pháp
60
+ Tinh thần pháp luật,2,Tinh thần | pháp luật,Tinh thần pháp luật của Montesquieu
61
+ Khế ước xã hội,2,Khế ước | xã hội,Montesquieu và Khế ước xã hội của Rousseau
62
+ chế độ quân chủ chuyên chế,2,chế độ quân chủ | chuyên chế,đã bị chế độ quân chủ chuyên chế cai trị
63
+ Đảng cộng sản,2,Đảng | cộng sản,đạo của Đảng cộng sản .
64
+ chủ nghĩa Mác,2,chủ nghĩa | Mác,"niệm của chủ nghĩa Mác , hiến"
65
+ nói lên,2,nói | lên,chính cũng nói lên tính chất
66
+ gọi là,2,gọi | là,thì được gọi là hàng hoá
67
+ Hiệp định GATS,2,Hiệp định | GATS,2 của Hiệp định GATS với điều
68
+ Ban chấp hành trung ương Đảng,2,Ban chấp hành | trung ương | Đảng,"bí thư Ban chấp hành trung ương Đảng , đã"
69
+ quốc kế dân sinh,2,quốc kế | dân sinh,vấn đề quốc kế dân sinh .
70
+ phương tiện thông tin đại chúng,2,phương tiện | thông tin đại chúng,", các phương tiện thông tin đại chúng còn thông"
71
+ Uỷ ban Pháp luật,2,Uỷ ban | Pháp luật,ii ) Uỷ ban Pháp luật của Quốc
72
+ Uỷ ban pháp luật,2,Uỷ ban | pháp luật,Còn Uỷ ban pháp luật thì thẩm
73
+ cách mạng tư sản,2,cách mạng | tư sản,"các cuộc cách mạng tư sản , các"
74
+ "ăn miếng, trả miếng",1,"ăn miếng, | trả miếng","là “ ăn miếng, trả miếng ” ,"
75
+ "răng đền răng, mạng đền mạng",1,"răng | đền | răng, | mạng | đền mạng",", “ răng đền răng, mạng đền mạng ."
76
+ lí do,1,lí | do đó,"Bởi lí do đó ,"
77
+ nhân từ,1,nhân | từ,"đối xử nhân từ , có"
78
+ tồn tại xã hội,1,tồn tại | xã hội,định bởi tồn tại xã hội .
79
+ vì sao,1,vì | sao,lí giải vì sao mà trong
80
+ cộng sản nguyên thuỷ,1,cộng sản | nguyên thuỷ,"xã hội cộng sản nguyên thuỷ , đối"
81
+ chế độ tư hữu,1,chế độ | tư hữu,"hội , chế độ tư hữu ra đời"
82
+ Carl V,1,Carl | V,"triều vua Carl V , tất"
83
+ tư bản chủ nghĩa,1,tư bản | chủ nghĩa,"sản xuất tư bản chủ nghĩa , xuất"
84
+ Bàn về tinh thần của pháp luật,1,Bàn | về | tinh thần | của | pháp luật,"như “ Bàn về tinh thần của pháp luật ” ,"
85
+ Shalia Mon'tkiơ,1,Shalia | Mon'tkiơ,"1748 của Shalia Mon'tkiơ , “"
86
+ Bàn về tội phạm và hình phạt,1,Bàn | về | tội phạm | và | hình phạt,", “ Bàn về tội phạm và hình phạt ” xuất"
87
+ Pháp luật của tự nhiên hoặc tinh thần hợp chân lí tự nhiên của pháp luật,1,Pháp luật | của | tự nhiên | hoặc | tinh thần | hợp | chân lí tự nhiên | của | pháp luật,", “ Pháp luật của tự nhiên hoặc tinh thần hợp chân lí tự nhiên của pháp luật ” xuất"
88
+ Các nguyên tắc của luật hình sự,1,Các | nguyên tắc | của | luật hình sự,", “ Các nguyên tắc của luật hình sự ” xuất"
89
+ mười tám,1,mười | tám,nhất là mười tám nước Tây
90
+ Ai Len,1,Ai | Len,"Đức , Ai Len , Aixơlen"
91
+ Hiệp định chung Châu Âu,1,Hiệp định | chung | Châu Âu,thứ VI Hiệp định chung Châu Âu về quyền
92
+ chân giá trị,1,chân | giá trị,phủ nhận chân giá trị của con
93
+ tạo dựng,1,tạo | dựng,góp phần tạo dựng nền tảng
94
+ Trưởng Ban,1,Trưởng | Ban,pháp làm Trưởng Ban đã bắt
95
+ Công ti trách nhiệm hữu hạn,1,Công ti | trách nhiệm | hữu hạn,dụ : Công ti trách nhiệm hữu hạn một thành
96
+ trưởng bản,1,trưởng | bản,"làng , trưởng bản , bí"
97
+ Luật Biên giới quốc gia,1,Luật Biên giới | quốc gia,"thông , Luật Biên giới quốc gia , Luật"
98
+ Luật Bảo vệ và phát triển rừng,1,Luật Bảo vệ | và | phát triển | rừng,"gia , Luật Bảo vệ và phát triển rừng , Pháp"
99
+ Pháp lệnh Xử lí vi phạm hành chính,1,Pháp lệnh | Xử lí | vi phạm | hành chính,"rừng , Pháp lệnh Xử lí vi phạm hành chính , Pháp"
100
+ Pháp lệnh Vệ sinh an toàn thực phẩm,1,Pháp lệnh | Vệ sinh | an toàn | thực phẩm,"chính , Pháp lệnh Vệ sinh an toàn thực phẩm ... )"
101
+ Luật Đầu tư,1,Luật | Đầu tư,"( như Luật Đầu tư , Luật"
102
+ Luật Cạnh tranh,1,Luật | Cạnh tranh,"mại , Luật Cạnh tranh , các"
103
+ "Luật Bảo vệ, Chăm sóc và giáo dục trẻ em",1,"Luật Bảo | vệ, | Chăm sóc | và | giáo dục | trẻ em","dục , Luật Bảo vệ, Chăm sóc và giáo dục trẻ em , Luật"
104
+ Luật Khoa học và công nghệ,1,Luật Khoa học | và | công nghệ,"em , Luật Khoa học và công nghệ , Pháp"
105
+ Pháp lệnh Người cao tuổi,1,Pháp lệnh | Người | cao tuổi,"nghệ , Pháp lệnh Người cao tuổi , Pháp"
106
+ Pháp lệnh Người tàn tật,1,Pháp lệnh | Người | tàn tật,"tuổi , Pháp lệnh Người tàn tật , Pháp"
107
+ "Pháp lệnh Tín ngưỡng, tôn giáo",1,"Pháp lệnh | Tín ngưỡng, | tôn giáo","tật , Pháp lệnh Tín ngưỡng, tôn giáo ... )"
108
+ cuộc thi,1,cuộc | thi,chức các cuộc thi tìm hiểu
109
+ Cổng thông tin điện tử,1,Cổng | thông tin | điện tử,", có Cổng thông tin điện tử với trang"
110
+ Thông tấn xã Việt Nam,1,Thông tấn xã | Việt Nam,"ngoài ( Thông tấn xã Việt Nam ) ,"
111
+ Bộ Tài nguyên và Môi trường,1,Bộ | Tài nguyên và Môi trường,"tuyến ( Bộ Tài nguyên và Môi trường ) ,"
112
+ khu công nghiệp,1,khu | công nghiệp,nhân các khu công nghiệp ( Bình
113
+ Bộ Tài chính,1,Bộ | Tài chính,Bộ Tài chính đã ban
114
+ tờ gấp,1,tờ | gấp,"sách , tờ gấp pháp luật"
115
+ đĩa hình,1,đĩa | hình,"băng , đĩa hình , đĩa"
116
+ giáo dục công dân,1,giáo dục | công dân,"dạy môn giáo dục công dân , pháp"
117
+ báo nói,1,báo | nói,"gồm cả báo nói , báo"
118
+ báo hình,1,báo | hình,"viết , báo hình , báo"
119
+ "Luật Phổ biến, giáo dục pháp luật",1,"Luật Phổ biến, | giáo dục | pháp luật","Xây dựng Luật Phổ biến, giáo dục pháp luật"
120
+ Trung ương Đảng,1,Trung ương | Đảng,Bí thư Trung ương Đảng ( khoá
121
+ Luật tiếp cận thông tin,1,Luật | tiếp cận | thông tin,XII có Luật tiếp cận thông tin .
122
+ đe doạ xâm hại,1,đe doạ | xâm hại,hại hoặc đe doạ xâm hại các mối
123
+ trìu tượng,1,trìu | tượng,"có tính trìu tượng cao ,"
124
+ Luật khiếu nại tố cáo,1,Luật | khiếu nại | tố cáo,chỉnh trong Luật khiếu nại tố cáo đối với
125
+ có giá,1,có | giá,giấy tờ có giá giả khác
126
+ đạo luật,1,đạo | luật hình sự,cả những đạo luật hình sự
127
+ chôn vùi,1,chôn | vùi,"nước , chôn vùi vào đất"
128
+ Tội phạm hoá,1,Tội phạm | hoá,Tội phạm hoá những hành
129
+ Hội đồng bộ trưởng Pháp,1,Hội đồng bộ trưởng | Pháp,thông qua Hội đồng bộ trưởng Pháp .
130
+ thống xứ,1,thống | xứ,do viên thống xứ đứng đầu
131
+ Tâm địa thực dân,1,Tâm địa | thực dân,"kể đến Tâm địa thực dân , Bình"
132
+ Vực thẳm thuộc địa,1,Vực thẳm | thuộc địa,"đẳng , Vực thẳm thuộc địa , Công"
133
+ Công cuộc khai hoá giết người,1,Công cuộc | khai hoá | giết | người,"địa , Công cuộc khai hoá giết người , những"
134
+ Bản án chế độ thực dân Pháp,1,Bản án | chế độ | thực dân | Pháp,tác phẩm Bản án chế độ thực dân Pháp .
135
+ ưu thời mẫn thế,1,ưu thời | mẫn thế,những người ưu thời mẫn thế của dân
136
+ Baron de Montesquieu,1,Baron | de Montesquieu,"Smith , Baron de Montesquieu , John"
137
+ chuyên đế,1,chuyên | đế,quân chủ chuyên đế để bước
138
+ Vạn pháp tinh lí,1,Vạn pháp | tinh lí,đó là Vạn pháp tinh lí và Xã
139
+ Xã ước,1,Xã | ước,lí và Xã ước .
140
+ quân chủ,1,quân | chủ,của nền quân chủ phương Đông
141
+ phương Đông,1,phương | Đông,quân chủ phương Đông .
142
+ đảm thụ,1,đảm | thụ,"không được đảm thụ , trăm"
143
+ bền chặt,1,bền | chặt,"Nam được bền chặt , thì"
144
+ quân chủ lập hiến,1,quân chủ | lập hiến,chính quyền quân chủ lập hiến dưới sự
145
+ Chế độ quân chủ lập hiến,1,Chế độ quân chủ | lập hiến,Chế độ quân chủ lập hiến mà Phạm
146
+ Pháp Việt,1,Pháp | Việt,trương “ Pháp Việt đề huề
147
+ Về chế độ dân chủ ở Mỹ,1,Về | chế độ | dân chủ | ở | Mỹ,giả cuốn Về chế độ dân chủ ở Mỹ ) .
148
+ Âu châu,1,Âu | châu,như người Âu châu ” và
149
+ tựa đề,1,tựa | đề,ca với tựa đề Việt Nam
150
+ Việt Nam yêu cầu ca,1,Việt Nam | yêu cầu | ca,tựa đề Việt Nam yêu cầu ca ( 1922
151
+ Nhóm Thanh Nghị,1,Nhóm | Thanh Nghị,"kể đến Nhóm Thanh Nghị , trong"
152
+ nhà luật học,1,nhà | luật học,là các nhà luật học Phan Anh
153
+ bất di bất dịch,1,bất di | bất dịch,"trở thành bất di bất dịch , được"
154
+ quân trị chủ nghĩa,1,quân | trị | chủ nghĩa,bàn về quân trị chủ nghĩa và dân
155
+ dân trị chủ nghĩa,1,dân trị | chủ nghĩa,nghĩa và dân trị chủ nghĩa ở Sài
156
+ quân trị,1,quân | trị,so sánh quân trị và dân
157
+ chế độ dân chủ,1,chế độ | dân chủ,xác lập chế độ dân chủ .
158
+ đảo chính,1,đảo | chính,"khi Nhật đảo chính Pháp ,"
159
+ khước từ,1,khước | từ,Kháng đã khước từ lời mời
160
+ xuất đầu lộ diện,1,xuất đầu | lộ diện,núi thẳm xuất đầu lộ diện làm nên
161
+ chưa biết chừng,1,chưa | biết chừng,việc cũng chưa biết chừng .
162
+ chủ nghĩa đế quốc,1,chủ nghĩa | đế quốc,đánh đuổi chủ nghĩa đế quốc phát xít
163
+ Đại diện chính trị,1,Đại diện | chính trị,"Trong bài Đại diện chính trị , Phan"
164
+ nhà chính tr���,1,nhà | chính trị,", các nhà chính trị đều công"
165
+ đại chính,1,đại | chính,chế độ đại chính ” (
166
+ régime représentatif,1,régime | représentatif,"” ( régime représentatif ) ,"
167
+ nhà cầm quyền,1,nhà | cầm quyền,"Mà nhà cầm quyền nào ,"
168
+ nhậy bén,1,nhậy | bén,nếu không nhậy bén thấu rõ
169
+ pháp hiến,1,pháp | hiến,Trải xem pháp hiến các nước
170
+ con người,1,con | người,đề quyền con người ở Việt
171
+ Yêu sách của nhân dân An Nam,1,Yêu sách | của | nhân dân | An Nam,"Trong bản Yêu sách của nhân dân An Nam , Người"
172
+ nghị hội,1,nghị | hội,án trước nghị hội .
173
+ Nghị hội,1,Nghị | hội,Nghị hội tức là
174
+ chế độ đại nghị,1,chế độ | đại nghị,thần của chế độ đại nghị được xây
175
+ Tham chính viện,1,Tham chính | viện,ở một Tham chính viện gồm các
176
+ Gouvernment Présidentiel,1,Gouvernment | Présidentiel,thống ( Gouvernment Présidentiel ) .
177
+ cầm quyền,1,cầm | quyền,trực tiếp cầm quyền hành chính
178
+ tấp tiến,1,tấp | tiến,viện được tấp tiến ; 2
179
+ Hồi Ký Thanh Nghị,1,Hồi Ký | Thanh Nghị,Hồi Ký Thanh Nghị của Vũ
180
+ cho biết,1,cho | biết,Đình Hoè cho biết ông Bùi
181
+ Nam triều,1,Nam | triều,Hình của Nam triều thật ra
182
+ Tạp chí Độc lập,1,Tạp chí | Độc lập,lập trên Tạp chí Độc lập .
183
+ ảnh huởng,1,ảnh | huởng,Mác-Lênin sẽ ảnh huởng đến tinh
184
+ Những nguyên lí của chủ nghĩa cộng sản,1,Những | nguyên lí | của | chủ nghĩa cộng sản,phẩm “ Những nguyên lí của chủ nghĩa cộng sản ” được
185
+ câu hỏi,1,câu | hỏi,Ăng-ghen cho câu hỏi “ Những
186
+ phương Tây,1,phương | Tây,do ở phương Tây ; ngược
187
+ Khuất Duy Tiến,1,Khuất | Duy Tiến,Khuất Duy Tiến đã tranh
188
+ chế độ một viện,1,chế độ | một viện,cấu theo chế độ một viện .
189
+ Chế độ một viện,1,Chế độ | một viện,Chế độ một viện là có
190
+ nội các chế,1,nội các | chế,) ; nội các chế ( nội
191
+ văn thức,1,văn | thức,vậy các văn thức quen thuộc
192
+ Tổ chức Thương mại Thế giới,1,Tổ chức | Thương mại | Thế giới,"viên của Tổ chức Thương mại Thế giới , sau"
193
+ khơi dậy,1,khơi | dậy,"hơn , khơi dậy mạnh mẽ"
194
+ Hiệp định Marrakesh,1,Hiệp định | Marrakesh,Khoản 4 Hiệp định Marrakesh về thành
195
+ Chuyển phát,1,Chuyển | phát,chính và Chuyển phát để có
196
+ phối kết hợp,1,phối | kết hợp,"hạn , phối kết hợp mềm dẻo"
197
+ Nội luật hoá,1,Nội | luật hoá,thức “ Nội luật hoá ” (
198
+ từ ngữ,1,từ | ngữ pháp lí,"niệm , từ ngữ pháp lí"
199
+ Bộ luật dân sự,1,Bộ | luật dân sự,"Bộ luật dân sự , Luật"
200
+ Luật sở hữu trí tuệ,1,Luật | sở hữu trí tuệ,"sự , Luật sở hữu trí tuệ và các"
201
+ Pacta sunt servanda,1,Pacta | sunt | servanda,Nam ( Pacta sunt servanda ) và
202
+ vụ kiện,1,vụ | kiện,gần 400 vụ kiện giữa các
203
+ Luật phá sản doanh nghiệp,1,Luật | phá sản | doanh nghiệp,Đó là Luật phá sản doanh nghiệp ( 1993
204
+ Luật khuyến khích đầu tư trong nước,1,Luật | khuyến khích | đầu tư | trong | nước,") , Luật khuyến khích đầu tư trong nước ( 1994"
205
+ Luật doanh nghiệp nhà nước,1,Luật | doanh nghiệp | nhà nước,") , Luật doanh nghiệp nhà nước ( 1995"
206
+ Luật hợp tác xã,1,Luật | hợp tác xã,") , Luật hợp tác xã ( 1996"
207
+ Luật ngân sách nhà nước,1,Luật | ngân sách | nhà nước,") , Luật ngân sách nhà nước ( 1996"
208
+ Tổ chức Thương Mại Thế giới,1,Tổ chức | Thương Mại | Thế giới,thức của Tổ chức Thương Mại Thế giới ( WTO
209
+ kì họp,1,kì | họp,định tại kì họp gần nhất
210
+ Hội đồng Nhân dân,1,Hội đồng | Nhân dân,thành lập Hội đồng Nhân dân và Uỷ
211
+ Toà án Nhân dân Tối cao,1,Toà án Nhân dân | Tối cao,"phủ , Toà án Nhân dân Tối cao , Viện"
212
+ Viện Kiểm sát Nhân dân Tối cao,1,Viện Kiểm sát Nhân dân | Tối cao,"cao , Viện Kiểm sát Nhân dân Tối cao , Mặt"
213
+ Luật Tổ chức Quốc hội,1,Luật Tổ chức | Quốc hội,và của Luật Tổ chức Quốc hội năm 2001
214
+ Văn phòng Chính phủ,1,Văn phòng | Chính phủ,luật thuộc Văn phòng Chính phủ để tổ
215
+ Văn phòng Quốc hội,1,Văn phòng | Quốc hội,luận về Văn phòng Quốc hội chậm nhất
216
+ bởi lẽ,1,bởi | lẽ,"kiến , bởi lẽ số lượng"
217
+ Bộ luật tố tụng hình sự,1,Bộ | luật tố tụng hình sự,sự ; Bộ luật tố tụng hình sự ; Luật
218
+ Luật hôn nhân và gia đình,1,Luật | hôn nhân | và | gia đình,sự ; Luật hôn nhân và gia đình ; Luật
219
+ Luật Đất đai,1,Luật | Đất đai,đình ; Luật Đất đai ; Bộ
220
+ Bộ luật Lao động,1,Bộ luật | Lao động,đai ; Bộ luật Lao động ; Bộ
221
+ Luật thuế sử dụng đất nông nghiệp,1,Luật | thuế | sử dụng | đất | nông nghiệp,sự ; Luật thuế sử dụng đất nông nghiệp ; Luật
222
+ sợi chỉ đỏ,1,sợi | chỉ đỏ,là “ sợi chỉ đỏ ” liên
223
+ Làm luật,1,Làm | luật,“ Làm luật phần nào
224
+ bề dày,1,bề | dày,tiễn có bề dày kinh nghiệm
225
+ Bộ tài chính,1,Bộ | tài chính,"bộ như Bộ tài chính , Bộ"
226
+ Bộ kế hoạch và đầu tư,1,Bộ | kế hoạch | và | đầu tư,"chính , Bộ kế hoạch và đầu tư , Bộ"
227
+ Bộ xây dựng,1,Bộ | xây dựng,"tư , Bộ xây dựng , Bộ"
228
+ Bộ công nghiệp,1,Bộ | công nghiệp,"dựng , Bộ công nghiệp , Ngân"
229
+ Ngân hàng Nhà nước Việt Nam,1,Ngân hàng | Nhà nước | Việt Nam,"nghiệp , Ngân hàng Nhà nước Việt Nam ..."
230
+ Toà án nhân dân tối cao,1,Toà án | nhân dân | tối cao,"Chánh án Toà án nhân dân tối cao , của"
231
+ Viện kiểm sát nhân dân tối cao,1,Viện kiểm sát | nhân dân | tối cao,Viện trưởng Viện kiểm sát nhân dân tối cao .
232
+ gần như,1,gần | như,giá trị gần như chính thức
233
+ lượng hoá,1,lượng | hoá,", việc lượng hoá ý kiến"
234
+ chủ nghĩa lập hiến,1,chủ nghĩa | lập hiến,pháp 1946 chủ nghĩa lập hiến và quyền
235
+ học thuyết,1,học | thuyết pháp quyền,", các học thuyết pháp quyền"
236
+ nhân trị,1,nhân | trị,"người ( nhân trị ) ,"
237
+ chủ nghĩa Mác Lê-nin,1,chủ nghĩa | Mác | Lê-nin,nền tảng chủ nghĩa Mác Lê-nin và tư
238
+ CHXHCN Việt Nam,1,CHXHCN | Việt Nam,Nhà nước CHXHCN Việt Nam là nhà
239
+ khoan thư,1,khoan | thư,; “ khoan thư sức dân
240
+ Toà án nhân dân,1,Toà án | nhân dân,nhất ; Toà án nhân dân tối cao
241
+ sát thực,1,sát | thực,một cách sát thực và trực
242
+ bắt đầu từ,1,bắt đầu | từ,phải được bắt đầu từ một Chính
243
+ phi Chính phủ,1,phi | Chính phủ,tổ chức phi Chính phủ .
244
+ chất xúc tác,1,chất | xúc tác,chất là chất xúc tác cho hoạt
245
+ Đành rằng,1,Đành | rằng,Đành rằng để xác
246
+ chính sự,1,chính | sự,làm cho chính sự được ngay
247
+ hợp hoà,1,hợp | hoà,ngày một hợp hoà ... ”
248
+ khác lạ,1,khác | lạ,phong tục khác lạ thì có
249
+ hệ tư tưởng,1,hệ | tư tưởng,nhập vào hệ tư tưởng làng xã
250
+ Quốc triều hình luật,1,Quốc triều | hình luật,hương các Quốc triều hình luật của các
251
+ ăn cây nào rào cây ấy,1,ăn | cây | nào | rào | cây | ấy,"kiểu “ ăn cây nào rào cây ấy ” ,"
252
+ ở đình nào chúc đình ấy,1,ở | đình | nào | chúc | đình | ấy,", “ ở đình nào chúc đình ấy ” ,"
253
+ "trống làng nào làng ấy đánh, thánh làng nào, làng ấy thờ",1,"trống | làng | nào | làng | ấy | đánh, | thánh | làng | nào, | làng | ấy | thờ",", “ trống làng nào làng ấy đánh, thánh làng nào, làng ấy thờ ” ,"
254
+ ngầm ẩn,1,ngầm | ẩn,những mạch ngầm ẩn dưới tầng
255
+ gạn đục khơi trong,1,gạn | đục | khơi | trong,"thức “ gạn đục khơi trong ” ,"
256
+ ngày nay,1,ngày | nay,Làng ngày nay không còn
257
+ Câu hỏi,1,Câu | hỏi,Câu hỏi còn bỏ
258
+ tư liệu sản xuất,1,tư liệu | sản xuất,"chủ về tư liệu sản xuất , làm"
259
+ làm tròn,1,làm | tròn,mình chưa làm tròn nhiệm vụ
260
+ phổ thông đầu phiếu,1,phổ thông | đầu phiếu,chế độ phổ thông đầu phiếu .
261
+ nhà yêu nước,1,nhà | yêu | nước,qua các nhà yêu nước như Phan
262
+ đặc quyền đặc lợi,1,đặc quyền | đặc lợi,bỏ những đặc quyền đặc lợi của thực
263
+ tuân theo,1,tuân | theo,sát việc tuân theo pháp luật
264
+ Ban chấp hành Trung ương Đảng,1,Ban chấp hành | Trung ương | Đảng,thứ 2 Ban chấp hành Trung ương Đảng khoá VII
265
+ chế độ dân chủ nhân dân,1,chế độ dân chủ | nhân dân,hiểm cho chế độ dân chủ nhân dân .
266
+ luật dân sự,1,luật | dân sự,chế định luật dân sự và tố
267
+ luật quốc tế,1,luật | quốc tế,"quy phạm luật quốc tế , các"
268
+ vi hiến,1,vi | hiến,hành vi vi hiến của cơ
src/conf/model/default.yaml CHANGED
@@ -1,7 +1,7 @@
1
- trainer: underthesea-core
2
- c1: 1.0
3
  c2: 0.001
4
- max_iterations: 100
5
 
6
  # Feature groups for ablation study
7
  # Set any group to false to disable it
@@ -13,3 +13,5 @@ features:
13
  right: true # G5: S[1], S[1].lower, S[2], S[2].lower
14
  bigram: true # G6: S[-1,0], S[0,1]
15
  trigram: true # G7: S[-1,0,1]
 
 
 
1
+ trainer: python-crfsuite
2
+ c1: 0.5
3
  c2: 0.001
4
+ max_iterations: 300
5
 
6
  # Feature groups for ablation study
7
  # Set any group to false to disable it
 
13
  right: true # G5: S[1], S[1].lower, S[2], S[2].lower
14
  bigram: true # G6: S[-1,0], S[0,1]
15
  trigram: true # G7: S[-1,0,1]
16
+ dictionary: true # G8: Dictionary lookup (external Viet74K: +0.26% word F1)
17
+ dictionary_source: external # "training", "external", "combined"
src/evaluate_word_segmentation.py ADDED
@@ -0,0 +1,740 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Error analysis script for Vietnamese Word Segmentation (TRE-1).
3
+
4
+ Loads a trained VLSP 2013 model, predicts on the test set, and performs
5
+ detailed error analysis across multiple dimensions:
6
+ - Syllable-level confusion (B/I)
7
+ - Word-level false splits and false joins
8
+ - Error rate by word length
9
+ - Top error patterns with context
10
+ - Boundary errors (near sentence start/end)
11
+
12
+ Usage:
13
+ source .venv/bin/activate
14
+ python src/evaluate_word_segmentation.py
15
+ python src/evaluate_word_segmentation.py --model models/word_segmentation/vlsp2013
16
+ python src/evaluate_word_segmentation.py --output results/word_segmentation
17
+ """
18
+
19
+ import csv
20
+ from collections import Counter, defaultdict
21
+ from pathlib import Path
22
+
23
+ import click
24
+
25
+ PROJECT_ROOT = Path(__file__).parent.parent
26
+
27
+
28
+ # ============================================================================
29
+ # Feature Extraction (duplicated from train_word_segmentation.py)
30
+ # ============================================================================
31
+
32
+ FEATURE_GROUPS = {
33
+ "form": ["S[0]", "S[0].lower"],
34
+ "type": ["S[0].istitle", "S[0].isupper", "S[0].isdigit", "S[0].ispunct", "S[0].len"],
35
+ "morphology": ["S[0].prefix2", "S[0].suffix2"],
36
+ "left": ["S[-1]", "S[-1].lower", "S[-2]", "S[-2].lower"],
37
+ "right": ["S[1]", "S[1].lower", "S[2]", "S[2].lower"],
38
+ "bigram": ["S[-1,0]", "S[0,1]"],
39
+ "trigram": ["S[-1,0,1]"],
40
+ "dictionary": ["S[-1,0].in_dict", "S[0,1].in_dict"],
41
+ }
42
+
43
+
44
+ def get_all_templates():
45
+ """Return all feature templates (all groups enabled)."""
46
+ templates = []
47
+ for group_templates in FEATURE_GROUPS.values():
48
+ templates.extend(group_templates)
49
+ return templates
50
+
51
+
52
+ def get_syllable_at(syllables, position, offset):
53
+ idx = position + offset
54
+ if idx < 0:
55
+ return "__BOS__"
56
+ elif idx >= len(syllables):
57
+ return "__EOS__"
58
+ return syllables[idx]
59
+
60
+
61
+ def is_punct(s):
62
+ return len(s) == 1 and not s.isalnum()
63
+
64
+
65
+ def load_dictionary(path):
66
+ """Load dictionary from a text file (one word per line)."""
67
+ dictionary = set()
68
+ with open(path, encoding="utf-8") as f:
69
+ for line in f:
70
+ line = line.strip()
71
+ if line:
72
+ dictionary.add(line)
73
+ return dictionary
74
+
75
+
76
+ def extract_syllable_features(syllables, position, active_templates, dictionary=None):
77
+ active = set(active_templates)
78
+ features = {}
79
+
80
+ s0 = get_syllable_at(syllables, position, 0)
81
+ is_boundary = s0 in ("__BOS__", "__EOS__")
82
+
83
+ if "S[0]" in active:
84
+ features["S[0]"] = s0
85
+ if "S[0].lower" in active:
86
+ features["S[0].lower"] = s0.lower() if not is_boundary else s0
87
+ if "S[0].istitle" in active:
88
+ features["S[0].istitle"] = str(s0.istitle()) if not is_boundary else "False"
89
+ if "S[0].isupper" in active:
90
+ features["S[0].isupper"] = str(s0.isupper()) if not is_boundary else "False"
91
+ if "S[0].isdigit" in active:
92
+ features["S[0].isdigit"] = str(s0.isdigit()) if not is_boundary else "False"
93
+ if "S[0].ispunct" in active:
94
+ features["S[0].ispunct"] = str(is_punct(s0)) if not is_boundary else "False"
95
+ if "S[0].len" in active:
96
+ features["S[0].len"] = str(len(s0)) if not is_boundary else "0"
97
+ if "S[0].prefix2" in active:
98
+ features["S[0].prefix2"] = s0[:2] if not is_boundary and len(s0) >= 2 else s0
99
+ if "S[0].suffix2" in active:
100
+ features["S[0].suffix2"] = s0[-2:] if not is_boundary and len(s0) >= 2 else s0
101
+
102
+ s_1 = get_syllable_at(syllables, position, -1)
103
+ s_2 = get_syllable_at(syllables, position, -2)
104
+ if "S[-1]" in active:
105
+ features["S[-1]"] = s_1
106
+ if "S[-1].lower" in active:
107
+ features["S[-1].lower"] = s_1.lower() if s_1 not in ("__BOS__", "__EOS__") else s_1
108
+ if "S[-2]" in active:
109
+ features["S[-2]"] = s_2
110
+ if "S[-2].lower" in active:
111
+ features["S[-2].lower"] = s_2.lower() if s_2 not in ("__BOS__", "__EOS__") else s_2
112
+
113
+ s1 = get_syllable_at(syllables, position, 1)
114
+ s2 = get_syllable_at(syllables, position, 2)
115
+ if "S[1]" in active:
116
+ features["S[1]"] = s1
117
+ if "S[1].lower" in active:
118
+ features["S[1].lower"] = s1.lower() if s1 not in ("__BOS__", "__EOS__") else s1
119
+ if "S[2]" in active:
120
+ features["S[2]"] = s2
121
+ if "S[2].lower" in active:
122
+ features["S[2].lower"] = s2.lower() if s2 not in ("__BOS__", "__EOS__") else s2
123
+
124
+ if "S[-1,0]" in active:
125
+ features["S[-1,0]"] = f"{s_1}|{s0}"
126
+ if "S[0,1]" in active:
127
+ features["S[0,1]"] = f"{s0}|{s1}"
128
+ if "S[-1,0,1]" in active:
129
+ features["S[-1,0,1]"] = f"{s_1}|{s0}|{s1}"
130
+
131
+ # G8: Dictionary lookup — longest match for bigram windows
132
+ if dictionary is not None:
133
+ n = len(syllables)
134
+
135
+ if "S[-1,0].in_dict" in active and position >= 1:
136
+ match = ""
137
+ for length in range(2, min(6, position + 2)):
138
+ start = position - length + 1
139
+ if start >= 0:
140
+ ngram = " ".join(syllables[start:position + 1]).lower()
141
+ if ngram in dictionary:
142
+ match = ngram
143
+ features["S[-1,0].in_dict"] = match if match else "0"
144
+
145
+ if "S[0,1].in_dict" in active and position < n - 1:
146
+ match = ""
147
+ for length in range(2, min(6, n - position + 1)):
148
+ ngram = " ".join(syllables[position:position + length]).lower()
149
+ if ngram in dictionary:
150
+ match = ngram
151
+ features["S[0,1].in_dict"] = match if match else "0"
152
+
153
+ return features
154
+
155
+
156
+ def sentence_to_syllable_features(syllables, active_templates, dictionary=None):
157
+ return [
158
+ [f"{k}={v}" for k, v in extract_syllable_features(syllables, i, active_templates, dictionary).items()]
159
+ for i in range(len(syllables))
160
+ ]
161
+
162
+
163
+ # ============================================================================
164
+ # Data Loading
165
+ # ============================================================================
166
+
167
+ def load_vlsp2013_test(data_dir):
168
+ """Load VLSP 2013 test set."""
169
+ tag_map = {"B-W": "B", "I-W": "I"}
170
+ sequences = []
171
+ current_syls = []
172
+ current_labels = []
173
+
174
+ with open(data_dir / "test.txt", encoding="utf-8") as f:
175
+ for line in f:
176
+ line = line.strip()
177
+ if not line:
178
+ if current_syls:
179
+ sequences.append((current_syls, current_labels))
180
+ current_syls = []
181
+ current_labels = []
182
+ else:
183
+ parts = line.split("\t")
184
+ if len(parts) == 2:
185
+ current_syls.append(parts[0])
186
+ current_labels.append(tag_map.get(parts[1], parts[1]))
187
+ if current_syls:
188
+ sequences.append((current_syls, current_labels))
189
+
190
+ return sequences
191
+
192
+
193
+ # ============================================================================
194
+ # Label Utilities
195
+ # ============================================================================
196
+
197
+ def labels_to_words(syllables, labels):
198
+ """Convert syllable sequence and BIO labels back to words."""
199
+ words = []
200
+ current_word = []
201
+ for syl, label in zip(syllables, labels):
202
+ if label == "B":
203
+ if current_word:
204
+ words.append(" ".join(current_word))
205
+ current_word = [syl]
206
+ else:
207
+ current_word.append(syl)
208
+ if current_word:
209
+ words.append(" ".join(current_word))
210
+ return words
211
+
212
+
213
+ def labels_to_word_spans(syllables, labels):
214
+ """Convert BIO labels to word spans as (start_idx, end_idx, word_text)."""
215
+ spans = []
216
+ start = 0
217
+ for i, (syl, label) in enumerate(zip(syllables, labels)):
218
+ if label == "B" and i > 0:
219
+ word = " ".join(syllables[start:i])
220
+ spans.append((start, i, word))
221
+ start = i
222
+ if start < len(syllables):
223
+ word = " ".join(syllables[start:])
224
+ spans.append((start, len(syllables), word))
225
+ return spans
226
+
227
+
228
+ # ============================================================================
229
+ # Error Analysis
230
+ # ============================================================================
231
+
232
+ def analyze_syllable_errors(all_true, all_pred):
233
+ """Analyze syllable-level B/I confusion."""
234
+ b_to_i = 0 # false join: predicted I where truth is B
235
+ i_to_b = 0 # false split: predicted B where truth is I
236
+ total_b = 0
237
+ total_i = 0
238
+
239
+ for true_labels, pred_labels in zip(all_true, all_pred):
240
+ for t, p in zip(true_labels, pred_labels):
241
+ if t == "B":
242
+ total_b += 1
243
+ if p == "I":
244
+ b_to_i += 1
245
+ elif t == "I":
246
+ total_i += 1
247
+ if p == "B":
248
+ i_to_b += 1
249
+
250
+ return {
251
+ "total_b": total_b,
252
+ "total_i": total_i,
253
+ "b_to_i": b_to_i,
254
+ "i_to_b": i_to_b,
255
+ "b_to_i_rate": b_to_i / total_b if total_b > 0 else 0,
256
+ "i_to_b_rate": i_to_b / total_i if total_i > 0 else 0,
257
+ }
258
+
259
+
260
+ def analyze_word_errors(all_syllables, all_true, all_pred):
261
+ """Analyze word-level errors: false splits and false joins."""
262
+ false_splits = [] # compound words incorrectly broken apart (I→B)
263
+ false_joins = [] # separate words incorrectly merged (B→I)
264
+
265
+ for syllables, true_labels, pred_labels in zip(all_syllables, all_true, all_pred):
266
+ true_spans = set()
267
+ pred_spans = set()
268
+
269
+ for start, end, word in labels_to_word_spans(syllables, true_labels):
270
+ true_spans.add((start, end))
271
+ for start, end, word in labels_to_word_spans(syllables, pred_labels):
272
+ pred_spans.add((start, end))
273
+
274
+ true_words = labels_to_words(syllables, true_labels)
275
+ pred_words = labels_to_words(syllables, pred_labels)
276
+
277
+ # Find words in truth that were split in prediction
278
+ true_span_list = labels_to_word_spans(syllables, true_labels)
279
+ pred_span_list = labels_to_word_spans(syllables, pred_labels)
280
+
281
+ for start, end, word in true_span_list:
282
+ n_syls = end - start
283
+ if n_syls > 1 and (start, end) not in pred_spans:
284
+ # This true multi-syllable word was not predicted as a unit
285
+ # Find what the prediction did with these syllables
286
+ pred_parts = []
287
+ for ps, pe, pw in pred_span_list:
288
+ if ps >= start and pe <= end:
289
+ pred_parts.append(pw)
290
+ elif ps < end and pe > start:
291
+ pred_parts.append(pw)
292
+ if len(pred_parts) > 1:
293
+ context_start = max(0, start - 2)
294
+ context_end = min(len(syllables), end + 2)
295
+ context = " ".join(syllables[context_start:context_end])
296
+ false_splits.append((word, pred_parts, context))
297
+
298
+ for start, end, word in pred_span_list:
299
+ n_syls = end - start
300
+ if n_syls > 1 and (start, end) not in true_spans:
301
+ # This predicted multi-syllable word was not in truth
302
+ # Find what truth had for these syllables
303
+ true_parts = []
304
+ for ts, te, tw in true_span_list:
305
+ if ts >= start and te <= end:
306
+ true_parts.append(tw)
307
+ elif ts < end and te > start:
308
+ true_parts.append(tw)
309
+ if len(true_parts) > 1:
310
+ context_start = max(0, start - 2)
311
+ context_end = min(len(syllables), end + 2)
312
+ context = " ".join(syllables[context_start:context_end])
313
+ false_joins.append((word, true_parts, context))
314
+
315
+ return false_splits, false_joins
316
+
317
+
318
+ def analyze_errors_by_word_length(all_syllables, all_true, all_pred):
319
+ """Compute error rates broken down by true word length (in syllables)."""
320
+ correct_by_len = Counter()
321
+ total_by_len = Counter()
322
+
323
+ for syllables, true_labels, pred_labels in zip(all_syllables, all_true, all_pred):
324
+ true_spans = set()
325
+ pred_spans = set()
326
+
327
+ for start, end, word in labels_to_word_spans(syllables, true_labels):
328
+ true_spans.add((start, end))
329
+ n_syls = end - start
330
+ total_by_len[n_syls] += 1
331
+
332
+ for start, end, word in labels_to_word_spans(syllables, pred_labels):
333
+ pred_spans.add((start, end))
334
+
335
+ for span in true_spans:
336
+ n_syls = span[1] - span[0]
337
+ if span in pred_spans:
338
+ correct_by_len[n_syls] += 1
339
+
340
+ results = {}
341
+ for length in sorted(total_by_len.keys()):
342
+ total = total_by_len[length]
343
+ correct = correct_by_len[length]
344
+ results[length] = {
345
+ "total": total,
346
+ "correct": correct,
347
+ "errors": total - correct,
348
+ "accuracy": correct / total if total > 0 else 0,
349
+ "error_rate": (total - correct) / total if total > 0 else 0,
350
+ }
351
+ return results
352
+
353
+
354
+ def analyze_boundary_errors(all_syllables, all_true, all_pred, window=3):
355
+ """Analyze errors near sentence start/end."""
356
+ start_errors = 0
357
+ start_total = 0
358
+ end_errors = 0
359
+ end_total = 0
360
+ middle_errors = 0
361
+ middle_total = 0
362
+
363
+ for syllables, true_labels, pred_labels in zip(all_syllables, all_true, all_pred):
364
+ n = len(syllables)
365
+ for i, (t, p) in enumerate(zip(true_labels, pred_labels)):
366
+ if i < window:
367
+ start_total += 1
368
+ if t != p:
369
+ start_errors += 1
370
+ elif i >= n - window:
371
+ end_total += 1
372
+ if t != p:
373
+ end_errors += 1
374
+ else:
375
+ middle_total += 1
376
+ if t != p:
377
+ middle_errors += 1
378
+
379
+ return {
380
+ "start": {"errors": start_errors, "total": start_total,
381
+ "error_rate": start_errors / start_total if start_total > 0 else 0},
382
+ "end": {"errors": end_errors, "total": end_total,
383
+ "error_rate": end_errors / end_total if end_total > 0 else 0},
384
+ "middle": {"errors": middle_errors, "total": middle_total,
385
+ "error_rate": middle_errors / middle_total if middle_total > 0 else 0},
386
+ }
387
+
388
+
389
+ def get_top_error_patterns(all_syllables, all_true, all_pred, top_n=20):
390
+ """Find the most common incorrectly segmented syllable pairs."""
391
+ error_patterns = Counter()
392
+
393
+ for syllables, true_labels, pred_labels in zip(all_syllables, all_true, all_pred):
394
+ for i, (t, p) in enumerate(zip(true_labels, pred_labels)):
395
+ if t != p:
396
+ syl = syllables[i]
397
+ prev_syl = syllables[i - 1] if i > 0 else "__BOS__"
398
+ next_syl = syllables[i + 1] if i < len(syllables) - 1 else "__EOS__"
399
+ error_type = f"{t}→{p}"
400
+ pattern = (prev_syl, syl, next_syl, error_type)
401
+ error_patterns[pattern] += 1
402
+
403
+ return error_patterns.most_common(top_n)
404
+
405
+
406
+ def compute_word_metrics(all_syllables, all_true, all_pred):
407
+ """Compute word-level precision, recall, F1."""
408
+ correct = 0
409
+ total_pred = 0
410
+ total_true = 0
411
+
412
+ for syllables, true_labels, pred_labels in zip(all_syllables, all_true, all_pred):
413
+ true_words = labels_to_words(syllables, true_labels)
414
+ pred_words = labels_to_words(syllables, pred_labels)
415
+
416
+ total_true += len(true_words)
417
+ total_pred += len(pred_words)
418
+
419
+ true_boundaries = set()
420
+ pred_boundaries = set()
421
+
422
+ pos = 0
423
+ for word in true_words:
424
+ n_syls = len(word.split())
425
+ true_boundaries.add((pos, pos + n_syls))
426
+ pos += n_syls
427
+
428
+ pos = 0
429
+ for word in pred_words:
430
+ n_syls = len(word.split())
431
+ pred_boundaries.add((pos, pos + n_syls))
432
+ pos += n_syls
433
+
434
+ correct += len(true_boundaries & pred_boundaries)
435
+
436
+ precision = correct / total_pred if total_pred > 0 else 0
437
+ recall = correct / total_true if total_true > 0 else 0
438
+ f1 = 2 * precision * recall / (precision + recall) if (precision + recall) > 0 else 0
439
+
440
+ return {
441
+ "precision": precision,
442
+ "recall": recall,
443
+ "f1": f1,
444
+ "total_true": total_true,
445
+ "total_pred": total_pred,
446
+ "correct": correct,
447
+ }
448
+
449
+
450
+ # ============================================================================
451
+ # Reporting
452
+ # ============================================================================
453
+
454
+ def format_report(syl_errors, word_metrics, false_splits, false_joins,
455
+ length_errors, boundary_errors, top_patterns,
456
+ num_sentences, num_syllables):
457
+ """Format error analysis as text report."""
458
+ lines = []
459
+ lines.append("=" * 70)
460
+ lines.append("Word Segmentation Error Analysis — VLSP 2013 Test Set")
461
+ lines.append("=" * 70)
462
+ lines.append("")
463
+
464
+ # Summary
465
+ total_syl_errors = syl_errors["b_to_i"] + syl_errors["i_to_b"]
466
+ lines.append("1. Summary")
467
+ lines.append("-" * 40)
468
+ lines.append(f" Sentences: {num_sentences:,}")
469
+ lines.append(f" Syllables: {num_syllables:,}")
470
+ lines.append(f" True words: {word_metrics['total_true']:,}")
471
+ lines.append(f" Predicted words: {word_metrics['total_pred']:,}")
472
+ lines.append(f" Correct words: {word_metrics['correct']:,}")
473
+ lines.append(f" Word Precision: {word_metrics['precision']:.4f} ({word_metrics['precision']*100:.2f}%)")
474
+ lines.append(f" Word Recall: {word_metrics['recall']:.4f} ({word_metrics['recall']*100:.2f}%)")
475
+ lines.append(f" Word F1: {word_metrics['f1']:.4f} ({word_metrics['f1']*100:.2f}%)")
476
+ lines.append(f" Syllable errors: {total_syl_errors:,} / {num_syllables:,} ({total_syl_errors/num_syllables*100:.2f}%)")
477
+ lines.append(f" Word errors (FN): {word_metrics['total_true'] - word_metrics['correct']:,}")
478
+ lines.append(f" Word errors (FP): {word_metrics['total_pred'] - word_metrics['correct']:,}")
479
+ lines.append("")
480
+
481
+ # Syllable confusion
482
+ lines.append("2. Syllable-Level Confusion (B/I)")
483
+ lines.append("-" * 40)
484
+ lines.append(f" True B, Predicted I (false join): {syl_errors['b_to_i']:,} / {syl_errors['total_b']:,} ({syl_errors['b_to_i_rate']*100:.2f}%)")
485
+ lines.append(f" True I, Predicted B (false split): {syl_errors['i_to_b']:,} / {syl_errors['total_i']:,} ({syl_errors['i_to_b_rate']*100:.2f}%)")
486
+ lines.append("")
487
+ lines.append(" Confusion Matrix:")
488
+ lines.append(f" Pred B Pred I")
489
+ lines.append(f" True B {syl_errors['total_b'] - syl_errors['b_to_i']:>8,} {syl_errors['b_to_i']:>8,}")
490
+ lines.append(f" True I {syl_errors['i_to_b']:>8,} {syl_errors['total_i'] - syl_errors['i_to_b']:>8,}")
491
+ lines.append("")
492
+
493
+ # False splits
494
+ split_counter = Counter()
495
+ for word, parts, context in false_splits:
496
+ split_counter[word] += 1
497
+
498
+ lines.append("3. Top False Splits (compound words broken apart)")
499
+ lines.append("-" * 70)
500
+ lines.append(f" Total false splits: {len(false_splits):,}")
501
+ lines.append(f" Unique words affected: {len(split_counter):,}")
502
+ lines.append("")
503
+ lines.append(f" {'Word':<25} {'Count':<8} {'Example context'}")
504
+ lines.append(f" {'----':<25} {'-----':<8} {'---------------'}")
505
+ for word, count in split_counter.most_common(20):
506
+ # Find an example context for this word
507
+ for w, parts, ctx in false_splits:
508
+ if w == word:
509
+ lines.append(f" {word:<25} {count:<8} {ctx}")
510
+ break
511
+ lines.append("")
512
+
513
+ # False joins
514
+ join_counter = Counter()
515
+ for word, parts, context in false_joins:
516
+ join_counter[word] += 1
517
+
518
+ lines.append("4. Top False Joins (separate words merged)")
519
+ lines.append("-" * 70)
520
+ lines.append(f" Total false joins: {len(false_joins):,}")
521
+ lines.append(f" Unique words affected: {len(join_counter):,}")
522
+ lines.append("")
523
+ lines.append(f" {'Merged as':<25} {'Count':<8} {'Should be':<30} {'Context'}")
524
+ lines.append(f" {'---------':<25} {'-----':<8} {'---------':<30} {'-------'}")
525
+ for word, count in join_counter.most_common(20):
526
+ for w, parts, ctx in false_joins:
527
+ if w == word:
528
+ should_be = " | ".join(parts)
529
+ lines.append(f" {word:<25} {count:<8} {should_be:<30} {ctx}")
530
+ break
531
+ lines.append("")
532
+
533
+ # Error by word length
534
+ lines.append("5. Error Rate by Word Length (syllables)")
535
+ lines.append("-" * 70)
536
+ lines.append(f" {'Length':<10} {'Total':<10} {'Correct':<10} {'Errors':<10} {'Accuracy':<12} {'Error Rate'}")
537
+ lines.append(f" {'------':<10} {'-----':<10} {'-------':<10} {'------':<10} {'--------':<12} {'----------'}")
538
+ for length, stats in sorted(length_errors.items()):
539
+ label = f"{length}-syl"
540
+ lines.append(f" {label:<10} {stats['total']:<10,} {stats['correct']:<10,} {stats['errors']:<10,} {stats['accuracy']*100:>8.2f}% {stats['error_rate']*100:.2f}%")
541
+ lines.append("")
542
+
543
+ # Boundary errors
544
+ lines.append("6. Error Rate by Position in Sentence")
545
+ lines.append("-" * 40)
546
+ for region, stats in boundary_errors.items():
547
+ label = f"{region.capitalize()} (first/last 3 syls)" if region != "middle" else "Middle"
548
+ lines.append(f" {label:<35} {stats['errors']:,} / {stats['total']:,} ({stats['error_rate']*100:.2f}%)")
549
+ lines.append("")
550
+
551
+ # Top error patterns
552
+ lines.append("7. Top Error Patterns (syllable in context)")
553
+ lines.append("-" * 70)
554
+ lines.append(f" {'Prev syl':<15} {'Current':<15} {'Next syl':<15} {'Error':<8} {'Count'}")
555
+ lines.append(f" {'--------':<15} {'-------':<15} {'--------':<15} {'-----':<8} {'-----'}")
556
+ for (prev_syl, syl, next_syl, error_type), count in top_patterns:
557
+ lines.append(f" {prev_syl:<15} {syl:<15} {next_syl:<15} {error_type:<8} {count}")
558
+ lines.append("")
559
+
560
+ lines.append("=" * 70)
561
+ return "\n".join(lines)
562
+
563
+
564
+ def save_errors_csv(output_path, false_splits, false_joins, length_errors):
565
+ """Save error details to CSV files."""
566
+ output_dir = output_path.parent
567
+
568
+ # False splits CSV
569
+ splits_path = output_dir / "false_splits.csv"
570
+ split_counter = Counter()
571
+ split_examples = {}
572
+ for word, parts, context in false_splits:
573
+ split_counter[word] += 1
574
+ if word not in split_examples:
575
+ split_examples[word] = (parts, context)
576
+
577
+ with open(splits_path, "w", newline="", encoding="utf-8") as f:
578
+ writer = csv.writer(f)
579
+ writer.writerow(["word", "count", "predicted_parts", "context"])
580
+ for word, count in split_counter.most_common():
581
+ parts, ctx = split_examples[word]
582
+ writer.writerow([word, count, " | ".join(parts), ctx])
583
+
584
+ # False joins CSV
585
+ joins_path = output_dir / "false_joins.csv"
586
+ join_counter = Counter()
587
+ join_examples = {}
588
+ for word, parts, context in false_joins:
589
+ join_counter[word] += 1
590
+ if word not in join_examples:
591
+ join_examples[word] = (parts, context)
592
+
593
+ with open(joins_path, "w", newline="", encoding="utf-8") as f:
594
+ writer = csv.writer(f)
595
+ writer.writerow(["merged_word", "count", "true_parts", "context"])
596
+ for word, count in join_counter.most_common():
597
+ parts, ctx = join_examples[word]
598
+ writer.writerow([word, count, " | ".join(parts), ctx])
599
+
600
+ # Word length error rates CSV
601
+ length_path = output_dir / "error_by_length.csv"
602
+ with open(length_path, "w", newline="", encoding="utf-8") as f:
603
+ writer = csv.writer(f)
604
+ writer.writerow(["word_length_syllables", "total", "correct", "errors", "accuracy", "error_rate"])
605
+ for length, stats in sorted(length_errors.items()):
606
+ writer.writerow([length, stats["total"], stats["correct"], stats["errors"],
607
+ f"{stats['accuracy']:.4f}", f"{stats['error_rate']:.4f}"])
608
+
609
+ return splits_path, joins_path, length_path
610
+
611
+
612
+ # ============================================================================
613
+ # Main
614
+ # ============================================================================
615
+
616
+ @click.command()
617
+ @click.option(
618
+ "--model", "-m",
619
+ default=None,
620
+ help="Model directory (default: models/word_segmentation/vlsp2013)",
621
+ )
622
+ @click.option(
623
+ "--data-dir", "-d",
624
+ default=None,
625
+ help="Dataset directory (default: datasets/c7veardo0e)",
626
+ )
627
+ @click.option(
628
+ "--output", "-o",
629
+ default=None,
630
+ help="Output directory for results (default: results/word_segmentation)",
631
+ )
632
+ def main(model, data_dir, output):
633
+ """Run error analysis on VLSP 2013 word segmentation test set."""
634
+ # Resolve paths
635
+ model_dir = Path(model) if model else PROJECT_ROOT / "models" / "word_segmentation" / "vlsp2013"
636
+ data_path = Path(data_dir) if data_dir else PROJECT_ROOT / "datasets" / "c7veardo0e"
637
+ output_dir = Path(output) if output else PROJECT_ROOT / "results" / "word_segmentation"
638
+ output_dir.mkdir(parents=True, exist_ok=True)
639
+
640
+ model_path = model_dir / "model.crf"
641
+ if not model_path.exists():
642
+ model_path = model_dir / "model.crfsuite"
643
+ if not model_path.exists():
644
+ raise click.ClickException(f"No model file found in {model_dir}")
645
+
646
+ click.echo(f"Model: {model_path}")
647
+ click.echo(f"Data: {data_path}")
648
+ click.echo(f"Output: {output_dir}")
649
+ click.echo("")
650
+
651
+ # Load model
652
+ click.echo("Loading model...")
653
+ model_path_str = str(model_path)
654
+ if model_path_str.endswith(".crf"):
655
+ from underthesea_core import CRFModel, CRFTagger
656
+ crf_model = CRFModel.load(model_path_str)
657
+ tagger = CRFTagger.from_model(crf_model)
658
+ predict_fn = lambda X: [tagger.tag(xseq) for xseq in X]
659
+ else:
660
+ import pycrfsuite
661
+ tagger = pycrfsuite.Tagger()
662
+ tagger.open(model_path_str)
663
+ predict_fn = lambda X: [tagger.tag(xseq) for xseq in X]
664
+
665
+ # Load test data
666
+ click.echo("Loading VLSP 2013 test set...")
667
+ test_data = load_vlsp2013_test(data_path)
668
+ click.echo(f" {len(test_data)} sentences")
669
+
670
+ all_syllables = [syls for syls, _ in test_data]
671
+ all_true = [labels for _, labels in test_data]
672
+ num_syllables = sum(len(syls) for syls in all_syllables)
673
+ click.echo(f" {num_syllables:,} syllables")
674
+
675
+ # Load dictionary if available
676
+ dict_path = model_dir / "dictionary.txt"
677
+ dictionary = None
678
+ if dict_path.exists():
679
+ dictionary = load_dictionary(dict_path)
680
+ click.echo(f" Dictionary: {len(dictionary)} words from {dict_path}")
681
+
682
+ # Extract features and predict
683
+ click.echo("Extracting features...")
684
+ active_templates = get_all_templates()
685
+ if dictionary is None:
686
+ active_templates = [t for t in active_templates if t not in FEATURE_GROUPS["dictionary"]]
687
+ X_test = [sentence_to_syllable_features(syls, active_templates, dictionary) for syls in all_syllables]
688
+
689
+ click.echo("Predicting...")
690
+ all_pred = predict_fn(X_test)
691
+
692
+ # Run analyses
693
+ click.echo("Analyzing errors...")
694
+
695
+ # 1. Syllable confusion
696
+ syl_errors = analyze_syllable_errors(all_true, all_pred)
697
+
698
+ # 2. Word metrics
699
+ word_metrics = compute_word_metrics(all_syllables, all_true, all_pred)
700
+
701
+ # 3. Word-level errors
702
+ false_splits, false_joins = analyze_word_errors(all_syllables, all_true, all_pred)
703
+
704
+ # 4. Error by word length
705
+ length_errors = analyze_errors_by_word_length(all_syllables, all_true, all_pred)
706
+
707
+ # 5. Boundary errors
708
+ boundary_errors = analyze_boundary_errors(all_syllables, all_true, all_pred)
709
+
710
+ # 6. Top error patterns
711
+ top_patterns = get_top_error_patterns(all_syllables, all_true, all_pred, top_n=20)
712
+
713
+ # Generate report
714
+ report = format_report(
715
+ syl_errors, word_metrics, false_splits, false_joins,
716
+ length_errors, boundary_errors, top_patterns,
717
+ len(test_data), num_syllables,
718
+ )
719
+
720
+ # Print to console
721
+ click.echo("")
722
+ click.echo(report)
723
+
724
+ # Save report
725
+ report_path = output_dir / "error_analysis.txt"
726
+ with open(report_path, "w", encoding="utf-8") as f:
727
+ f.write(report)
728
+ click.echo(f"\nReport saved to {report_path}")
729
+
730
+ # Save CSVs
731
+ splits_csv, joins_csv, length_csv = save_errors_csv(
732
+ report_path, false_splits, false_joins, length_errors
733
+ )
734
+ click.echo(f"False splits CSV: {splits_csv}")
735
+ click.echo(f"False joins CSV: {joins_csv}")
736
+ click.echo(f"Error by length: {length_csv}")
737
+
738
+
739
+ if __name__ == "__main__":
740
+ main()
src/predict_word_segmentation.py CHANGED
@@ -19,6 +19,7 @@ Usage:
19
  """
20
 
21
  import sys
 
22
 
23
  import click
24
  import pycrfsuite
@@ -40,7 +41,18 @@ def is_punct(s):
40
  return len(s) == 1 and not s.isalnum()
41
 
42
 
43
- def extract_syllable_features(syllables, position):
 
 
 
 
 
 
 
 
 
 
 
44
  """Extract features for a syllable at given position."""
45
  features = {}
46
 
@@ -81,13 +93,35 @@ def extract_syllable_features(syllables, position):
81
  # Trigrams
82
  features["S[-1,0,1]"] = f"{s_1}|{s0}|{s1}"
83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  return features
85
 
86
 
87
- def sentence_to_syllable_features(syllables):
88
  """Convert syllable sequence to feature sequences."""
89
  return [
90
- [f"{k}={v}" for k, v in extract_syllable_features(syllables, i).items()]
91
  for i in range(len(syllables))
92
  ]
93
 
@@ -111,7 +145,7 @@ def labels_to_words(syllables, labels):
111
  return words
112
 
113
 
114
- def segment_text(text, tagger):
115
  """
116
  Full pipeline: regex tokenize -> CRF segment -> output words.
117
  """
@@ -122,7 +156,7 @@ def segment_text(text, tagger):
122
  return ""
123
 
124
  # Step 2: Extract syllable features
125
- X = sentence_to_syllable_features(syllables)
126
 
127
  # Step 3: Predict BIO labels
128
  labels = tagger.tag(X)
@@ -133,7 +167,7 @@ def segment_text(text, tagger):
133
  return "_".join(words).replace(" ", "_").replace("_", " ").replace(" ", " _ ")
134
 
135
 
136
- def segment_text_formatted(text, tagger, use_underscore=True):
137
  """
138
  Full pipeline with formatted output.
139
  """
@@ -142,7 +176,7 @@ def segment_text_formatted(text, tagger, use_underscore=True):
142
  if not syllables:
143
  return ""
144
 
145
- X = sentence_to_syllable_features(syllables)
146
  labels = tagger.tag(X)
147
  words = labels_to_words(syllables, labels)
148
 
@@ -190,10 +224,17 @@ def main(text, model, underscore):
190
  tagger = pycrfsuite.Tagger()
191
  tagger.open(model)
192
 
 
 
 
 
 
 
 
193
  # Process each line
194
  for line in text.split("\n"):
195
  if line.strip():
196
- result = segment_text_formatted(line, tagger, use_underscore=underscore)
197
  click.echo(result)
198
 
199
 
 
19
  """
20
 
21
  import sys
22
+ from pathlib import Path
23
 
24
  import click
25
  import pycrfsuite
 
41
  return len(s) == 1 and not s.isalnum()
42
 
43
 
44
+ def load_dictionary(path):
45
+ """Load dictionary from a text file (one word per line)."""
46
+ dictionary = set()
47
+ with open(path, encoding="utf-8") as f:
48
+ for line in f:
49
+ line = line.strip()
50
+ if line:
51
+ dictionary.add(line)
52
+ return dictionary
53
+
54
+
55
+ def extract_syllable_features(syllables, position, dictionary=None):
56
  """Extract features for a syllable at given position."""
57
  features = {}
58
 
 
93
  # Trigrams
94
  features["S[-1,0,1]"] = f"{s_1}|{s0}|{s1}"
95
 
96
+ # Dictionary lookup — longest match for bigram windows
97
+ if dictionary is not None:
98
+ n = len(syllables)
99
+
100
+ if position >= 1:
101
+ match = ""
102
+ for length in range(2, min(6, position + 2)):
103
+ start = position - length + 1
104
+ if start >= 0:
105
+ ngram = " ".join(syllables[start:position + 1]).lower()
106
+ if ngram in dictionary:
107
+ match = ngram
108
+ features["S[-1,0].in_dict"] = match if match else "0"
109
+
110
+ if position < n - 1:
111
+ match = ""
112
+ for length in range(2, min(6, n - position + 1)):
113
+ ngram = " ".join(syllables[position:position + length]).lower()
114
+ if ngram in dictionary:
115
+ match = ngram
116
+ features["S[0,1].in_dict"] = match if match else "0"
117
+
118
  return features
119
 
120
 
121
+ def sentence_to_syllable_features(syllables, dictionary=None):
122
  """Convert syllable sequence to feature sequences."""
123
  return [
124
+ [f"{k}={v}" for k, v in extract_syllable_features(syllables, i, dictionary).items()]
125
  for i in range(len(syllables))
126
  ]
127
 
 
145
  return words
146
 
147
 
148
+ def segment_text(text, tagger, dictionary=None):
149
  """
150
  Full pipeline: regex tokenize -> CRF segment -> output words.
151
  """
 
156
  return ""
157
 
158
  # Step 2: Extract syllable features
159
+ X = sentence_to_syllable_features(syllables, dictionary)
160
 
161
  # Step 3: Predict BIO labels
162
  labels = tagger.tag(X)
 
167
  return "_".join(words).replace(" ", "_").replace("_", " ").replace(" ", " _ ")
168
 
169
 
170
+ def segment_text_formatted(text, tagger, use_underscore=True, dictionary=None):
171
  """
172
  Full pipeline with formatted output.
173
  """
 
176
  if not syllables:
177
  return ""
178
 
179
+ X = sentence_to_syllable_features(syllables, dictionary)
180
  labels = tagger.tag(X)
181
  words = labels_to_words(syllables, labels)
182
 
 
224
  tagger = pycrfsuite.Tagger()
225
  tagger.open(model)
226
 
227
+ # Load dictionary if available alongside model
228
+ model_dir = Path(model).parent
229
+ dict_path = model_dir / "dictionary.txt"
230
+ dictionary = load_dictionary(dict_path) if dict_path.exists() else None
231
+ if dictionary:
232
+ click.echo(f"Dictionary: {len(dictionary)} words", err=True)
233
+
234
  # Process each line
235
  for line in text.split("\n"):
236
  if line.strip():
237
+ result = segment_text_formatted(line, tagger, use_underscore=underscore, dictionary=dictionary)
238
  click.echo(result)
239
 
240
 
src/train_word_segmentation.py CHANGED
@@ -51,6 +51,7 @@ FEATURE_GROUPS = {
51
  "right": ["S[1]", "S[1].lower", "S[2]", "S[2].lower"],
52
  "bigram": ["S[-1,0]", "S[0,1]"],
53
  "trigram": ["S[-1,0,1]"],
 
54
  }
55
 
56
 
@@ -112,6 +113,85 @@ def format_duration(seconds):
112
  return f"{hours}h {minutes}m {secs:.2f}s"
113
 
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  # ============================================================================
116
  # Feature Extraction
117
  # ============================================================================
@@ -131,7 +211,7 @@ def is_punct(s):
131
  return len(s) == 1 and not s.isalnum()
132
 
133
 
134
- def extract_syllable_features(syllables, position, active_templates):
135
  """Extract features for a syllable at given position."""
136
  active = set(active_templates)
137
  features = {}
@@ -197,13 +277,37 @@ def extract_syllable_features(syllables, position, active_templates):
197
  if "S[-1,0,1]" in active:
198
  features["S[-1,0,1]"] = f"{s_1}|{s0}|{s1}"
199
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  return features
201
 
202
 
203
- def sentence_to_syllable_features(syllables, active_templates):
204
  """Convert syllable sequence to feature sequences."""
205
  return [
206
- [f"{k}={v}" for k, v in extract_syllable_features(syllables, i, active_templates).items()]
207
  for i in range(len(syllables))
208
  ]
209
 
@@ -645,10 +749,20 @@ def train(cfg: DictConfig):
645
  log.info(f"Validation: {len(val_data)} sentences ({data_stats['val_syllables']} syllables)")
646
  log.info(f"Test: {len(test_data)} sentences ({data_stats['test_syllables']} syllables)")
647
 
 
 
 
 
 
 
 
 
 
 
648
  # Prepare training data
649
  log.info("Extracting syllable-level features...")
650
  feature_start = time.time()
651
- X_train = [sentence_to_syllable_features(syls, active_templates) for syls, _ in train_data]
652
  y_train = [labels for _, labels in train_data]
653
  log.info(f"Feature extraction: {format_duration(time.time() - feature_start)}")
654
 
@@ -667,7 +781,7 @@ def train(cfg: DictConfig):
667
  # Evaluation
668
  log.info("Evaluating on test set...")
669
 
670
- X_test = [sentence_to_syllable_features(syls, active_templates) for syls, _ in test_data]
671
  y_test = [labels for _, labels in test_data]
672
  syllables_test = [syls for syls, _ in test_data]
673
 
 
51
  "right": ["S[1]", "S[1].lower", "S[2]", "S[2].lower"],
52
  "bigram": ["S[-1,0]", "S[0,1]"],
53
  "trigram": ["S[-1,0,1]"],
54
+ "dictionary": ["S[-1,0].in_dict", "S[0,1].in_dict"],
55
  }
56
 
57
 
 
113
  return f"{hours}h {minutes}m {secs:.2f}s"
114
 
115
 
116
+ # ============================================================================
117
+ # Dictionary
118
+ # ============================================================================
119
+
120
+ def build_word_dictionary(train_data, min_freq=1, min_syls=2):
121
+ """Build a set of multi-syllable words from training data.
122
+
123
+ Extracts words with min_syls+ syllables from BIO-labeled training
124
+ sequences. Words must appear at least min_freq times to be included.
125
+
126
+ Args:
127
+ train_data: List of (syllables, labels) tuples with BIO labels.
128
+ min_freq: Minimum frequency to include a word (default: 1).
129
+ min_syls: Minimum number of syllables (default: 2).
130
+
131
+ Returns:
132
+ Set of lowercased multi-syllable words, e.g. {"chủ nghĩa", "hợp hiến"}.
133
+ """
134
+ from collections import Counter
135
+ word_counts = Counter()
136
+ for syllables, labels in train_data:
137
+ current_word_syls = []
138
+ for syl, label in zip(syllables, labels):
139
+ if label == "B":
140
+ if len(current_word_syls) >= min_syls:
141
+ word_counts[" ".join(current_word_syls).lower()] += 1
142
+ current_word_syls = [syl]
143
+ else: # I
144
+ current_word_syls.append(syl)
145
+ if len(current_word_syls) >= min_syls:
146
+ word_counts[" ".join(current_word_syls).lower()] += 1
147
+ return {word for word, count in word_counts.items() if count >= min_freq}
148
+
149
+
150
+ def load_external_dictionary(min_syls=2):
151
+ """Load Viet74K + UTS Dictionary from underthesea package (~64K multi-syl entries)."""
152
+ from underthesea.corpus.readers.dictionary_loader import DictionaryLoader
153
+ from underthesea.datasets import get_dictionary
154
+ dictionary = set()
155
+ for word in DictionaryLoader("Viet74K.txt").words:
156
+ w = word.lower().strip()
157
+ if len(w.split()) >= min_syls:
158
+ dictionary.add(w)
159
+ for word in get_dictionary():
160
+ w = word.lower().strip()
161
+ if len(w.split()) >= min_syls:
162
+ dictionary.add(w)
163
+ return dictionary
164
+
165
+
166
+ def build_dictionary(train_data, source="external", min_syls=2):
167
+ """Build dictionary from configured source."""
168
+ if source == "training":
169
+ return build_word_dictionary(train_data, min_freq=1, min_syls=min_syls)
170
+ elif source == "external":
171
+ return load_external_dictionary(min_syls=min_syls)
172
+ elif source == "combined":
173
+ return build_word_dictionary(train_data, min_freq=1, min_syls=min_syls) | load_external_dictionary(min_syls=min_syls)
174
+ raise ValueError(f"Unknown dictionary source: {source}")
175
+
176
+
177
+ def save_dictionary(dictionary, path):
178
+ """Save dictionary to a text file (one word per line)."""
179
+ with open(path, "w", encoding="utf-8") as f:
180
+ for word in sorted(dictionary):
181
+ f.write(word + "\n")
182
+
183
+
184
+ def load_dictionary(path):
185
+ """Load dictionary from a text file (one word per line)."""
186
+ dictionary = set()
187
+ with open(path, encoding="utf-8") as f:
188
+ for line in f:
189
+ line = line.strip()
190
+ if line:
191
+ dictionary.add(line)
192
+ return dictionary
193
+
194
+
195
  # ============================================================================
196
  # Feature Extraction
197
  # ============================================================================
 
211
  return len(s) == 1 and not s.isalnum()
212
 
213
 
214
+ def extract_syllable_features(syllables, position, active_templates, dictionary=None):
215
  """Extract features for a syllable at given position."""
216
  active = set(active_templates)
217
  features = {}
 
277
  if "S[-1,0,1]" in active:
278
  features["S[-1,0,1]"] = f"{s_1}|{s0}|{s1}"
279
 
280
+ # G8: Dictionary lookup — longest match for bigram windows
281
+ if dictionary is not None:
282
+ n = len(syllables)
283
+
284
+ # Longest dict word ending at current position that includes prev syllable
285
+ if "S[-1,0].in_dict" in active and position >= 1:
286
+ match = ""
287
+ for length in range(2, min(6, position + 2)):
288
+ start = position - length + 1
289
+ if start >= 0:
290
+ ngram = " ".join(syllables[start:position + 1]).lower()
291
+ if ngram in dictionary:
292
+ match = ngram
293
+ features["S[-1,0].in_dict"] = match if match else "0"
294
+
295
+ # Longest dict word starting at current position that includes next syllable
296
+ if "S[0,1].in_dict" in active and position < n - 1:
297
+ match = ""
298
+ for length in range(2, min(6, n - position + 1)):
299
+ ngram = " ".join(syllables[position:position + length]).lower()
300
+ if ngram in dictionary:
301
+ match = ngram
302
+ features["S[0,1].in_dict"] = match if match else "0"
303
+
304
  return features
305
 
306
 
307
+ def sentence_to_syllable_features(syllables, active_templates, dictionary=None):
308
  """Convert syllable sequence to feature sequences."""
309
  return [
310
+ [f"{k}={v}" for k, v in extract_syllable_features(syllables, i, active_templates, dictionary).items()]
311
  for i in range(len(syllables))
312
  ]
313
 
 
749
  log.info(f"Validation: {len(val_data)} sentences ({data_stats['val_syllables']} syllables)")
750
  log.info(f"Test: {len(test_data)} sentences ({data_stats['test_syllables']} syllables)")
751
 
752
+ # Build dictionary (if dictionary features enabled)
753
+ dictionary = None
754
+ if model_cfg.features.get("dictionary", True):
755
+ dict_source = model_cfg.features.get("dictionary_source", "external")
756
+ log.info(f"Building dictionary (source={dict_source})...")
757
+ dictionary = build_dictionary(train_data, source=dict_source)
758
+ log.info(f"Dictionary: {len(dictionary)} multi-syllable words")
759
+ save_dictionary(dictionary, output_dir / "dictionary.txt")
760
+ log.info(f"Dictionary saved to {output_dir / 'dictionary.txt'}")
761
+
762
  # Prepare training data
763
  log.info("Extracting syllable-level features...")
764
  feature_start = time.time()
765
+ X_train = [sentence_to_syllable_features(syls, active_templates, dictionary) for syls, _ in train_data]
766
  y_train = [labels for _, labels in train_data]
767
  log.info(f"Feature extraction: {format_duration(time.time() - feature_start)}")
768
 
 
781
  # Evaluation
782
  log.info("Evaluating on test set...")
783
 
784
+ X_test = [sentence_to_syllable_features(syls, active_templates, dictionary) for syls, _ in test_data]
785
  y_test = [labels for _, labels in test_data]
786
  syllables_test = [syls for syls, _ in test_data]
787