I want to cluster my word2vec clusters using Affinity Propagation and get the cluster center words.
My current code is as follows.
model = word2vec.Word2Vec.load("word2vec")
word_vectors = model.wv.syn0
affprop = AffinityPropagation(affinity="precomputed", damping=0.5)
af= affprop.fit(word_vectors)
However, this raise the following error:
ValueError: S must be a square array (shape=(77, 300))
As I understand 300 means word2vec hidden layer dimension and 77 is my vocabulary size.
I am just wondering how to use Affinity Propagation for word2vec vectors that are not square arrays.
Please help me!