update spacy-wordnet code example (#8327)

* update spacy-wordnet code example

- include spaCy 2.x and 3.x init alternatives
- upgrade recognai logo

* fix escape chars
This commit is contained in:
Francisco Aranda 2021-06-10 21:53:11 +02:00 committed by GitHub
parent 6d2789452e
commit 0a1a4c665d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2080,14 +2080,17 @@
"description": "`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)",
"github": "recognai/spacy-wordnet",
"tags": ["wordnet", "synsets"],
"thumb": "https://i.imgur.com/3y2uPUv.jpg",
"thumb": "https://i.imgur.com/ud4C7cj.png",
"code_example": [
"import spacy",
"from spacy_wordnet.wordnet_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')",
"# Spacy 3.x",
"nlp.add_pipe(\"spacy_wordnet\", after='tagger', config={'lang': nlp.lang})",
"# Spacy 2.x",
"# 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",