mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-11 17:56:30 +03:00
Fix formatting and wording
This commit is contained in:
parent
f803da609f
commit
14148cd147
|
@ -73,7 +73,7 @@ so it only becomes visible on click, making the issue easier to read and follow.
|
||||||
### Issue labels
|
### Issue labels
|
||||||
|
|
||||||
To distinguish issues that are opened by us, the maintainers, we usually add a
|
To distinguish issues that are opened by us, the maintainers, we usually add a
|
||||||
💫 to the title. [See this page](https://github.com/explosion/spaCy/labels)
|
💫 to the title. [See this page](https://github.com/explosion/spaCy/labels)
|
||||||
for an overview of the system we use to tag our issues and pull requests.
|
for an overview of the system we use to tag our issues and pull requests.
|
||||||
|
|
||||||
## Contributing to the code base
|
## Contributing to the code base
|
||||||
|
|
|
@ -27,8 +27,6 @@ The docs can always use another example or more detail, and they should always b
|
||||||
|
|
||||||
While all page content lives in the `.jade` files, article meta (page titles, sidebars etc.) is stored as JSON. Each folder contains a `_data.json` with all required meta for its files.
|
While all page content lives in the `.jade` files, article meta (page titles, sidebars etc.) is stored as JSON. Each folder contains a `_data.json` with all required meta for its files.
|
||||||
|
|
||||||
For simplicity, all sites linked in the [tutorials](https://spacy.io/docs/usage/tutorials) and [showcase](https://spacy.io/docs/usage/showcase) are also stored as JSON. So in order to edit those pages, there's no need to dig into the Jade files – simply edit the [`_data.json`](docs/usage/_data.json).
|
|
||||||
|
|
||||||
### Markup language and conventions
|
### Markup language and conventions
|
||||||
|
|
||||||
Jade/Pug is a whitespace-sensitive markup language that compiles to HTML. Indentation is used to nest elements, and for template logic, like `if`/`else` or `for`, mainly used to iterate over objects and arrays in the meta data. It also allows inline JavaScript expressions.
|
Jade/Pug is a whitespace-sensitive markup language that compiles to HTML. Indentation is used to nest elements, and for template logic, like `if`/`else` or `for`, mainly used to iterate over objects and arrays in the meta data. It also allows inline JavaScript expressions.
|
||||||
|
|
|
@ -4,7 +4,7 @@ p
|
||||||
| The individual components #[strong expose variables] that can be imported
|
| The individual components #[strong expose variables] that can be imported
|
||||||
| within a language module, and added to the language's #[code Defaults].
|
| within a language module, and added to the language's #[code Defaults].
|
||||||
| Some components, like the punctuation rules, usually don't need much
|
| Some components, like the punctuation rules, usually don't need much
|
||||||
| customisation and can simply be imported from the global rules. Others,
|
| customisation and can be imported from the global rules. Others,
|
||||||
| like the tokenizer and norm exceptions, are very specific and will make
|
| like the tokenizer and norm exceptions, are very specific and will make
|
||||||
| a big difference to spaCy's performance on the particular language and
|
| a big difference to spaCy's performance on the particular language and
|
||||||
| training a language model.
|
| training a language model.
|
||||||
|
|
|
@ -39,7 +39,7 @@ p
|
||||||
| this. The above error mostly occurs when doing a system-wide installation,
|
| this. The above error mostly occurs when doing a system-wide installation,
|
||||||
| which will create the symlinks in a system directory. Run the
|
| which will create the symlinks in a system directory. Run the
|
||||||
| #[code download] or #[code link] command as administrator (on Windows,
|
| #[code download] or #[code link] command as administrator (on Windows,
|
||||||
| simply right-click on your terminal or shell ans select "Run as
|
| you can either right-click on your terminal or shell ans select "Run as
|
||||||
| Administrator"), or use a #[code virtualenv] to install spaCy in a user
|
| Administrator"), or use a #[code virtualenv] to install spaCy in a user
|
||||||
| directory, instead of doing a system-wide installation.
|
| directory, instead of doing a system-wide installation.
|
||||||
|
|
||||||
|
|
|
@ -220,8 +220,8 @@ p
|
||||||
|
|
||||||
p
|
p
|
||||||
| The best way to understand spaCy's dependency parser is interactively.
|
| The best way to understand spaCy's dependency parser is interactively.
|
||||||
| To make this easier, spaCy v2.0+ comes with a visualization module. Simply
|
| To make this easier, spaCy v2.0+ comes with a visualization module. You
|
||||||
| pass a #[code Doc] or a list of #[code Doc] objects to
|
| can pass a #[code Doc] or a list of #[code Doc] objects to
|
||||||
| displaCy and run #[+api("top-level#displacy.serve") #[code displacy.serve]] to
|
| displaCy and run #[+api("top-level#displacy.serve") #[code displacy.serve]] to
|
||||||
| run the web server, or #[+api("top-level#displacy.render") #[code displacy.render]]
|
| run the web server, or #[+api("top-level#displacy.render") #[code displacy.render]]
|
||||||
| to generate the raw markup. If you want to know how to write rules that
|
| to generate the raw markup. If you want to know how to write rules that
|
||||||
|
|
|
@ -195,7 +195,7 @@ p
|
||||||
| lets you explore an entity recognition model's behaviour interactively.
|
| lets you explore an entity recognition model's behaviour interactively.
|
||||||
| If you're training a model, it's very useful to run the visualization
|
| If you're training a model, it's very useful to run the visualization
|
||||||
| yourself. To help you do that, spaCy v2.0+ comes with a visualization
|
| yourself. To help you do that, spaCy v2.0+ comes with a visualization
|
||||||
| module. Simply pass a #[code Doc] or a list of #[code Doc] objects to
|
| module. You can pass a #[code Doc] or a list of #[code Doc] objects to
|
||||||
| displaCy and run #[+api("top-level#displacy.serve") #[code displacy.serve]] to
|
| displaCy and run #[+api("top-level#displacy.serve") #[code displacy.serve]] to
|
||||||
| run the web server, or #[+api("top-level#displacy.render") #[code displacy.render]]
|
| run the web server, or #[+api("top-level#displacy.render") #[code displacy.render]]
|
||||||
| to generate the raw markup.
|
| to generate the raw markup.
|
||||||
|
|
|
@ -274,7 +274,7 @@ p
|
||||||
| In spaCy v1.x, you had to add a custom tokenizer by passing it to the
|
| In spaCy v1.x, you had to add a custom tokenizer by passing it to the
|
||||||
| #[code make_doc] keyword argument, or by passing a tokenizer "factory"
|
| #[code make_doc] keyword argument, or by passing a tokenizer "factory"
|
||||||
| to #[code create_make_doc]. This was unnecessarily complicated. Since
|
| to #[code create_make_doc]. This was unnecessarily complicated. Since
|
||||||
| spaCy v2.0, you can simply write to #[code nlp.tokenizer]. If your
|
| spaCy v2.0, you can write to #[code nlp.tokenizer] instead. If your
|
||||||
| tokenizer needs the vocab, you can write a function and use
|
| tokenizer needs the vocab, you can write a function and use
|
||||||
| #[code nlp.vocab].
|
| #[code nlp.vocab].
|
||||||
|
|
||||||
|
|
|
@ -19,15 +19,15 @@ include _install-basics
|
||||||
+h(3, "download-pip") Installation via pip
|
+h(3, "download-pip") Installation via pip
|
||||||
|
|
||||||
p
|
p
|
||||||
| To download a model directly using #[+a("https://pypi.python.org/pypi/pip") pip],
|
| To download a model directly using #[+a("https://pypi.python.org/pypi/pip") pip],
|
||||||
| simply point #[code pip install] to the URL or local path of the archive
|
| point #[code pip install] to the URL or local path of the archive
|
||||||
| file. To find the direct link to a model, head over to the
|
| file. To find the direct link to a model, head over to the
|
||||||
| #[+a(gh("spacy-models") + "/releases") model releases], right click on the archive
|
| #[+a(gh("spacy-models") + "/releases") model releases], right click on the archive
|
||||||
| link and copy it to your clipboard.
|
| link and copy it to your clipboard.
|
||||||
|
|
||||||
+code(false, "bash").
|
+code(false, "bash").
|
||||||
# with external URL
|
# with external URL
|
||||||
pip install #{gh("spacy-models")}/releases/download/en_core_web_md-1.2.0/en_core_web_md-1.2.0.tar.gz
|
pip install #{gh("spacy-models")}/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz
|
||||||
|
|
||||||
# with local file
|
# with local file
|
||||||
pip install /Users/you/en_core_web_md-1.2.0.tar.gz
|
pip install /Users/you/en_core_web_md-1.2.0.tar.gz
|
||||||
|
@ -69,7 +69,7 @@ p
|
||||||
|
|
||||||
p
|
p
|
||||||
| You can place the #[strong model package directory] anywhere on your
|
| You can place the #[strong model package directory] anywhere on your
|
||||||
| local file system. To use it with spaCy, simply assign it a name by
|
| local file system. To use it with spaCy, assign it a name by
|
||||||
| creating a #[+a("#usage") shortcut link] for the data directory.
|
| creating a #[+a("#usage") shortcut link] for the data directory.
|
||||||
|
|
||||||
+h(3, "usage") Using models with spaCy
|
+h(3, "usage") Using models with spaCy
|
||||||
|
|
|
@ -26,7 +26,7 @@ p
|
||||||
p
|
p
|
||||||
| Because all models are valid Python packages, you can add them to your
|
| Because all models are valid Python packages, you can add them to your
|
||||||
| application's #[code requirements.txt]. If you're running your own
|
| application's #[code requirements.txt]. If you're running your own
|
||||||
| internal PyPi installation, you can simply upload the models there. pip's
|
| internal PyPi installation, you can upload the models there. pip's
|
||||||
| #[+a("https://pip.pypa.io/en/latest/reference/pip_install/#requirements-file-format") requirements file format]
|
| #[+a("https://pip.pypa.io/en/latest/reference/pip_install/#requirements-file-format") requirements file format]
|
||||||
| supports both package names to download via a PyPi server, as well as direct
|
| supports both package names to download via a PyPi server, as well as direct
|
||||||
| URLs.
|
| URLs.
|
||||||
|
|
|
@ -5,7 +5,7 @@ p
|
||||||
| segments it into words, punctuation and so on. This is done by applying
|
| segments it into words, punctuation and so on. This is done by applying
|
||||||
| rules specific to each language. For example, punctuation at the end of a
|
| rules specific to each language. For example, punctuation at the end of a
|
||||||
| sentence should be split off – whereas "U.K." should remain one token.
|
| sentence should be split off – whereas "U.K." should remain one token.
|
||||||
| Each #[code Doc] consists of individual tokens, and we can simply iterate
|
| Each #[code Doc] consists of individual tokens, and we can iterate
|
||||||
| over them:
|
| over them:
|
||||||
|
|
||||||
+code-exec.
|
+code-exec.
|
||||||
|
|
|
@ -72,10 +72,11 @@ p
|
||||||
| you want to visualize output from other libraries, like
|
| you want to visualize output from other libraries, like
|
||||||
| #[+a("http://www.nltk.org") NLTK] or
|
| #[+a("http://www.nltk.org") NLTK] or
|
||||||
| #[+a("https://github.com/tensorflow/models/tree/master/research/syntaxnet") SyntaxNet].
|
| #[+a("https://github.com/tensorflow/models/tree/master/research/syntaxnet") SyntaxNet].
|
||||||
| Simply convert the dependency parse or recognised entities to displaCy's
|
| If you set #[code manual=True] on either #[code render()] or
|
||||||
| format and set #[code manual=True] on either #[code render()] or
|
| #[code serve()], you can pass in data in displaCy's format (instead of
|
||||||
| #[code serve()]. When setting #[code ents] manually, make sure to supply
|
| #[code Doc] objects). When setting #[code ents] manually, make sure to
|
||||||
| them in the right order, i.e. starting with the lowest start position.
|
| supply them in the right order, i.e. starting with the lowest start
|
||||||
|
| position.
|
||||||
|
|
||||||
+aside-code("Example").
|
+aside-code("Example").
|
||||||
ex = [{'text': 'But Google is starting from behind.',
|
ex = [{'text': 'But Google is starting from behind.',
|
||||||
|
@ -109,7 +110,7 @@ p
|
||||||
| If you want to use the visualizers as part of a web application, for
|
| If you want to use the visualizers as part of a web application, for
|
||||||
| example to create something like our
|
| example to create something like our
|
||||||
| #[+a(DEMOS_URL + "/displacy") online demo], it's not recommended to
|
| #[+a(DEMOS_URL + "/displacy") online demo], it's not recommended to
|
||||||
| simply wrap and serve the displaCy renderer. Instead, you should only
|
| only wrap and serve the displaCy renderer. Instead, you should only
|
||||||
| rely on the server to perform spaCy's processing capabilities, and use
|
| rely on the server to perform spaCy's processing capabilities, and use
|
||||||
| #[+a(gh("displacy")) displaCy.js] to render the JSON-formatted output.
|
| #[+a(gh("displacy")) displaCy.js] to render the JSON-formatted output.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user