2.1載入自己的語料庫

使用PlaintextCorpusReader 載入自己的語料

假設你的文件的位置:C:\cl

       form nltk.corpus import PlaintCorpusReader

       corpus_root=r'C:\cl'

      wordlist=PlaintextCorpusReader(corpus_root,'.*')

       print(wordlist.fileids())

結果輸入C:\cl下的所有類型文件

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章