Question: 2 . ( 4 points ) Recall an ( n ) - gram consists of ( n ) - adjacent words.

2.(4 points) Recall an \( n \)-gram consists of \( n \)-adjacent words. Thus a bigram is shorthand for an \( n \)-gram where \( n=2\) and a trigram is an n -gram where \(\mathrm{n}=3\). We defined a 'smart' bigram or trigram to be n -grams in which we removed cases that contained a stopword or punctuation. Consider the following sentence:
It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair.
a) List all possible 'smart' bigrams and trigrams for the sentence above if the set of stopwords is \{the, of, was\}
b) Pretend there are no commas in the sentence above and then list all possible 'smart' bigrams and trigrams if the set of stopwords is \{the, of, was \}
2 . ( 4 points ) Recall an \ ( n \ ) - gram

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!