mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-11 17:56:30 +03:00
update to training doc
This commit is contained in:
parent
f3c61ae246
commit
349143faa2
|
@ -13,14 +13,17 @@ p
|
||||||
|
|
||||||
+code.
|
+code.
|
||||||
from spacy.vocab import Vocab
|
from spacy.vocab import Vocab
|
||||||
from spacy.pipeline import Tagger
|
from spacy.tagger import Tagger
|
||||||
from spacy.tokens import Doc
|
from spacy.tokens import Doc
|
||||||
|
from spacy.gold import GoldParse
|
||||||
|
|
||||||
|
|
||||||
vocab = Vocab(tag_map={'N': {'pos': 'NOUN'}, 'V': {'pos': 'VERB'}})
|
vocab = Vocab(tag_map={'N': {'pos': 'NOUN'}, 'V': {'pos': 'VERB'}})
|
||||||
tagger = Tagger(vocab)
|
tagger = Tagger(vocab)
|
||||||
|
|
||||||
doc = Doc(vocab, words=['I', 'like', 'stuff'])
|
doc = Doc(vocab, words=['I', 'like', 'stuff'])
|
||||||
tagger.update(doc, ['N', 'V', 'N'])
|
gold = GoldParse(doc, tags=['N', 'V', 'N'])
|
||||||
|
tagger.update(doc, gold)
|
||||||
|
|
||||||
tagger.model.end_training()
|
tagger.model.end_training()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user