Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from fast_bert.prediction import BertClassificationPredictor
- predictor = BertClassificationPredictor(model_path=MODEL_PATH, pretrained_path=BERT_PRETRAINED_PATH,
- label_path=LABEL_PATH, multi_label=False)
- # Single prediction
- single_prediction = predictor.predict("just get me result for this text")
- # Batch predictions
- texts = [
- "this is the first text",
- "this is the second text"
- ]
- multiple_predictions = predictor.predict(texts)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement