I have a simple neural-network which can create new text out of words which are likely to come after a specific word.

The code lacks of comma placement and punctuation.

It also can't transform a sentence into a question.

The code has the following steps:

  • Read the training texts
  • Create the network out the above explained parts
  • Create the new text out of a "Start-Word" e.g. "We" or "I"

I need a approach on how to implement the comma placement and punctuation and optional is to transform a sentence into a question.

Is there a specific schema on how to determine the correct position of a dot?

Example:

The dog sits in front of the house George is inside the house

有帮助吗?

解决方案

Treat commas, periods and other forms of interpunctuation as if they were words. That allows you to train the neural network to learn when it is appropriate to end a sentence with a period or insert a comma. "End of text" should also be a "word" the neural network should learn to use appropriately.

Turning a statement into a question is a task which is different from generating a text. So you might want to train a separate neural network to do that. Feed it with an appropriate training set of statements and their corresponding questions.

许可以下: CC-BY-SA归因
scroll top