def similarity ( word1 : str , word2 : str ) -> float : return _MODEL . similarity ( word1 , word2 )
python similarities between two strings word2vec
Get cosine similarity between two words . If a word is not in the vocabulary KeyError will be raised .
def similarity(word1: str, word2: str) -> float:
    """
    Get cosine similarity between two words.
    If a word is not in the vocabulary, KeyError will be raised.

    :param string word1: first word
    :param string word2: second word
    :return: the cosine similarity between the two word vectors
    """
    return _MODEL.similarity(word1, word2)