mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-04 21:50:35 +03:00
Fix examples
This commit is contained in:
parent
44f83b35bc
commit
4d272e25ee
|
@ -10,7 +10,7 @@ they're called on is passed in as the first argument.
|
||||||
Developed for: spaCy 2.0.0a17
|
Developed for: spaCy 2.0.0a17
|
||||||
Last updated for: spaCy 2.0.0a18
|
Last updated for: spaCy 2.0.0a18
|
||||||
"""
|
"""
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals, print_function
|
||||||
|
|
||||||
import plac
|
import plac
|
||||||
from spacy.lang.en import English
|
from spacy.lang.en import English
|
||||||
|
|
|
@ -11,7 +11,7 @@ coordinates. Can be extended with more details from the API.
|
||||||
Developed for: spaCy 2.0.0a17
|
Developed for: spaCy 2.0.0a17
|
||||||
Last updated for: spaCy 2.0.0a18
|
Last updated for: spaCy 2.0.0a18
|
||||||
"""
|
"""
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals, print_function
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import plac
|
import plac
|
||||||
|
|
|
@ -11,7 +11,7 @@ respectively.
|
||||||
Developed for: spaCy 2.0.0a17
|
Developed for: spaCy 2.0.0a17
|
||||||
Last updated for: spaCy 2.0.0a18
|
Last updated for: spaCy 2.0.0a18
|
||||||
"""
|
"""
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals, print_function
|
||||||
|
|
||||||
import plac
|
import plac
|
||||||
from spacy.lang.en import English
|
from spacy.lang.en import English
|
||||||
|
|
|
@ -90,7 +90,7 @@ def main(model=None, output_dir=None, n_iter=1000):
|
||||||
nlp.to_disk(output_dir)
|
nlp.to_disk(output_dir)
|
||||||
print("Saved model to", output_dir)
|
print("Saved model to", output_dir)
|
||||||
|
|
||||||
# test the save model
|
# test the saved model
|
||||||
print("Loading from", output_dir)
|
print("Loading from", output_dir)
|
||||||
nlp2 = spacy.load(output_dir)
|
nlp2 = spacy.load(output_dir)
|
||||||
doc = nlp2(test_text)
|
doc = nlp2(test_text)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user