相关疑难解决方法(0)

与python的tfidf的数据框架

我必须对一些情绪进行分类,我的数据框是这样的

Phrase                      Sentiment

is it  good movie          positive

wooow is it very goode      positive

bad movie                  negative
Run Code Online (Sandbox Code Playgroud)

我做了一些预处理作为标记化停止词干...等我得到

Phrase                      Sentiment

[ good , movie  ]        positive

[wooow ,is , it ,very, good  ]   positive

[bad , movie ]            negative
Run Code Online (Sandbox Code Playgroud)

我需要最终得到一个数据帧,该行是文本,其值是tf_idf,列是像这样的单词

good     movie   wooow    very      bad                Sentiment

tf idf    tfidf_  tfidf    tf_idf    tf_idf               positive
Run Code Online (Sandbox Code Playgroud)

(其余两条线也一样)

python text-mining tf-idf dataframe pandas

9
推荐指数
2
解决办法
2214
查看次数

标签 统计

dataframe ×1

pandas ×1

python ×1

text-mining ×1

tf-idf ×1