I wish to create a system where I give a sentence and the system spits out sentences similar in meaning to the input sentence I gave
Asked Answered
D

3

8

This is an NLP problem and I was wondering how I should proceed.

How difficult is the problem? Could I replace the word with synonyms and check that the grammar is correct?

Debag answered 24/2, 2014 at 14:3 Comment(1)
Synonym replacement is not hard at all, as long as you are staying clear of idiomatic usages and phrasal verbs. Going beyond that to generate semantically similar sentences is, in short, extremely difficult.Silverts
L
5

Replacing words with synonyms is probably the first thing to try, but be careful not to miss multiple words expressions and idioms. Also, make sure you choose a synonym with the same part of speech.

they look for a good solution < ! > they view/stare/... for a good solution

they work hard < ! > they job/task/… hard

More complicated rephrasing is only possible if you use some level of grammatical analysis. You should at least recognize constituents within a sentence.

Here are some examples for rephrasing which take into consideration the grammatical structure of the sentence:

the dog ate my homework < > my homework was eaten by the dog (passivisation)

the bone of the dog was stolen < > the dog’s bone was stolen (possessive rephrasing)

she sent him a letter < > she sent a letter to him (verb complements replacing)

my name is Bond < > Bond is my name (copular)

the cat ate the cake < > it was the cat who ate the cake (cleft)

Have a look at Contextors API and its Voice Conjugator

Lymphangitis answered 24/2, 2014 at 20:16 Comment(3)
Contextors API and Voice Conjugator links are giving me 404 not found today.Talkington
Are there alternate links or APIs we can look at?Talkington
You ca try paid API like SpinRewriter or WorAIBucci
G
3

This is a very difficult problem, and it seems to be off the radar of common NLP SOTA models, or at least I could not find any benchmark that tests for it.

One way of getting similar sentences is by translating your sentence in a different language and then translate it back, e.g. English -> German -> English. That often switches words or even sentence structure.

Georgettageorgette answered 30/4, 2020 at 6:5 Comment(0)
R
1

You should start by programming easy structures by yourself, doing something called sentence transformation, then make your system available for free and with the option of adding more combinations or alternative structures which convey a similar meaning to the original sentence but using different parts of speech as well as grammatical structures.

for instance, you could write an original sentence into your system such as,

The angry mob did not let the cars pass until the police came.

Then another user of your system will help to rewrite the sentence with a different structure but a similar meaning, rephrasing or using the appropriate parts of speech as your system specifies, the more users sign up to your system or download and use the app, the more options will come out after someone types a sentence and expects another one with a similar meaning to the input sentence you, or anyone had given.

The cars were not allowed to pass by the angry mob until the police came.

it is easier if people work together collaborating in your project than if you try to create it by your self or write all of the sorts of sentences that can be rephrased.

Other examples;

User 1 - I had never tasted Mexican food before.

User 89 - It is the first time I had tasted Mexican Food.

User 76 - Rachell was determined to pay for our drinks.

User 532 - Rachell insisted on paying for our drinks.

User 976 - I prefer to arrive 15 min before.

User 3465 - I would rather arrive 15 min before.

Good luck with your system, let me know how it goes!

Rehnberg answered 22/2, 2019 at 7:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.