mirror of https://github.com/explosion/spaCy.git
Revert "Fix report of ParserStateError"
This reverts commit 78f19baafa
.
This commit is contained in:
parent
6736977d82
commit
e3285f6f30
|
@ -113,7 +113,7 @@ cdef class Parser:
|
||||||
# Check for KeyboardInterrupt etc. Untested
|
# Check for KeyboardInterrupt etc. Untested
|
||||||
PyErr_CheckSignals()
|
PyErr_CheckSignals()
|
||||||
if status != 0:
|
if status != 0:
|
||||||
raise ParserStateError(self.moves, tokens)
|
raise ParserStateError(tokens)
|
||||||
self.moves.finalize_doc(tokens)
|
self.moves.finalize_doc(tokens)
|
||||||
|
|
||||||
def pipe(self, stream, int batch_size=1000, int n_threads=2):
|
def pipe(self, stream, int batch_size=1000, int n_threads=2):
|
||||||
|
@ -306,16 +306,14 @@ cdef class StepwiseState:
|
||||||
|
|
||||||
|
|
||||||
class ParserStateError(ValueError):
|
class ParserStateError(ValueError):
|
||||||
def __init__(self, TransitionSystem moves, doc):
|
def __repr__(self):
|
||||||
actions = [moves.move_name(moves.c[i].move, moves.c[i].label) for i
|
raise ValueError(
|
||||||
in range(moves.n_moves)]
|
|
||||||
ValueError.__init__(self,
|
|
||||||
"Error analysing doc -- no valid actions available. This should "
|
"Error analysing doc -- no valid actions available. This should "
|
||||||
"never happen, so please report the error on the issue tracker. "
|
"never happen, so please report the error on the issue tracker. "
|
||||||
"Here's the thread to do so --- reopen it if it's closed:\n"
|
"Here's the thread to do so --- reopen it if it's closed:\n"
|
||||||
"https://github.com/spacy-io/spaCy/issues/429\n"
|
"https://github.com/spacy-io/spaCy/issues/429\n"
|
||||||
"Please include the text that the parser failed on, which is:\n"
|
"Please include the text that the parser failed on, which is:\n"
|
||||||
"'%s'\nAnd the list of actions, which is:%s\n" % (doc.text, actions))
|
"%s" % repr(self.args[0].text))
|
||||||
|
|
||||||
|
|
||||||
cdef int _arg_max_clas(const weight_t* scores, int move, const Transition* actions,
|
cdef int _arg_max_clas(const weight_t* scores, int move, const Transition* actions,
|
||||||
|
|
Loading…
Reference in New Issue