Part-A

Information

The hindi corpus used is same as in assignment 1. Unigram and bigram models are used to segment the test file. Unigram model gives better result as compared to bigram one because bigrams are having mostly frequency one.

The results are as follows:

Precision Recall f-score
Unigram 0.94463086 0.85173976 0.8958
Bigram 0.89850247 0.85987264 0.8788

Link to Code

  • Codes : Please supply a hindi corpus and follow the steps as shown in information.txt ot get unigrams and input to the ngrams.py file. Similar steps are there to follow to get bigrams. On terminal input lines are given to get segmented output.
  • Part-B

    Information

    In this implementation the spell corrector uses unigram model for single word correction. The file hi-spell2--.txt is used for performance evaluation. This provides precision of 27.56% with the correct the word carrying highest probability. Also, this does not include implementation of word segmentation in cases when two words are combined. Not considering these accuracy is 36.43%. This low precision is avoidable if user himself chooses a word from suggested list by spell checker, the way it aspell demands. In comparision with this aspell hindi spell checker performs better than this. It gives accuracy of 37.53% with choosing first suggested word as correct word.

    Bigram model of spell checker for sentence correction is also implemented.

    Link to Codes and files