mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Update docs [ci skip]
This commit is contained in:
parent
6a683970ea
commit
7752f80f39
|
@ -245,6 +245,8 @@ Also see the usage guides on the
|
|||
|
||||
| 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]]~~ |
|
||||
| `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]~~ |
|
||||
|
|
|
@ -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)
|
||||
and extending the tokenization patterns.
|
||||
[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
|
||||
>
|
||||
|
@ -281,6 +283,9 @@ $ python -m spacy download en_core_web_sm
|
|||
|
||||
# Download exact package version
|
||||
$ 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
|
||||
|
@ -433,8 +438,8 @@ URLs.
|
|||
|
||||
```text
|
||||
### requirements.txt
|
||||
spacy>=2.2.0,<3.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
|
||||
spacy>=3.0.0,<4.0.0
|
||||
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
|
||||
|
|
|
@ -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.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. |
|
||||
| [`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). |
|
||||
|
@ -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
|
||||
mode on initialization.
|
||||
- Various keyword arguments across functions and methods are now explicitly
|
||||
declared as _keyword-only_ arguments. Those arguments are documented
|
||||
accordingly across the API reference.
|
||||
declared as **keyword-only** arguments. Those arguments are documented
|
||||
accordingly across the API reference using the <Tag>keyword-only</Tag> tag.
|
||||
|
||||
### Removed or renamed API {#incompat-removed}
|
||||
|
||||
|
|
|
@ -121,7 +121,6 @@ function parseArgs(raw) {
|
|||
}
|
||||
|
||||
function convertLine(line, i) {
|
||||
console.log(line, i)
|
||||
const cliRegex = /^(\$ )?python -m spacy/
|
||||
if (cliRegex.test(line)) {
|
||||
const text = line.replace(cliRegex, '')
|
||||
|
|
|
@ -27,18 +27,22 @@ const NavigationDropdown = ({ items = [], section }) => {
|
|||
}
|
||||
|
||||
export default function Navigation({ title, items = [], section, search, alert, children }) {
|
||||
const logo = (
|
||||
<Link to="/" aria-label={title} hidden>
|
||||
<h1 className={classes.title}>{title}</h1>
|
||||
<Logo className={classes.logo} width={300} height={96} />
|
||||
</Link>
|
||||
)
|
||||
|
||||
return (
|
||||
<nav className={classes.root}>
|
||||
<Link
|
||||
to="/"
|
||||
aria-label={title}
|
||||
hidden
|
||||
className={classNames({ [classes.hasAlert]: !!alert })}
|
||||
>
|
||||
<h1 className={classes.title}>{title}</h1>
|
||||
<Logo className={classes.logo} width={300} height={96} />
|
||||
{alert && <span className={classes.alert}>{alert}</span>}
|
||||
</Link>
|
||||
{!alert ? (
|
||||
logo
|
||||
) : (
|
||||
<span className={classes.hasAlert}>
|
||||
{logo} <span className={classes.alert}>{alert}</span>
|
||||
</span>
|
||||
)}
|
||||
|
||||
<div className={classes.menu}>
|
||||
<NavigationDropdown items={items} section={section} />
|
||||
|
|
|
@ -51,16 +51,25 @@ const data = [
|
|||
id: 'config',
|
||||
title: 'Options',
|
||||
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 [lang, setLang] = useState(DEFAULT_LANG)
|
||||
const [wheel, setWheel] = useState(false)
|
||||
const [efficiency, setEfficiency] = useState(DEFAULT_OPT === 'efficiency')
|
||||
const setters = {
|
||||
lang: setLang,
|
||||
optimize: v => setEfficiency(v.includes('efficiency')),
|
||||
config: v => setWheel(v.includes('wheel')),
|
||||
}
|
||||
return (
|
||||
<StaticQuery
|
||||
|
@ -87,7 +96,10 @@ const QuickstartInstall = ({ id, title, description, children }) => {
|
|||
const exampleText = example || 'No text available yet'
|
||||
return lang !== code ? null : (
|
||||
<Fragment key={code}>
|
||||
<QS>python -m spacy download {pkg}</QS>
|
||||
<QS>
|
||||
python -m spacy download {pkg}
|
||||
{wheel ? ' --wheel' : ''}
|
||||
</QS>
|
||||
<QS divider />
|
||||
<QS load="spacy" prompt="python">
|
||||
import spacy
|
||||
|
|
Loading…
Reference in New Issue
Block a user