Question: Q 2 . Neural Network Approach for WSD: Code [ 1 0 ] In this question, you will build WSD using a Bi - directional
Q Neural Network Approach for WSD: Code
In this question, you will build WSD using a Bidirectional LSTM You may use PyTorch for this task.
Load SemCor corpus using NLTK with semcor.sents Similarly, load WordNet model in NLTK as import wordnet as wn Randomly select sentences as the test set for this question and remaining sentences will be the train set. Build a vocabulary of all the words in the SemCor dataset and assign unique index to each word.
Extract WordNet tags as the labels for evaluation. Note that for stop words, the data does not have the tags.
Build a neural network model with an Embedding layer of dimension Bidirectional LSTM layers, a Dense layer, and an output layer with the SoftMax activation function.
Train the model assuming your own hyperparameters such as epochs, optimizer, learning rate, etc.
Evaluate the model using test set with metrics precision, recall, and Fscore. Report the hyperparameters used for model training.
With examples from test set, compare and analyse the results of the modelsl. Your analysis will include the performance of each model, if the model is able to disambiguate the senses if it fails then why, etc.
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
