Downloads · 30 days
0
UVA-MSBA/M4-Team12-2024
M4-Team12-2024 is a machine learning model from UVA-MSBA. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
widget: - text: "I never imagined a pill could cause so much pain. It started with a dull ache, then my muscles felt like they were on fire. Breathing became a struggle, each breath felt like a battle. It's terrifying…
Downloads · 30 days
0
Access
Public
Updated May 12, 2024
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 55%
From the Hugging Face model README
widget:
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("UVA-MSBA/Mod4_T12")
model = AutoModelForSequenceClassification.from_pretrained("UVA-MSBA/Mod4_T12")
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 an extremely bad headache."
adr_predict(sentence)