olegtarasov/FastText.NetWrapper

Training ist not possible with pretrained vectors (throws exception)

Closed this issue · 2 comments

Training with pretrained vectors is not possible. No matter if the method is SkipGram or Supervised, the wrapper throws an exception:

"External component has thrown an exception."
StackTrace:
at FastText.NetWrapper.FastTextWrapper.Train(IntPtr hPtr, String input, String output, TrainingArgsStruct args, String labelPrefix, String pretrainedVectors)

In addition, the original Fasttext library allows supervised training with pretrained vectors, whereas in the wrapper this is only possible for low-level training (missing property in the supervised hyperparameters).
For small learning sets, however, it is necessary that the training can process a pretrained vector file with both methods.

Is it possible a.) to fix the error and b.) to implement pretrained vectors in supervised training as well?

Hi @Vic281!

In addition, the original Fasttext library allows supervised training with pretrained vectors, whereas in the wrapper this is only possible for low-level training (missing property in the supervised hyperparameters).

If you are referring to SupervisedArgs and its Train() overload, I consider them deprecated. They will be marked [Obsolete] in the next version of the wrapper. Please use FastTextArgs and corresponding Train() overload.

Training with pretrained vectors is not possible. No matter if the method is SkipGram or Supervised, the wrapper throws an exception

Can you provide sample code as well as more info about what vectors you are using? Did you check that pretrained vectors have the same dimension as your supervised arguments? The default vector dimension for supervised training in fastText is 100, but many pretrained models on the internet have the dimension of 300.

Thank you a lot! The dimension value was it!