Skip to content

Instantly share code, notes, and snippets.

@kanekomasahiro
Last active March 28, 2021 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanekomasahiro/b98cceee2aea1aaef7716eb2884b3289 to your computer and use it in GitHub Desktop.
Save kanekomasahiro/b98cceee2aea1aaef7716eb2884b3289 to your computer and use it in GitHub Desktop.
gensimのembeddingの平均ベクトルを計算する
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