thtrieu / qclass_dl Goto Github PK
View Code? Open in Web Editor NEWQuestion classification on TREC dataset using Deep Neural structures, namely CNN & LSTM & both of them.
License: GNU General Public License v3.0
Question classification on TREC dataset using Deep Neural structures, namely CNN & LSTM & both of them.
License: GNU General Public License v3.0
After fix some place caused by different version of tf, I ran lstm model success but only get 84% Valid Acc, What do I missed?
Can you please give a script for testing the trained model for a new question(without a question type) from a console?
Why are you added the output of l2_loss(b) to l2_loss(self.w) ? It didnt make sense to me. Could you please explain what am I missing ?
l2_loss += tf.nn.l2_loss(self.W)
l2_loss += tf.nn.l2_loss(b)
Thanks.
Hi thtrieu:
Your repository is pretty cool and easy to read. But I have a few questions.
# Collect the appropriate last words into variable output (dimension = batch x embedding_size)
output = outputs[0]
one = tf.ones([1, hidden_unit], tf.float32)
with tf.variable_scope("Output"):
tf.get_variable_scope().reuse_variables()
for i in range(1,len(outputs)):
ind = self.real_len < (i+1)
ind = tf.to_float(ind)
ind = tf.expand_dims(ind, -1)
mat = tf.matmul(ind, one)
output = tf.add(tf.mul(output, mat),tf.mul(outputs[i], 1.0 - mat))
I am not sure why you do these step. Can you explain some detail about it please?
By the way, when I try to remove these lines, just use output = outputs[-1]
, I get terrible result. I guess output = outputs[-1]
my be the output of <PAD/>
word. So my result is terrible. Am I right?
Hello Sir, when i'm trying to run your program n Phyton 3, it gives me errors in this function.
def add_unknown_words(word_vecs, vocab, min_df=0, k=300):
"""
0.25 is chosen so the unknown vectors have (approximately) same variance as pre-trained ones
"""
count = 0
for word in vocab:
if word not in word_vecs and vocab[word] >= min_df:
word_vecs[word] = np.random.uniform(-0.25, 0.25, k)
else:
count += 1
return count
But when I'm trying to run on Python 3.6 it doesn't work and it makes the following errors. What should I change to run it on Python 3. Thanks
Traceback (most recent call last):
File "/Users/apple-PC/PycharmProjects/qclass_dl/train_cnn.py", line 56, in
count = data_helpers.add_unknown_words(trained_vecs, vocabulary)
File "/Users/apple-PC/PycharmProjects/qclass_dl/data_helpers.py", line 178, in add_unknown_words
word_vecs[word] = np.random.uniform(-0.25, 0.25, k)
TypeError: list indices must be integers or slices, not str
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.