How to get Synonym for small sentence using Python NodeJS Java

0 votes

I'd want to find synonyms for short sentences. I'm not sure how I'm going to accomplish it.

My wordnet python code looks like this:

from nltk.corpus import wordnet as wn
print(wn.synsets('work'))

Then i will get some synonyms returned like this:

employment, work, exercise etc...

But can i get the synonyms for some small sentences like "not working", "not feeling well"

Example I am expecting synonym for "not working" as-- faulty, not functioning etc.. Is there any libraries available to do that? I have tried using SimpleNLG but its not helping my case.

Jun 13, 2022 in Node-js by Vaani
• 7,070 points
686 views

1 answer to this question.

0 votes
Compound words are supported by WordNet, however they are largely nouns. For example, the entry for faulty only comprises the words "defective" and "imperfect." It does not contain the words "not working" or "not operating."

However, you might be able to locate them by using antonyms and then just adding "not" before them? This answer illustrates how to use NLTK to obtain adjectival antonyms from WordNet: https://stackoverflow.com/a/24199627/841830.

It's a bit hazardous because you won't know whether "not" is widely used to negate that adjective, and you could wind up with some odd language. "Not nonabsorbent," for example. (Some corpus analysis can help you figure out how popular the compounds you make from antonyms are.)
answered Jun 13, 2022 by Neha
• 9,020 points

Related Questions In Node-js

0 votes
1 answer

How to extract request http headers from a request using NodeJS connect?

Hello @kartik, To see a list of HTTP ...READ MORE

answered Jul 15, 2020 in Node-js by Niroj
• 82,840 points
23,294 views
0 votes
1 answer

How to get the _id of inserted document in Mongo database in NodeJS?

Hello @kartik, A shorter way than using second ...READ MORE

answered Sep 7, 2020 in Node-js by Niroj
• 82,840 points
13,790 views
0 votes
1 answer

How to get path from the request in nodejs?

Hello @kartik, Try this out: var http = require('http'); var ...READ MORE

answered Oct 14, 2020 in Node-js by Niroj
• 82,840 points
4,537 views
0 votes
1 answer

How to run shell script file using nodejs?

Hello @kartik, You could use "child process" module ...READ MORE

answered Oct 16, 2020 in Node-js by Niroj
• 82,840 points
9,534 views
0 votes
1 answer
0 votes
1 answer

How to set different destinations in nodejs using multer?

With multer 1.2.1. You need to use DiskStorage to specify where & how of the ...READ MORE

answered Jun 13, 2022 in Node-js by Neha
• 9,020 points
5,623 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to schedule a google meet and get the meet link in NodeJs?

To create a Google Meet, you'll need ...READ MORE

answered May 27, 2022 in Node-js by Neha
• 9,020 points
3,904 views
0 votes
1 answer

How to use pino-transport in nodejs for logs?

Ensure that you have a recent version ...READ MORE

answered Jun 9, 2022 in Node-js by Neha
• 9,020 points
5,286 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP