Skip to content
Snippets Groups Projects
Commit 22d47332 authored by Fize Jacques's avatar Fize Jacques
Browse files

Optimisation on ngram embedding

parent 5c0d03fa
No related branches found
No related tags found
No related merge requests found
...@@ -130,7 +130,7 @@ if os.path.exists(EMBEDDING_FN): ...@@ -130,7 +130,7 @@ if os.path.exists(EMBEDDING_FN):
logging.info("Embedding loaded ! ") logging.info("Embedding loaded ! ")
else: else:
logging.info("Generating N-GRAM Embedding...") logging.info("Generating N-GRAM Embedding...")
embedding_weights = index.get_embedding_layer([index.encode(p) for p in np.concatenate((pairs_of_toponym.toponym.unique(),pairs_of_toponym.toponym_context.unique()))],dim= EMBEDDING_DIM,iter=WORDVEC_ITER) embedding_weights = index.get_embedding_layer(np.concatenate((pairs_of_toponym.toponym.unique(),pairs_of_toponym.toponym_context.unique())),dim= EMBEDDING_DIM,iter=WORDVEC_ITER)
np.save(EMBEDDING_FN,embedding_weights) np.save(EMBEDDING_FN,embedding_weights)
logging.info("Embedding generated !") logging.info("Embedding generated !")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment