How to calculate cosine similarity between scalar and vector in Python?
I am trying to multiply the output of a ngram model's probability with the output of a pretrained word2vec model to rerank the next possible word using word prediction. (Natural language processing)
Is there a library for this? I tried sklearn's here:https://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise.cosine_similarity.html
But it only takes in two vectors to calculate pairwise cosine similarity.