Data Science Asked by Liza Savenko on April 27, 2021
My task is to connect 2-3 parts of the sentence into one whole using a preposition
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.
Examples:
[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
The traditional approach for this kind of problem would be an n-gram language model. The language model is trained on a large corpus, then it's reasonably simple to calculate the most likely missing tokens for any incomplete sentence. SRILM was one of the most common toolkits, but there are probably many other libraries.
Answered by Erwan on April 27, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP