Views
No views yet
| Model | char_acc | word_acc | exact | diac_acc |
|---|---|---|---|---|
| CRF-bidir (this) | 0.939 | 0.685 | nan | nan |
| CRF-forward | — | — | — | — |
| GRU 50M (BitNet) | 0.024 | 0.000 | 0.000 | 0.004 |
| Transformer 51.8M | 0.731 | 0.830 | 0.268 | 0.736 |
| File | Description |
|---|---|
crf_gpu.safetensors | Model weights + labels metadata (GPU inference) |
crf_bidir.pkl | Trained sklearn-crfsuite model (CPU inference) |
crf_forward.pkl | Causal (left-context only) variant |
crf_gpu.py | GPU inference module (CRFGPUModel) |
ldgc/vocab.py | Character vocabulary (required by crf_gpu.py) |
1from crf_gpu import CRFGPUModel
2
3model = CRFGPUModel.from_pretrained("crf_gpu.safetensors", device="cuda")
4preds = model.predict(["turkce cok guzel", "bugun hava guzel"], batch_size=512)
5# → ["türkçe çok güzel", "bugün hava güzel"]1import pickle
2crf = pickle.load(open("crf_bidir.pkl", "rb"))
3sent = "turkce cok guzel"
4feats = [...] # see crf_gpu.py encode_batch for feature extraction
5pred = "".join(crf.predict([feats])[0])1from crf_gpu import predict_stream
2
3with open("large_corpus.txt") as f:
4 for restored in predict_stream(model, f, batch_size=512):
5 process(restored)' ' '!' ',' '.' '?' 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'r' 's' 't' 'u' 'v' 'y' 'z' 'â' 'ç' 'î' 'ö' 'û' 'ü' 'ğ' 'ı' 'ş'1@misc{ldgc2025,
2 title = {LDGC: Latent Dynamics Grammar Corrector for Turkish},
3 author = {Emircan EROL},
4 year = {2025},
5 url = {https://github.com/emircan-erol/tr-grammar},
6}