socialsent icon indicating copy to clipboard operation
socialsent copied to clipboard

Reference for a lexicon induction method

Open ndrmahmoudi opened this issue 5 years ago • 0 comments

Hi @williamleif,

I really like that you have provided a reference for each of lexicon induction method. Can you let please let me know where you have adopted dist function from?

def dist(embeds, positive_seeds, negative_seeds, **kwargs):
    polarities = {}
    sim_mat = similarity_matrix(embeds, **kwargs)
    for i, w in enumerate(embeds.iw):
        if w not in positive_seeds and w not in negative_seeds:
            pol = sum(sim_mat[embeds.wi[p_seed], i] for p_seed in positive_seeds)
            pol -= sum(sim_mat[embeds.wi[n_seed], i] for n_seed in negative_seeds)
            polarities[w] = pol
    return polarities

Regards Nader

ndrmahmoudi avatar Mar 24 '19 21:03 ndrmahmoudi