ThilinaRajapakse / pytorch-transformers-classification

Based on the Pytorch-Transformers library by HuggingFace. To be used as a starting point for employing Transformer models in text classification tasks. Contains code to easily train BERT, XLNet, RoBERTa, and XLM models for text classification.
Apache License 2.0
304 stars 97 forks source link

Running Inference #37

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hello Thilina, thank you for this repo.

Question: After I've fine-tuned a roberta model for sentence classification, how do I run inference on a sample sentence in real-time? Is there a specific function in your code base you can point me to?

ThilinaRajapakse commented 4 years ago

This repo doesn't really have built-in support for that, although it shouldn't be hard to implement. I recommend you use Simple Transformers, which does support this (and a lot more) out of the box.

ghost commented 4 years ago

thank you