Converting adjectives and adverbs to their noun forms

2024/9/23 23:27:35

I am experimenting with word sense disambiguation using wordnet for my project. As a part of the project, I would like to convert a derived adjective or an adverb form to it's root noun form.

For example

beautiful ==> beauty wonderful ==> wonder

  1. How can I achieve this? Is there any other dict other than wordnet that provides this kind of transformation?

  2. It would be an added bonus for me if I can map the exact sense of the adjective word to its noun form with exact sense. Is that possible?

Thank you

Answer

Search google or SO for terms like 'stemming' and 'lemmatization', these terms might help you get what you are looking for.
For example, go to http://qaa.ath.cx/porter_js_demo.html and enter the words 'beautiful' and 'beauty', and you will see they both stem to the same token.
Porter stemmer essentially removes common suffixes found in the english language, so is by no means definitive, but is a pretty good place to start.
You can consider words that map to the same stem to be in some sense synonymous. If you can procure part of speech tags for all these words as well, you will be able to infer that beauty is the noun form of the adjective beautiful.

https://en.xdnf.cn/q/71768.html

Related Q&A

Sending a packet over physical loopback in scapy

Ive recently discovered Scapy & it looks wonderfulIm trying to look at simple traffic over a physical loopback module / stub on my NIC.But Scapy sniff doesnt give anythingWhat Im doing to send a pa…

Python Perfect Numbers

So I am supposed to write a Python program that will identify and print all the perfect numbers in some closed interval [ 2, n ], one per line. We only have to use nested while loops/ if-else statement…

Counting consecutive 1s in NumPy array

[1, 1, 1, 0, 0, 0, 1, 1, 0, 0]I have a NumPy array consisting of 0s and 1s like above. How can I add all consecutive 1s like below? Any time I encounter a 0, I reset.[1, 2, 3, 0, 0, 0, 1, 2, 0, 0]I ca…

python 3 replacement for dircache?

Before I go reinventing the wheel, can anyone tell me if theres a drop-in (or semi-drop-in) replacement for the single-line statement:allfiles = dircache.listdir(.)

AES_128_CTR encryption by openssl and PyCrypto

Wondering the right way to convert a AES_128_CTR encryption by openssl to PyCrypto.First, I did an encryption by openssl as following:openssl enc -aes-128-ctr -in input.mp4 -out output.openssl.mp4 -K 7…

How can i determine the exact size of a type used by python

>>> sys.getsizeof(int) 436 #? does this mean int occupies 436 bytes .>>> sys.getsizeof(1) 12 #12 bytes for int object, is this the memory requirement.I thought int in python is repre…

Python list.clear complexity [duplicate]

This question already has answers here:Python list.clear() time and space complexity?(4 answers)Closed 2 years ago.What is the complexity of the Python 3 method list.clear() ?It is not given here: ht…

Unresolved import org.python / working with jython and java?

Im using Eclipse and I"m trying to create a java program that can run my python code. Im following the guidelines on this page: http://jythonpodcast.hostjava.net/jythonbook/en/1.0/JythonAndJavaInt…

elegant unpacking variable-length tuples

A real, if silly problem:https://github.com/joshmarshall/tornadorpc/blob/master/tornadorpc/base.pydef start_server(handlers, ...):...for (route, handler) in handlers:...Normally "handlers" is…

Extracting data from a 3D scatter plot in matplotlib

Im writing an interface for making 3D scatter plots in matplotlib, and Id like to access the data from a python script. For a 2D scatter plot, I know the process would be:import numpy as np from matpl…