Question: Q 1 . Lesk Algorithm for Word Sense Disambiguation: Code [ 1 0 ] In this question, you will implementing Simplified Lesk algorithm for Word
Q Lesk Algorithm for Word Sense Disambiguation: Code
In this question, you will implementing Simplified Lesk algorithm for Word Sense Disambiguation task.
Load SemCor corpus using NLTK with semcor. sents Similarly, load WordNet model in NLTK as import wordnet as wn Randomly select sentences and store the sentences sents and their corresponding tagged version taggedsents as data and labels for first models.
Our first model for word sense disambiguation is Most Frequent Sense model, in which, as the name suggests, we choose most frequent sense for each word from the senses in a labelled corpus. For wordnet, this corresponds to the first sense in synset Using synset and definition find the sense for each word. Evaluate and report the results using precision, recall and Fscore.
Our second model is SimplifiedLesk algorithm as follows:
function SIMPLIFIED LESKword sentence returns best sense of word.
Here, ComputeOverlap method calculates the number of words overlapping in the context
sentence and the definition of the word from wordnet excluding the stopwords. The sense with largest overlap is chosen.
Evaluate and report the results with tags from the dataset using precision, recall and Fscore.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
