Predicting text with neural networks

1 visualización (últimos 30 días)
Philip G
Philip G el 13 de Abr. de 2017
Comentada: Philip G el 20 de Abr. de 2017
Hi, I have worked with standard fitting and classification networks as well as convolutional networks so far. But now I am stuck with a problem and maybe you can steer me towards the right direction.
In general I want to predict text. As input I have a very long text available. So 26 letters + spaces + some symbols. Lets say 30 parameters. My idea was the following, using standard feed forward networks:
  • Hot-One-Encode the letters to create 30 classes (lets call them C)
  • Cut the text into N pieces of length L (5 for example) with a sliding window
  • use each piece as one sample (of size L x C)
  • and then use the following letter as an output (of size 1 x C)
  • for example: The text says "alphabet" - this gives input "alpha" + output "b", input "lphab" + output "e", and so on
  • finally the network could be used step by step to predict letters
For this strategy one problem I encountered was, that the size of the input is L x C. And squeezing it into an array did not yield proper results.
I assume for this task, a RNN ( layrecnet ) or Nonlinear autoregressive neural network ( narnet ) might be a lot easier to use, as for the latter one - the whole text would be the input vector and no output vector is needed. As I am not very experienced with time-series networks ... maybe some of you can give me a hint what architecture to use - or how I could modify the decribed network to perform this task. Thanks.
  1 comentario
Philip G
Philip G el 20 de Abr. de 2017
Is anything unclear? Also my last questions here did not get any answers ... and if even questions like "i have 2 cell - how can i combine them?!" get answers ... I think I am doing something wrong ;)
Just links to the topic would also help me. Thanks in advance.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by