cat ./Data/*.txt > corpus.txtThis corpus was very unclean, and required many steps before it could be usable.
tr "[a-zA-Z\:\;\.\,\'\"\`\-]" " " < corpus.txt > stage1.txt
cat stage1.txt | tr " " "\n" | sort | uniq -c | sort -gr > stage2.txt
cat stage2.txt | sed -r '/^\ *[0-9]*\ \t/d' | sed -r '/^\ *[0-9]+$/d' > stage3.txt
sed -r '/^\ *[0-9]*\ .{1,3}$/d' < stage3.txt > stage4.txt
sed -r '/^\ *[1-2]\ /d' < stage4.txt > stage5.txt
[freq_of_the_word_in_a_corpus] [word_itself]Despite my input being in that format, the tool did not give me any results. The problem was the spaces at the beginning of the sentences (used by the sort command to right-align all the frequency values. Once these were removed, the output was non-empty.
sed -r 's/^\ +//' < stage5.txt > final.txt
#define SMALL_ROOT_LENGTH 4*Of these parameters, the ones marked with the asterisk (*) have been modified systematically, to try to achieve an optimal result. This was a slightly slow process, since the segments were checked manually, but enough values were tested to reach a conclusion. The best combination of these parameters (according to the trials) is given above.
#define LOW_FREQUENCY_DROPOUTS 1
#define LOW_FREQUENCY_DROPOUTS_LEARNING 5
#define SUFFIX_CUTOFF_THRESHOLD 50
#define PREFIX_CUTOFF_THRESHOLD 70
#define COMPOSITE_SUFFIX_THRESHOLD 0.65
#define WRFR_SUFFIX_THRESHOLD 10
#define WRFR_PREFIX_THRESHOLD 1.5
#define SLS_NORMALIZATION_CONSTANT 7
#define ALLOMORPH_REPLACEMENT_THRESHOLD 4
#define ALLOMORPH_DELETION_THRESHOLD 4
#define ALLOMORPH_ADDITION_THRESHOLD 4
#define PROMOTE_LONG_SEGMENTATION 1*
#define PROMOTE_LONG_SEGMENTATION_LENGTH 30*
#define INDUCE_OUTOFVOCABULARY_ROOTS 1
#define INDUCE_OUTOFVOCABULARY_ROOTS_THRESHOLD 5
./a.out wordlist.eng 1 1 0 1 0
| Parameters |
Results |
|||
SMALL_ROOT_LENGTH |
PROMOTE_LONG_SEGMENTATION_LENGTH |
Accuracy of Segmentation (All test cases) |
Accuracy of Segmentation (Proper test cases) |
Accuracy of Segmentation (Improper test cases) |
| 3 |
15 |
23.17% |
28.9% |
9.59% |
| 4 | 20 |
40.24% |
47.98% |
21.92% |
| 5 |
20 |
39.43% |
47.40% |
20.55% |
| 4 |
25 |
43.90% |
52.02% |
24.65% |
| 4 |
30 |
45.53% |
53.18% |
27.40% |
| 4 |
40 |
44.31% |
50.29% |
30.14% |
| 4 |
Infinity (Setting PROMOTE_LONG_SEGMENTATION
to 0) |
43.90% | 48.55% |
32.88% |
| SMALL_ROOT_LENGTH = 3 PROMOTE_LONG_SEGMENTATION_LENGTH = 15 |
|
|
||||||||||||||||||
| SMALL_ROOT_LENGTH = 4 PROMOTE_LONG_SEGMENTATION_LENGTH = 20 |
|
|
||||||||||||||||||
| SMALL_ROOT_LENGTH = 5 PROMOTE_LONG_SEGMENTATION_LENGTH = 20 |
|
|
||||||||||||||||||
| SMALL_ROOT_LENGTH = 4 PROMOTE_LONG_SEGMENTATION_LENGTH = 25 |
|
|
||||||||||||||||||
| SMALL_ROOT_LENGTH = 4 PROMOTE_LONG_SEGMENTATION_LENGTH = 30 |
|
|
||||||||||||||||||
| SMALL_ROOT_LENGTH = 4 PROMOTE_LONG_SEGMENTATION_LENGTH = 40 |
|
|
||||||||||||||||||
| SMALL_ROOT_LENGTH = 4 PROMOTE_LONG_SEGMENTATION_LENGTH = Infinite |
|
|