Natural Language Processing (NLP)
Natural Language Processing (NLP) is a way for computers to understand human language. It helps computers do things like translate languages, write different kinds of creative content, and answer your questions in an informative way.
Here are some examples of NLP:
- A machine translation system that can translate text from one language to another.
- A speech recognition system that can transcribe audio into text.
- A text analysis system that can identify the sentiment of a piece of text (e.g., whether it is positive, negative, or neutral).
- A question answering system that can answer your questions about a topic.
Here are some of the most common techniques used in NLP:
- Tokenization: This is the process of dividing text into smaller units, such as words or phrases.
- Stemming: This is the process of reducing words to their root form. For example, the words “running” and “ran” would both be stemmed to “run”.
- Lemmatization: This is similar to stemming, but it takes into account the context of the word. For example, the word “better” would be lemmatized to “good” in the context of “I am better than you”.
- Part-of-speech tagging: This is the process of identifying the part of speech of each word in a sentence. For example, the word “dog” would be tagged as a noun in the sentence “The dog ate the bone”.
- Semantic analysis: This is the process of understanding the meaning of text. This can be done by using a variety of techniques, such as word embedding, topic modeling, and sentiment analysis.
NLP is a complex and challenging field, but it is also a very rewarding one. With the advancement of machine learning and artificial intelligence, NLP is becoming increasingly powerful and capable. As a result, NLP is being used to solve a wide variety of problems, from machine translation to fraud detection.
import matplotlib.pyplot as plt
from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator
text = " ".join(i for i in data.review)
stopwords = set(STOPWORDS)
wordcloud = WordCloud(stopwords=stopwords, background_color="white").generate(text)
plt.figure( figsize=(15,10))
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis("off")
plt.show()
user = input("Enter a Text: ")
data = cv.transform([user]).toarray()
output = model.predict(data)
print(output)
Enter a Text: it was best movie i have ever seen
['positive']
Click for Project— Click for Source
“It does not matter how slowly you go as long as you do not stop.” — Chinese Philosopher Confucius
Have a nice reading! :D