Skip to content

Instantly share code, notes, and snippets.

@JakubMifek JakubMifek/
Created Apr 15, 2019

What would you like to do?



  • forms
  • lemmas
  • tags

We have sentences and want to predict classes (nouns, verbs, ..)

  • we can specify mask which specifies number of words in sentence and "disables" parts of NN which will not be used (since we have less data). This will influence even the loss function
  • 1 for used place, 0 for not used (tf.keras.layers.Masking)
  • we want to use word embedding - not word ids (embedding layer - tf.keras.layers.Embedding)
  • mask_zero = True - all words with ID zero will be omitted (immitates the mask)
  • we need to change dimension of golden data to 3D (X x Y x 1)

Morpho with CNN

  • instead of 3D matrix with words (sentences) we use charseqs-ids:

and then batch refers this map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.