mirror of https://github.com/explosion/spaCy.git
Also fix #3387 on develop
This commit is contained in:
parent
c998cde7e2
commit
8dbf1e9037
|
@ -283,7 +283,7 @@ from pathlib import Path
|
||||||
nlp = spacy.load("en_core_web_sm")
|
nlp = spacy.load("en_core_web_sm")
|
||||||
sentences = [u"This is an example.", u"This is another one."]
|
sentences = [u"This is an example.", u"This is another one."]
|
||||||
for sent in sentences:
|
for sent in sentences:
|
||||||
doc = nlp(sentence)
|
doc = nlp(sent)
|
||||||
svg = displacy.render(doc, style="dep")
|
svg = displacy.render(doc, style="dep")
|
||||||
file_name = '-'.join([w.text for w in doc if not w.is_punct]) + ".svg"
|
file_name = '-'.join([w.text for w in doc if not w.is_punct]) + ".svg"
|
||||||
output_path = Path("/images/" + file_name)
|
output_path = Path("/images/" + file_name)
|
||||||
|
|
Loading…
Reference in New Issue