自然语言处理学习4:nltk词频统计FreqDist,ConditionalFreqDist和tabulate 结合汽车评论实例
1.加载函数和准备数据importnltkimportjiebaimportnumpyasnpimportpandasaspdimportre#读取评价数据defload_comments(filename):df=pd.read_csv(filename,encoding='gbk')pos_comments=list(df['advance'])neg_comments=list(df['di