天天看點

tfidf裡面遇到的‘list’ object has no attribute 'lower'問題

  • 出現問題
  • TfidfVectorizer對象執行個體化的時候
  • fit時候的資料出現問題
    tfidf裡面遇到的‘list’ object has no attribute 'lower'問題
    tfidf裡面遇到的‘list’ object has no attribute 'lower'問題
  • 可以看到test(資料)是list套list,而所需要的資料是可疊代對象裡面為str
  • 改成[‘是要 申報… 謝謝你’,‘xx xx xx’,’’…]這種形式
  • 把裡面的[]去掉,取出來改為str類型即可解決這個問題