OSError: [E050] Can't find model 'en'

simran gupta

I am trying to use this pytextrank library of python- https://github.com/DerwenAI/pytextrank/blob/master/example.ipynb but i am unable to resolve this error , earlier i was getting an error that ip.json can't be found, but then was resolved

    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     if not spacy_nlp:
    186         if not SPACY_NLP:
--> 187             SPACY_NLP = spacy.load("en")
    188 
    189         spacy_nlp = SPACY_NLP

~\Anaconda3\lib\site-packages\spacy\__init__.py in load(name, **overrides)
     25     if depr_path not in (True, False, None):
     26         deprecation_warning(Warnings.W001.format(path=depr_path))
---> 27     return util.load_model(name, **overrides)
     28 
     29 

~\Anaconda3\lib\site-packages\spacy\util.py in load_model(name, **overrides)
    137     elif hasattr(name, "exists"):  # Path or Path-like to model data
    138         return load_model_from_path(name, **overrides)
--> 139     raise IOError(Errors.E050.format(name=name))
    140 
    141 

OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.
Paco

The model names changed, so en_core_web_sm or another model needed to be downloaded. That issue is resolved in the v1.2.1 release which updates to spaCy 2.x.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

OSError:[E050]モデル 'en'が見つかりません

分類Dev

Python nlp spacy OSError:[E050]モデル 'de'が見つかりません

分類Dev

spacy Can't find model 'en_core_web_sm' on windows 10 and Python 3.5.3 :: Anaconda custom (64-bit)

分類Dev

OSError:[E050]モデル 'de'が見つかりません。ショートカットリンク、Pythonパッケージ、またはデータディレクトリへの有効なパスではないようです

分類Dev

System can't find path

分類Dev

Docker can't find OpenJDK

分類Dev

Can't find value of row

分類Dev

Xcode can't find SpriteKit?

分類Dev

can't find my files

分類Dev

Appcode can't find destination

分類Dev

JPA can't find table

分類Dev

Wordpress can´t find file

分類Dev

CoreBluetooth: Can't find iPad

分類Dev

Compass can't find SingularityGS

分類Dev

Can't Catch Error for Mongoose Model Save

分類Dev

why I can't update this model in Yii?

分類Dev

Model in dae format can't be moved or scaled, can it be locked?

分類Dev

Couldn't find <Model> without an ID - rails 5

分類Dev

Why can't pgrep find a process?

分類Dev

Debian Gnome can't find Bluetooth headset

分類Dev

can't find saved entity in test

分類Dev

LibGDX project can't find assets folder

分類Dev

python submodule can't find import

分類Dev

python submodule can't find import

分類Dev

LibGDX project can't find assets folder

分類Dev

Django can't find template directory

分類Dev

Flask can't find app file

分類Dev

Xcode can't find my cell identifier

分類Dev

Can't find resource bundle exception