I'm using simpletransformers (https://github.com/ThilinaRajapakse/simpletransformers) for a work project. After training a model, I get a bunch of files dumped to the output folder. I was wondering, if you wanted to load in a previously trained model (which I assume is saved to the output folder) so that you can immediately run it against new data, how would one go about doing this?Picture of files in output folder
With scikit-learn, you can export models to json easily, and load them back in, I figured there might be a similar process for this?
from simpletransformers.classification import ClassificationModel
model = ClassificationModel("bert", "outputs/best_model")
model.predict(['Enter text to classify'])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With