Thesis / Research code
Steps:
- Get the sentences from the corpus and separate them into training and test data. (brown.sentences + brown_test.sentences)
File: scripts/get_sentences_from_brown.py
####################################################
####################################################
- Count the words in the training + test data and store them in words.count
File: scripts/count_words_and_write_to_file.py
####################################################
####################################################
- Create Huffman code for the words in words.count and store them in files as per their bit word lengths.
File: scripts/create_huffman_code_for_all_words.py
####################################################
####################################################
- Calculate unigram and bigram probabilities for the words on brown.sentences
File: scripts/calculate_unigram_probabilities.py
####################################################
####################################################
File: scripts/calculate_bigram_probabilities.py
####################################################
Format: prob[(<huffman_encoded_word_1>, <huffman_encoded_word_2>)] = P[(<huffman_encoded_word_1>, <huffman_encoded_word_2>) / <huffman_encoded_word_1>)]
####################################################