What is difference between en_core_web_sm, en_core_web_md and en_core_web_lg model of spacy?

笑着哭i 提交于 2019-12-06 19:52:02

问题


I installed spacy on my system and I want to parse/extract person name, organization for english. But I saw here, there is 4 model for english. And there is model versioning. I didn't get which model is large and which I have to choose for development?


回答1:


sm/md/lg refer to the sizes of the models (small, medium, large respectively).

As it says on the models page you linked to,

Model differences are mostly statistical. In general, we do expect larger models to be "better" and more accurate overall. Ultimately, it depends on your use case and requirements. We recommend starting with the default models (marked with a star below).

FWIW, the sm model is the default (as alluded to above)




回答2:


The difference is in the accuracy of the predictions.

But, as you can see in the comparison in the spaCy documentation, the difference is very small.

The en_core_web_lg (788 MB) compared to en_core_web_sm (10 MB):

  • LAS: 90.07% vs 89.66%
  • POS: 96.98% vs 96.78%
  • UAS: 91.83% vs 91.53%
  • NER F-score: 86.62% vs 85.86%
  • NER precision: 87.03% vs 86.33%
  • NER recall: 86.20% vs 85.39%

All that while en_core_web_lg is 79 times larger, hence loads a lot more slowly.

What I recommend is using the en_core_web_sm while developing and then switching to a larger model in production. You can easily switch just by changing the model you load.

nlp = spacy.load("en_core_web_lg")


来源:https://stackoverflow.com/questions/50487495/what-is-difference-between-en-core-web-sm-en-core-web-mdand-en-core-web-lg-mod

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!