def transform_gensim(wv):
    """
    Transforms word2Vec model class to two structures: word2id dictionary (used to translate word into IDs) and
    id_word_vec which contains the tuple (id, word, embedding) for each word in the model. Used to be called from
    either main or as block of the pipeline.
    :param wv: word2vec model with the word embeddings
    :return: word2id and id_word_vec
    """
    print("Transforming from gensim a total of %s" % len(wv.vocab.items()))
    complete_vec = [(v.index, w, wv.word_vec(w)) for w, v in wv.vocab.items()]
    sorted_vec = sorted(complete_vec)
    id_word_vec = sorted_vec
    word2id = dict([(w, id) for id, w, _ in id_word_vec])

    return word2id, id_word_vec