Last active
March 28, 2021 06:42
-
-
Save kanekomasahiro/b98cceee2aea1aaef7716eb2884b3289 to your computer and use it in GitHub Desktop.
gensimのembeddingの平均ベクトルを計算する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def calculate_mean_vector(embedding): | |
return np.mean(embedding[list(embedding.vocab)], axis=0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment