Views
No views yet
| Configuration | With case ending | Without case ending |
|---|---|---|
| Including no diacritic | 10.33% | 8.45% |
| Excluding no diacritic | 12.72% | 10.33% |
| Configuration | With case ending | Without case ending |
|---|---|---|
| Including no diacritic | 30.16% | 19.71% |
| Excluding no diacritic | 29.91% | 19.60% |
1git clone https://github.com/rufaelfekadu/diac.git
2cd diac
3pip install -e .1from diac.models import DiacritizationModule
2
3model = DiacritizationModule.from_pretrained(
4 "rufaelfekadu/diac-transformer-text-only-tashkeela",
5 tokenizer_constants_path="constants/" # Path to constants directory
6)1# Predict diacritization for a text file
2model.predict_file(
3 input_file="path/to/input.txt",
4 output_file="path/to/output.txt"
5)
6
7# Or predict for a single text string
8diacritized_text = model.predict_text("مرحبا بك")1python inference.py \
2 --config configs/<model>.yml \
3 --opts \
4 DATA.TEST_PATH path/to/test.txt \
5 INFERENCE.MODEL_PATH <path_to_checkpoint> \
6 INFERENCE.OUTPUT_PATH path/to/predictions.txt1python src/diac/utils/prep_ref.py \
2 --input_file path/to/test.txt \
3 -o path/to/output_dir1python src/diac/utils/eval.py \
2 -ofp path/to/predictions.txt \
3 -tfp path/to/reference.txt \
4 --style Fadel