Fix initialisation of Doc in lightning tour example

This commit is contained in:
ines 2017-05-27 17:58:06 +02:00
parent e05bcd6aa8
commit 0d33ead507
1 changed files with 2 additions and 1 deletions

View File

@ -129,13 +129,14 @@ p
+code.
import spacy
from spacy.tokens.doc import Doc
from spacy.vocab import Vocab
nlp = spacy.load('en')
moby_dick = open('moby_dick.txt', 'r')
doc = nlp(moby_dick)
doc.to_disk('/moby_dick.bin')
new_doc = Doc().from_disk('/moby_dick.bin')
new_doc = Doc(Vocab()).from_disk('/moby_dick.bin')
+infobox
| #[strong Usage:] #[+a("/docs/usage/saving-loading") Saving and loading]