Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_keywords2(lines):
- key_words = []
- for line in lines:
- tokens = line.split()
- if len(tokens) != 5 or not re.search('[a-zA-Z]', tokens[0]) == None:
- continue
- word = tokens[0]
- pos_count = tokens[3]
- neg_count = tokens[4]
- if int(pos_count) != 0:
- key_words += [([word],"postive")]* int(pos_count)
- if int(neg_count) != 0:
- key_words += [([word],"negative")]* int(neg_count)
- return key_words
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement