How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-classification", model="UVA-MSBA/Mod4_T7")
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("UVA-MSBA/Mod4_T7")
model = AutoModelForSequenceClassification.from_pretrained("UVA-MSBA/Mod4_T7")
Quick Links

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_T7")  
model = AutoModelForSequenceClassification.from_pretrained("UVA-MSBA/Mod4_T7")

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)
Downloads last month
17
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support