Update README.md
#3
by
moshe-raboh
- opened
README.md
CHANGED
@@ -36,22 +36,25 @@ By default, we are using Drug+Target cold-split, as provided by tdcommons.
|
|
36 |
Using `ibm/biomed.omics.bl.sm.ma-ted-400m` requires installing [https://github.com/BiomedSciAI/biomed-multi-alignment](https://github.com/TBD)
|
37 |
|
38 |
```
|
39 |
-
pip install git+https://github.com/BiomedSciAI/biomed-multi-alignment.git
|
40 |
```
|
41 |
|
42 |
A simple example for a task already supported by `ibm/biomed.omics.bl.sm.ma-ted-400m`:
|
43 |
```python
|
44 |
import os
|
45 |
-
|
46 |
from fuse.data.tokenizers.modular_tokenizer.op import ModularTokenizerOp
|
47 |
-
from fuse.data.utils.collates import CollateDefault
|
48 |
|
49 |
from mammal.examples.dti_bindingdb_kd.task import DtiBindingdbKdTask
|
50 |
from mammal.keys import CLS_PRED, SCORES
|
51 |
from mammal.model import Mammal
|
52 |
|
|
|
|
|
|
|
|
|
53 |
# Load Model
|
54 |
model = Mammal.from_pretrained("ibm/biomed.omics.bl.sm.ma-ted-400m.dti_bindingdb_pkd")
|
|
|
55 |
|
56 |
# Load Tokenizer
|
57 |
tokenizer_op = ModularTokenizerOp.from_pretrained("ibm/biomed.omics.bl.sm.ma-ted-400m.dti_bindingdb_pkd")
|
@@ -65,11 +68,11 @@ sample_dict = DtiBindingdbKdTask.data_preprocessing(
|
|
65 |
drug_sequence_key="drug_seq",
|
66 |
norm_y_mean=None,
|
67 |
norm_y_std=None,
|
68 |
-
device=
|
69 |
)
|
70 |
|
71 |
-
# forward pass - encoder_only mode which supports
|
72 |
-
batch_dict =
|
73 |
|
74 |
# Post-process the model's output
|
75 |
batch_dict = DtiBindingdbKdTask.process_model_output(
|
@@ -91,7 +94,7 @@ For more advanced usage, see our detailed example at: on `https://github.com/Bio
|
|
91 |
|
92 |
## Citation
|
93 |
|
94 |
-
If you found our work useful, please consider
|
95 |
```
|
96 |
@article{TBD,
|
97 |
title={TBD},
|
|
|
36 |
Using `ibm/biomed.omics.bl.sm.ma-ted-400m` requires installing [https://github.com/BiomedSciAI/biomed-multi-alignment](https://github.com/TBD)
|
37 |
|
38 |
```
|
39 |
+
pip install git+https://github.com/BiomedSciAI/biomed-multi-alignment.git#egg=mammal[examples]
|
40 |
```
|
41 |
|
42 |
A simple example for a task already supported by `ibm/biomed.omics.bl.sm.ma-ted-400m`:
|
43 |
```python
|
44 |
import os
|
|
|
45 |
from fuse.data.tokenizers.modular_tokenizer.op import ModularTokenizerOp
|
|
|
46 |
|
47 |
from mammal.examples.dti_bindingdb_kd.task import DtiBindingdbKdTask
|
48 |
from mammal.keys import CLS_PRED, SCORES
|
49 |
from mammal.model import Mammal
|
50 |
|
51 |
+
# input
|
52 |
+
target_seq = "NLMKRCTRGFRKLGKCTTLEEEKCKTLYPRGQCTCSDSKMNTHSCDCKSC"
|
53 |
+
drug_seq = "CC(=O)NCCC1=CNc2c1cc(OC)cc2"
|
54 |
+
|
55 |
# Load Model
|
56 |
model = Mammal.from_pretrained("ibm/biomed.omics.bl.sm.ma-ted-400m.dti_bindingdb_pkd")
|
57 |
+
model.eval()
|
58 |
|
59 |
# Load Tokenizer
|
60 |
tokenizer_op = ModularTokenizerOp.from_pretrained("ibm/biomed.omics.bl.sm.ma-ted-400m.dti_bindingdb_pkd")
|
|
|
68 |
drug_sequence_key="drug_seq",
|
69 |
norm_y_mean=None,
|
70 |
norm_y_std=None,
|
71 |
+
device=model.device,
|
72 |
)
|
73 |
|
74 |
+
# forward pass - encoder_only mode which supports scalar predictions
|
75 |
+
batch_dict = model.forward_encoder_only([sample_dict])
|
76 |
|
77 |
# Post-process the model's output
|
78 |
batch_dict = DtiBindingdbKdTask.process_model_output(
|
|
|
94 |
|
95 |
## Citation
|
96 |
|
97 |
+
If you found our work useful, please consider giving a star to the repo and cite our paper:
|
98 |
```
|
99 |
@article{TBD,
|
100 |
title={TBD},
|