我用以下命令安装了spacy并下载了en_core_web_sm : pip install spacy python -m spacy download en_core_web_sm还尝试了pip3安装https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.0/en_core_web_sm-2.2.0.tar.gz
我的spaCy版本: 2.2.0我的Python版本: 3.7.4
*import aqgFunction
import spacy
import en_core_web_sm
nlp = en_core_web_sm.load()
# Main Function
def main():
# Create AQG object
aqg = aqgFunction.AutomaticQuestionGenerator()
inputTextPath = "E:\Automatic-Question-Generator-master\Automatic-Question-Generator-master\AutomaticQuestionGenerator\DB\db.txt"
readFile = open(inputTextPath, 'r+', encoding="utf8")
#readFile = open(inputTextPath, 'r+', encoding="utf8", errors = 'ignore')
inputText = readFile.read()
#inputText = '''I am Dipta. I love codding. I build my carrier with this.'''
questionList = aqg.aqgParse(inputText)
aqg.display(questionList)
#aqg.DisNormal(questionList)
return 0
# Call Main Function
if __name__ == "__main__":
main()*发布于 2020-08-04 21:14:49
尝试使用此命令安装spacy和模型:
pip3 install spacy
python3 -m spacy download en_core_web_sm然后在python控制台中运行这些代码。
nlp = spacy.load("en_core_web_sm")
doc = nlp("Text here")发布于 2021-06-17 12:28:10
在Jupyter笔记本中使用:
!python -m spacy download en_core_web_md 然后:
[Ctrl+M] or `Restart runtime` from menu bar发布于 2021-04-02 14:03:30
如果您收到任何错误,如
“错误:无法安装程序包,因为出现EnvironmentError: WinError 5访问被拒绝:'C:\Users\ttayyab\Anaconda3\Lib\site-packages~rsly\msgpack\_packer.cp38-win_amd64.pyd‘请考虑使用--user选项或检查权限。”
要在Windows 10上安装spacy,请打开Anaconda提示符或命令提示符
pip install spacy --user
python -m spacy download en_core_web_sm #for small
python -m spacy download en_core_web_md #for medium
python -m spacy download en_core_web_lg #for large 链接到官方页面https://spacy.io/api/cli#download
@Rajni Arora,你需要下载en_core_web_md
https://stackoverflow.com/questions/63244030
复制相似问题