Update docs [ci skip]

This commit is contained in:
Ines Montani 2021-01-31 16:11:24 +11:00
parent 6a683970ea
commit 7752f80f39
6 changed files with 41 additions and 18 deletions

View File

@ -245,6 +245,8 @@ Also see the usage guides on the
| Name | Description | | Name | Description |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `after_init` | Optional callback to modify the `nlp` object after initialization. ~~Optional[Callable[[Language], Language]]~~ |
| `before_init` | Optional callback to modify the `nlp` object before initialization. ~~Optional[Callable[[Language], Language]]~~ |
| `components` | Additional arguments passed to the `initialize` method of a pipeline component, keyed by component name. If type annotations are available on the method, the config will be validated against them. The `initialize` methods will always receive the `get_examples` callback and the current `nlp` object. ~~Dict[str, Dict[str, Any]]~~ | | `components` | Additional arguments passed to the `initialize` method of a pipeline component, keyed by component name. If type annotations are available on the method, the config will be validated against them. The `initialize` methods will always receive the `get_examples` callback and the current `nlp` object. ~~Dict[str, Dict[str, Any]]~~ |
| `init_tok2vec` | Optional path to pretrained tok2vec weights created with [`spacy pretrain`](/api/cli#pretrain). Defaults to variable `${paths.init_tok2vec}`. ~~Optional[str]~~ | | `init_tok2vec` | Optional path to pretrained tok2vec weights created with [`spacy pretrain`](/api/cli#pretrain). Defaults to variable `${paths.init_tok2vec}`. ~~Optional[str]~~ |
| `lookups` | Additional lexeme and vocab data from [`spacy-lookups-data`](https://github.com/explosion/spacy-lookups-data). Defaults to `null`. ~~Optional[Lookups]~~ | | `lookups` | Additional lexeme and vocab data from [`spacy-lookups-data`](https://github.com/explosion/spacy-lookups-data). Defaults to `null`. ~~Optional[Lookups]~~ |

View File

@ -33,7 +33,9 @@ spaCy currently provides support for the following languages. You can help by
improving the existing [language data](/usage/linguistic-features#language-data) improving the existing [language data](/usage/linguistic-features#language-data)
and extending the tokenization patterns. and extending the tokenization patterns.
[See here](https://github.com/explosion/spaCy/issues/3056) for details on how to [See here](https://github.com/explosion/spaCy/issues/3056) for details on how to
contribute to development. contribute to development. Also see the
[training documentation](/usage/training) for how to train your own pipelines on
your data.
> #### Usage note > #### Usage note
> >
@ -281,6 +283,9 @@ $ python -m spacy download en_core_web_sm
# Download exact package version # Download exact package version
$ python -m spacy download en_core_web_sm-3.0.0 --direct $ python -m spacy download en_core_web_sm-3.0.0 --direct
# Download binary wheel (can be more efficient)
$ python -m spacy download en_core_web_sm --wheel
``` ```
The download command will [install the package](/usage/models#download-pip) via The download command will [install the package](/usage/models#download-pip) via
@ -433,8 +438,8 @@ URLs.
```text ```text
### requirements.txt ### requirements.txt
spacy>=2.2.0,<3.0.0 spacy>=3.0.0,<4.0.0
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.0/en_core_web_sm-2.2.0.tar.gz#egg=en_core_web_sm https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0.tar.gz#egg=en_core_web_sm
``` ```
Specifying `#egg=` with the package name tells pip which package to expect from Specifying `#egg=` with the package name tells pip which package to expect from

View File

@ -456,6 +456,7 @@ The following methods, attributes and commands are new in spaCy v3.0.
| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [`Token.lex`](/api/token#attributes) | Access a token's [`Lexeme`](/api/lexeme). | | [`Token.lex`](/api/token#attributes) | Access a token's [`Lexeme`](/api/lexeme). |
| [`Token.morph`](/api/token#attributes) | Access a token's morphological analysis. | | [`Token.morph`](/api/token#attributes) | Access a token's morphological analysis. |
| [`Doc.spans`](/api/doc#spans) | Named span groups to store and access collections of potentially overlapping spans. Uses the new [`SpanGroup`](/api/spangroup) data structure. |
| [`Doc.has_annotation`](/api/doc#has_annotation) | Check whether a doc has annotation on a token attribute. | | [`Doc.has_annotation`](/api/doc#has_annotation) | Check whether a doc has annotation on a token attribute. |
| [`Language.select_pipes`](/api/language#select_pipes) | Context manager for enabling or disabling specific pipeline components for a block. | | [`Language.select_pipes`](/api/language#select_pipes) | Context manager for enabling or disabling specific pipeline components for a block. |
| [`Language.disable_pipe`](/api/language#disable_pipe), [`Language.enable_pipe`](/api/language#enable_pipe) | Disable or enable a loaded pipeline component (but don't remove it). | | [`Language.disable_pipe`](/api/language#disable_pipe), [`Language.enable_pipe`](/api/language#enable_pipe) | Disable or enable a loaded pipeline component (but don't remove it). |
@ -584,8 +585,8 @@ Note that spaCy v3.0 now requires **Python 3.6+**.
rule-based lemmas. You can now add it to your pipeline explicitly and set its rule-based lemmas. You can now add it to your pipeline explicitly and set its
mode on initialization. mode on initialization.
- Various keyword arguments across functions and methods are now explicitly - Various keyword arguments across functions and methods are now explicitly
declared as _keyword-only_ arguments. Those arguments are documented declared as **keyword-only** arguments. Those arguments are documented
accordingly across the API reference. accordingly across the API reference using the <Tag>keyword-only</Tag> tag.
### Removed or renamed API {#incompat-removed} ### Removed or renamed API {#incompat-removed}

View File

@ -121,7 +121,6 @@ function parseArgs(raw) {
} }
function convertLine(line, i) { function convertLine(line, i) {
console.log(line, i)
const cliRegex = /^(\$ )?python -m spacy/ const cliRegex = /^(\$ )?python -m spacy/
if (cliRegex.test(line)) { if (cliRegex.test(line)) {
const text = line.replace(cliRegex, '') const text = line.replace(cliRegex, '')

View File

@ -27,18 +27,22 @@ const NavigationDropdown = ({ items = [], section }) => {
} }
export default function Navigation({ title, items = [], section, search, alert, children }) { export default function Navigation({ title, items = [], section, search, alert, children }) {
return ( const logo = (
<nav className={classes.root}> <Link to="/" aria-label={title} hidden>
<Link
to="/"
aria-label={title}
hidden
className={classNames({ [classes.hasAlert]: !!alert })}
>
<h1 className={classes.title}>{title}</h1> <h1 className={classes.title}>{title}</h1>
<Logo className={classes.logo} width={300} height={96} /> <Logo className={classes.logo} width={300} height={96} />
{alert && <span className={classes.alert}>{alert}</span>}
</Link> </Link>
)
return (
<nav className={classes.root}>
{!alert ? (
logo
) : (
<span className={classes.hasAlert}>
{logo} <span className={classes.alert}>{alert}</span>
</span>
)}
<div className={classes.menu}> <div className={classes.menu}>
<NavigationDropdown items={items} section={section} /> <NavigationDropdown items={items} section={section} />

View File

@ -51,16 +51,25 @@ const data = [
id: 'config', id: 'config',
title: 'Options', title: 'Options',
multiple: true, multiple: true,
options: [{ id: 'example', title: 'Show text example' }], options: [
{
id: 'wheel',
title: 'Download binary wheel',
help: 'Can make download and installation more efficient',
},
{ id: 'example', title: 'Show text example' },
],
}, },
] ]
const QuickstartInstall = ({ id, title, description, children }) => { const QuickstartInstall = ({ id, title, description, children }) => {
const [lang, setLang] = useState(DEFAULT_LANG) const [lang, setLang] = useState(DEFAULT_LANG)
const [wheel, setWheel] = useState(false)
const [efficiency, setEfficiency] = useState(DEFAULT_OPT === 'efficiency') const [efficiency, setEfficiency] = useState(DEFAULT_OPT === 'efficiency')
const setters = { const setters = {
lang: setLang, lang: setLang,
optimize: v => setEfficiency(v.includes('efficiency')), optimize: v => setEfficiency(v.includes('efficiency')),
config: v => setWheel(v.includes('wheel')),
} }
return ( return (
<StaticQuery <StaticQuery
@ -87,7 +96,10 @@ const QuickstartInstall = ({ id, title, description, children }) => {
const exampleText = example || 'No text available yet' const exampleText = example || 'No text available yet'
return lang !== code ? null : ( return lang !== code ? null : (
<Fragment key={code}> <Fragment key={code}>
<QS>python -m spacy download {pkg}</QS> <QS>
python -m spacy download {pkg}
{wheel ? ' --wheel' : ''}
</QS>
<QS divider /> <QS divider />
<QS load="spacy" prompt="python"> <QS load="spacy" prompt="python">
import spacy import spacy