File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/neo4j_graphrag/experimental/components Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 13
13
# See the License for the specific language governing permissions and
14
14
# limitations under the License.
15
15
import abc
16
+ import logging
16
17
from itertools import combinations
17
18
from typing import Any , Optional , List
18
19
27
28
from neo4j_graphrag .experimental .pipeline import Component
28
29
from neo4j_graphrag .utils import driver_config
29
30
31
+ logger = logging .getLogger (__name__ )
30
32
31
33
class EntityResolver (Component , abc .ABC ):
32
34
"""Entity resolution base class
@@ -314,10 +316,9 @@ def _load_or_download_spacy_model(model_name: str) -> Language:
314
316
try :
315
317
return spacy .load (model_name )
316
318
except OSError as e :
317
- # The exact error message can differ slightly depending on spaCy version,
318
- # so you may want to be broader or narrower with handling logic:
319
+ # handling cases where the spaCy model is not yet downloaded:
319
320
if "doesn't seem to be a Python package or a valid path" in str (e ):
320
- print (f"Model '{ model_name } ' not found. Downloading..." )
321
+ logger . info (f"Model '{ model_name } ' not found. Downloading..." )
321
322
spacy_download (model_name )
322
323
return spacy .load (model_name )
323
324
else :
You can’t perform that action at this time.
0 commit comments