小编sim*_*pta的帖子

OSError: [E050] 找不到模型“en”

我正在尝试使用 python 的这个 pytextrank 库-https: //github.com/DerwenAI/pytextrank/blob/master/example.ipynb 但我无法解决这个错误,早些时候我收到了一个错误,ip.json 可以没有找到,但后来解决了

    import pytextrank
    import sys
    path_stage0="data/ip.json" 
    path_stage1="o1.json"

    with open(path_stage1,'w') as f:
        for graf in pytextrank.parse_doc(pytextrank.json_iter(path_stage0)):
            f.write("%s\n" % pytextrank.pretty_print(graf._asdict()))
            print(pytextrank.pretty_print(graf))


    OSError                                   Traceback (most recent call last)
    <ipython-input-12-a20b437ea0f1> in <module>
          6 
          7 with open(path_stage1,'w') as f:
    ----> 8     for graf in pytextrank.parse_doc(pytextrank.json_iter(path_stage0)):
          9         f.write("%s\n" % pytextrank.pretty_print(graf._asdict()))
         10         print(pytextrank.pretty_print(graf))

~\Anaconda3\lib\site-packages\pytextrank\pytextrank.py in parse_doc(json_iter)
    259                 print("graf_text:", graf_text)
    260 
--> 261             grafs, new_base_idx = parse_graf(meta["id"], graf_text, base_idx)
    262             base_idx = new_base_idx
    263 

~\Anaconda3\lib\site-packages\pytextrank\pytextrank.py in parse_graf(doc_id, graf_text, base_idx, spacy_nlp)
    185 …
Run Code Online (Sandbox Code Playgroud)

python nlp spacy pytextrank

4
推荐指数
3
解决办法
6757
查看次数

标签 统计

nlp ×1

pytextrank ×1

python ×1

spacy ×1