Commit b2670b8a authored by  Joel  Oksanen's avatar Joel Oksanen
Browse files

Added come words to glossary.

parent 7ee763a7
......@@ -8,7 +8,7 @@ tree = ET.parse('ABSA16_Laptops_Train_SB1_v2_with_parse_trees.xml')
reviews = tree.getroot()
glossary = {
'laptop': ['computer', 'device', 'price', 'cost', 'macbook', 'mac', 'pc', 'speed', 'it', 'product'],
'laptop': ['computer', 'device', 'machine', 'price', 'cost', 'macbook', 'mac', 'pc', 'speed', 'it', 'this', 'product'],
'display': ['monitor', 'screen', 'touchscreen'],
'cpu': ['processor'],
'hard disc': ['storage'],
......@@ -23,6 +23,8 @@ glossary = {
'multimedia devices': ['sound', 'audio', 'microphone', 'camera', 'webcam', 'speakers', 'headphone'],
'os': ['os x', 'windows', 'linux', 'start menu', 'safe mode', 'boot manager', 'drag and drop feature'],
'software': ['office', 'iwork', 'word processor', 'microsoft word', 'powerpoint', 'browser', 'skype', 'iphoto', 'ilife', 'pages', 'keynote', 'antivirus program', 'firewall', 'games', 'facial recognition'],
'shipping': ['delivery'],
'support': ['service'],
'company': ['apple', 'hp', 'asus', 'toshiba', 'dell', 'compaq', 'acer', 'lenovo']
}
......@@ -133,17 +135,17 @@ for review in reviews:
modified_tree = replace_feature_nps_tree(opinion[0], parse_tree, nps)
if modified_tree:
prepped_opinions += 1
# print('---')
# print(text)
# print(' '.join(modified_tree.leaves()))
# print(opinion)
# print('---')
else:
pass
print('---')
print(text)
print(nps)
print(' '.join(modified_tree.leaves()))
print(opinion)
print('---')
else:
pass
# print('---')
# print(text)
# print(nps)
# print(opinion)
i += 1
print('{}/{}'.format(i, n))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment