Closed meshiguge closed 6 years ago
@meshiguge The problem is the parser model isn't loaded, because you disable during load. You could call parser.from_disk()
with the subdirectory, but the following should be easier:
nlp = spacy.load('en' )
parser = nlp.parser
disabled = nlp.disable_pipes('parser', 'ner', 'textcat')
Btw you might want to still use pipe in the parser, like so: lines = ( line.strip() for line in open(file)) docs = nlp.pipe( lines, batch_size = ... ) match_docs = (doc for doc in docs if match_condition) for doc in parser.pipe(docs): do_something(doc_tag )
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
as
match_condition
only needtoken
andtagger
, parser was disable in nlp.pipe how to addparser
for specific documents ?cause error
Your Environment