Difference between revisions of "Charlifter"
Jump to navigation
Jump to search
Line 8: | Line 8: | ||
* <code>XX-clean.txt</code>: A file with a list of known clean words |
* <code>XX-clean.txt</code>: A file with a list of known clean words |
||
* <code>XX-prettyclean.txt</code>: A file with a list of probably clean words (can be |
* <code>XX-prettyclean.txt</code>: A file with a list of probably clean words (can be empty) |
||
;Process |
;Process |
Revision as of 03:53, 19 August 2011
Training
You need a corpus:
XX-corpus.txt
: A clean (orthographically correct) corpus in the language
You need two wordlists:
XX-clean.txt
: A file with a list of known clean wordsXX-prettyclean.txt
: A file with a list of probably clean words (can be empty)
- Process
First do 'make', you might want to edit the makefile
to change your paths.
Then, put the source files (corpus, wordlists) where sf.pl
can find them, and run:
$ cat cv-training.crp | perl sf.pl -t -l cv Reading the clean dictionary... Clean dictionary processed... Reading the "pretty clean" dictionary... "Pretty clean" dictionary processed... Reading the training text... Training texts processed (1143 words)... Computing final probabilities... Dumping plain text hashes to disk...
Then:
$ perl sf.pl -m -l cv Reading in plain text hashes... Saving storable hashes to disk...
Now you should be able to use the program.
- Usage
$ cat testing/cv-source.txt | perl sf.pl -r -d . -l cv
- Evaluation
You can use apertium-eval-translator to evaluate the quality of the restoration:
$ apertium-eval-translator -t testing/cv-test.txt -r testing/cv-reference.txt Test file: 'testing/cv-test.txt' Reference file 'testing/cv-reference.txt' Statistics about input files ------------------------------------------------------- Number of words in reference: 804 Number of words in test: 804 Number of unknown words (marked with a star) in test: Percentage of unknown words: 0.00 % Results when removing unknown-word marks (stars) ------------------------------------------------------- Edit distance: 451 Word error rate (WER): 56.09 % Number of position-independent word errors: 451 Position-independent word error rate (PER): 56.09 % Results when unknown-word marks (stars) are not removed ------------------------------------------------------- Edit distance: 451 Word Error Rate (WER): 56.09 % Number of position-independent word errors: 451 Position-independent word error rate (PER): 56.09 % Statistics about the translation of unknown words ------------------------------------------------------- Number of unknown words which were free rides: 0 Percentage of unknown words that were free rides: 0%