florishoogenboom / keras-han-for-docla Goto Github PK
View Code? Open in Web Editor NEWAn implementation of Hierchical Attention Networks for Document Classification in Keras.
License: MIT License
An implementation of Hierchical Attention Networks for Document Classification in Keras.
License: MIT License
WARNING:tensorflow:
The following Variables were used a Lambda layer's call (lambda_4), but
are not present in its tracked objects:
<tf.Variable 'sentence_attention/W:0' shape=(100, 100) dtype=float32>
<tf.Variable 'sentence_attention/context_vector:0' shape=(100, 1) dtype=float32>
It is possible that this is intended behavior, but it is more likely
an omission. This is a strong indication that this layer should be
formulated as a subclassed Layer rather than a Lambda layer.
Hi, how do I predict with the model?
Tried this but didn't work
print('Test...')
test_data = pd.read_csv('C:/Users/UOU/Desktop/ebifolder/mpm/keras-han-for-docla/trialdata/testData.tsv', sep='\t')
test_data = test_data['review'].values
result = han_model.predict(test_data)
from keras_han.models import HAN
Should be changed for
from keras_han.model import HAN
This is the error I got
TypeError Traceback (most recent call last)
in
132 # Load the embeddings from a file
133 embeddings = {}
--> 134 with open('C:/Users/UOU/Desktop/ebifolder/mpm/keras-han-for-docla/trialdata/glove.6B.100d.txt' % GLOVE_DIM, encoding='utf-8') as file:
135 for line in file:
136 values = line.split()
TypeError: not all arguments converted during string formatting
Any ideas?
Hello and thanks for sharing your code!
I have a question, what do the input layers represent in this model? I think the first input represents the word indexes, so in that case what does input_2 represent? Is it the encoded states of the sentences? In that case shouldn't it be a float?
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.