shenxiul / aspect-sentiment

CS224D course project
9 stars 4 forks source link

Modifying the code of TreeLSTM for a label at each node #1

Open ankitp94 opened 8 years ago

ankitp94 commented 8 years ago

I am trying to give the same label to top logN nodes of tree, as of whole sentence. How the grad equations will change for this new case ?

I am trying to use LSTM for author identification. I have got some results with single label for each sentence and I think the results will improve after replicating the label to some depth. Any help would be appreciated. My fork is here. There are some minor changes to do author identification for each sentence.

shenxiul commented 8 years ago

Sorry for not watching it for a while. It's fairly easy to add labels in non-root nodes, just add output layers in the nodes you are interested in. We didn't do that because the intuition for doing this was tackling vanishing gradient problem, but we are tackling it by LSTM. Anyway it is definitely worth to try. Especially, for your specific case, adding multiple labels down the tree makes even more sense.

You can find a (hopefully) more comprehensive model introduction in http://cs224d.stanford.edu/reports/LiuShenxiu.pdf for our model. And previous literature Himabindu Lakkaraju, Richard Socher, Chris Manning. Aspect Specific Sentiment Analysis using Hierarchical Deep Learning also elaborates exactly your idea.

I guess my code is absolutely far from perfect, if you meet any further problem, please don't hesitate to ask and I am ready for help :)