mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-04 04:10:20 +03:00
Remove debugging
This commit is contained in:
parent
dac12fb684
commit
d52d7d9c87
|
@ -138,18 +138,21 @@ class SpanFinder(TrainablePipe):
|
||||||
min_length: Optional[int] = None,
|
min_length: Optional[int] = None,
|
||||||
scorer: Optional[Callable] = span_finder_score,
|
scorer: Optional[Callable] = span_finder_score,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the span boundary detector.
|
"""Initialize the span finder.
|
||||||
model (thinc.api.Model): The Thinc Model powering the pipeline component.
|
model (thinc.api.Model): The Thinc Model powering the pipeline
|
||||||
|
component.
|
||||||
name (str): The component instance name, used to add entries to the
|
name (str): The component instance name, used to add entries to the
|
||||||
losses during training.
|
losses during training.
|
||||||
threshold (float): Minimum probability to consider a prediction
|
threshold (float): Minimum probability to consider a prediction
|
||||||
positive.
|
positive.
|
||||||
scorer (Optional[Callable]): The scoring method.
|
scorer (Optional[Callable]): The scoring method.
|
||||||
spans_key (str): Key of the doc.spans dict to save the spans under. During
|
spans_key (str): Key of the doc.spans dict to save the spans under.
|
||||||
initialization and training, the component will look for spans on the
|
During initialization and training, the component will look for
|
||||||
reference document under the same key.
|
spans on the reference document under the same key.
|
||||||
max_length (Optional[int]): Max length of the produced spans, defaults to None meaning unlimited length.
|
max_length (Optional[int]): Maximum length of the produced spans,
|
||||||
min_length (Optional[int]): Min length of the produced spans, defaults to None meaning shortest span is length 1.
|
defaults to None meaning unlimited length.
|
||||||
|
min_length (Optional[int]): Minimum length of the produced spans,
|
||||||
|
defaults to None meaning shortest span length is 1.
|
||||||
"""
|
"""
|
||||||
self.vocab = nlp.vocab
|
self.vocab = nlp.vocab
|
||||||
if (max_length is not None and max_length < 1) or (
|
if (max_length is not None and max_length < 1) or (
|
||||||
|
@ -194,7 +197,6 @@ class SpanFinder(TrainablePipe):
|
||||||
if token_score[1] >= self.cfg["threshold"]:
|
if token_score[1] >= self.cfg["threshold"]:
|
||||||
ends.append(token.i)
|
ends.append(token.i)
|
||||||
|
|
||||||
print(self.cfg)
|
|
||||||
for start in starts:
|
for start in starts:
|
||||||
for end in ends:
|
for end in ends:
|
||||||
span_length = end + 1 - start
|
span_length = end + 1 - start
|
||||||
|
|
Loading…
Reference in New Issue
Block a user