Skip to content

Instantly share code, notes, and snippets.

@JakubMifek
Created April 15, 2019 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JakubMifek/392d91b25e0fc202e32def1c5ffaa5d3 to your computer and use it in GitHub Desktop.
Save JakubMifek/392d91b25e0fc202e32def1c5ffaa5d3 to your computer and use it in GitHub Desktop.

Morpho

Batch:

  • 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:
Ixxxxx
wantxx
toxxxx
goxxxx
Prague

and then batch refers this map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment