Comments (1)
words_used_in_sent = tf.sign(tf.reduce_max(tf.abs(self.input_data), reduction_indices=2))
the input data sentences contains variable sentence lengths. Hence the sentences are 0 padded to fixed length. Basically words_used_in_sent is a variable which transforms None * sentence_size * num_words into None * sentence_size. NOTE: None is number of sentences or batch size.
So the words_used_in_sent is actually a matrix of 0s and 1s. It is 1 if the word is actually present in the sentence or 0 if it is a 0 padded word.
This is just a hacked tensorflow statement to do just that, if u dont understand clearly try substituting and check.
self.length = tf.cast(tf.reduce_sum(words_used_in_sent, reduction_indices=1), tf.int32)
This statement just reduces the 01 matrix to compute the length of each sentence.
from ner-lstm.
Related Issues (20)
- get_conll_embeddings.py question HOT 1
- 'bidirectional_rnn' question HOT 8
- output trained NERs HOT 1
- "key error" while generating conll embeddings HOT 1
- Cost function HOT 2
- How to run this project
- Dropout shoud be 1 during test time.
- Glove error vector.txt not found HOT 1
- ValueError: setting an array element with a sequence. HOT 1
- Configurations on local machine HOT 1
- test data is labeled and is in iob format
- how to generate training data to train our custom ner ? HOT 1
- this cannot support tensorflow1.3 HOT 2
- Want to print prediction of unclassified text
- the F1-Score of CoNLL 2003 English dataset HOT 2
- can you provide source for Hindi training dataset? HOT 1
- how to run ? HOT 1
- use of NER HOT 1
- error HOT 1
- ICON execution problems
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ner-lstm.