Question: Use Jupyter notebok / lab for al codes please. 1 . [ Points 2 0 ] Answer the following questions. Given the training and test
Use Jupyter noteboklab for al codes please.
Points Answer the following questions. Given the training and test examples.
Training Examples:
I love to watch movies
He loves to watch football
They love watching movies
He plays football every Sunday
Test Example:
I love watching football
Text normalization: apply case lowering and may remove any punctuation characters if any.
aPoints Show all probability calculations for both unigram and bigram models. Show detailed computations. Please apply addone smoothing techniques.
bPoints Calculate the perplexity for both models on the test sentence.
cPoints Comment on the difference in perplexity between the unigram and bigram models and explain why one might be lower than the other.
points Given the training documents, classify the testing text as either a "Positive" or "Negative" sentiment by answering the questions below.
Training Text:
D: "I love this movie" Positive
D: "This movie is great" Positive
D: "I hate this movie" Negative
D: "This movie is terrible" Negative
Testing Text:
D: "I love this great movie"
D: "I hate this terrible movie"
apoints Tokenize the documents by splitting them into words. Perform case lowering and remove punctuation if any Create the vocabulary for the training document.
bpoints Compute the prior class probability PC where C is the class label.
cpoints Compute the likelihoodprobability PWC of your given training words using the addone smoothing approach. Show each calculation in detail.
dpoints Compute the test document class probability for each document use log scale to overcome underflow issues Compare and decide the class label based on your computation.
epoints Write a simple code to implement the above steps ad and show the classification results for the given test set. Your computation should show each step computation ad in detail.
points Given the following text documents, answer the below questions.
Document : "I enjoy watching movies on weekends."
Document : "The weather today is sunny and pleasant."
Document : He plays football every Sunday with his friends."
apoints Provide the tokenized version of the text for each document. Apply text normalization steps convert all words to lowercase and remove punctuation if necessary. Show each step in detail. What is the vocabulary size unique words for each document?
bpoints Generate all contexttarget word pairs for each document using window size W Explain how the window size W impacts the number of contexttarget pairs generated.
points Given the initial word embedding from the question
"watching":
"movies":
"sunny":
"football":
"friends":
Instructions: Follow the steps when applicable to : i Simulate the dot product between context and target vectors. ii Apply gradient descent to update the word vectors assume a learning rate of iii Perform one iteration of the embedding update.
apoints Show the word embedding updates after one iteration for the word "movies" when the context word is "watching." Show detailed computations in each step. Explain how the dot product helps capture word similarity during the training process.
bpoints Assume we are performing negative sampling for the word pair movies "watching" Randomly sample three negative words from the vocabulary: "sunny", "football", "friends".
Compute the dot product between "movies" and its negative samples. Show detailed computations. Explain the purpose of negative sampling and how it improves the efficiency of training WordVec models.
cpoints Calculate the cosine similarity between "movies" and "watching" using their updated embeddings from the previous question. Based on the cosine similarity result, explain whether these words are semantically close or not. What threshold would you consider when deciding if two words are similar?
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
