Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
3 changes: 0 additions & 3 deletions datasets/acl-14-short-data/test.raw
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file modified datasets/acl-14-short-data/test.raw.graph
Binary file not shown.
Binary file modified datasets/acl-14-short-data/test.raw.tree
Binary file not shown.
3 changes: 0 additions & 3 deletions datasets/acl-14-short-data/train.raw
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file modified datasets/acl-14-short-data/train.raw.graph
Binary file not shown.
Binary file modified datasets/acl-14-short-data/train.raw.tree
Binary file not shown.
6 changes: 0 additions & 6 deletions datasets/semeval14/laptop_test.raw
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file modified datasets/semeval14/laptop_test.raw.graph
Binary file not shown.
Binary file modified datasets/semeval14/laptop_test.raw.tree
Binary file not shown.
5 changes: 1 addition & 4 deletions datasets/semeval14/laptop_train.raw
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Binary file modified datasets/semeval14/laptop_train.raw.graph
Binary file not shown.
Binary file modified datasets/semeval14/laptop_train.raw.tree
Binary file not shown.
3 changes: 0 additions & 3 deletions datasets/semeval14/restaurant_test.raw
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file modified datasets/semeval14/restaurant_test.raw.graph
Binary file not shown.
Binary file modified datasets/semeval14/restaurant_test.raw.tree
Binary file not shown.
18 changes: 0 additions & 18 deletions datasets/semeval14/restaurant_train.raw
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file modified datasets/semeval14/restaurant_train.raw.graph
Binary file not shown.
Binary file modified datasets/semeval14/restaurant_train.raw.tree
Binary file not shown.
24 changes: 9 additions & 15 deletions datasets/semeval15/restaurant_test.raw
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down Expand Up @@ -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 .
Expand Down Expand Up @@ -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 .
Expand Down Expand Up @@ -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$ .
Expand Down Expand Up @@ -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 .
Expand Down Expand Up @@ -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 .
Expand Down Expand Up @@ -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 .
Expand Down Expand Up @@ -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
Binary file modified datasets/semeval15/restaurant_test.raw.graph
Binary file not shown.
Binary file modified datasets/semeval15/restaurant_test.raw.tree
Binary file not shown.
35 changes: 13 additions & 22 deletions datasets/semeval15/restaurant_train.raw
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down Expand Up @@ -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 .
Expand Down Expand Up @@ -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$ .
Expand Down Expand Up @@ -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 .
Expand Down Expand Up @@ -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 .
Expand Down Expand Up @@ -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 .
Expand Down Expand Up @@ -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 .
Expand Down Expand Up @@ -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 .
Expand All @@ -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 .
Expand Down Expand Up @@ -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 .
Expand Down Expand Up @@ -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 !
Expand Down Expand Up @@ -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 .
Expand Down Expand Up @@ -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
Binary file modified datasets/semeval15/restaurant_train.raw.graph
Binary file not shown.
Binary file modified datasets/semeval15/restaurant_train.raw.tree
Binary file not shown.
Loading