【问题标题】:Csv file tokenization using Pandas Python [duplicate]使用 Pandas Python 的 CSV 文件标记化 [重复]
【发布时间】:2020-08-12 04:34:54
【问题描述】:

我找不到任何关于如何使用 Pandas Python 对 csv 文件进行标记化的示例编码。以下是我的代码以及经过清理的评论。我将使用这个“cleaned_review”来执行标记化。

enter image description here

【问题讨论】:

    标签: python pandas nlp nltk


    【解决方案1】:

    要对 clean_review 执行标记化,请将 NLTK 单词标记器逐行应用于列。

    import nltk
    steam_reviews['cleaned_review'] = steam_reviews.apply(lambda row: nltk.word_tokenize(row['cleaned_review']), axis=1)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-09
      • 2015-11-09
      • 2018-02-10
      • 2010-12-16
      • 2021-11-07
      • 2017-12-26
      • 1970-01-01
      • 2016-10-04
      相关资源
      最近更新 更多