mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 18:26:30 +03:00
Update docs [ci skip]
This commit is contained in:
parent
febb99916d
commit
1316071086
|
@ -61,17 +61,13 @@ import Benchmarks from 'usage/\_benchmarks-models.md'
|
|||
|
||||
<Benchmarks />
|
||||
|
||||
<!-- TODO:
|
||||
|
||||
<Project id="benchmarks/penn_treebank">
|
||||
<Project id="benchmarks/parsing_penn_treebank">
|
||||
|
||||
The easiest way to reproduce spaCy's benchmarks on the Penn Treebank is to clone
|
||||
our project template.
|
||||
|
||||
</Project>
|
||||
|
||||
-->
|
||||
|
||||
<!-- ## Citing spaCy {#citation}
|
||||
|
||||
<!-- TODO: update -->
|
||||
|
|
|
@ -1075,7 +1075,7 @@ relations and tokens we want to match:
|
|||
|
||||
> #### Visualizing the parse
|
||||
>
|
||||
> The [`displacy` visualizer](/usage/visualizer) lets you render `Doc` objects
|
||||
> The [`displacy` visualizer](/usage/visualizers) lets you render `Doc` objects
|
||||
> and their dependency parse and part-of-speech tags:
|
||||
>
|
||||
> ```python
|
||||
|
|
|
@ -26,11 +26,27 @@ const replacements = {
|
|||
GITHUB_SPACY: `https://github.com/explosion/spaCy/tree/${branch}`,
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the overall total counts of models and languages
|
||||
*/
|
||||
function getCounts(langs = []) {
|
||||
return {
|
||||
langs: langs.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),
|
||||
starters: langs
|
||||
.map(({ starters }) => (starters ? starters.length : 0))
|
||||
.reduce((a, b) => a + b, 0),
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
siteMetadata: {
|
||||
...site,
|
||||
sidebars,
|
||||
...models,
|
||||
counts: getCounts(models.languages),
|
||||
universe,
|
||||
nightly: isNightly,
|
||||
binderBranch,
|
||||
|
|
|
@ -38,8 +38,8 @@ export const LandingSubtitle = ({ children }) => (
|
|||
)
|
||||
|
||||
export const LandingGrid = ({ cols = 3, blocks = false, style, children }) => (
|
||||
<Content className={classNames(classes.grid, { [classes.blocks]: blocks })}>
|
||||
<Grid cols={cols} narrow={blocks} style={style}>
|
||||
<Content className={classNames({ [classes.blocks]: blocks })}>
|
||||
<Grid cols={cols} narrow={blocks} className={classes.grid} style={style}>
|
||||
{children}
|
||||
</Grid>
|
||||
</Content>
|
||||
|
|
|
@ -26,8 +26,11 @@
|
|||
border-bottom-right-radius: 0
|
||||
|
||||
.icon
|
||||
width: 2rem
|
||||
height: 2rem
|
||||
$width: 2rem
|
||||
|
||||
width: $width
|
||||
height: $width
|
||||
flex: 0 0 $width
|
||||
background: var(--color-theme)
|
||||
color: var(--color-back)
|
||||
border-radius: 50%
|
||||
|
|
|
@ -128,14 +128,17 @@
|
|||
padding-right: 2rem
|
||||
|
||||
@include breakpoint(max, md)
|
||||
.banner
|
||||
padding: 1rem 3rem
|
||||
|
||||
.banner-content
|
||||
display: block
|
||||
|
||||
.banner-text
|
||||
padding-top: 0
|
||||
|
||||
.col
|
||||
grid-column: 1 / span 2
|
||||
.grid
|
||||
grid-template-columns: 1fr !important
|
||||
|
||||
.banner-button
|
||||
margin-bottom: var(--spacing-sm)
|
||||
|
|
|
@ -54,23 +54,8 @@ for entity in doc.ents:
|
|||
print(entity.text, entity.label_)
|
||||
`
|
||||
|
||||
/**
|
||||
* Compute the overall total counts of models and languages
|
||||
*/
|
||||
function getCounts(langs = []) {
|
||||
return {
|
||||
langs: langs.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),
|
||||
starters: langs
|
||||
.map(({ starters }) => (starters ? starters.length : 0))
|
||||
.reduce((a, b) => a + b, 0),
|
||||
}
|
||||
}
|
||||
|
||||
const Landing = ({ data }) => {
|
||||
const counts = getCounts(data.languages)
|
||||
const { counts } = data
|
||||
return (
|
||||
<>
|
||||
<LandingHeader nightly={data.nightly}>
|
||||
|
@ -345,7 +330,10 @@ const landingQuery = graphql`
|
|||
siteMetadata {
|
||||
nightly
|
||||
repo
|
||||
languages {
|
||||
counts {
|
||||
langs
|
||||
modelLangs
|
||||
starterLangs
|
||||
models
|
||||
starters
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user