From 8fc6aaf1345afb2040bcd377642e90bd1a1158e2 Mon Sep 17 00:00:00 2001 From: mak <9056896+maknotavailable@users.noreply.github.com> Date: Thu, 31 Jan 2019 23:43:22 +0100 Subject: [PATCH] Updated main to make use of lang variable (#3220) Updated main to make use of language variable when initializing spacy. --- examples/information_extraction/phrase_matcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/information_extraction/phrase_matcher.py b/examples/information_extraction/phrase_matcher.py index 28266bbd1..fbf3760f2 100644 --- a/examples/information_extraction/phrase_matcher.py +++ b/examples/information_extraction/phrase_matcher.py @@ -57,7 +57,7 @@ import spacy n=("Number of texts to read", "option", "n", int), lang=("Language class to initialise", "option", "l", str)) def main(patterns_loc, text_loc, n=10000, lang='en'): - nlp = spacy.blank('en') + nlp = spacy.blank(lang) nlp.vocab.lex_attr_getters = {} phrases = read_gazetteer(nlp.tokenizer, patterns_loc) count = 0