python 情绪分析
Modules to be used:
使用的模块:
nltk, collections, string and matplotlib modules.
nltk , collections , string和matplotlib模块。
nltk Module
nltk模块
The full form of nltk is "Natural Language Tool Kit". It is a module written in Python which works on the human language like what are the sentiments and emotions attached to it.
nltk的完整形式是“ 自然语言工具包” 。 这是一个用Python编写的模块,它可以处理人类语言上的情感和情感 。
How can we Download it?
我们如何下载它?
General Way:
pip install nltk
Pycharm Users:
Go to the project interpreter and install it.
Now after downloading this module, it does not mean that we can use its every package, for this we have to download its every package in this way,
现在,下载此模块后,并不意味着我们可以使用其所有软件包,为此,我们必须以这种方式下载其所有软件包,
Create a blank .py file and write this code in it,
创建一个空白的.py文件并在其中写入此代码,
# import the nltk module import nltk # write this command nltk.download()
And, run the fileNow after running this file, the compiler will show you the interface like this,
现在,运行该文件后,编译器将向您显示如下界面,
NLTK Downloader --------------------------------------------------------------------------- d) Download l) List u) Update c) Config h) Help q) Quit --------------------------------------------------------------------------- Downloader> Write d as we have to download the packages of nltk in it. After this: Download which package (l=list; x=cancel)? Identifier> Write all in this ass we have to Download all packages of nltk in our system,and after pressing enter this will take some