Resource u'tokenizers/punkt/english.pickle' not found

前端 未结 17 2093
粉色の甜心
粉色の甜心 2020-12-13 01:49

My Code:

import nltk.data
tokenizer = nltk.data.load(\'nltk:tokenizers/punkt/english.pickle\')

ERROR Message:

[ec2-user@ip-         


        
17条回答
  •  甜味超标
    2020-12-13 02:19

    If you're looking to only download the punkt model:

    import nltk
    nltk.download('punkt')
    

    If you're unsure which data/model you need, you can install the popular datasets, models and taggers from NLTK:

    import nltk
    nltk.download('popular')
    

    With the above command, there is no need to use the GUI to download the datasets.

提交回复
热议问题