utils_dr_pre_word_simi.py
def simi_verb_each_cat():
    '''
    for each word, get its most similar word in each cat from glove emb
    both word and its simi words are supposed to be in infinitive form
    '''
    # cat -> infi form of words
    df = pd.DataFrame()
    agency_cats = ['pos', 'neg', 'equal']
    glove_model = KeyedVectors.load_word2vec_format("gensim_glove_vectors.txt", binary=False)
    vs_col = ['verb', 'oricat']
    vs_col.extend(agency_cats)
    for cat, verbset in agen_v.items():
        data = [simi_each_word(v, agen_v, cat, glove_model, agency_cats) for v in verbset]
        catdf = pd.DataFrame(data, columns=vs_col)
        df = df.append(catdf)
    df.to_csv('verb2simi.csv')
    return df

    for each word, get its most similar word in each cat from glove emb
    both word and its simi words are supposed to be in infinitive form
    
for each word, get its most similar word in each cat from glove emb
both word and its simi words are supposed to be in infinitive form
for each word get its most similar word in each cat from glove emb both word and its simi words are supposed to be in infinitive form
def simi_verb_each_cat():
    df = pd.DataFrame()
    agency_cats = ['pos', 'neg', 'equal']
    glove_model = KeyedVectors.load_word2vec_format("gensim_glove_vectors.txt", binary=False)
    vs_col = ['verb', 'oricat']
    vs_col.extend(agency_cats)
    for cat, verbset in agen_v.items():
        data = [simi_each_word(v, agen_v, cat, glove_model, agency_cats) for v in verbset]
        catdf = pd.DataFrame(data, columns=vs_col)
        df = df.append(catdf)
    df.to_csv('verb2simi.csv')
    return df
def simi_verb_each_cat ( ) : df = pd . DataFrame ( ) agency_cats = [ 'pos' , 'neg' , 'equal' ] glove_model = KeyedVectors . load_word2vec_format ( "gensim_glove_vectors.txt" , binary = False ) vs_col = [ 'verb' , 'oricat' ] vs_col . extend ( agency_cats ) for cat , verbset in agen_v . items ( ) : data = [ simi_each_word ( v , agen_v , cat , glove_model , agency_cats ) for v in verbset ] catdf = pd . DataFrame ( data , columns = vs_col ) df = df . append ( catdf ) df . to_csv ( 'verb2simi.csv' ) return df
for each word, get its most similar word in each cat from glove emb
both word and its simi words are supposed to be in infinitive form
for each word get its most similar word in each cat from glove emb both word and its simi words are supposed to be in infinitive form
'''
    for each word, get its most similar word in each cat from glove emb
    both word and its simi words are supposed to be in infinitive form
    ''' # cat -> infi form of words