hipster-philology / pandora

A Tagger-Lemmatizer for Natural Languages
MIT License
9 stars 4 forks source link

Training with include_morph = label yiels TypeError: to_categorical() got an unexpected keyword argument 'nb_classes' #67

Closed Jean-Baptiste-Camps closed 6 years ago

Jean-Baptiste-Camps commented 6 years ago

This is similar to the bug described in #12 . When I launch training on the Geste sample data, with

include_morph = label

in the config, I get the following error,

Traceback (most recent call last):
  File "train.py", line 6, in <module>
    cli_train()
  File "/home/jbc/Data/F/pandora/pandora_testing/hipster-philology/pandora/pandora/cli.py", line 144, in cli_train
    train_func(**vars(parser.parse_args()))
  File "/home/jbc/Data/F/pandora/pandora_testing/hipster-philology/pandora/pandora/cli.py", line 94, in train_func
    tagger.setup_to_train(**data_sets)
  File "/home/jbc/Data/F/pandora/pandora_testing/hipster-philology/pandora/pandora/tagger.py", line 230, in setup_to_train
    morph=self.train_morph)
  File "/home/jbc/Data/F/pandora/pandora_testing/hipster-philology/pandora/pandora/preprocessing.py", line 516, in transform
    X_morph, nb_classes=len(self.morph_encoder.classes_))
TypeError: to_categorical() got an unexpected keyword argument 'nb_classes

This does not happen, though, with

include_morph = multilabel

which seems to work quite fine (I'm actually impressed by the results obtained with this option).

mikekestemont commented 6 years ago

Can you close this, if the PR satisfactory @Jean-Baptiste-Camps ?

PonteIneptique commented 6 years ago

You PRed the wrong repo @mikekestemont :)