aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sec_certs/model
diff options
context:
space:
mode:
authorAdam Janovsky2023-04-16 19:30:08 +0200
committerAdam Janovsky2023-04-16 19:30:08 +0200
commit88f46304f3d679b17e2f41b79134cd046e2ed732 (patch)
treedd7a9ad37ad724c72e52df7696c83e618b1509ac /src/sec_certs/model
parentc4a256bd2a28cef3c210d181e7f9b118ea25c8ee (diff)
downloadsec-certs-88f46304f3d679b17e2f41b79134cd046e2ed732.tar.gz
sec-certs-88f46304f3d679b17e2f41b79134cd046e2ed732.tar.zst
sec-certs-88f46304f3d679b17e2f41b79134cd046e2ed732.zip
defer few imports
Diffstat (limited to 'src/sec_certs/model')
-rw-r--r--src/sec_certs/model/cpe_matching.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sec_certs/model/cpe_matching.py b/src/sec_certs/model/cpe_matching.py
index 5d08d7af..3015aeaa 100644
--- a/src/sec_certs/model/cpe_matching.py
+++ b/src/sec_certs/model/cpe_matching.py
@@ -6,7 +6,6 @@ import operator
import re
from typing import Pattern
-import spacy
from rapidfuzz import fuzz
from sec_certs import cert_rules, constants
@@ -28,6 +27,8 @@ class CPEClassifier:
vendors_: set[str]
def __init__(self, match_threshold: int = 80, n_max_matches: int = 10, spacy_model_to_use: str = "en_core_web_sm"):
+ import spacy
+
self.match_threshold = match_threshold
self.n_max_matches = n_max_matches
self.nlp = spacy.load(spacy_model_to_use, disable=["parser", "ner"])