fixing relative filepath search of doc2vec model in naive approach
This commit is contained in:
parent
da0b23ddeb
commit
406460d031
@ -43,7 +43,8 @@ def stemming(message):
|
|||||||
# * compare words to emoji descriptions
|
# * compare words to emoji descriptions
|
||||||
def evaluate_sentence(sentence, description_key = 'description', lang = 'eng', emojis_to_consider="all", stem=True):
|
def evaluate_sentence(sentence, description_key = 'description', lang = 'eng', emojis_to_consider="all", stem=True):
|
||||||
# assumes there is a trained w2v model stored in the same directory!
|
# assumes there is a trained w2v model stored in the same directory!
|
||||||
wv = KeyedVectors.load("word2vec.model", mmap='r')
|
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
|
||||||
|
wv = KeyedVectors.load(str(__location__)+"/word2vec.model", mmap='r')
|
||||||
|
|
||||||
if (stem):
|
if (stem):
|
||||||
sentence = stemming(sentence)
|
sentence = stemming(sentence)
|
||||||
|
Loading…
Reference in New Issue
Block a user