Writing a Translation Software

Bengali Corpus Building

Full connected letter list for Bengali is on this page.

Terminology

Markov chain : possibility of next words depending on this word. sum(possibility) should equal to 1.

1st Order Markov chain : like n-gram. Only 1 word determines possibility. 2nd Order Markov chain : two consequent words determine the 3rd. -- 22-Sep-2022

Bengali Conjugated letters

ক্ক ক্ট ক্ট্র ক্ত ক্য ক্র ক্ল ক্ষ ক্ষ্ম ক্ষ্য ক্স খ্য গ্ধ গ্ধ্য গ্ন গ্ম গ্য গ্র গ্ল ঘ্য ঘ্র ঙ্ক ঙ্গ চ্চ চ্ছ চ্য জ্জ জ্ঞ জ্ব জ্য জ্র ঞ্চ ট্ট ট্য ট্র ড্ড ড্য ড্র ঢ্য ঢ্র ত্ত ত্ন ত্ব ধ্য ত্ম ত্য ত্র ন্ট ন্ঠ থ্য থ্র দ্দ দ্ধ দ্ব দ্ভ দ্ম দ্য দ্র ধ্ব ধ্য ধ্র ন্ট ন্ঠ ন্ড ন্ত ন্ত্য ন্ত্র ন্দ ন্দ্য ন্দ্র ন্ধ ন্ধ্য ন্ধ্র ন্ন ন্ম ন্য প্ট প্ত প্ন প্প প্য প্র প্র্য প্ল প্স ফ্র ফ্ল ব্জ ব্দ ব্ধ ব্ব ব্য ব্র ব্ল ভ্য ভ্র ম্ন ম্প ম্প্র ম্ফ ম্ব ম্ভ ম্ভ্র ম্ম ম্য ম্র ম্ল য্য র্ক র্ক্য র্গ র্গ্য র্গ্র র্ঘ র্ঘ্য র্চ র্চ্য র্ছ র্জ র্জ্য র্ঝ র্ট র্ড র্ঢ্য র্ত র্ত্য র্ত্র র্থ র্থ্য র্দ র্দ্ব র্দ্র র্ধ্ব র্ন র্প র্ফ র্ব্য র্ভ র্ম র্ম্য র্য র্ল র্শ র্শ্য র্ষ র্স র্হ র‍্য ল্ক ল্ক্য ল্গ ল্ট ল্ড ল্প ল্ম ল্য ল্ল শ্চ শ্ন শ্ব শ্ম শ্য শ্র শ্ল ষ্ট ষ্ট্য ষ্ট্র ষ্ঠ ষ্ঠ্য ষ্ণ ষ্য স্ক স্ক্র স্ট স্ট্র স্ত স্ত্য স্ত্র স্থ স্থ্য স্ন স্প স্প্র স্ফ স্ব স্য স্র স্ল হৃ হ্ন হ্ম হ্য হ্র

There are more letters, but I am only listing those that are actually used in daily writing. Instead of adding, my next quest will be to further shorten this list.

Parsed Al-Bidaya : 95% words are correct

Here's the stats Total words : 2.3m. Unique words : 150k

Most frequent 5 words [ইবন] => 40762 [তার] => 36735 [তিনি] => 31334 [এবং] => 26525 [ও] => 24311

Bad words, due to OCR failure, starts to appear after 8000 words. And 100k of the total 150k words appears only once, which is 70% of total unique words. These are bad words.

Therefore that gives us about 100k bad words within 2.3 million total words. Indicating 95% of the OCRed words are correct.

Need to clean it up as best as I can before proceeding.

Date : 20-Sep-2022

Need to build a corpus

This is the first realization. It's not that I can feed tons of text into a model and it will magically output my translation.

Rather it's a ground up work.

  1. First a dictionary. One word translated to one word.
  2. Next whole list of variations of those words. Still one world list. But now x100 times larger.
  3. Extend to two word list. Then 3 words. Then 4 words.
Now you can expect a machine to learn something from it.

You can take help of the machine in generating that list. But the list has to be generated statically. First.

Date : 17-Sep-2022

Building my first neural network

Here's the cheat sheet I get building it. Had to study 3 sources from github and a lot of technical writing. But finally got it right.

Learnt a lot of the foundations working on it.

Date : 12-Sep-2022

ML : Learning Steps

Here's the progress of learning ML in NLP. In order
  • First learn CNN, a basic Neural Network 17-Sep-2022
  • Then learn RNN as in Recurrent Neural Netwrok.
  • Then LSTM and Seq2Seq model. This one had been the norm 5 years back. And still better for some work than others.
  • Finally Transformer model, the one you will actually use. And the one which everyone is using now.

Date : 17-Sep-2022

External Resources

Published
12-Sep-2022
Updated
23-Sep-2022