utils.py
def agen_verbs():
    '''
    for word in each category, get its infinitive form if it's in verb.txt
    for short phrases like 'apply to', only the first word is considered
    Note: 24 words not in verb.txt
    '''
    df = pd.read_csv('./CFdata/agency_verb.csv')
    agen_v = {}
    total = 0
    cats = {'+': 'pos', '-':'neg', '=':'equal'}
    for k, v in cats.items():
        subdf = df[df['Agency{agent}_Label'] == k]
        ver_li = subdf['verb'].str.split()
        agen_v[v] = set(word_infinitive(li[0]) for li in ver_li if len(li) > 0)
        total += len(agen_v[v])
    return agen_v

    for word in each category, get its infinitive form if it's in verb.txt
    for short phrases like 'apply to', only the first word is considered
    Note: 24 words not in verb.txt
    
for word in each category, get its infinitive form if it's in verb.txt
for short phrases like 'apply to', only the first word is considered
Note: 24 words not in verb.txt
for word in each category get its infinitive form if it ' s in verb . txt for short phrases like ' apply to ' only the first word is considered Note : 24 words not in verb . txt
def agen_verbs():
    df = pd.read_csv('./CFdata/agency_verb.csv')
    agen_v = {}
    total = 0
    cats = {'+': 'pos', '-':'neg', '=':'equal'}
    for k, v in cats.items():
        subdf = df[df['Agency{agent}_Label'] == k]
        ver_li = subdf['verb'].str.split()
        agen_v[v] = set(word_infinitive(li[0]) for li in ver_li if len(li) > 0)
        total += len(agen_v[v])
    return agen_v
def agen_verbs ( ) : df = pd . read_csv ( './CFdata/agency_verb.csv' ) agen_v = { } total = 0 cats = { '+' : 'pos' , '-' : 'neg' , '=' : 'equal' } for k , v in cats . items ( ) : subdf = df [ df [ 'Agency{agent}_Label' ] == k ] ver_li = subdf [ 'verb' ] . str . split ( ) agen_v [ v ] = set ( word_infinitive ( li [ 0 ] ) for li in ver_li if len ( li ) > 0 ) total += len ( agen_v [ v ] ) return agen_v
for word in each category, get its infinitive form if it's in verb.txt
for short phrases like 'apply to', only the first word is considered
Note: 24 words not in verb.txt
for word in each category get its infinitive form if it ' s in verb . txt for short phrases like ' apply to ' only the first word is considered Note : 24 words not in verb . txt
'''
    for word in each category, get its infinitive form if it's in verb.txt
    for short phrases like 'apply to', only the first word is considered
    Note: 24 words not in verb.txt
    '''