I am working on Natural Language Generation project.
I've created bag of words from paragraph,like nouns,verbs,adjectives.etc
and I am trying to generate sentence of pattern Subject+verb+object.
Example:
- Noun: Elizabeth, Dog, Eiffel Tower, Bike
- Verb: Sings, barks, shines
- Current output: Elizabeth shines, Eiffel Tower barks, Bike sings ..etc
- Expected pairs: Elizabeth sings, Dog barks, Eiffel Tower shines, Bike shines
Subject and verbs must have a relation which will create a meaningful sentence.Is there any way to establish relation between nouns and probable verbs to generate subject+verb pattern?
Also If we have verbs then to find probable objects using input corpus to generate new meaningful sentences?
Example:
- Verb: riding, reading
- Objects: horse,bike, books,novels.
- Expected pairs: riding horse,riding bike, reading books,reading novels.
Let's think about it this way. There are certain acts like barking and singing that could only be done by animate beings, thus a bike, an inanimate object, cannot sing. Also, barking is done by an animal, i.e, a human cannot be the one who does the act of barking. So let's define certain features for each one of our constituents. For instance:
When you run this you get:
Same goes for pairing verbs with suitable objects. You simply have to assign proper features to your pairs.