mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Fix initialisation of Doc in lightning tour example
This commit is contained in:
parent
e05bcd6aa8
commit
0d33ead507
|
@ -129,13 +129,14 @@ p
|
||||||
+code.
|
+code.
|
||||||
import spacy
|
import spacy
|
||||||
from spacy.tokens.doc import Doc
|
from spacy.tokens.doc import Doc
|
||||||
|
from spacy.vocab import Vocab
|
||||||
|
|
||||||
nlp = spacy.load('en')
|
nlp = spacy.load('en')
|
||||||
moby_dick = open('moby_dick.txt', 'r')
|
moby_dick = open('moby_dick.txt', 'r')
|
||||||
doc = nlp(moby_dick)
|
doc = nlp(moby_dick)
|
||||||
doc.to_disk('/moby_dick.bin')
|
doc.to_disk('/moby_dick.bin')
|
||||||
|
|
||||||
new_doc = Doc().from_disk('/moby_dick.bin')
|
new_doc = Doc(Vocab()).from_disk('/moby_dick.bin')
|
||||||
|
|
||||||
+infobox
|
+infobox
|
||||||
| #[strong Usage:] #[+a("/docs/usage/saving-loading") Saving and loading]
|
| #[strong Usage:] #[+a("/docs/usage/saving-loading") Saving and loading]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user