mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
Don't create low-data text classifier if no vectors
This commit is contained in:
parent
e7a9174877
commit
9f9439667b
|
@ -434,7 +434,7 @@ def build_text_classifier(nr_class, width=64, **cfg):
|
||||||
pretrained_dims = cfg.get('pretrained_dims', 0)
|
pretrained_dims = cfg.get('pretrained_dims', 0)
|
||||||
with Model.define_operators({'>>': chain, '+': add, '|': concatenate,
|
with Model.define_operators({'>>': chain, '+': add, '|': concatenate,
|
||||||
'**': clone}):
|
'**': clone}):
|
||||||
if cfg.get('low_data'):
|
if cfg.get('low_data') and pretrained_dims:
|
||||||
model = (
|
model = (
|
||||||
SpacyVectors
|
SpacyVectors
|
||||||
>> flatten_add_lengths
|
>> flatten_add_lengths
|
||||||
|
|
Loading…
Reference in New Issue
Block a user