mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-24 00:04:15 +03:00
Fix exclusive_classes in textcat ensemble (#5166)
Pass the exclusive_classes setting to the bow model within the ensemble textcat model.
This commit is contained in:
parent
e904958115
commit
d47b810ba4
|
@ -693,9 +693,11 @@ def build_text_classifier(nr_class, width=64, **cfg):
|
||||||
)
|
)
|
||||||
|
|
||||||
linear_model = build_bow_text_classifier(
|
linear_model = build_bow_text_classifier(
|
||||||
nr_class, ngram_size=cfg.get("ngram_size", 1), exclusive_classes=False
|
nr_class,
|
||||||
|
ngram_size=cfg.get("ngram_size", 1),
|
||||||
|
exclusive_classes=cfg.get("exclusive_classes", False),
|
||||||
)
|
)
|
||||||
if cfg.get("exclusive_classes"):
|
if cfg.get("exclusive_classes", False):
|
||||||
output_layer = Softmax(nr_class, nr_class * 2)
|
output_layer = Softmax(nr_class, nr_class * 2)
|
||||||
else:
|
else:
|
||||||
output_layer = (
|
output_layer = (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user