Answers.Body: <p>As Andreas has commented this is a problem of statistical language model (a probability distribution over a sequence of words). The important thing you need is a hash table mapping fixed-length to the expected ending chains of words in your dictionary.<br>
  Things that can make your prediction better:<br></p>
  
  <ul>
  <li>Add better and more words to your dictionary.</li>
  <li>Use text expansion.</li>
  </ul>
  
  <p>What you are looking for will require a pinch of Reinforcement Learning too. You need to figure out a way to penalize and award the predictions and then use the result in future. Your case also requires you to build your own corpus, which is the hardest part. If your corpus is good, it will give better results.<br>
  This is the <a href="http://www.stats.ox.ac.uk/~teh/research/compling/WooGasArc2011a.pdf" rel="nofollow noreferrer">research paper</a> that will help you a lot.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-19T17:18:00.843Z
Answers.Text: Can you point me to an example of such an implementation that I can base my work around?
Answers.UserDisplayName: TreHoffman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-09T08:07:49.907Z
Answers.LastActivityDate: 2018-09-09T08:07:49.907Z
Answers.UserDisplayName: Ugnes
Answers.Body: <p>I would also suggest character level Recurrent neural nets but with Normal Char level RNN we can only predict next chars based on previous chars so you should consider it to be bidirectional RNN because say we have text "xxx12345" basically if we feed this to our model our model should predict first three places based on last places ( in DL they call it as going back through time) and this is possible only by Bidirectional RNN.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-19T17:18:16.493Z
Answers.Text: Can you point me to an example of such an implementation that I can base my work around?
Answers.UserDisplayName: TreHoffman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-08T17:44:04.587Z
Answers.LastActivityDate: 2018-06-08T17:44:04.587Z
Answers.UserDisplayName: koushik
Answers.Body: <p>you should definitely check about recurrent-neural networks trained on character level language data. but it make sure you have a relevant dataset.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-19T17:17:25.787Z
Answers.Text: Can you point me to an example of such an implementation that I can base my work around?
Answers.UserDisplayName: TreHoffman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-22T04:27:48.097Z
Answers.Text: https://github.com/karpathy/char-rnn
Answers.UserDisplayName: thecomplexitytheorist
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-01T21:30:47.447Z
Answers.LastActivityDate: 2018-06-01T21:30:47.447Z
Answers.UserDisplayName: thecomplexitytheorist
Answers.Body: <p>I would suggest you use a sequence to sequence model with character level features. It is an easy task, provided you have data.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-19T17:17:38.087Z
Answers.Text: Can you point me to an example of such an implementation that I can base my work around?
Answers.UserDisplayName: TreHoffman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-10T04:55:24.193Z
Answers.LastActivityDate: 2018-08-10T04:55:24.193Z
Answers.UserDisplayName: Patel Sunil
Body: <p>I want to be able to input a block of text and then have it guess a string within a predefined range (i.e. a string that starts with three letters and ends with five numbers like "XXX12345", etc).  Ideally, the string it will be guessing will be somewhere in the block of text, but sometimes it won't be.</p>
  
  <p>I have been struggling where to begin on this or if I am even going in the right direction for considering Machine/Deep learning to try to do this.</p>
  
  <p>Help!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-10T19:04:17.623Z
Comments.Text: Sounds like a statistics problem. But sounds like you _could_  use recurrent neural networks
Comments.UserDisplayName: Andreas Storvik Strauman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-10T19:53:20.733Z
Comments.Text: Is the block of text variable in size? Can you add an example of how the input would look like?
Comments.UserDisplayName: Andreas Storvik Strauman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-10T19:58:23.650Z
Comments.Text: Yeah the block of text would be variable in size.  An example would be something like:
  
  **hello my name is richard cheese.
  XXX12345
  12345 Fake Street
  Faketown, FakeState USA**
  
  or
  
  **XXX12345 is my handle.  my interests are posting on stackoverflow and drinking myself into a coma.  look forward to hearing from you!**
  
  ...basically want a neural network to pick out the "handle" from any block of text that is given to it.
Comments.UserDisplayName: TreHoffman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-10T20:06:37.560Z
Comments.Text: Sounds like you want to parse it, and not learn it. You could take a look at regular expressions. [Here is an example](https://regex101.com/r/dAVd8E/1).
Comments.UserDisplayName: Andreas Storvik Strauman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-10T20:09:37.820Z
Comments.Text: Yes, that's what I've been using for this kind of stuff, but I was hoping that using a neural network would make it so that the handle could be identified even if the handle was misspelled or omitted entirely from the block of text as long as it had enough training.  Do you think what I'm asking is feasible?
Comments.UserDisplayName: TreHoffman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-10T20:12:38.273Z
Comments.Text: Honestly, I don't know. I do suspect that there are better ways of doing this with more accuracy. It would heavily depend on the training data, and what misspellings you teach the algorithm. If you really want to use DL, I still stand by RNNs being your best choice here, since they can pick up "context". Check out [colah's blog](http://colah.github.io/posts/2015-08-Understanding-LSTMs/) for more info on RNNs.
Comments.UserDisplayName: Andreas Storvik Strauman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-11T13:37:30.593Z
Comments.Text: My initial plan was to modify this [demo](http://caza.la/synaptic/#/wikipedia) to fit my needs, but I'm unsure how to do so.
Comments.UserDisplayName: TreHoffman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-11T13:41:08.007Z
Comments.Text: This makes more sense now! I'll answer when I have time (if no one else did so first :) )
Comments.UserDisplayName: Andreas Storvik Strauman
Tags: <neural-networks><machine-learning><deep-learning><long-short-term-memory><text-summarization>
Title: Use Machine/Deep Learning to Guess a String
UserDisplayName: TreHoffman
ThreadText: # Use Machine/Deep Learning to Guess a String
  
  (Asked by: username_0 on 2018-04-10)
  
  I want to be able to input a block of text and then have it guess a string within a predefined range (i.e. a string that starts with three letters and ends with five numbers like "XXX12345", etc). Ideally, the string it will be guessing will be somewhere in the block of text, but sometimes it won't be.
  
  I have been struggling where to begin on this or if I am even going in the right direction for considering Machine/Deep learning to try to do this.
  
  Help!
  
  **Tags:** neural-networks, machine-learning, deep-learning, long-short-term-memory, text-summarization
  
  > **Comments:**
  > **username_1**: Sounds like a statistics problem. But sounds like you _could_  use recurrent neural networks  
  > **username_1**: Is the block of text variable in size? Can you add an example of how the input would look like?  
  > **username_0**: Yeah the block of text would be variable in size.  An example would be something like:  **hello my name is richard cheese. XXX12345 12345 Fake Street Faketown, FakeState USA**  or  **XXX12345 is my handle.  my interests are posting on stackoverflow and drinking myself into a coma.  look forward to hearing from you!**  ...basically want a neural network to pick out the "handle" from any block of text that is given to it.  
  > **username_1**: Sounds like you want to parse it, and not learn it. You could take a look at regular expressions. [Here is an example](https://regex101.com/r/dAVd8E/1).  
  > **username_0**: Yes, that's what I've been using for this kind of stuff, but I was hoping that using a neural network would make it so that the handle could be identified even if the handle was misspelled or omitted entirely from the block of text as long as it had enough training.  Do you think what I'm asking is feasible?  
  > **username_1**: Honestly, I don't know. I do suspect that there are better ways of doing this with more accuracy. It would heavily depend on the training data, and what misspellings you teach the algorithm. If you really want to use DL, I still stand by RNNs being your best choice here, since they can pick up "context". Check out [colah's blog](http://colah.github.io/posts/2015-08-Understanding-LSTMs/) for more info on RNNs.  
  > **username_0**: My initial plan was to modify this [demo](http://caza.la/synaptic/#/wikipedia) to fit my needs, but I'm unsure how to do so.  
  > **username_1**: This makes more sense now! I'll answer when I have time (if no one else did so first :) )  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_2 on 2018-09-09. Score: 0
  
  As username_1 has commented this is a problem of statistical language model (a probability distribution over a sequence of words). The important thing you need is a hash table mapping fixed-length to the expected ending chains of words in your dictionary.  
  Things that can make your prediction better:
  
  * Add better and more words to your dictionary.
  * Use text expansion.
  
  What you are looking for will require a pinch of Reinforcement Learning too. You need to figure out a way to penalize and award the predictions and then use the result in future. Your case also requires you to build your own corpus, which is the hardest part. If your corpus is good, it will give better results.  
  This is the [research paper](http://www.stats.ox.ac.uk/~teh/research/compling/WooGasArc2011a.pdf) that will help you a lot.
  
  > **Comments:**
  > **username_0**: Can you point me to an example of such an implementation that I can base my work around?  
  
  ---
  
  ### Answer by username_3 on 2018-06-08. Score: 0
  
  I would also suggest character level Recurrent neural nets but with Normal Char level RNN we can only predict next chars based on previous chars so you should consider it to be bidirectional RNN because say we have text "xxx12345" basically if we feed this to our model our model should predict first three places based on last places ( in DL they call it as going back through time) and this is possible only by Bidirectional RNN.
  
  > **Comments:**
  > **username_0**: Can you point me to an example of such an implementation that I can base my work around?  
  
  ---
  
  ### Answer by username_4 on 2018-06-01. Score: 0
  
  you should definitely check about recurrent-neural networks trained on character level language data. but it make sure you have a relevant dataset.
  
  > **Comments:**
  > **username_0**: Can you point me to an example of such an implementation that I can base my work around?  
  > **username_4**: https://github.com/karpathy/char-rnn  
  
  ---
  
  ### Answer by username_5 on 2018-08-10. Score: 0
  
  I would suggest you use a sequence to sequence model with character level features. It is an easy task, provided you have data.
  
  > **Comments:**
  > **username_0**: Can you point me to an example of such an implementation that I can base my work around?  
  
  ---
  
  