def generate_by_embedding_model(lex, embedding_model, k=25):
    """Described in "Exploring Word Embeddings for Unsupervised Textual User-Generated
    Content Normalization, Bertaglia and Nunes(2016)"

    Args:
        lex (dict): The lexicon dictionary.
        embedding_model (obj): The embedding model in word2vec format. Must be readable by gensim.
        k (int): Number of neares neighbours to evaluate (all experiments ran with k=25).

    Returns:
        dict(str: list(str)): A list of possible corrections for each word.
    """
    cands = {}
    corrs = {}

    cands = {
        word: [
            sims[0]
            for sims in embedding_model.most_similar(word, topn=k)
            if sims[0] not in lex
        ]
        for word in lex
        if word in embedding_model
    }

    for word in cands:
        for c in cands[word]:
            if c not in corrs:
                corrs[c] = []
            corrs[c].append(word)

    return corrs