mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +03:00
Update NER workflow with new displaCy
This commit is contained in:
parent
860a60e251
commit
c6e8d55dcb
|
@ -105,17 +105,36 @@ p
|
||||||
| consistent state.
|
| consistent state.
|
||||||
|
|
||||||
|
|
||||||
+h(2, "displacy") The displaCy #[sup ENT] visualizer
|
+h(2, "displacy") Visualizing named entities
|
||||||
|
|
||||||
p
|
p
|
||||||
| The #[+a(DEMOS_URL + "/displacy-ent/") displaCy #[sup ENT] visualizer]
|
| The #[+a(DEMOS_URL + "/displacy-ent/") displaCy #[sup ENT] visualizer]
|
||||||
| 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
|
||||||
| server yourself. To help you do that, we've open-sourced both the
|
| yourself. To help you do that, spaCy v2.0+ comes with a visualization
|
||||||
| #[+a(gh("spacy-services")) back-end service] and the
|
| module. Simply pass a #[code Doc] or a list of #[code Doc] objects to
|
||||||
| #[+a(gh("displacy-ent")) front-end client].
|
| displaCy and run #[+api("displacy#serve") #[code displacy.serve]] to
|
||||||
|
| run the web server, or #[+api("displacy#render") #[code displacy.render]]
|
||||||
|
| to generate the raw markup.
|
||||||
|
|
||||||
+codepen("ALxpQO", 450)
|
p
|
||||||
|
| For more details and examples, see the
|
||||||
|
| #[+a("/docs/usage/visualizers") usage workflow on visualizing spaCy].
|
||||||
|
|
||||||
|
+code("Named Entity example").
|
||||||
|
import spacy
|
||||||
|
from spacy import displacy
|
||||||
|
|
||||||
|
text = """But Google is starting from behind. The company made a late push
|
||||||
|
into hardware, and Apple’s Siri, available on iPhones, and Amazon’s Alexa
|
||||||
|
software, which runs on its Echo and Dot devices, have clear leads in
|
||||||
|
consumer adoption."""
|
||||||
|
|
||||||
|
nlp = spacy.load('custom_ner_model')
|
||||||
|
doc = nlp(text)
|
||||||
|
displacy.serve(doc, style='ent')
|
||||||
|
|
||||||
|
+codepen("a73f8b68f9af3157855962b283b364e4", 345)
|
||||||
|
|
||||||
+h(2, "entity-types") Built-in entity types
|
+h(2, "entity-types") Built-in entity types
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user