My task is to connect 2-3 parts of the sentence into one whole using a preposition
- the first part is some kind of action. Ex. "take pictures"
- the second part is an object that can consist of only one noun or a noun with adjectives and additions dependent on it. Ex. "juicy cherry pie", "squirrel"
- the third part is a place. Ex. "room", "London"
To solve this task I've already tried some options such as generation using GPT-2 (or other networks like LSTM) and using grammar rules, but both of them didn't work as well as I want.
Using GPT-2 needs a lot of resources and performance, which is very expensive on the server. Ordinary neural networks aren't good enough and often generate bad results. And it is also impossible to describe all cases using only grammar rules.
Are there any approaches how you can implement a solution to this problem without using transformers or grammatical rules, so that the model isn't too heavy and at the same time effective?
There may be several options for prepositions, the main thing is that they are used.
P.s. a good option was to use n-grams, but it is not clear how to work with it when the second part is long.
[Pour, juice, boiler room] -> Pour the juice into the boiler room
[Go, theater] -> Go to the theater
[Learn the history, ballet] -> Learn the history of ballet