You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the pretrained model for DDI and trying to do relation extraction for the below abstract from Pubmed, I'm getting the output as same as the input text which is the abstract itself, instead I need to get the right response: the interaction between plenaxis and testosterone is mechanism.
import torch
from src.transformer_lm_prompt import TransformerLanguageModelPrompt
pubmed_abstract = 'No formal drug/drug interaction studies with Plenaxis were performed. Cytochrome P-450 is not known to be involved in the metabolism of Plenaxis. Plenaxis is highly bound to plasma proteins (96 to 99%). Laboratory Tests Response to Plenaxis should be monitored by measuring serum total testosterone concentrations just prior to administration on Day 29 and every 8 weeks thereafter. Serum transaminase levels should be obtained before starting treatment with Plenaxis and periodically during treatment. Periodic measurement of serum PSA levels may also be considered.'
m = TransformerLanguageModelPrompt.from_pretrained(
"checkpoints/RE-DDI-BioGPT",
"checkpoint_avg.pt",
"data/DDI/relis-bin",
tokenizer='moses',
bpe='fastbpe',
bpe_codes="data/bpecodes",
max_len_b=1024,
beam=1)
m.cuda()
src_text=pubmed_abstract # input text, e.g., a PubMed abstract
src_tokens = m.encode(src_text)
generate = m.generate([src_tokens], beam=5)[0]
output = m.decode(generate[0]["tokens"])
print(output)
'No formal drug/drug interaction studies with Plenaxis were performed. Cytochrome P-450 is not known to be involved in the metabolism of Plenaxis. Plenaxis is highly bound to plasma proteins (96 to 99%). Laboratory Tests Response to Plenaxis should be monitored by measuring serum total testosterone concentrations just prior to administration on Day 29 and every 8 weeks thereafter. Serum transaminase levels should be obtained before starting treatment with Plenaxis and periodically during treatment. Periodic measurement of serum PSA levels may also be considered.'
The correct response should be: the interaction between plenaxis and testosterone is mechanism. . How do I get it? Thanks
The text was updated successfully, but these errors were encountered:
Hi team,
I'm using the pretrained model for DDI and trying to do relation extraction for the below abstract from Pubmed, I'm getting the output as same as the input text which is the abstract itself, instead I need to get the right response: the interaction between plenaxis and testosterone is mechanism.
The correct response should be: the interaction between plenaxis and testosterone is mechanism. . How do I get it? Thanks
The text was updated successfully, but these errors were encountered: