Computer Science, asked by Anonymous, 4 months ago

What is “bag of words” in NLP? ​

Answers

Answered by anilahirwar0002
22

Answer:

Bag of Words (BOW) is a method to extract features from text documents. These features can be used for training machine learning algorithms. It creates a vocabulary of all the unique words occurring in all the documents in the training set.

Answered by Anonymous
427

Answer:

\large\mathsf{\red{\underline{\underline{Bag~ Of~ Words:-}}}} Bag of Words is a Natural Language Processing model which helps in extracting features out of the text which can be helpful in machine learning algorithm.

  • In Bag Of Words , we get the Occurance of each word and construct the vocabulary for the corpus.

For example:-

Document 1:-

\boxed{\begin{array}{cc}\sf\:Aman~ and~ Anil~ are\\\\ \sf\: stressed.~Aman \: went \\  \\  \sf \: to \: a \: therapist. \: Anil \: went    \\  \\ \sf \:  to \: downlod \: a \: \: health \: chatbot.\\\\\end{array}}

Now, let us find the word frequency first:-

\rule{150}{2}

Aman :- 2

and :- 1

Anil :- 2

are :- 1

stressed :- 1

went :- 2

to :- 2

a :- 2

therapist :- 1

download :- 1

health :- 1

chatbot :- 1

\rule{150}{2}

Bag Of Words :-

\boxed{\begin{array}{cc}\sf\:Aman~ and~ Anil~ are\\\\ \sf\: stressed~ went  \:  to \: a \: therapist  \\  \\  \sf\: Anil \: download \: health \: chatbot\\\\\end{array}}

Similar questions