mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-05 12:50:20 +03:00
formatting
This commit is contained in:
parent
87fb268f76
commit
dbaf68a439
|
@ -114,7 +114,7 @@ def make_parser(
|
||||||
beam_update_prob=0.0,
|
beam_update_prob=0.0,
|
||||||
# At some point in the future we can try to implement support for
|
# At some point in the future we can try to implement support for
|
||||||
# partial annotations, perhaps only in the beam objective.
|
# partial annotations, perhaps only in the beam objective.
|
||||||
incorrect_spans_key=None
|
incorrect_spans_key=None,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ def make_beam_parser(
|
||||||
min_action_freq=min_action_freq,
|
min_action_freq=min_action_freq,
|
||||||
# At some point in the future we can try to implement support for
|
# At some point in the future we can try to implement support for
|
||||||
# partial annotations, perhaps only in the beam objective.
|
# partial annotations, perhaps only in the beam objective.
|
||||||
incorrect_spans_key=None
|
incorrect_spans_key=None,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -235,8 +235,7 @@ class DependencyParser(Parser):
|
||||||
multitasks=tuple(),
|
multitasks=tuple(),
|
||||||
incorrect_spans_key=None,
|
incorrect_spans_key=None,
|
||||||
):
|
):
|
||||||
"""Create a DependencyParser.
|
"""Create a DependencyParser."""
|
||||||
"""
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
vocab,
|
vocab,
|
||||||
model,
|
model,
|
||||||
|
|
|
@ -40,7 +40,7 @@ DEFAULT_NER_MODEL = Config().from_str(default_model_config)["model"]
|
||||||
"moves": None,
|
"moves": None,
|
||||||
"update_with_oracle_cut_size": 100,
|
"update_with_oracle_cut_size": 100,
|
||||||
"model": DEFAULT_NER_MODEL,
|
"model": DEFAULT_NER_MODEL,
|
||||||
"incorrect_spans_key": None
|
"incorrect_spans_key": None,
|
||||||
},
|
},
|
||||||
default_score_weights={
|
default_score_weights={
|
||||||
"ents_f": 1.0,
|
"ents_f": 1.0,
|
||||||
|
@ -55,7 +55,7 @@ def make_ner(
|
||||||
model: Model,
|
model: Model,
|
||||||
moves: Optional[TransitionSystem],
|
moves: Optional[TransitionSystem],
|
||||||
update_with_oracle_cut_size: int,
|
update_with_oracle_cut_size: int,
|
||||||
incorrect_spans_key: Optional[str]=None
|
incorrect_spans_key: Optional[str] = None,
|
||||||
):
|
):
|
||||||
"""Create a transition-based EntityRecognizer component. The entity recognizer
|
"""Create a transition-based EntityRecognizer component. The entity recognizer
|
||||||
identifies non-overlapping labelled spans of tokens.
|
identifies non-overlapping labelled spans of tokens.
|
||||||
|
@ -126,7 +126,7 @@ def make_beam_ner(
|
||||||
beam_width: int,
|
beam_width: int,
|
||||||
beam_density: float,
|
beam_density: float,
|
||||||
beam_update_prob: float,
|
beam_update_prob: float,
|
||||||
incorrect_spans_key: Optional[str]=None
|
incorrect_spans_key: Optional[str] = None,
|
||||||
):
|
):
|
||||||
"""Create a transition-based EntityRecognizer component that uses beam-search.
|
"""Create a transition-based EntityRecognizer component that uses beam-search.
|
||||||
The entity recognizer identifies non-overlapping labelled spans of tokens.
|
The entity recognizer identifies non-overlapping labelled spans of tokens.
|
||||||
|
@ -173,7 +173,7 @@ def make_beam_ner(
|
||||||
beam_width=beam_width,
|
beam_width=beam_width,
|
||||||
beam_density=beam_density,
|
beam_density=beam_density,
|
||||||
beam_update_prob=beam_update_prob,
|
beam_update_prob=beam_update_prob,
|
||||||
incorrect_spans_key=incorrect_spans_key
|
incorrect_spans_key=incorrect_spans_key,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -199,15 +199,14 @@ class EntityRecognizer(Parser):
|
||||||
multitasks=tuple(),
|
multitasks=tuple(),
|
||||||
incorrect_spans_key=None,
|
incorrect_spans_key=None,
|
||||||
):
|
):
|
||||||
"""Create an EntityRecognizer.
|
"""Create an EntityRecognizer."""
|
||||||
"""
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
vocab,
|
vocab,
|
||||||
model,
|
model,
|
||||||
name,
|
name,
|
||||||
moves,
|
moves,
|
||||||
update_with_oracle_cut_size=update_with_oracle_cut_size,
|
update_with_oracle_cut_size=update_with_oracle_cut_size,
|
||||||
min_action_freq=1, # not relevant for NER
|
min_action_freq=1, # not relevant for NER
|
||||||
learn_tokens=False, # not relevant for NER
|
learn_tokens=False, # not relevant for NER
|
||||||
beam_width=beam_width,
|
beam_width=beam_width,
|
||||||
beam_density=beam_density,
|
beam_density=beam_density,
|
||||||
|
|
|
@ -56,7 +56,7 @@ PARTIAL_DATA = [
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
PARSERS = ["parser"] # TODO: Test beam_parser when ready
|
PARSERS = ["parser"] # TODO: Test beam_parser when ready
|
||||||
|
|
||||||
eps = 0.1
|
eps = 0.1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user