Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import csv
- table = dict()
- with open('polarity.csv', 'r', encoding='utf-8') as polarity:
- next(polarity)
- # n gram Negative, Neutrual, Positive
- for line in csv.reader(polarity):
- key = str()
- for word in line[0].split(';'):
- key += word.split('/')[0]
- table[key] = {'Neg': line[3], 'Neut': line[4], 'Pos': line[6]}
- print(table['화재'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement