TL;DR
Last week I collected letters (323 letter forms) from open-tamil and estimated the unigram, bigrams and trigram frequencies in a given Tamil lexicon with about 65,0000 odd words. The interesting results are found in this Open-Office Calc spreadsheet.
This was somewhat of a enjoyable exercise to me, to revisit some of the hardwork I have done in Open-Tamil, particularly in the utf8 module, among other contributions to Open-Tamil library from a wider team.
However, whats in it for you, dear reader ? To cut to the chase, here is all the meat and potatoes of the results:
- Tamil word frequencies sorted by word-length for the 65k words show a mean wordlength (using weighted average) of 5.404; 5 is a beautiful Prime number and Indian mythology will also have some suitable references.
- Unigram data show Zipf’s law like distribution (e.g. from NLP course material); also we see only 100 of 323 possible letter forms in Tamil make up the text of the lexicon. One wonders of a Samuel Morse that sent his telegram’s for Tamil, if he would have chosen ‘.’ to represent the ‘ம்’ ? However Tamil reading or recitation of Morse code would be like jathi-reciting Barathanatyam dance teacher. Dit daa daa. The first 100 most frequent letters in lexicon are presented here.
Letter Frequency ம் 18164 த 17207 க 14670 ல் 14165 த் 9540 க் 8257 ன் 8133 ர 7639 ப 7639 வ 7005 தி 6625 ச 6402 கு 6154 ம 5925 ப் 5809 ட் 5690 டு 5566 ர் 5503 ய 5049 அ 4683 ட 4563 ரு 4536 பு 4292 கா 4262 து 4162 ல 4046 வி 3838 டி 3798 ண் 3773 சி 3720 ன 3563 ரி 3379 ங் 3284 ந் 3254 ற் 3099 இ 2939 று 2811 ச் 2811 சு 2751 பா 2705 கி 2625 பி 2614 வா 2569 மு 2458 ள் 2432 லை 2212 உ 2185 டை 2156 தா 2154 ண 2134 கை 2121 ஆ 2020 மா 2015 ய் 1916 ள 1902 சா 1837 ற 1821 லி 1744 வு 1522 கொ 1497 ந 1491 நி 1465 ஞ் 1461 ரா 1452 ணி 1450 ளி 1432 யா 1421 நா 1303 றி 1263 கோ 1260 செ 1236 ழி 1234 னி 1219 ழு 1122 மி 1117 யி 1095 பொ 1082 ரை 1057 வெ 1036 எ 1025 மை 990 றை 976 பூ 949 னை 937 ழ 937 லா 911 சை 837 வை 822 போ 815 கூ 802 வே 797 டா 793 தை 786 பெ 765 ளை 764 தே 674 ஒ 655 ழ் 618 லு 613 நீ 581 - Bigram data also has promising structure as Shannon would have imagined it would be from a human language; these things are known to have redundancy, structure and predictability.
- First 2000 bigrams occupy more than 50% of all observed bigrams.
- Lexicon contained only ~ 13.25% of all possible bigrams in the wild!
- This sparseness of bigram data indicates mainly a limited data set or highly structured vocabulary in Tamil, but I’ll wager the former.
- Zipf’s law fit is not as nice as for unigrams but here it goes:
- The top 100 bigrams, by frequency, are the following:
-
தல் 8670 த்த 4645 க்க 2844 கம் 2824 த்தி 2160 ரம் 2023 க்கு 2019 தம் 1893 ட்டு 1805 ப்பு 1757 டுத 1641 ப்ப 1582 யம் 1532 த்து 1517 ம்ப 1484 னம் 1402 ம்அ 1397 ந்த 1305 ங்க 1286 டம் 1233 லம் 1230 ட்ட 1108 க்கா 1082 சம் 985 ட்டி 976 ம்பு 958 கன் 904 ம்க 904 ல்க 882 க்கி 869 திர 852 ந்தி 823 ணம் 819 ம்ச 799 ங்கு 797 ச்சி 789 ண்ட 767 ர்த் 757 கட் 755 குத 743 ம்இ 729 ப்பி 720 கண் 716 ரன் 712 ல்அ 707 கார 692 ற்று 689 ப்பா 688 ம்ம 681 வன் 672 ம்பி 641 ச்ச 632 ம்ஆ 624 தன் 617 வம் 599 கர 592 பம் 587 கல் 581 ம்உ 534 கரு 534 ல்ப 530 யன் 519 றுத 517 ல்வ 515 ந்து 511 த்தா 510 ச்சு 502 ம்பா 500 ஞ்ச 495 டுத் 492 பிர 490 ரிய 488 டித் 480 படு 477 ல்த 475 ல்கு 467 ல்உ 467 னல் 462 ளம் 459 ன்அ 456 ற்ற 450 ட்டை 443 திரு 442 ருத் 435 ல்இ 431 ங்கா 415 ன்ன 414 தலை 411 வர் 406 ம்த 403 ன்ம 398 ன்க 394 க்கொ 392 ண்டு 391 ம்வி 388 ல்வி 384 மம் 384 ர்க் 384 டுக் 381 ல்ம 379
- Moving on to trigrams we find, even more sparseness since the data is so limited – 65k words with total letter size of 345,315 letters only. Of the possible 323^3 = 33,698,267 ~ 34 million trigrams we have only 107,715 trigrams present in the Lexicon, about 2%, making this is the weakest dataset yet.
- About 10,000 trigrams form more than 50% of the available trigrams from the data-set with rest of trigrams occurring sparsely.
- The most frequently occurring 100 trigrams and their frequency in this lexicon are shown below:
த்தல் 2992 டுதல் 1573 குதல் 674 தல்க 575 ட்டுத 557 க்கம் 513 த்திர 479 தல்அ 476 றுதல் 472 ர்த்த 446 ட்டம் 431 டித்த 431 த்தம் 382 கட்டு 380 தல்ப 374 தல்த 353 தல்உ 351 துதல் 332 டுத்த 331 காரன் 325 திரம் 322 க்கட் 310 தல்கு 309 க்கார 298 ந்தம் 295 க்குத 293 தல்வ 288 ங்கம் 280 தல்இ 271 படுத 271 ங்குத 256 த்துத 250 த்திய 250 ந்திர 250 தல்மு 246 ளுதல் 245 தல்ம 242 தனம் 242 சனம் 234 ய்தல் 228 ர்க்க 228 ப்படு 227 தல்வி 226 கம்அ 222 க்கல் 218 காரம் 218 ரித்த 208 தல்ச 206 ர்தல் 206 பத்தி 202 தம்அ 201 ருத்த 196 ள்ளுத 195 தல்பு 193 கம்ப 192 ண்டம் 185 ரம்அ 183 த்துவ 180 ம்பிர 174 ட்டுக் 174 வுதல் 171 தல்கா 170 ரணம் 170 ற்றுத 168 தல்ந 167 யம்அ 165 ரியம் 164 கொள்ளு 164 தல்சி 164 லுதல் 162 கரம் 162 புதல் 160 கம்க 159 தல்ஒ 158 சுதல் 157 தல்நி 156 ர்த்தி 156 ப்பிர 155 ணுதல் 154 காட்டு 153 தல்கை 150 தல்பி 149 போடுத 148 தல்ஆ 147 கண்ட 147 க்கிர 146 தியம் 146 தல்எ 145 சித்த 145 தல்சு 144 வைத்த 143 க்கர 141 ரம்க 140 த்தன் 138 தல்து 138 காலம் 138 மரம் 137 ரம்ப 137 விடுத 136 சங்க 135
Conclusion
It is quite easily possible to build a random word/text generation in Tamil with these statistical data and smoothing information for the missing 80% bigram, 98% trigram data using Monte Carlo techniques. Further word-level frequency, word-level bigram and trigram data will make a more relevant text generation at the sentential level.
More later. Adios amigo.