-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
feat / visualizersFeature: Built-in displaCy and other visualizersFeature: Built-in displaCy and other visualizers
Description
Firstly, I am very grateful for your open-source tool for dependency visualization.
When I tested the input with separate punctuations, the generated output figure from the displacy.serve or displacy.render functions attached the punctuations to the tokens.
How can I separate punctuations in dependency visualization?
The scripts that I tested and the generated output figure are also attached:
import spacy
nlp = spacy.load("en_core_web_sm")
doc = nlp("The curious cat, with a fluffy tail, explored the garden.")
# Dependency Info of the input sentence.
"""
1 The the DET DT _ 3 det _ _
2 curious curious ADJ JJ _ 3 amod _ _
3 cat cat NOUN NN _ 10 nsubj _ SpaceAfter=No
4 , , PUNCT , _ 3 punct _ _
5 with with ADP IN _ 3 prep _ _
6 a a DET DT _ 8 det _ _
7 fluffy fluffy ADJ JJ _ 8 amod _ _
8 tail tail NOUN NN _ 5 pobj _ SpaceAfter=No
9 , , PUNCT , _ 3 punct _ _
10 explored explore VERB VBD _ 0 ROOT _ _
11 the the DET DT _ 12 det _ _
12 garden garden NOUN NN _ 10 dobj _ SpaceAfter=No
13 . . PUNCT . _ 10 punct _ SpaceAfter=No
"""
spacy.displacy.serve(doc, style="dep")
The output is:
Metadata
Metadata
Assignees
Labels
feat / visualizersFeature: Built-in displaCy and other visualizersFeature: Built-in displaCy and other visualizers