<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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)