{"componentChunkName":"component---src-templates-index-js","path":"/models","result":{"data":{"site":{"siteMetadata":{"title":"spaCy","description":"spaCy is a free open-source library for Natural Language Processing in Python. It features NER, POS tagging, dependency parsing, word vectors and more.","legacy":true,"navigation":[{"text":"Usage","url":"/usage"},{"text":"Models","url":"/models"},{"text":"API","url":"/api"},{"text":"Universe","url":"/universe"}],"docSearch":{"apiKey":"371e26ed49d29a27bd36273dfdaf89af","indexName":"spacy"}}},"file":{"childMdx":{"code":{"scope":"","body":"function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nconst layoutProps = {};\nreturn class MDXContent extends React.Component {\n  constructor(props) {\n    super(props);\n    this.layout = null;\n  }\n\n  render() {\n    const _this$props = this.props,\n          {\n      components\n    } = _this$props,\n          props = _objectWithoutProperties(_this$props, [\"components\"]);\n\n    return React.createElement(MDXTag, {\n      name: \"wrapper\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"section\",\n      components: components,\n      props: {}\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `The models directory includes two types of pretrained models:`), React.createElement(MDXTag, {\n      name: \"ol\",\n      components: components,\n      parentName: \"section\"\n    }, React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"li\"\n    }, `Core models:`), ` General-purpose pretrained models to predict named entities,\npart-of-speech tags and syntactic dependencies. Can be used out-of-the-box\nand fine-tuned on more specific data.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"li\"\n    }, `Starter models:`), ` Transfer learning starter packs with pretrained weights\nyou can initialize your models with to achieve better accuracy. They can\ninclude word vectors (which will be used as features during training) or\nother pretrained representations like BERT. These models don’t include\ncomponents for specific tasks like NER or text classification and are\nintended to be used as base models when training your own models.`)), React.createElement(MDXTag, {\n      name: \"h3\",\n      components: components,\n      parentName: \"section\",\n      props: {\n        \"hidden\": \"true\"\n      }\n    }, `Quickstart`), React.createElement(QuickstartModels, {\n      title: \"Quickstart\",\n      id: \"quickstart\",\n      description: \"Install a default model, get the code to load it from within spaCy and test it.\"\n    }), React.createElement(Infobox, {\n      title: \"\\uD83D\\uDCD6 Installation and usage\"\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `For more details on how to use models with spaCy, see the\n`, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"p\",\n      props: {\n        \"href\": \"/usage/models\"\n      }\n    }, `usage guide on models`), `.`))), React.createElement(MDXTag, {\n      name: \"section\",\n      components: components,\n      props: {\n        \"id\": \"section-architecture\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components,\n      parentName: \"section\",\n      props: {\n        \"id\": \"architecture\"\n      }\n    }, `Model architecture`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `spaCy v2.0 features new neural models for `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `tagging`), `, `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `parsing`), ` and `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `entity\nrecognition`), `. The models have been designed and implemented from scratch\nspecifically for spaCy, to give you an unmatched balance of speed, size and\naccuracy. A novel bloom embedding strategy with subword features is used to\nsupport huge vocabularies in tiny tables. Convolutional layers with residual\nconnections, layer normalization and maxout non-linearity are used, giving much\nbetter efficiency than the standard BiLSTM solution.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `The parser and NER use an imitation learning objective to deliver `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `accuracy\nin-line with the latest research systems`), `, even when evaluated from raw text.\nWith these innovations, spaCy v2.0’s models are `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `10× smaller`), `, `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `20% more\naccurate`), `, and `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `even cheaper to run`), ` than the previous generation. The\ncurrent architecture hasn’t been published yet, but in the meantime we prepared\na video that explains how the models work, with particular focus on NER.`), React.createElement(YouTube, {\n      id: \"sqDHBH9IjRU\"\n    }), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `The parsing model is a blend of recent results. The two recent inspirations have\nbeen the work of Eli Klipperwasser and Yoav Goldberg at Bar Ilan`, React.createElement(MDXTag, {\n      name: \"sup\",\n      components: components,\n      parentName: \"p\",\n      props: {\n        \"id\": \"fnref-1\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"sup\",\n      props: {\n        \"href\": \"#fn-1\",\n        \"className\": \"footnote-ref\"\n      }\n    }, `1`)), `, and the\nSyntaxNet team from Google. The foundation of the parser is still based on the\nwork of Joakim Nivre`, React.createElement(MDXTag, {\n      name: \"sup\",\n      components: components,\n      parentName: \"p\",\n      props: {\n        \"id\": \"fnref-2\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"sup\",\n      props: {\n        \"href\": \"#fn-2\",\n        \"className\": \"footnote-ref\"\n      }\n    }, `2`)), `, who introduced the transition-based framework`, React.createElement(MDXTag, {\n      name: \"sup\",\n      components: components,\n      parentName: \"p\",\n      props: {\n        \"id\": \"fnref-3\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"sup\",\n      props: {\n        \"href\": \"#fn-3\",\n        \"className\": \"footnote-ref\"\n      }\n    }, `3`)), `, the\narc-eager transition system, and the imitation learning objective. The model is\nimplemented using `, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"p\",\n      props: {\n        \"href\": \"https://github.com/explosion/thinc\"\n      }\n    }, `Thinc`), `, spaCy’s machine\nlearning library. We first predict context-sensitive vectors for each word in\nthe input:`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components,\n      parentName: \"section\"\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-python\",\n        \"lang\": \"python\"\n      }\n    }, `(embed_lower | embed_prefix | embed_suffix | embed_shape)\n    >> Maxout(token_width)\n    >> convolution ** 4\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `This convolutional layer is shared between the tagger, parser and NER, and will\nalso be shared by the future neural lemmatizer. Because the parser shares these\nlayers with the tagger, the parser does not require tag features. I got this\ntrick from David Weiss’s “Stack Combination” paper`, React.createElement(MDXTag, {\n      name: \"sup\",\n      components: components,\n      parentName: \"p\",\n      props: {\n        \"id\": \"fnref-4\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"sup\",\n      props: {\n        \"href\": \"#fn-4\",\n        \"className\": \"footnote-ref\"\n      }\n    }, `4`)), `.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `To boost the representation, the tagger actually predicts a “super tag” with\nPOS, morphology and dependency label`, React.createElement(MDXTag, {\n      name: \"sup\",\n      components: components,\n      parentName: \"p\",\n      props: {\n        \"id\": \"fnref-5\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"sup\",\n      props: {\n        \"href\": \"#fn-5\",\n        \"className\": \"footnote-ref\"\n      }\n    }, `5`)), `. The tagger predicts these supertags by\nadding a softmax layer onto the convolutional layer – so, we’re teaching the\nconvolutional layer to give us a representation that’s one affine transform from\nthis informative lexical information. This is obviously good for the parser\n(which backprops to the convolutions, too). The parser model makes a state\nvector by concatenating the vector representations for its context tokens. The\ncurrent context tokens:`), React.createElement(MDXTag, {\n      name: \"table\",\n      components: components,\n      parentName: \"section\"\n    }, React.createElement(MDXTag, {\n      name: \"thead\",\n      components: components,\n      parentName: \"table\"\n    }, React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"thead\"\n    }, React.createElement(MDXTag, {\n      name: \"th\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Context tokens`), React.createElement(MDXTag, {\n      name: \"th\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Description`))), React.createElement(MDXTag, {\n      name: \"tbody\",\n      components: components,\n      parentName: \"table\"\n    }, React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"tbody\"\n    }, React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S0`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S1`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S2`)), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Top three words on the stack.`)), React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"tbody\"\n    }, React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `B0`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `B1`)), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `First two words of the buffer.`)), React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"tbody\"\n    }, React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S0L1`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S1L1`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S2L1`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `B0L1`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `B1L1`), React.createElement(\"br\", null), React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S0L2`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S1L2`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S2L2`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `B0L2`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `B1L2`)), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Leftmost and second leftmost children of `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S0`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S1`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S2`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `B0`), ` and `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `B1`), `.`)), React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"tbody\"\n    }, React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S0R1`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S1R1`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S2R1`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `B0R1`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `B1R1`), React.createElement(\"br\", null), React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S0R2`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S1R2`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S2R2`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `B0R2`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `B1R2`)), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": null\n      }\n    }, `Rightmost and second rightmost children of `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S0`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S1`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `S2`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `B0`), ` and `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"td\"\n    }, `B1`), `.`)))), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `This makes the state vector quite long: `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `13*T`), `, where `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `T`), ` is the token vector\nwidth (128 is working well). Fortunately, there’s a way to structure the\ncomputation to save some expense (and make it more GPU-friendly).`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `The parser typically visits `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `2*N`), ` states for a sentence of length `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `N`), ` (although\nit may visit more, if it back-tracks with a non-monotonic transition`, React.createElement(MDXTag, {\n      name: \"sup\",\n      components: components,\n      parentName: \"p\",\n      props: {\n        \"id\": \"fnref-4\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"sup\",\n      props: {\n        \"href\": \"#fn-4\",\n        \"className\": \"footnote-ref\"\n      }\n    }, `4`)), `). A\nnaive implementation would require `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `2*N (B, 13*T) @ (13*T, H)`), ` matrix\nmultiplications for a batch of size `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `B`), `. We can instead perform one\n`, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `(B*N, T) @ (T, 13*H)`), ` multiplication, to pre-compute the hidden weights for\neach positional feature with respect to the words in the batch. (Note that our\ntoken vectors come from the CNN — so we can’t play this trick over the\nvocabulary. That’s how Stanford’s NN parser`, React.createElement(MDXTag, {\n      name: \"sup\",\n      components: components,\n      parentName: \"p\",\n      props: {\n        \"id\": \"fnref-3\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"sup\",\n      props: {\n        \"href\": \"#fn-3\",\n        \"className\": \"footnote-ref\"\n      }\n    }, `3`)), ` works — and why its model is so\nbig.)`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `This pre-computation strategy allows a nice compromise between GPU-friendliness\nand implementation simplicity. The CNN and the wide lower layer are computed on\nthe GPU, and then the precomputed hidden weights are moved to the CPU, before we\nstart the transition-based parsing process. This makes a lot of things much\neasier. We don’t have to worry about variable-length batch sizes, and we don’t\nhave to implement the dynamic oracle in CUDA to train.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `Currently the parser’s loss function is multi-label log loss`, React.createElement(MDXTag, {\n      name: \"sup\",\n      components: components,\n      parentName: \"p\",\n      props: {\n        \"id\": \"fnref-6\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"sup\",\n      props: {\n        \"href\": \"#fn-6\",\n        \"className\": \"footnote-ref\"\n      }\n    }, `6`)), `, as the dynamic\noracle allows multiple states to be 0 cost. This is defined as follows, where\n`, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `gZ`), ` is the sum of the scores assigned to gold classes:`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components,\n      parentName: \"section\"\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-python\",\n        \"lang\": \"python\"\n      }\n    }, `(exp(score) / Z) - (exp(score) / gZ)\n`)), React.createElement(Infobox, {\n      title: \"Bibliography\"\n    }, React.createElement(MDXTag, {\n      name: \"ol\",\n      components: components,\n      parentName: \"section\"\n    }, React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"li\",\n      props: {\n        \"href\": \"https://www.semanticscholar.org/paper/Simple-and-Accurate-Dependency-Parsing-Using-Bidir-Kiperwasser-Goldberg/3cf31ecb2724b5088783d7c96a5fc0d5604cbf41\",\n        \"id\": \"fn-1\"\n      }\n    }, `Simple and Accurate Dependency Parsing Using Bidirectional LSTM Feature Representations`), `.\nEliyahu Kiperwasser, Yoav Goldberg. (2016)`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"li\",\n      props: {\n        \"href\": \"https://www.semanticscholar.org/paper/A-Dynamic-Oracle-for-Arc-Eager-Dependency-Parsing-Goldberg-Nivre/22697256ec19ecc3e14fcfc63624a44cf9c22df4\",\n        \"id\": \"fn-2\"\n      }\n    }, `A Dynamic Oracle for Arc-Eager Dependency Parsing`), `.\nYoav Goldberg, Joakim Nivre (2012)`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"li\",\n      props: {\n        \"href\": \"https://explosion.ai/blog/parsing-english-in-python\",\n        \"id\": \"fn-3\"\n      }\n    }, `Parsing English in 500 Lines of Python`), `.\nMatthew Honnibal (2013)`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"li\",\n      props: {\n        \"href\": \"https://www.semanticscholar.org/paper/Stack-propagation-Improved-Representation-Learning-Zhang-Weiss/0c133f79b23e8c680891d2e49a66f0e3d37f1466\",\n        \"id\": \"fn-4\"\n      }\n    }, `Stack-propagation: Improved Representation Learning for Syntax`), `.\nYuan Zhang, David Weiss (2016)`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"li\",\n      props: {\n        \"href\": \"https://www.semanticscholar.org/paper/Deep-multi-task-learning-with-low-level-tasks-supe-S%C3%B8gaard-Goldberg/03ad06583c9721855ccd82c3d969a01360218d86\",\n        \"id\": \"fn-5\"\n      }\n    }, `Deep multi-task learning with low level tasks supervised at lower layers`), `.\nAnders Søgaard, Yoav Goldberg (2016)`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"li\",\n      props: {\n        \"href\": \"https://www.semanticscholar.org/paper/An-Improved-Non-monotonic-Transition-System-for-De-Honnibal-Johnson/4094cee47ade13b77b5ab4d2e6cb9dd2b8a2917c\",\n        \"id\": \"fn-6\"\n      }\n    }, `An Improved Non-monotonic Transition System for Dependency Parsing`), `.\nMatthew Honnibal, Mark Johnson (2015)`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"li\",\n      props: {\n        \"href\": \"http://cs.stanford.edu/people/danqi/papers/emnlp2014.pdf\",\n        \"id\": \"fn-7\"\n      }\n    }, `A Fast and Accurate Dependency Parser using Neural Networks`), `.\nDanqi Cheng, Christopher D. Manning (2014)`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"li\",\n      props: {\n        \"href\": \"https://www.semanticscholar.org/paper/Parsing-the-Wall-Street-Journal-using-a-Lexical-Fu-Riezler-King/0ad07862a91cd59b7eb5de38267e47725a62b8b2\",\n        \"id\": \"fn-8\"\n      }\n    }, `Parsing the Wall Street Journal using a Lexical-Functional Grammar and Discriminative Estimation Techniques`), `.\nStefan Riezler et al. (2002)`)))), React.createElement(MDXTag, {\n      name: \"section\",\n      components: components,\n      props: {\n        \"id\": \"section-conventions\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components,\n      parentName: \"section\",\n      props: {\n        \"id\": \"conventions\"\n      }\n    }, `Model naming conventions`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `In general, spaCy expects all model packages to follow the naming convention of\n`, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `[lang`), `_`, `[name]`, `]. For spaCy’s models, we also chose to divide the name into\nthree components:`), React.createElement(MDXTag, {\n      name: \"ol\",\n      components: components,\n      parentName: \"section\"\n    }, React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"li\"\n    }, `Type:`), ` Model capabilities (e.g. `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `core`), ` for general-purpose model with\nvocabulary, syntax, entities and word vectors, or `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `depent`), ` for only vocab,\nsyntax and entities).`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"li\"\n    }, `Genre:`), ` Type of text the model is trained on, e.g. `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `web`), ` or `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `news`), `.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"li\"\n    }, `Size:`), ` Model size indicator, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `sm`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `md`), ` or `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `lg`), `.`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `For example, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `en_core_web_sm`), ` is a small English model trained on written web\ntext (blogs, news, comments), that includes vocabulary, vectors, syntax and\nentities.`), React.createElement(MDXTag, {\n      name: \"h3\",\n      components: components,\n      parentName: \"section\",\n      props: {\n        \"id\": \"model-versioning\"\n      }\n    }, `Model versioning`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `Additionally, the model versioning reflects both the compatibility with spaCy,\nas well as the major and minor model version. A model version `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `a.b.c`), ` translates\nto:`), React.createElement(MDXTag, {\n      name: \"ul\",\n      components: components,\n      parentName: \"section\"\n    }, React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `a`), `: `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"li\"\n    }, `spaCy major version`), `. For example, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `2`), ` for spaCy v2.x.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `b`), `: `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"li\"\n    }, `Model major version`), `. Models with a different major version can’t be\nloaded by the same code. For example, changing the width of the model, adding\nhidden layers or changing the activation changes the model major version.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `c`), `: `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"li\"\n    }, `Model minor version`), `. Same model structure, but different parameter\nvalues, e.g. from being trained on different data, for different numbers of\niterations, etc.`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"section\"\n    }, `For a detailed compatibility overview, see the\n`, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"p\",\n      props: {\n        \"href\": \"https://github.com/explosion/spacy-models/tree/master/compatibility.json\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"a\"\n    }, `compatibility.json`)), `\nin the models repository. This is also the source of spaCy’s internal\ncompatibility check, performed when you run the `, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"p\",\n      props: {\n        \"href\": \"/api/cli#download\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"a\"\n    }, `download`)), `\ncommand.`)));\n  }\n\n}\nMDXContent.isMDXComponent = true;"}}}},"pageContext":{"slug":"/models","isIndex":true,"title":"Models","section":"models","sectionTitle":"Models Documentation","menu":[["Quickstart","quickstart"],["Model Architecture","architecture"],["Conventions","conventions"]],"teaser":"Downloadable pretrained models for spaCy","source":null,"sidebar":null,"tag":null,"version":null,"theme":"blue","searchExclude":null,"next":null}},"staticQueryHashes":["1000021950","1044952032","1170736448","1243072483","1991307982","1991307982","3437686058","4047918112","4209628047","4288151425","947638783"]}