sapruash / recursivenn Goto Github PK
View Code? Open in Web Editor NEWTensorflow implementation of Recursive Neural Networks using LSTM units
Tensorflow implementation of Recursive Neural Networks using LSTM units
Since some words' labels may be -1,
in def extract_batch_tree_data from tf_data_utils,
labels_arr.fill(-1) may be not reasonable.(in line 185)
I am appreciated for your reply.
Hello,
In the code, it looks like the files that need to be read are "vocab-cased.txt", "trainsents.txt", "testsents.txt", etc (see below). However, when I download the dataset from http://nlp.stanford.edu/sentiment/index.html (three links on the right hand side), I don't see those files in any of the downloads. Can you kindly point me to where I need to pick the correct set of files? Thanks a ton.
`def load_sentiment_treebank(data_dir,fine_grained):
voc=Vocab(os.path.join(data_dir,'vocab-cased.txt'))
split_paths={}
for split in ['train','test','dev']:
split_paths[split]=os.path.join(data_dir,split)
fnlist=[tNode.encodetokens,tNode.relabel]
arglist=[voc.encode,fine_grained]
#fnlist,arglist=[tNode.relabel],[fine_grained]
data={}
for split,path in split_paths.iteritems():
sentencepath=os.path.join(path,'sents.txt')
treepath=os.path.join(path,'parents.txt')
labelpath=os.path.join(path,'labels.txt')
trees=parse_trees(sentencepath,treepath,labelpath)
if not fine_grained:
trees=[tree for tree in trees if tree.label != 0]
trees = [(processTree(tree,fnlist,arglist),tree.label) for tree in trees]
data[split]=trees
return data,voc`
I get the error about various input data shape ! how is the static computation graph supposed to handle this issue? I taught that I have to use a dynamic computation graph provided in TensorFlow fold and PyTorch for these kinds of tasks. The error I get is this :
(0) Invalid argument: Shapes of all inputs must match: values[0].shape = [17] != values[2].shape = [23] [[node stack (defined at C:\Users\RAKA\Documents\tree_lstm\HSR_tree_lstm\tree_structured_lstm.py:150) ]]
line 150 :
batch_loss = tf.stack(outloss)
Hi, thank you for sharing this code! I wonder if you could point out/explain a bit which part of the code I would need to change to use the SICK dataset? Thank you so much.
Kurt
I just found your code while trying to understand the paper and was wondering if you could help me.
In section 4.2, it is said that the first step in investigating relatedness between two sentences is to produce sentence representations of HL and HR using a Tree-LSTM model over each sentence's parse tree. Afterwards, another neural network is introduced which uses the angle and distance of the obtained sentence representation pairs.
My question would be how exactly are the HL and HR obtained using the Tree-LSTM model?
Section 5.2 also mentions a produced constituency parse using PCFG, how is this used with the Tree-LSTM?
What is the license of the code present in this repository?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.