From 52ddf8a12c588577f0a75524e5475f8a6fe81c67 Mon Sep 17 00:00:00 2001 From: ZJaume Date: Thu, 28 Oct 2021 09:53:46 +0000 Subject: [PATCH] Improve spacy inference speed disabling the rest of the pipeline --- biner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biner.py b/biner.py index 3b5f731..78c5fbf 100644 --- a/biner.py +++ b/biner.py @@ -6,7 +6,7 @@ PUNCTUATION = "[¡¿" + string.punctuation.replace("'","").replace("-","") + "]" ENTITIES = {"PERSON"} -nlp = spacy.load("en_core_web_sm") +nlp = spacy.load("en_core_web_sm", disable=["tok2vec", "tagger", "parser", "attribute_ruler", "lemmatizer"]) # Regular expression for emails # https://www.regextester.com/19