Advertisement
Guest User

Untitled

a guest
May 25th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. from fast_bert.prediction import BertClassificationPredictor
  2.  
  3. predictor = BertClassificationPredictor(model_path=MODEL_PATH, pretrained_path=BERT_PRETRAINED_PATH,
  4. label_path=LABEL_PATH, multi_label=False)
  5.  
  6. # Single prediction
  7. single_prediction = predictor.predict("just get me result for this text")
  8.  
  9. # Batch predictions
  10. texts = [
  11. "this is the first text",
  12. "this is the second text"
  13. ]
  14.  
  15. multiple_predictions = predictor.predict(texts)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement