# some dummy data
word_vectors = np.random.random((77, 300))
# using eucliden distance
affprop = AffinityPropagation(affinity='euclidean', damping=0.5)
af = affprop.fit(word_vectors)
# using cosine
from sklearn.metrics.pairwise import cosine_distances
word_cosine = cosine_distances(word_vectors)
affprop = AffinityPropagation(affinity='precomputed', damping=0.5)
af = affprop.fit(word_cosine)