5
$\begingroup$

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!

$\endgroup$
8
  • 1
    $\begingroup$ Sounds like a statistics problem. But sounds like you could use recurrent neural networks $\endgroup$ Commented Apr 10, 2018 at 19:04
  • 1
    $\begingroup$ Is the block of text variable in size? Can you add an example of how the input would look like? $\endgroup$ Commented Apr 10, 2018 at 19:53
  • 1
    $\begingroup$ 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. $\endgroup$
    – TreHoffman
    Commented Apr 10, 2018 at 19:58
  • 1
    $\begingroup$ Sounds like you want to parse it, and not learn it. You could take a look at regular expressions. Here is an example. $\endgroup$ Commented Apr 10, 2018 at 20:06
  • 2
    $\begingroup$ 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 for more info on RNNs. $\endgroup$ Commented Apr 10, 2018 at 20:12

4 Answers 4

0
$\begingroup$

you should definitely check about recurrent-neural networks trained on character level language data. but it make sure you have a relevant dataset.

$\endgroup$
2
0
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ Can you point me to an example of such an implementation that I can base my work around? $\endgroup$
    – TreHoffman
    Commented Oct 19, 2018 at 17:18
0
$\begingroup$

I would suggest you use a sequence to sequence model with character level features. It is an easy task, provided you have data.

$\endgroup$
2
  • $\begingroup$ Can you provide more details in your answer....the answer is too short and can be written as a comment also $\endgroup$
    – user9947
    Commented Aug 10, 2018 at 12:44
  • $\begingroup$ Can you point me to an example of such an implementation that I can base my work around? $\endgroup$
    – TreHoffman
    Commented Oct 19, 2018 at 17:17
0
$\begingroup$

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.
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 that will help you a lot.

$\endgroup$
1
  • $\begingroup$ Can you point me to an example of such an implementation that I can base my work around? $\endgroup$
    – TreHoffman
    Commented Oct 19, 2018 at 17:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .