diff --git a/README.md b/README.md index fac26e6..03a9b1d 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,13 @@ * 11/11/2020: I introduce a new [ASTCN](/models/astcn.py) model which contains a bidirectional graph convolutional network over directed dependency trees. * 10/5/2020: Many of you may be faced with [reproducibility issue](https://github.com/GeneZC/ASGCN/issues/2) owing to corrupted word vectors when downloading (i.e., glove.840B.300d.txt is generally too large). Thus, we have released [trimmed version](/300_rest14_embedding_matrix.pkl) of word embeddings on rest14 dataset as a pickled file along with [vocabulary](/rest14_word2idx.pkl) for you to verify the reproducibility. +### Updates of Evaluation + +| Datasets | ASGCN | ASTCN | ASCNN | LSTM | +| :------: | :--------: | :-------------: |:---------:|:---------:| +| Rest15 |80.37 (63.49)|80.12 (62.03)|70.97 (60.99)|77.22 (57.31)| +| Rest16 |88.94 (67.88)|89.00 (69.01)|88.18 (66.69)|86.99 (65.01)| + ## Requirements * Python 3.6 diff --git a/data_utils.py b/data_utils.py index 301ba94..dbe5905 100644 --- a/data_utils.py +++ b/data_utils.py @@ -24,7 +24,7 @@ def build_embedding_matrix(word2idx, embed_dim, type): print('loading word vectors ...') embedding_matrix = np.zeros((len(word2idx), embed_dim)) # idx 0 and 1 are all-zeros embedding_matrix[1, :] = np.random.uniform(-1/np.sqrt(embed_dim), 1/np.sqrt(embed_dim), (1, embed_dim)) - fname = './glove/glove.840B.300d.txt' + fname = 'glove.840B.300d.txt' word_vec = load_word_vec(fname, word2idx=word2idx, embed_dim=embed_dim) print('building embedding_matrix:', embedding_matrix_file_name) for word, i in word2idx.items(): diff --git a/datasets/acl-14-short-data/test.raw b/datasets/acl-14-short-data/test.raw index d50f33a..0fbd93d 100644 --- a/datasets/acl-14-short-data/test.raw +++ b/datasets/acl-14-short-data/test.raw @@ -2071,6 +2071,3 @@ windows 7 2 hours later , no longer seeing confused russian $T$ . steve jobs 0 -'' Technically if a girl wants to sparkle she can put on glitter , but I think the correct answer would be a smile . '' - $T$ . -demi lovato -0 \ No newline at end of file diff --git a/datasets/acl-14-short-data/test.raw.graph b/datasets/acl-14-short-data/test.raw.graph index 266a5f0..fe4625d 100644 Binary files a/datasets/acl-14-short-data/test.raw.graph and b/datasets/acl-14-short-data/test.raw.graph differ diff --git a/datasets/acl-14-short-data/test.raw.tree b/datasets/acl-14-short-data/test.raw.tree index a8ada92..46a4e27 100644 Binary files a/datasets/acl-14-short-data/test.raw.tree and b/datasets/acl-14-short-data/test.raw.tree differ diff --git a/datasets/acl-14-short-data/train.raw b/datasets/acl-14-short-data/train.raw index aeeff78..4fe2cbb 100644 --- a/datasets/acl-14-short-data/train.raw +++ b/datasets/acl-14-short-data/train.raw @@ -18739,6 +18739,3 @@ lady gaga nic cage sues business manager for ' financial ruin ' : filed under : celebrity justice $T$ , who has made untold . . nicolas cage 0 -the top 5 stars in need of help ... asap : abc news when $T$ signed on to advise the high fashion house . . -lindsay lohan -0 \ No newline at end of file diff --git a/datasets/acl-14-short-data/train.raw.graph b/datasets/acl-14-short-data/train.raw.graph index a674981..f3ea407 100644 Binary files a/datasets/acl-14-short-data/train.raw.graph and b/datasets/acl-14-short-data/train.raw.graph differ diff --git a/datasets/acl-14-short-data/train.raw.tree b/datasets/acl-14-short-data/train.raw.tree index ba6787f..7f6604f 100644 Binary files a/datasets/acl-14-short-data/train.raw.tree and b/datasets/acl-14-short-data/train.raw.tree differ diff --git a/datasets/semeval14/laptop_test.raw b/datasets/semeval14/laptop_test.raw index 9c7f098..a99eca1 100644 --- a/datasets/semeval14/laptop_test.raw +++ b/datasets/semeval14/laptop_test.raw @@ -1906,9 +1906,3 @@ updates the latest version does not have a $T$ . disc drive 0 -$T$ - although some people might complain about low res which I think is ridiculous . -Screen -1 -Screen - although some people might complain about low $T$ which I think is ridiculous . -res -1 diff --git a/datasets/semeval14/laptop_test.raw.graph b/datasets/semeval14/laptop_test.raw.graph index 9066523..a88ceca 100644 Binary files a/datasets/semeval14/laptop_test.raw.graph and b/datasets/semeval14/laptop_test.raw.graph differ diff --git a/datasets/semeval14/laptop_test.raw.tree b/datasets/semeval14/laptop_test.raw.tree index 6e287e9..f47b1ad 100644 Binary files a/datasets/semeval14/laptop_test.raw.tree and b/datasets/semeval14/laptop_test.raw.tree differ diff --git a/datasets/semeval14/laptop_train.raw b/datasets/semeval14/laptop_train.raw index b81a625..4fe43ca 100644 --- a/datasets/semeval14/laptop_train.raw +++ b/datasets/semeval14/laptop_train.raw @@ -3179,7 +3179,7 @@ I have Vista , so I am unable to $T$ and uninstall some programs . install -1 I have Vista , so I am unable to install and $T$ some programs . -uninstall  +uninstall -1 The $T$ is bright and vivid and the keyboard is very easy to use , very important for use quick typers . screen @@ -6979,6 +6979,3 @@ Windows Server 2008 Enterprise How Toshiba handles the repair seems to vary , some folks indicate that they were charged for even an intial fix , others had the $T$ done 5 times . repair 1 -I would like to use a different $T$ altogether . -operating system -0 diff --git a/datasets/semeval14/laptop_train.raw.graph b/datasets/semeval14/laptop_train.raw.graph index 5789401..8c33260 100644 Binary files a/datasets/semeval14/laptop_train.raw.graph and b/datasets/semeval14/laptop_train.raw.graph differ diff --git a/datasets/semeval14/laptop_train.raw.tree b/datasets/semeval14/laptop_train.raw.tree index 0951ea3..c35d776 100644 Binary files a/datasets/semeval14/laptop_train.raw.tree and b/datasets/semeval14/laptop_train.raw.tree differ diff --git a/datasets/semeval14/restaurant_test.raw b/datasets/semeval14/restaurant_test.raw index db59453..6429c0d 100644 --- a/datasets/semeval14/restaurant_test.raw +++ b/datasets/semeval14/restaurant_test.raw @@ -3355,6 +3355,3 @@ taramasalata Creamy appetizers -- taramasalata , $T$ , and Greek yogurt -LRB- with cuccumber , dill , and garlic -RRB- taste excellent when on warm pitas . eggplant salad 1 -Creamy appetizers -- taramasalata , eggplant salad , and $T$ taste excellent when on warm pitas . -Greek yogurt (with cuccumber, dill, and garlic) -1 diff --git a/datasets/semeval14/restaurant_test.raw.graph b/datasets/semeval14/restaurant_test.raw.graph index 14bc7f9..0c74643 100644 Binary files a/datasets/semeval14/restaurant_test.raw.graph and b/datasets/semeval14/restaurant_test.raw.graph differ diff --git a/datasets/semeval14/restaurant_test.raw.tree b/datasets/semeval14/restaurant_test.raw.tree index 51c6f41..7404c49 100644 Binary files a/datasets/semeval14/restaurant_test.raw.tree and b/datasets/semeval14/restaurant_test.raw.tree differ diff --git a/datasets/semeval14/restaurant_train.raw b/datasets/semeval14/restaurant_train.raw index f3b1a07..b0d539d 100644 --- a/datasets/semeval14/restaurant_train.raw +++ b/datasets/semeval14/restaurant_train.raw @@ -10804,21 +10804,3 @@ foods From the appetizers we ate , the dim sum and other variety of foods , it was impossible to criticize the $T$ . food 1 -Each $T$ has a pot of boiling water sunken into its surface , and you get platters of thin sliced meats , various vegetables , and rice and glass noodles . -table -0 -Each table has a $T$ sunken into its surface , and you get platters of thin sliced meats , various vegetables , and rice and glass noodles . -pot of boiling water -0 -Each table has a pot of boiling water sunken into its surface , and you get platters of thin sliced $T$ , various vegetables , and rice and glass noodles . -meats -0 -Each table has a pot of boiling water sunken into its surface , and you get platters of thin sliced meats , various $T$ , and rice and glass noodles . -vegetables -0 -Each table has a pot of boiling water sunken into its surface , and you get platters of thin sliced meats , various vegetables , and $T$ and glass noodles . -rice -0 -Each table has a pot of boiling water sunken into its surface , and you get platters of thin sliced meats , various vegetables , and rice and $T$ . -glass noodles -0 diff --git a/datasets/semeval14/restaurant_train.raw.graph b/datasets/semeval14/restaurant_train.raw.graph index 9efa146..38df18a 100644 Binary files a/datasets/semeval14/restaurant_train.raw.graph and b/datasets/semeval14/restaurant_train.raw.graph differ diff --git a/datasets/semeval14/restaurant_train.raw.tree b/datasets/semeval14/restaurant_train.raw.tree index 1c0fae4..463d566 100644 Binary files a/datasets/semeval14/restaurant_train.raw.tree and b/datasets/semeval14/restaurant_train.raw.tree differ diff --git a/datasets/semeval15/restaurant_test.raw b/datasets/semeval15/restaurant_test.raw index 03396ed..df94f8b 100644 --- a/datasets/semeval15/restaurant_test.raw +++ b/datasets/semeval15/restaurant_test.raw @@ -436,7 +436,7 @@ food i 've enjoyed 99 % of the $T$ we 've ordered with the only exceptions being the occasional too - authentic - for - me dish ( i 'm a daring eater but not that daring ) . dishes 1 -i 've enjoyed 99 % of the $T$ es we 've ordered with the only exceptions being the occasional too - authentic - for - me $ t$ ( i 'm a daring eater but not that daring ) . +i 've enjoyed 99 % of the $T$ es we 've ordered with the only exceptions being the occasional too - authentic - for - me dish ( i 'm a daring eater but not that daring ) . dish -1 my daughter 's wedding reception at $T$ received the highest compliments from our guests . @@ -532,7 +532,7 @@ seating the $T$ are not as small as some of the reviews make them out to look they 're perfect for 2 people . boths 1 -the $T$ was extremely fast and attentive(thanks to the $ t$ button on your table ) but i barely understood 1 word when the waiter took our order . +the $T$ was extremely fast and attentive(thanks to the service button on your table ) but i barely understood 1 word when the waiter took our order . service 1 the service was extremely fast and attentive(thanks to the $T$ on your table ) but i barely understood 1 word when the waiter took our order . @@ -676,7 +676,7 @@ rolls $T$ is an excellent place to go if you re not into sashimi , or if you have friends who does nt like sushi much . yamato 1 -they have great $T$ , the triple color and norwegetan $ t$ , are awesome and filling . +they have great $T$ , the triple color and norwegetan rolls , are awesome and filling . rolls 1 they have great rolls , the $T$ , are awesome and filling . @@ -1105,7 +1105,7 @@ east village pizza i love $T$ – i looove east village pizza margherita pizza 1 -love this $T$ , every time we are in the city this is one of the $ t$s we always go . +love this $T$ , every time we are in the city this is one of the places we always go . place 1 a quintessential $T$ . @@ -1255,7 +1255,7 @@ place this place has totally weird $T$ , stairs going up with mirrored walls - i am surprised how no one yet broke their head or fall off the stairs - mirrored walls make you dizzy and delusional ... decor -1 -this place has totally weird decor , stairs going up with $T$ - i am surprised how no one yet broke their head or fall off the stairs - $ t$ make you dizzy and delusional ... +this place has totally weird decor , stairs going up with $T$ - i am surprised how no one yet broke their head or fall off the stairs - mirrored walls make you dizzy and delusional ... mirrored walls -1 this $T$ is not inviting and the food is totally weird . @@ -1336,13 +1336,13 @@ chicken it was served with skin , over a bed of extremely undercooked $T$ and mashed potatoes . spinach -1 -i took one bite from the $ 24 $T$ , and i have never , in the 17 years i have been going to restaurants tasted $ t$ as fishy , as dry , and as bland as the one in flatbush farms . +i took one bite from the $ 24 $T$ , and i have never , in the 17 years i have been going to restaurants tasted salmon as fishy , as dry , and as bland as the one in flatbush farms . salmon -1 -at this point , the $T$ comes over and asks us if everything was okay , i was literally so shocked that i was speechless and did n't say anything , and guess what , the $ t$ walked away . +at this point , the $T$ comes over and asks us if everything was okay , i was literally so shocked that i was speechless and did n't say anything , and guess what , the waitress walked away . waitress -1 -so , i switch with my boyfriend again to see if maybe i could stomach the meat and $T$ again , but the $ t$ was so undercooked that i just could not bite through it . +so , i switch with my boyfriend again to see if maybe i could stomach the meat and $T$ again , but the spinach was so undercooked that i just could not bite through it . spinach -1 this is where it really really gets bad : the $T$ said , there is absolutely nothing we can do , it 's a matter of taste that she did n't like it , and i can not comp it . @@ -1516,7 +1516,7 @@ hot dogs at first glance this place seems a bit pricey for a hot dog joint , but at $T$ you do n't just get your average hot dog . bark -1 -at first glance this place seems a bit pricey for a $T$ joint , but at bark you do n't just get your average $ t$. +at first glance this place seems a bit pricey for a $T$ joint , but at bark you do n't just get your average hot dog. hot dog 1 here the $T$ is elevated to the level of a real entree with numerous variations available . @@ -1618,9 +1618,3 @@ waiter the $T$ came to check in on us every few minutes , and began to clear the plates while half of us were still eating ( a big pet peeve of mine that happens almost everywhere , so i try to ignore it ) . waitress -1 -i wish i could like this $T$ more , and i wish someone would retrain the staff . -place --1 -i wish i could like this place more , and i wish someone would retrain the $T$ . -staff --1 diff --git a/datasets/semeval15/restaurant_test.raw.graph b/datasets/semeval15/restaurant_test.raw.graph index 4498735..1afd839 100644 Binary files a/datasets/semeval15/restaurant_test.raw.graph and b/datasets/semeval15/restaurant_test.raw.graph differ diff --git a/datasets/semeval15/restaurant_test.raw.tree b/datasets/semeval15/restaurant_test.raw.tree index 2c1a8a9..edd1699 100644 Binary files a/datasets/semeval15/restaurant_test.raw.tree and b/datasets/semeval15/restaurant_test.raw.tree differ diff --git a/datasets/semeval15/restaurant_train.raw b/datasets/semeval15/restaurant_train.raw index d990c67..1365186 100644 --- a/datasets/semeval15/restaurant_train.raw +++ b/datasets/semeval15/restaurant_train.raw @@ -238,7 +238,7 @@ cheese the $T$ is overpriced and soggy . pizza -1 -yes , they use fancy $T$ , but even fancy $ t$ do n't make for good pizza unless someone knows how to get the crust right . +yes , they use fancy $T$ , but even fancy ingredients do n't make for good pizza unless someone knows how to get the crust right . ingredients 1 yes , they use fancy ingredients , but even fancy ingredients do n't make for good $T$ unless someone knows how to get the crust right . @@ -604,7 +604,7 @@ service great service , great $T$ . food 1 -the $T$ is delicious - they use fresh mozzarella instead of the cheap , frozen , shredded cheese common to most $ t$ria 's . +the $T$ is delicious - they use fresh mozzarella instead of the cheap , frozen , shredded cheese common to most pizzaria 's . pizza 1 the pizza is delicious - they use $T$ instead of the cheap , frozen , shredded cheese common to most pizzaria 's . @@ -724,7 +724,7 @@ restaurant the $T$ is cute but not upscale . restaurant 0 -the $T$ is a diamond in rough -- the $ t$ is delicious and homemade with the perfect balance of herbs and tomatoes . +the $T$ is a diamond in rough -- the food is delicious and homemade with the perfect balance of herbs and tomatoes . food 1 the food is a diamond in rough -- the food is delicious and homemade with the perfect $T$ . @@ -784,7 +784,7 @@ service i have to highly recommend the $T$ - not to much mayo ; you can tell it was a fresh lobster . lobster roll 1 -i have to highly recommend the $T$ roll - not to much mayo ; you can tell it was a fresh $ t$. +i have to highly recommend the $T$ roll - not to much mayo ; you can tell it was a fresh lobster. lobster 1 other guests enjoyed $T$ , santa fe chopped salad and fish and chips . @@ -955,10 +955,10 @@ service sometimes i get bad $T$ and bad service , sometimes i get good good and bad service . food -1 -sometimes i get bad food and bad $T$ , sometimes i get good good and bad $ t$. +sometimes i get bad food and bad $T$ , sometimes i get good good and bad service. service -1 -sometimes i get bad food and bad service , sometimes i get $T$ $ t$ and bad service . +sometimes i get bad food and bad service , sometimes i get $T$ good and bad service . good 1 the place is a bistro which means : simple $T$ and wine served efficiently in a bustling atmosphere . @@ -1255,7 +1255,7 @@ service the $T$ is small and intimate and you may feel a little crowded , but the service is excellent and it 's great for friends out , a romantic date , or a special occassion . place -1 -the $T$ can get pricey but the prixe fixe tasting menu is the greatest $ t$ for a good price and they cater the $ t$ to any $ t$ allergies or $ t$ you do n't like . +the $T$ can get pricey but the prixe fixe tasting menu is the greatest food for a good price and they cater the food to any food allergies or food you do n't like . food -1 the food can get pricey but the $T$ is the greatest food for a good price and they cater the food to any food allergies or food you do n't like . @@ -1870,7 +1870,7 @@ cafe noir the $T$ was terrible , we had to wait for everything and ask several of different people for the same thing before we were allowed to be served . service -1 -the $T$ , seems to be more concerned of looking good than actually $ t$ing . +the $T$ , seems to be more concerned of looking good than actually waitressing . waitress -1 after dinner the $T$ grabbed my boyfriend , asked him : where are you from ... maybe you do nt know how things work in america ... and in the end stormed away almost teareyed yelling that tips are the only thing they survive on . @@ -2146,7 +2146,7 @@ service the service was excellent and the $T$ was delicious . food 1 -we are very particular about $T$ and were both please with every choice which included : ceviche mix ( special ) , crab dumplings , assorted sashimi , $ t$ and rolls , two types of sake , and the banana tempura . +we are very particular about $T$ and were both please with every choice which included : ceviche mix ( special ) , crab dumplings , assorted sashimi , sushi and rolls , two types of sake , and the banana tempura . sushi 1 we are very particular about sushi and were both please with every choice which included : $T$ , crab dumplings , assorted sashimi , sushi and rolls , two types of sake , and the banana tempura . @@ -2158,7 +2158,7 @@ crab dumplings we are very particular about sushi and were both please with every choice which included : ceviche mix ( special ) , crab dumplings , $T$ , sushi and rolls , two types of sake , and the banana tempura . assorted sashimi 1 -we are very particular about $T$ and were both please with every choice which included : ceviche mix ( special ) , crab dumplings , assorted sashimi , $ t$ and rolls , two types of sake , and the banana tempura . +we are very particular about $T$ and were both please with every choice which included : ceviche mix ( special ) , crab dumplings , assorted sashimi , sushi and rolls , two types of sake , and the banana tempura . sushi 1 we are very particular about sushi and were both please with every choice which included : ceviche mix ( special ) , crab dumplings , assorted sashimi , sushi and $T$ , two types of sake , and the banana tempura . @@ -2215,7 +2215,7 @@ food $T$ was really great , we both had the filet , very good , did n't much like the frites that came with , but the filet was so good , neither of us cared . guacamole+shrimp appetizer 1 -guacamole+shrimp appetizer was really great , we both had the $T$ , very good , did n't much like the frites that came with , but the $ t$ was so good , neither of us cared . +guacamole+shrimp appetizer was really great , we both had the $T$ , very good , did n't much like the frites that came with , but the filet was so good , neither of us cared . filet 1 guacamole+shrimp appetizer was really great , we both had the filet , very good , did n't much like the $T$ that came with , but the filet was so good , neither of us cared . @@ -2803,7 +2803,7 @@ indian food i really loved the different and inovated touch that 's the $T$ gives to the food . cheff 1 -also it 's great to have dinner in a very romantic and confortable $T$ , the service it 's just perfect ... they're so frendly that we never want to live the $ t$ ! +also it 's great to have dinner in a very romantic and confortable $T$ , the service it 's just perfect ... they're so frendly that we never want to live the place ! place 1 also it 's great to have dinner in a very romantic and confortable place , the $T$ it 's just perfect ... they're so frendly that we never want to live the place ! @@ -3094,7 +3094,7 @@ reuben sandwich do n't miss $T$ on your next trip to manhatten . bloom 's 1 -it was the first $T$ we ate on our first trip to new york , and it will be the last $ t$ we stop as we head out of town on our next trip to new york . +it was the first $T$ we ate on our first trip to new york , and it will be the last place we stop as we head out of town on our next trip to new york . place 1 thanks $T$ for a lovely trip . @@ -3601,12 +3601,3 @@ meal we could have made a meal of the yummy $T$ from the dumpling menu . dumplings 1 -luckily we saved room for the $T$ , sea bass and crispy duck . -bbq salmon -1 -luckily we saved room for the bbq salmon , $T$ and crispy duck . -sea bass -1 -luckily we saved room for the bbq salmon , sea bass and $T$ . -crispy duck -1 diff --git a/datasets/semeval15/restaurant_train.raw.graph b/datasets/semeval15/restaurant_train.raw.graph index ea5429e..c2c5f72 100644 Binary files a/datasets/semeval15/restaurant_train.raw.graph and b/datasets/semeval15/restaurant_train.raw.graph differ diff --git a/datasets/semeval15/restaurant_train.raw.tree b/datasets/semeval15/restaurant_train.raw.tree index b3fe383..e4ad93b 100644 Binary files a/datasets/semeval15/restaurant_train.raw.tree and b/datasets/semeval15/restaurant_train.raw.tree differ diff --git a/datasets/semeval16/restaurant_test.raw b/datasets/semeval16/restaurant_test.raw index 33cd5fc..4dda362 100644 --- a/datasets/semeval16/restaurant_test.raw +++ b/datasets/semeval16/restaurant_test.raw @@ -601,7 +601,7 @@ wine not the $T$ it once was place -1 -– it is sad to see a $T$ that was once " the " $ t$ to meet and eat for bfast or lunch , now be the $ t$ that is a big " dont bother . " +– it is sad to see a $T$ that was once " the " place to meet and eat for bfast or lunch , now be the place that is a big " dont bother . " place -1 the $T$ is not what it once was ( potions have seriously seen downsizing ) prices have gone up , and the service is the worst i have experienced anywhere ( including mainland europe ) . @@ -925,7 +925,7 @@ soho location your a sushi fan , you love expertly cut fish , great sake , a killer soho location , and of course : $T$ , tuna , fluke , yellow tail , cod , mackeral , jellyfish , sea urchin , shrimp , lobster , sea bream , trout , milk fish , blue fin tuna , eel , crab , sardine , monk fish , roe , scallop , oysters , and a varity of toro . salmon 1 -your a sushi fan , you love expertly cut fish , great sake , a killer soho location , and of course : salmon , $T$ , fluke , yellow tail , cod , mackeral , jellyfish , sea urchin , shrimp , lobster , sea bream , trout , milk fish , blue fin $ t$ , eel , crab , sardine , monk fish , roe , scallop , oysters , and a varity of toro . +your a sushi fan , you love expertly cut fish , great sake , a killer soho location , and of course : salmon , $T$ , fluke , yellow tail , cod , mackeral , jellyfish , sea urchin , shrimp , lobster , sea bream , trout , milk fish , blue fin tuna , eel , crab , sardine , monk fish , roe , scallop , oysters , and a varity of toro . tuna 1 your a sushi fan , you love expertly cut fish , great sake , a killer soho location , and of course : salmon , tuna , $T$ , yellow tail , cod , mackeral , jellyfish , sea urchin , shrimp , lobster , sea bream , trout , milk fish , blue fin tuna , eel , crab , sardine , monk fish , roe , scallop , oysters , and a varity of toro . @@ -1027,7 +1027,7 @@ service – as with most restaurants in seattle , mioposto 's service was bad and the $T$ was overpriced . food -1 -i know many people have their favorite types of $T$ and $ t$ places , but mioposto 's $ t$ lacks quality and good taste . +i know many people have their favorite types of $T$ and pizza places , but mioposto 's pizza lacks quality and good taste . pizza -1 to be honest , i 've had better frozen $T$ . @@ -1048,7 +1048,7 @@ food the food is fantastic , and the $T$ has been perfect every single time we 've been there . waiting staff 1 -the only problem would be the $T$ , but we usually just have a drink in the front while $ t$ing . +the only problem would be the $T$ , but we usually just have a drink in the front while waiting . wait 0 $T$ plus @@ -1069,7 +1069,7 @@ bottle of wine leave room for $T$ . dessert 1 -the $T$ was ok , but the service was so poor that the $ t$ was cold buy the time everyone in my party was served . +the $T$ was ok , but the service was so poor that the food was cold buy the time everyone in my party was served . food 0 the food was ok , but the $T$ was so poor that the food was cold buy the time everyone in my party was served . @@ -1126,7 +1126,7 @@ pizza great pizza , poor $T$ service -1 -– love their $T$ , especially the mushroom $ t$. +– love their $T$ , especially the mushroom pizza. pizza 1 – love their pizza , especially the $T$ . @@ -1300,7 +1300,7 @@ food while this diner had reasonably good food , the $T$ seemed completely indifferent to our presence , and this attitude was reflected in the lack of service . restaurant staff -1 -after one member of our party had been bumped repeatedly by a $T$ , a polite request that he not be bumped sent the $ t$ into an abusive rant . +after one member of our party had been bumped repeatedly by a $T$ , a polite request that he not be bumped sent the waitress into an abusive rant . waitress -1 a brief conversation with the $T$ at the end of the meal was the greatest disappointment -- to say we had been " blown off " would be an understatement . @@ -1399,7 +1399,7 @@ price fixed pre - show dinner when i walked in , i was taken aback by their incredible $T$ . wood decor 1 -the $T$ playing was very hip , 20 - 30 something pop $ t$ , but the subwoofer to the sound system was located under my seat , which became annoying midway through dinner . +the $T$ playing was very hip , 20 - 30 something pop music , but the subwoofer to the sound system was located under my seat , which became annoying midway through dinner . music 1 the music playing was very hip , 20 - 30 something pop music , but the $T$ was located under my seat , which became annoying midway through dinner . @@ -1444,7 +1444,7 @@ restaurant good $T$ , good food – i honestly do n't know much about japanese food at all . sake 1 -good sake , good $T$ – i honestly do n't know much about japanese $ t$ at all . +good sake , good $T$ – i honestly do n't know much about japanese food at all . food 1 server made several $T$ suggestions which were very good . @@ -1747,7 +1747,7 @@ juice i should have just asked for the check when i saw that ; but their $T$ was so unique that i continued . menu 1 -the $T$ were certainly inventive but $ 8.50 for 3 - 6 " $ t$ ( one of them was more like 5 " ) in the pancake flight ( sample of 3 different $ t$ ) is well over - priced . +the $T$ were certainly inventive but $ 8.50 for 3 - 6 " pancakes ( one of them was more like 5 " ) in the pancake flight ( sample of 3 different pancakes ) is well over - priced . pancakes 1 the $T$ should be larger ( at least 8 " ) to justify the expense even with the unique offerings . @@ -1756,7 +1756,7 @@ pancakes on my meal i had to send back my $T$ for a simple request of breaking the yokes before cooking , and would have had to send them back again if i had n't rejected the meal all together . eggs -1 -on my $T$ i had to send back my eggs for a simple request of breaking the yokes before cooking , and would have had to send them back again if i had n't rejected the $ t$ all together . +on my $T$ i had to send back my eggs for a simple request of breaking the yokes before cooking , and would have had to send them back again if i had n't rejected the meal all together . meal -1 i rejected it because in the process of attempting to fix the eggs they broke something else in the $T$ and i was too frustrated to continue . @@ -1843,6 +1843,3 @@ server while i could have done without the youth who shared the evening with us , our wonderful server and $T$ made the experience a very positive one . food 1 -oh yeah ... the $T$ was good , too . -view -1 diff --git a/datasets/semeval16/restaurant_test.raw.graph b/datasets/semeval16/restaurant_test.raw.graph index 6894b46..520e744 100644 Binary files a/datasets/semeval16/restaurant_test.raw.graph and b/datasets/semeval16/restaurant_test.raw.graph differ diff --git a/datasets/semeval16/restaurant_test.raw.tree b/datasets/semeval16/restaurant_test.raw.tree index 6e31d7d..699981d 100644 Binary files a/datasets/semeval16/restaurant_test.raw.tree and b/datasets/semeval16/restaurant_test.raw.tree differ diff --git a/datasets/semeval16/restaurant_train.raw b/datasets/semeval16/restaurant_train.raw index 72b02c8..d430776 100644 --- a/datasets/semeval16/restaurant_train.raw +++ b/datasets/semeval16/restaurant_train.raw @@ -238,7 +238,7 @@ cheese the $T$ is overpriced and soggy . pizza -1 -yes , they use fancy $T$ , but even fancy $ t$ do n't make for good pizza unless someone knows how to get the crust right . +yes , they use fancy $T$ , but even fancy ingredients do n't make for good pizza unless someone knows how to get the crust right . ingredients 1 yes , they use fancy ingredients , but even fancy ingredients do n't make for good $T$ unless someone knows how to get the crust right . @@ -610,7 +610,7 @@ service great service , great $T$ . food 1 -the $T$ is delicious - they use fresh mozzarella instead of the cheap , frozen , shredded cheese common to most $ t$ria 's . +the $T$ is delicious - they use fresh mozzarella instead of the cheap , frozen , shredded cheese common to most pizzaria 's . pizza 1 the pizza is delicious - they use $T$ instead of the cheap , frozen , shredded cheese common to most pizzaria 's . @@ -730,7 +730,7 @@ restaurant the $T$ is cute but not upscale . restaurant 0 -the $T$ is a diamond in rough -- the $ t$ is delicious and homemade with the perfect balance of herbs and tomatoes . +the $T$ is a diamond in rough -- the food is delicious and homemade with the perfect balance of herbs and tomatoes . food 1 the food is a diamond in rough -- the food is delicious and homemade with the perfect $T$ . @@ -787,7 +787,7 @@ service i have to highly recommend the $T$ - not to much mayo ; you can tell it was a fresh lobster . lobster roll 1 -i have to highly recommend the $T$ roll - not to much mayo ; you can tell it was a fresh $ t$. +i have to highly recommend the $T$ roll - not to much mayo ; you can tell it was a fresh lobster. lobster 1 other guests enjoyed $T$ , santa fe chopped salad and fish and chips . @@ -961,10 +961,10 @@ service sometimes i get bad $T$ and bad service , sometimes i get good good and bad service . food -1 -sometimes i get bad food and bad $T$ , sometimes i get good good and bad $ t$. +sometimes i get bad food and bad $T$ , sometimes i get good good and bad service. service -1 -sometimes i get bad food and bad service , sometimes i get $T$ $ t$ and bad service . +sometimes i get bad food and bad service , sometimes i get $T$ good and bad service . good 1 the place is a bistro which means : simple $T$ and wine served efficiently in a bustling atmosphere . @@ -1261,7 +1261,7 @@ service the $T$ is small and intimate and you may feel a little crowded , but the service is excellent and it 's great for friends out , a romantic date , or a special occassion . place -1 -the $T$ can get pricey but the prixe fixe tasting menu is the greatest $ t$ for a good price and they cater the $ t$ to any $ t$ allergies or $ t$ you do n't like . +the $T$ can get pricey but the prixe fixe tasting menu is the greatest food for a good price and they cater the food to any food allergies or food you do n't like . food -1 the food can get pricey but the $T$ is the greatest food for a good price and they cater the food to any food allergies or food you do n't like . @@ -1876,7 +1876,7 @@ cafe noir the $T$ was terrible , we had to wait for everything and ask several of different people for the same thing before we were allowed to be served . service -1 -the $T$ , seems to be more concerned of looking good than actually $ t$ing . +the $T$ , seems to be more concerned of looking good than actually waitressing . waitress -1 after dinner the $T$ grabbed my boyfriend , asked him : where are you from ... maybe you do nt know how things work in america ... and in the end stormed away almost teareyed yelling that tips are the only thing they survive on . @@ -2152,7 +2152,7 @@ service the service was excellent and the $T$ was delicious . food 1 -we are very particular about $T$ and were both please with every choice which included : ceviche mix ( special ) , crab dumplings , assorted sashimi , $ t$ and rolls , two types of sake , and the banana tempura . +we are very particular about $T$ and were both please with every choice which included : ceviche mix ( special ) , crab dumplings , assorted sashimi , sushi and rolls , two types of sake , and the banana tempura . sushi 1 we are very particular about sushi and were both please with every choice which included : $T$ , crab dumplings , assorted sashimi , sushi and rolls , two types of sake , and the banana tempura . @@ -2164,7 +2164,7 @@ crab dumplings we are very particular about sushi and were both please with every choice which included : ceviche mix ( special ) , crab dumplings , $T$ , sushi and rolls , two types of sake , and the banana tempura . assorted sashimi 1 -we are very particular about $T$ and were both please with every choice which included : ceviche mix ( special ) , crab dumplings , assorted sashimi , $ t$ and rolls , two types of sake , and the banana tempura . +we are very particular about $T$ and were both please with every choice which included : ceviche mix ( special ) , crab dumplings , assorted sashimi , sushi and rolls , two types of sake , and the banana tempura . sushi 1 we are very particular about sushi and were both please with every choice which included : ceviche mix ( special ) , crab dumplings , assorted sashimi , sushi and $T$ , two types of sake , and the banana tempura . @@ -2221,7 +2221,7 @@ food $T$ was really great , we both had the filet , very good , did n't much like the frites that came with , but the filet was so good , neither of us cared . guacamole+shrimp appetizer 1 -guacamole+shrimp appetizer was really great , we both had the $T$ , very good , did n't much like the frites that came with , but the $ t$ was so good , neither of us cared . +guacamole+shrimp appetizer was really great , we both had the $T$ , very good , did n't much like the frites that came with , but the filet was so good , neither of us cared . filet 1 guacamole+shrimp appetizer was really great , we both had the filet , very good , did n't much like the $T$ that came with , but the filet was so good , neither of us cared . @@ -2812,7 +2812,7 @@ indian food i really loved the different and inovated touch that 's the $T$ gives to the food . cheff 1 -also it 's great to have dinner in a very romantic and confortable $T$ , the service it 's just perfect ... they're so frendly that we never want to live the $ t$ ! +also it 's great to have dinner in a very romantic and confortable $T$ , the service it 's just perfect ... they're so frendly that we never want to live the place ! place 1 also it 's great to have dinner in a very romantic and confortable place , the $T$ it 's just perfect ... they're so frendly that we never want to live the place ! @@ -3103,7 +3103,7 @@ reuben sandwich do n't miss $T$ on your next trip to manhatten . bloom 's 1 -it was the first $T$ we ate on our first trip to new york , and it will be the last $ t$ we stop as we head out of town on our next trip to new york . +it was the first $T$ we ate on our first trip to new york , and it will be the last place we stop as we head out of town on our next trip to new york . place 1 thanks $T$ for a lovely trip . @@ -4057,7 +4057,7 @@ food i 've enjoyed 99 % of the $T$ we 've ordered with the only exceptions being the occasional too - authentic - for - me dish ( i 'm a daring eater but not that daring ) . dishes 1 -i 've enjoyed 99 % of the $T$ es we 've ordered with the only exceptions being the occasional too - authentic - for - me $ t$ ( i 'm a daring eater but not that daring ) . +i 've enjoyed 99 % of the $T$ es we 've ordered with the only exceptions being the occasional too - authentic - for - me dish ( i 'm a daring eater but not that daring ) . dish -1 my daughter 's wedding reception at $T$ received the highest compliments from our guests . @@ -4153,7 +4153,7 @@ seating the $T$ are not as small as some of the reviews make them out to look they 're perfect for 2 people . boths 1 -the $T$ was extremely fast and attentive(thanks to the $ t$ button on your table ) but i barely understood 1 word when the waiter took our order . +the $T$ was extremely fast and attentive(thanks to the service button on your table ) but i barely understood 1 word when the waiter took our order . service 1 the service was extremely fast and attentive(thanks to the $T$ on your table ) but i barely understood 1 word when the waiter took our order . @@ -4297,7 +4297,7 @@ rolls $T$ is an excellent place to go if you re not into sashimi , or if you have friends who does nt like sushi much . yamato 1 -they have great $T$ , the triple color and norwegetan $ t$ , are awesome and filling . +they have great $T$ , the triple color and norwegetan rolls , are awesome and filling . rolls 1 they have great rolls , the $T$ , are awesome and filling . @@ -4726,7 +4726,7 @@ east village pizza i love $T$ – i looove east village pizza margherita pizza 1 -love this $T$ , every time we are in the city this is one of the $ t$s we always go . +love this $T$ , every time we are in the city this is one of the places we always go . place 1 a quintessential $T$ . @@ -4873,7 +4873,7 @@ place this place has totally weird $T$ , stairs going up with mirrored walls - i am surprised how no one yet broke their head or fall off the stairs - mirrored walls make you dizzy and delusional ... decor -1 -this place has totally weird decor , stairs going up with $T$ - i am surprised how no one yet broke their head or fall off the stairs - $ t$ make you dizzy and delusional ... +this place has totally weird decor , stairs going up with $T$ - i am surprised how no one yet broke their head or fall off the stairs - mirrored walls make you dizzy and delusional ... mirrored walls -1 this $T$ is not inviting and the food is totally weird . @@ -4954,13 +4954,13 @@ chicken it was served with skin , over a bed of extremely undercooked $T$ and mashed potatoes . spinach -1 -i took one bite from the $ 24 $T$ , and i have never , in the 17 years i have been going to restaurants tasted $ t$ as fishy , as dry , and as bland as the one in flatbush farms . +i took one bite from the $ 24 $T$ , and i have never , in the 17 years i have been going to restaurants tasted salmon as fishy , as dry , and as bland as the one in flatbush farms . salmon -1 -at this point , the $T$ comes over and asks us if everything was okay , i was literally so shocked that i was speechless and did n't say anything , and guess what , the $ t$ walked away . +at this point , the $T$ comes over and asks us if everything was okay , i was literally so shocked that i was speechless and did n't say anything , and guess what , the waitress walked away . waitress -1 -so , i switch with my boyfriend again to see if maybe i could stomach the meat and $T$ again , but the $ t$ was so undercooked that i just could not bite through it . +so , i switch with my boyfriend again to see if maybe i could stomach the meat and $T$ again , but the spinach was so undercooked that i just could not bite through it . spinach -1 this is where it really really gets bad : the $T$ said , there is absolutely nothing we can do , it 's a matter of taste that she did n't like it , and i can not comp it . @@ -5134,7 +5134,7 @@ hot dogs at first glance this place seems a bit pricey for a hot dog joint , but at $T$ you do n't just get your average hot dog . bark -1 -at first glance this place seems a bit pricey for a $T$ joint , but at bark you do n't just get your average $ t$. +at first glance this place seems a bit pricey for a $T$ joint , but at bark you do n't just get your average hot dog. hot dog 1 here the $T$ is elevated to the level of a real entree with numerous variations available . @@ -5236,9 +5236,3 @@ waiter the $T$ came to check in on us every few minutes , and began to clear the plates while half of us were still eating ( a big pet peeve of mine that happens almost everywhere , so i try to ignore it ) . waitress -1 -i wish i could like this $T$ more , and i wish someone would retrain the staff . -place --1 -i wish i could like this place more , and i wish someone would retrain the $T$ . -staff --1 diff --git a/datasets/semeval16/restaurant_train.raw.graph b/datasets/semeval16/restaurant_train.raw.graph index 15fc7bd..5dbef92 100644 Binary files a/datasets/semeval16/restaurant_train.raw.graph and b/datasets/semeval16/restaurant_train.raw.graph differ diff --git a/datasets/semeval16/restaurant_train.raw.tree b/datasets/semeval16/restaurant_train.raw.tree index 2d1963f..6f044bc 100644 Binary files a/datasets/semeval16/restaurant_train.raw.tree and b/datasets/semeval16/restaurant_train.raw.tree differ diff --git a/log/ascnn_rest15_val.txt b/log/ascnn_rest15_val.txt new file mode 100644 index 0000000..d10046e --- /dev/null +++ b/log/ascnn_rest15_val.txt @@ -0,0 +1 @@ +repeat: 1max_test_acc: 0.7944444444444444, max_test_f1: 0.6238722755958718repeat: 2max_test_acc: 0.7944444444444444, max_test_f1: 0.6144918476845341repeat: 3max_test_acc: 0.7981481481481482, max_test_f1: 0.59124953857512 \ No newline at end of file diff --git a/log/ascnn_rest16_val.txt b/log/ascnn_rest16_val.txt new file mode 100644 index 0000000..e8aac81 --- /dev/null +++ b/log/ascnn_rest16_val.txt @@ -0,0 +1 @@ +repeat: 1max_test_acc: 0.8731707317073171, max_test_f1: 0.675576418529397repeat: 2max_test_acc: 0.8910569105691057, max_test_f1: 0.6585704168729999repeat: 3max_test_acc: 0.8813008130081301, max_test_f1: 0.6666059402534676 \ No newline at end of file diff --git a/log/asgcn_rest15_val.txt b/log/asgcn_rest15_val.txt new file mode 100644 index 0000000..ae87563 --- /dev/null +++ b/log/asgcn_rest15_val.txt @@ -0,0 +1 @@ +repeat: 1max_test_acc: 0.8092592592592592, max_test_f1: 0.666697254682236repeat: 2max_test_acc: 0.8037037037037037, max_test_f1: 0.6376893294275268repeat: 3max_test_acc: 0.7981481481481482, max_test_f1: 0.6002583029271223 \ No newline at end of file diff --git a/log/asgcn_rest16_val.txt b/log/asgcn_rest16_val.txt new file mode 100644 index 0000000..00a5c1e --- /dev/null +++ b/log/asgcn_rest16_val.txt @@ -0,0 +1 @@ +repeat: 1max_test_acc: 0.8829268292682927, max_test_f1: 0.6597934347922488repeat: 2max_test_acc: 0.8910569105691057, max_test_f1: 0.6738939662793287repeat: 3max_test_acc: 0.8943089430894309, max_test_f1: 0.7027507130955407 \ No newline at end of file diff --git a/log/astcn_rest15_val.txt b/log/astcn_rest15_val.txt new file mode 100644 index 0000000..31a6a72 --- /dev/null +++ b/log/astcn_rest15_val.txt @@ -0,0 +1 @@ +repeat: 1max_test_acc: 0.7981481481481482, max_test_f1: 0.5900740666516362repeat: 2max_test_acc: 0.7925925925925926, max_test_f1: 0.627909666976857repeat: 3max_test_acc: 0.812962962962963, max_test_f1: 0.642979032280154 \ No newline at end of file diff --git a/log/astcn_rest16_val.txt b/log/astcn_rest16_val.txt new file mode 100644 index 0000000..f05fbb7 --- /dev/null +++ b/log/astcn_rest16_val.txt @@ -0,0 +1 @@ +repeat: 1max_test_acc: 0.8796747967479674, max_test_f1: 0.6823554797692729repeat: 2max_test_acc: 0.8975609756097561, max_test_f1: 0.7094832297810756repeat: 3max_test_acc: 0.8926829268292683, max_test_f1: 0.680845244189597 \ No newline at end of file diff --git a/log/lstm_rest15_val.txt b/log/lstm_rest15_val.txt new file mode 100644 index 0000000..ebedac3 --- /dev/null +++ b/log/lstm_rest15_val.txt @@ -0,0 +1 @@ +repeat: 1max_test_acc: 0.7703703703703704, max_test_f1: 0.5855363535348923repeat: 2max_test_acc: 0.7870370370370371, max_test_f1: 0.5722668593651857repeat: 3max_test_acc: 0.7592592592592593, max_test_f1: 0.5614574965382638 \ No newline at end of file diff --git a/log/lstm_rest16_val.txt b/log/lstm_rest16_val.txt new file mode 100644 index 0000000..6a60729 --- /dev/null +++ b/log/lstm_rest16_val.txt @@ -0,0 +1 @@ +repeat: 1max_test_acc: 0.8731707317073171, max_test_f1: 0.6708922782198644repeat: 2max_test_acc: 0.8682926829268293, max_test_f1: 0.6496357794294717repeat: 3max_test_acc: 0.8682926829268293, max_test_f1: 0.629719375715545 \ No newline at end of file diff --git a/models/ascnn.py b/models/ascnn.py index bc741df..4b1914c 100644 --- a/models/ascnn.py +++ b/models/ascnn.py @@ -59,7 +59,7 @@ def forward(self, inputs): aspect_double_idx = torch.cat([left_len.unsqueeze(1), (left_len+aspect_len-1).unsqueeze(1)], dim=1) text = self.embed(text_indices) text = self.text_embed_dropout(text) - text_out, (_, _) = self.text_lstm(text, text_len) + text_out, (_, _) = self.text_lstm(text, text_len.detach().cpu()) x = F.relu(self.conv1(self.position_weight(text_out, aspect_double_idx, text_len, aspect_len).transpose(1,2))) x = F.relu(self.conv2(self.position_weight(x.transpose(1,2), aspect_double_idx, text_len, aspect_len).transpose(1,2))) x = self.mask(x.transpose(1,2), aspect_double_idx) diff --git a/models/asgcn.py b/models/asgcn.py index c4ea60a..25d13b5 100644 --- a/models/asgcn.py +++ b/models/asgcn.py @@ -82,7 +82,7 @@ def forward(self, inputs): aspect_double_idx = torch.cat([left_len.unsqueeze(1), (left_len+aspect_len-1).unsqueeze(1)], dim=1) text = self.embed(text_indices) text = self.text_embed_dropout(text) - text_out, (_, _) = self.text_lstm(text, text_len) + text_out, (_, _) = self.text_lstm(text, text_len.detach().cpu()) x = F.relu(self.gc1(self.position_weight(text_out, aspect_double_idx, text_len, aspect_len), adj)) x = F.relu(self.gc2(self.position_weight(x, aspect_double_idx, text_len, aspect_len), adj)) x = self.mask(x, aspect_double_idx) diff --git a/models/astcn.py b/models/astcn.py index 0204b02..40ed99b 100644 --- a/models/astcn.py +++ b/models/astcn.py @@ -84,7 +84,7 @@ def forward(self, inputs): aspect_double_idx = torch.cat([left_len.unsqueeze(1), (left_len+aspect_len-1).unsqueeze(1)], dim=1) text = self.embed(text_indices) text = self.text_embed_dropout(text) - text_out, (_, _) = self.text_lstm(text, text_len) + text_out, (_, _) = self.text_lstm(text, text_len.detach().cpu()) f_x = F.relu(self.f_gc1(self.position_weight(text_out, aspect_double_idx, text_len, aspect_len), adj)) f_x = F.relu(self.f_gc2(self.position_weight(f_x, aspect_double_idx, text_len, aspect_len), adj)) b_x = F.relu(self.b_gc1(self.position_weight(text_out, aspect_double_idx, text_len, aspect_len), adj.transpose(1, 2))) diff --git a/models/lstm.py b/models/lstm.py index 9bce511..136bbea 100644 --- a/models/lstm.py +++ b/models/lstm.py @@ -16,6 +16,6 @@ def forward(self, inputs): text_indices = inputs[0] x = self.embed(text_indices) x_len = torch.sum(text_indices != 0, dim=-1) - _, (h_n, _) = self.lstm(x, x_len) + _, (h_n, _) = self.lstm(x, x_len.detach().cpu()) out = self.fc(h_n[0]) return out diff --git a/train.py b/train.py index c85151c..ab1c20b 100644 --- a/train.py +++ b/train.py @@ -157,8 +157,8 @@ def run(self, repeats=3): if __name__ == '__main__': # Hyper Parameters parser = argparse.ArgumentParser() - parser.add_argument('--model_name', default='lstm', type=str) - parser.add_argument('--dataset', default='twitter', type=str, help='twitter, rest14, lap14, rest15, rest16') + parser.add_argument('--model_name', default='astcn', type=str) + parser.add_argument('--dataset', default='rest16', type=str, help='twitter, rest14, lap14, rest15, rest16') parser.add_argument('--optimizer', default='adam', type=str) parser.add_argument('--initializer', default='xavier_uniform_', type=str) parser.add_argument('--learning_rate', default=0.001, type=float)