From 2db34e1479ac64b7236850ba6485728055a635fd Mon Sep 17 00:00:00 2001 From: wei Date: Thu, 25 Jan 2018 16:13:44 +0800 Subject: [PATCH] Resolve the ImportError when there's "utils" model. --- synonyms/__init__.py | 6 +++--- synonyms/word2vec.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/synonyms/__init__.py b/synonyms/__init__.py index 8c72eef..9259cb8 100755 --- a/synonyms/__init__.py +++ b/synonyms/__init__.py @@ -44,9 +44,9 @@ else: import json import gzip import shutil -from word2vec import KeyedVectors -from utils import any2utf8 -from utils import any2unicode +from synonyms.word2vec import KeyedVectors +from synonyms.utils import any2utf8 +from synonyms.utils import any2unicode import jieba.posseg as _tokenizer import jieba diff --git a/synonyms/word2vec.py b/synonyms/word2vec.py index 23eebfa..fc9f070 100644 --- a/synonyms/word2vec.py +++ b/synonyms/word2vec.py @@ -28,7 +28,7 @@ if sys.version_info[0] < 3: else: xrange = range -import utils +import synonyms.utils as utils from numpy import dot, zeros, dtype, float32 as REAL,\ double, array, vstack, fromstring, sqrt, newaxis,\ ndarray, sum as np_sum, prod, ascontiguousarray,\