Skip to main content

Add a short description here!

Project description

# Spacy wordnet annotator

`spacy-wordnet` creates annotations that easily allow the use of wordnet
and [wordnet domains](http://wndomains.fbk.eu/) by using
the [nltk wordnet interface](http://www.nltk.org/howto/wordnet.html)




## Install

````bash
pip install spacy-wordnet
````

## Requirements
Some nltk data must be installed before using this package

````bash
python -m nltk.downloader wordnet
python -m nltk.downloader omw

````

## Usage

````python

import spacy

from spacy_wordnet.wornet_annotator import WordnetAnnotator

# Load an spacy model (supported models are "es" and "en")
nlp = spacy.load('en')
nlp.add_pipe(WordnetAnnotator(nlp.lang), after='tagger')
token = nlp('prices')[0]

# wordnet object link spacy token with nltk wordnet interface by giving acces to
# synsets and lemmas
token._.wordnet.synsets()
token._.wordnet.lemmas()

# And automatically tags with wordnet domains
token._.wordnet.wordnet_domains()

````

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spacy-wordnet-0.0.1.tar.gz (83.9 kB view details)

Uploaded Source

File details

Details for the file spacy-wordnet-0.0.1.tar.gz.

File metadata

  • Download URL: spacy-wordnet-0.0.1.tar.gz
  • Upload date:
  • Size: 83.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for spacy-wordnet-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c30c70f3b01c013243ecf31cc80ffb6330bdadac5b82d53d65c701f8f28fae00
MD5 44b8fb5bcc9c8af9b229d9caeb5ea0f9
BLAKE2b-256 f18ee85da0ed4bdccfbb42234de6da25fec3ad4ac261ec5fe30d1d1804ba102e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page