mirror of https://github.com/explosion/spaCy.git
Improve redundant variable name (#3643)
* Improve redundant variable name * Apply suggestions from code review Co-Authored-By: pickfire <pickfire@riseup.net>
This commit is contained in:
parent
dc87fb805d
commit
fa94f83697
|
@ -712,9 +712,9 @@ from spacy.matcher import PhraseMatcher
|
||||||
|
|
||||||
nlp = spacy.load('en_core_web_sm')
|
nlp = spacy.load('en_core_web_sm')
|
||||||
matcher = PhraseMatcher(nlp.vocab)
|
matcher = PhraseMatcher(nlp.vocab)
|
||||||
terminology_list = [u"Barack Obama", u"Angela Merkel", u"Washington, D.C."]
|
terms = [u"Barack Obama", u"Angela Merkel", u"Washington, D.C."]
|
||||||
# Only run nlp.make_doc to speed things up
|
# Only run nlp.make_doc to speed things up
|
||||||
patterns = [nlp.make_doc(text) for text in terminology_list]
|
patterns = [nlp.make_doc(text) for text in terms]
|
||||||
matcher.add("TerminologyList", None, *patterns)
|
matcher.add("TerminologyList", None, *patterns)
|
||||||
|
|
||||||
doc = nlp(u"German Chancellor Angela Merkel and US President Barack Obama "
|
doc = nlp(u"German Chancellor Angela Merkel and US President Barack Obama "
|
||||||
|
|
Loading…
Reference in New Issue