Advertisement
Guest User

Untitled

a guest
May 20th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import csv
  2.  
  3. table = dict()
  4. with open('polarity.csv', 'r', encoding='utf-8') as polarity:
  5. next(polarity)
  6. # n gram Negative, Neutrual, Positive
  7. for line in csv.reader(polarity):
  8. key = str()
  9. for word in line[0].split(';'):
  10. key += word.split('/')[0]
  11.  
  12. table[key] = {'Neg': line[3], 'Neut': line[4], 'Pos': line[6]}
  13.  
  14. print(table['화재'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement