Update models docs [ci skip]

This commit is contained in:
Ines Montani 2020-10-14 20:50:23 +02:00
parent 82be1478cb
commit a966c271f7
7 changed files with 16 additions and 27 deletions

View File

@ -22,12 +22,12 @@ import QuickstartModels from 'widgets/quickstart-models.js'
## Package naming conventions {#conventions} ## Package naming conventions {#conventions}
In general, spaCy expects all pipeline packages to follow the naming convention In general, spaCy expects all pipeline packages to follow the naming convention
of `[lang`\_[name]]. For spaCy's pipelines, we also chose to divide the name of `[lang]\_[name]`. For spaCy's pipelines, we also chose to divide the name
into three components: into three components:
1. **Type:** Capabilities (e.g. `core` for general-purpose pipeline with 1. **Type:** Capabilities (e.g. `core` for general-purpose pipeline with
vocabulary, syntax, entities and word vectors, or `depent` for only vocab, vocabulary, syntax, entities and word vectors, or `dep` for only vocab and
syntax and entities). syntax).
2. **Genre:** Type of text the pipeline is trained on, e.g. `web` or `news`. 2. **Genre:** Type of text the pipeline is trained on, e.g. `web` or `news`.
3. **Size:** Package size indicator, `sm`, `md` or `lg`. 3. **Size:** Package size indicator, `sm`, `md` or `lg`.

View File

@ -41,11 +41,7 @@ function getCounts(langs = []) {
return { return {
langs: langs.length, langs: langs.length,
modelLangs: langs.filter(({ models }) => models && !!models.length).length, modelLangs: langs.filter(({ models }) => models && !!models.length).length,
starterLangs: langs.filter(({ starters }) => starters && !!starters.length).length,
models: langs.map(({ models }) => (models ? models.length : 0)).reduce((a, b) => a + b, 0), models: langs.map(({ models }) => (models ? models.length : 0)).reduce((a, b) => a + b, 0),
starters: langs
.map(({ starters }) => (starters ? starters.length : 0))
.reduce((a, b) => a + b, 0),
} }
} }

View File

@ -37,7 +37,6 @@ exports.createPages = ({ graphql, actions }) => {
code code
name name
models models
starters
example example
has_examples has_examples
} }

View File

@ -31,7 +31,6 @@
"code": "en", "code": "en",
"name": "English", "name": "English",
"models": ["en_core_web_sm", "en_core_web_md", "en_core_web_lg", "en_core_web_trf"], "models": ["en_core_web_sm", "en_core_web_md", "en_core_web_lg", "en_core_web_trf"],
"starters": ["en_vectors_web_lg"],
"example": "This is a sentence.", "example": "This is a sentence.",
"has_examples": true "has_examples": true
}, },

View File

@ -52,10 +52,6 @@
{ {
"label": "Trained Pipelines", "label": "Trained Pipelines",
"items": [] "items": []
},
{
"label": "Starter Packages",
"items": []
} }
] ]
}, },

View File

@ -51,17 +51,19 @@ const Docs = ({ pageContext, children }) => (
id: model, id: model,
})), })),
})) }))
sidebar.items[2].items = languages if (sidebar.items.length > 2) {
.filter(({ starters }) => starters && starters.length) sidebar.items[2].items = languages
.map(lang => ({ .filter(({ starters }) => starters && starters.length)
text: lang.name, .map(lang => ({
url: `/models/${lang.code}-starters`, text: lang.name,
isActive: id === `${lang.code}-starters`, url: `/models/${lang.code}-starters`,
menu: lang.starters.map(model => ({ isActive: id === `${lang.code}-starters`,
text: model, menu: lang.starters.map(model => ({
id: model, text: model,
})), id: model,
})) })),
}))
}
} }
const sourcePath = source ? github(source) : null const sourcePath = source ? github(source) : null
const currentSource = getCurrentSource(slug, isIndex) const currentSource = getCurrentSource(slug, isIndex)
@ -146,7 +148,6 @@ const query = graphql`
code code
name name
models models
starters
} }
nightly nightly
sidebars { sidebars {

View File

@ -336,9 +336,7 @@ const landingQuery = graphql`
counts { counts {
langs langs
modelLangs modelLangs
starterLangs
models models
starters
} }
} }
} }