Downloads · 30 days
26
4% of all-time downloads
QizhiPei/biot5-base-dti-human
biot5-base-dti-human is a machine learning model from QizhiPei. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
For more information, please refer to our paper and GitHub repository.
Downloads · 30 days
26
4% of all-time downloads
All-time downloads
705
Public
Parameters
252M
2 GB on disk
Likes
0
Public
Click a slice to open those files.
.bin1 GB · 50%
From the Hugging Face model README
from transformers import T5Tokenizer, T5ForConditionalGeneration
def add_prefix_to_amino_acids(protein_sequence):
amino_acids = list(protein_sequence)
prefixed_amino_acids = ['<p>' + aa for aa in amino_acids]
new_sequence = ''.join(prefixed_amino_acids)
return new_sequence
tokenizer = T5Tokenizer.from_pretrained("QizhiPei/biot5-base-dti-human", model_max_length=512)
model = T5ForConditionalGeneration.from_pretrained('QizhiPei/biot5-base-dti-human')
task_definition = 'Definition: Drug target interaction prediction task (a binary classification task) for the human dataset. If the given molecule and protein can interact with each other, indicate via "Yes". Otherwise, response via "No".\n\n'
selfies_input = '[C][/C][=C][Branch1][C][\\C][C][=Branch1][C][=O][O]'
protein_input = 'MQALRVSQALIRSFSSTARNRFQNRVREKQKLFQEDNDIPLYLKGGIVDNILYRVTMTLCLGGTVYSLYSLGWASFPRN'
protein_input = add_prefix_to_amino_acids(protein_input)
task_input = f'Now complete the following example -\nInput: Molecule: <bom>{selfies_input}<eom>\nProtein: <bop>{protein_input}<eop>\nOutput: '
model_input = task_definition + task_input
input_ids = tokenizer(model_input, return_tensors="pt").input_ids
generation_config = model.generation_config
generation_config.max_length = 8
generation_config.num_beams = 1
outputs = model.generate(input_ids, generation_config=generation_config)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
For more information, please refer to our paper and GitHub repository.
GitHub: BioT5
Authors: Qizhi Pei, Wei Zhang, Jinhua Zhu, Kehan Wu, Kaiyuan Gao, Lijun Wu, Yingce Xia, and Rui Yan