mirror of https://github.com/explosion/spaCy.git
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:
parent
6d2789452e
commit
0a1a4c665d
|
@ -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)",
|
"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",
|
"github": "recognai/spacy-wordnet",
|
||||||
"tags": ["wordnet", "synsets"],
|
"tags": ["wordnet", "synsets"],
|
||||||
"thumb": "https://i.imgur.com/3y2uPUv.jpg",
|
"thumb": "https://i.imgur.com/ud4C7cj.png",
|
||||||
"code_example": [
|
"code_example": [
|
||||||
"import spacy",
|
"import spacy",
|
||||||
"from spacy_wordnet.wordnet_annotator import WordnetAnnotator ",
|
"from spacy_wordnet.wordnet_annotator import WordnetAnnotator ",
|
||||||
"",
|
"",
|
||||||
"# Load an spacy model (supported models are \"es\" and \"en\") ",
|
"# Load an spacy model (supported models are \"es\" and \"en\") ",
|
||||||
"nlp = spacy.load('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]",
|
"token = nlp('prices')[0]",
|
||||||
"",
|
"",
|
||||||
"# wordnet object link spacy token with nltk wordnet interface by giving acces to",
|
"# wordnet object link spacy token with nltk wordnet interface by giving acces to",
|
||||||
|
|
Loading…
Reference in New Issue