WordNet - What does n and the number represent?

2024/10/13 19:18:47

My question is related to WordNet Interface.

   >>> wn.synsets('cat')[Synset('cat.n.01'), Synset('guy.n.01'), Synset('cat.n.03'),Synset('kat.n.01'), Synset('cat-o'-nine-tails.n.01'), Synset('caterpillar.n.02'), Synset('big_cat.n.01'), Synset('computerized_tomography.n.01'), Synset('cat.v.01'), Synset('vomit.v.01')]>>> 

I could not find the answer to what is the purpose of n and the following number in cat.n.01 or caterpillar.n.02.

Answer

Per the NLTK docs, a <lemma>.<pos>.<number> Synset string is composed of the following parts:

  • <lemma> is the word’s morphological stem
  • <pos> is one of the module attributes ADJ, ADJ_SAT, ADV, NOUN or VERB
  • <number> is the sense number, counting from 0

Thus, the <pos> is the part of speech. According to the wordnet man page, the part of speech character has the following meaning:

n    NOUN
v    VERB
a    ADJECTIVE
s    ADJECTIVE SATELLITE
r    ADVERB 

The <number> is used to disambiguate word meanings.

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

Related Q&A

How to change the values of a column based on two conditions in Python

I have a dataset where I have the time in a game and the time of an event. EVENT GAME0:34 0:43NaN 0:232:34 3:43NaN 4:50I want to replace the NaN in the EVENT column where GAME…

logging module for python reports incorrect timezone under cygwin

I am running python script that uses logging module under cygwin on Windows 7. The date command reports correct time:$ date Tue, Aug 14, 2012 2:47:49 PMHowever, the python script is five hours off:201…

Set ordering of Apps and models in Django admin dashboard

By default, the Django admin dashboard looks like this for me:I want to change the ordering of models in Profile section, so by using codes from here and here I was able to change the ordering of model…

python database / sql programming - where to start

What is the best way to use an embedded database, say sqlite in Python:Should be small footprint. Im only needing few thousands records per table. And just a handful of tables per database. If its one …

How to install Python 3.5 on Raspbian Jessie

I need to install Python 3.5+ on Rasbian (Debian for the Raspberry Pi). Currently only version 3.4 is supported. For the sources I want to compile I have to install:sudo apt-get install -y python3 pyth…

Django - last insert id

I cant get the last insert id like I usually do and Im not sure why.In my view:comment = Comments( ...) comment.save() comment.id #returns NoneIn my Model:class Comments(models.Model):id = models.Integ…

How to check if default value for python function argument is set using inspect?

Im trying to identify the parameters of a function for which default values are not set. Im using inspect.signature(func).parameters.value() function which gives a list of function parameters. Since Im…

OpenCV-Python cv2.CV_CAP_PROP_POS_FRAMES error

Currently, I am using opencv 3.1.0, and I encountered the following error when executing the following code:post_frame = cap.get(cv2.CV_CAP_PROP_POS_FRAMES)I got the following error Message:File "…

How to get the total number of tests passed, failed and skipped from pytest

How can I get to the statistics information of a test session in pytest?Ive tried to define pytest_sessionfinish in the conftest.py file, but I only see testsfailed and testscollected attributes on th…

Tensorflow ArgumentError Running CIFAR-10 example

I am trying to run the CIFAR-10 example of Tensorflow. However when executing python cifar10.py I am getting the error attached below. I have installed Version 0.6.0 of the Tensorflow package using pip…