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 in Node-js by Vaani
• 7,020 points
51 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 by Neha
• 8,740 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,740 points
14,509 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,740 points
8,477 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,740 points
2,359 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,740 points
4,530 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 in Node-js by Neha
• 8,740 points
139 views
0 votes
1 answer
0 votes
1 answer
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 in Node-js by Neha
• 8,740 points
251 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP