mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
use English instead of model
This commit is contained in:
parent
46628d8890
commit
7939c63886
|
@ -2,6 +2,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import spacy
|
||||
from spacy.lang.en import English
|
||||
from spacy.tokens import Span, Doc
|
||||
|
||||
|
||||
|
@ -30,9 +31,10 @@ class CustomPipe:
|
|||
|
||||
def test_issue4903():
|
||||
# ensures that this runs correctly and doesn't hang or crash on Windows / macOS
|
||||
nlp = spacy.load("en_core_web_sm")
|
||||
nlp = English()
|
||||
custom_component = CustomPipe()
|
||||
nlp.add_pipe(custom_component, after="parser")
|
||||
nlp.add_pipe(nlp.create_pipe("sentencizer"))
|
||||
nlp.add_pipe(custom_component, after="sentencizer")
|
||||
|
||||
text = ["I like bananas.", "Do you like them?", "No, I prefer wasabi."]
|
||||
docs = list(nlp.pipe(text, n_process=2))
|
||||
|
|
Loading…
Reference in New Issue
Block a user