Views
No views yet
1ferrous fumarate 191 MG is contraindicated with Hemochromatosis.
224 HR metoprolol succinate 50 MG Extended Release Oral Capsule [Kapspargo] contains the ingredient Metoprolol.
3Genvoya has the established pharmacologic class Cytochrome P450 3A Inhibitor.
4cefprozil 250 MG Oral Tablet may be used to treat Haemophilus Infections.
5mecobalamin 1 MG Sublingual Tablet contains the ingredient Vitamin B 12.1from transformers import AutoTokenizer, AutoModelForMaskedLM
2import torch
3
4# load the tokenizer and model
5tokenizer = AutoTokenizer.from_pretrained("Su-informatics-lab/bert_base_uncased_rxnorm_babbage")
6model = AutoModelForMaskedLM.from_pretrained("Su-informatics-lab/bert_base_uncased_rxnorm_babbage")
7
8# prepare the input
9text = "0.05 ML aflibercept 40 MG/ML Injection is contraindicated with [MASK]."
10inputs = tokenizer(text, return_tensors="pt")
11
12# get model predictions
13with torch.no_grad():
14 outputs = model(**inputs)
15
16# decode the predictions
17predictions = outputs.logits
18masked_index = (inputs.input_ids == tokenizer.mask_token_id)[0].nonzero(as_tuple=True)[0]
19predicted_token_id = predictions[0, masked_index].argmax(axis=-1)
20predicted_token = tokenizer.decode(predicted_token_id)