Downloads · 30 days
6
15% of all-time downloads
hellomattnewman/msba-adrida
msba-adrida is a text classification model from hellomattnewman. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This model takes text (narrative of reasctions to medications) as input and returns a predicted severity score for the reaction (LABEL1 is severe reaction). Please do NOT use for medical diagnosis. Example usage:
Downloads · 30 days
6
15% of all-time downloads
All-time downloads
41
Public
Repo size
867 MB
Likes
0
Public
Click a slice to open those files.
.bin433 MB · 100%
From the Hugging Face model README
This model takes text (narrative of reasctions to medications) as input and returns a predicted severity score for the reaction (LABEL_1 is severe reaction). Please do NOT use for medical diagnosis. Example usage:
import torch
import tensorflow as tf
from transformers import RobertaTokenizer, RobertaModel
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("hellomattnewman/msba-adrida")
model = AutoModelForSequenceClassification.from_pretrained("hellomattnewman/msba-adrida")
def adr_predict(x):
encoded_input = tokenizer(x, return_tensors='pt')
output = model(**encoded_input)
scores = output[0][0].detach().numpy()
scores = tf.nn.softmax(scores)
return scores.numpy()[1]
sentence = "I have severe pain."
adr_predict(sentence)