All Projects → nltk → wordnet

nltk / wordnet

Licence: other
Stand-alone WordNet API

Programming Languages

python
139335 projects - #7 most used programming language
TeX
3793 projects
shell
77523 projects

Projects that are alternatives of or similar to wordnet

NLIDB
Natural Language Interface to DataBases
Stars: ✭ 100 (+156.41%)
Mutual labels:  wordnet
wordhoard
This Python module can be used to obtain antonyms, synonyms, hypernyms, hyponyms, homophones and definitions.
Stars: ✭ 78 (+100%)
Mutual labels:  wordnet
Pattern
Web mining module for Python, with tools for scraping, natural language processing, machine learning, network analysis and visualization.
Stars: ✭ 8,112 (+20700%)
Mutual labels:  wordnet
TurkishWordNet
Turkish WordNet KeNet
Stars: ✭ 32 (-17.95%)
Mutual labels:  wordnet
gf-wordnet
A WordNet in GF
Stars: ✭ 15 (-61.54%)
Mutual labels:  wordnet
LMMS
Language Modelling Makes Sense - WSD (and more) with Contextual Embeddings
Stars: ✭ 79 (+102.56%)
Mutual labels:  wordnet
Hierarchical-Word-Sense-Disambiguation-using-WordNet-Senses
Word Sense Disambiguation using Word Specific models, All word models and Hierarchical models in Tensorflow
Stars: ✭ 33 (-15.38%)
Mutual labels:  wordnet
m3gm
Max-Margin Markov Graph Models for WordNet (EMNLP 2018)
Stars: ✭ 40 (+2.56%)
Mutual labels:  wordnet
NatLang
NatLang is an English parser with an extensible grammar
Stars: ✭ 20 (-48.72%)
Mutual labels:  wordnet
textaugment
TextAugment: Text Augmentation Library
Stars: ✭ 280 (+617.95%)
Mutual labels:  wordnet
Wordbook
Wordbook is a dictionary application built for GNOME.
Stars: ✭ 56 (+43.59%)
Mutual labels:  wordnet
CogNet
CogNet: a large-scale, high-quality cognate database for 338 languages, 1.07M words, and 8.1 million cognates
Stars: ✭ 26 (-33.33%)
Mutual labels:  wordnet
wn
A modern, interlingual wordnet interface for Python
Stars: ✭ 119 (+205.13%)
Mutual labels:  wordnet
ws4j
WordNet Similarity for Java provides an API for several Semantic Relatedness/Similarity algorithms
Stars: ✭ 41 (+5.13%)
Mutual labels:  wordnet

wordnet

Build Status

Notice:

This repository is no longer being maintained. For a standalone Python module for wordnets with a similar API, please see https://github.com/goodmami/wn.

Install

While this project is no longer maintained, you can install the last release (0.0.23) from PyPI as follows:

pip install -U 'wn==0.0.23'

The version number is required because the wn project on PyPI is now used by https://github.com/goodmami/wn. If you're interested in moving to the newer module, see the migration guide.

Use

>>> from wn import WordNet
>>> from wn.info import WordNetInformationContent

>>> from wn.constants import wordnet_30_dir, wordnet_33_dir
>>> wordnet = WordNet(wordnet_30_dir) # Uses WordNet v3.0 to be comparable to NLTK, by default uses v3.3

>>> wordnet.synsets('dog')
[Synset('dog.n.01'), Synset('frump.n.01'), Synset('dog.n.03'), Synset('cad.n.01'), Synset('frank.n.02'), Synset('pawl.n.01'), Synset('andiron.n.01'), Synset('chase.v.01')]

>>> wordnet.synset('dog.n.01')
Synset('dog.n.01')

>>> wordnet.synset('dog.n.01').lemma_names()
['dog', 'domestic_dog', 'Canis_familiaris']

>>> wordnet.synset('dog.n.01').lemma_names(lang='spa')
['can', 'perro']

>>> dog = wordnet.synset('dog.n.01')
>>> cat = wordnet.synset('cat.n.01')

>>> wordnet.path_similarity(dog, cat)
0.2
>>> wordnet.wup_similarity(dog, cat)
0.8571428571428571
>>> wordnet.lch_similarity(dog, cat)
2.0281482472922856


>>> wordnet_ic = WordNetInformationContent(corpus='bnc', resnik=True, add1=True)

>>> wordnet.res_similarity(dog, cat, wordnet_ic)
7.66654127408746
>>> wordnet.jcn_similarity(dog, cat, wordnet_ic)
0.3774428077151209
>>> wordnet.lin_similarity(dog, cat, wordnet_ic)
0.852667348509242

With NLTK

As a comparison, this is the interface from NLTK v3.4.5

>>> from nltk.corpus import wordnet
>>> from nltk.corpus import wordnet_ic

>>> wordnet.synset('dog.n.1').lemma_names()
['dog', 'domestic_dog', 'Canis_familiaris']
>>> wordnet.synset('dog.n.1').lemma_names(lang='spa')
['can', 'perro']

>>> dog = wordnet.synset('dog.n.01')
>>> cat = wordnet.synset('cat.n.01')

>>> wordnet.path_similarity(dog, cat)
0.2
>>> wordnet.wup_similarity(dog, cat)
0.8571428571428571
>>> wordnet.lch_similarity(dog, cat)
2.0281482472922856

>>> ic = wordnet_ic('ic-bnc-resnik-add1.dat')

>>> dog.res_similarity(cat, ic)
7.66654127408746
>>> dog.jcn_similarity(cat, ic)
0.3774428077151209
>>> dog.lin_similarity(cat, ic)
0.852667348509242
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].