diff --git a/ADA/aspect-based SA data/SemEval-2016/prep_data.py b/ADA/aspect-based SA data/SemEval-2016/prep_data.py index a8ca5a2e194278d3c776fb38d8ff00f29c564311..82a6b53167096871516a9699894c5ddd1be146be 100644 --- a/ADA/aspect-based SA data/SemEval-2016/prep_data.py +++ b/ADA/aspect-based SA data/SemEval-2016/prep_data.py @@ -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))