问题
Is there any way to get the model loss for the unsupervised training of models using Fast Text with the python API? At the moment I am doing the training using the C++ model and loading it using the Python API.
For e.g., I first run the following code to tweak hyper parameters
./fasttext skipgram \
-input /data/cleaned.txt \
-output /models/cleaned-model \
-epoch 12000 \
-minCount 2 \
-ws 3
The command-line interface gives an estimate of the loss like so:
Progress: 100.0% words/sec/thread: 103006 lr: 0.000000 loss: 1.803622 ETA: 0h 0m
However, doing the same using the Python API:
import fastText
model = fastText.train_unsupervised('/data/cleaned.txt',
epoch=12000,
minCount=2,
ws=3)
This trains but does not output the loss? I checked increasing the verbosity level verbosity=3
in the training function options but nothing happens. Is this a missing feature or something I am missing?
回答1:
If you run the python script from the shell, it prints the desired output.
Maybe you're using Jupyter Notebook. In this case, currently there's not a simple way to see the output in the notebook.
来源:https://stackoverflow.com/questions/54773706/fast-text-unsupervised-model-loss-with-python-api