Skip to content

Commit

Permalink
update gensim to code inside.
Browse files Browse the repository at this point in the history
  • Loading branch information
shibing624 committed Sep 16, 2023
1 parent d4b4d79 commit 63be6d2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ transformers>=4.6.0
datasets
tqdm
scikit-learn
gensim>=4.0.0
pandas
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"datasets",
"tqdm",
"scikit-learn",
"gensim>=4.0.0",
"pandas",
],
packages=find_packages(exclude=['tests']),
Expand Down
3 changes: 2 additions & 1 deletion text2vec/word2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from typing import List, Union, Dict

import numpy as np
from gensim.models import KeyedVectors
from loguru import logger
from numpy import ndarray
from tqdm import tqdm
Expand Down Expand Up @@ -63,6 +62,8 @@ def __init__(self, model_name_or_path: str = 'w2v-light-tencent-chinese',
stopwords: list, stopwords
cache_folder: str, save model dir
"""
from gensim.models import KeyedVectors # noqa

self.w2v_kwargs = w2v_kwargs if w2v_kwargs is not None else {}
if model_name_or_path and os.path.exists(model_name_or_path):
logger.info('Load pretrained model:{}'.format(model_name_or_path))
Expand Down

0 comments on commit 63be6d2

Please sign in to comment.