Mihir3009 commited on
Commit
c7242bd
1 Parent(s): 849e44a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +22 -0
README.md CHANGED
@@ -32,6 +32,28 @@ git lfs install
32
  git clone https://huggingface.co/cogint/in-boxbart
33
  ```
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  BibTeX Entry and Citation Info
36
  ===============
37
  If you are using our model, please cite our paper:
 
32
  git clone https://huggingface.co/cogint/in-boxbart
33
  ```
34
 
35
+ Inference Example
36
+ =============
37
+
38
+ Here, we provide an example for the "Document Classification" (HoC dataset) task. Once you load the model from huggigface for inference, you can append instruction given in `./templates` for that particular dataset with input instance. Below is an example of one instance.
39
+
40
+ ```python
41
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
42
+ tokenizer = AutoTokenizer.from_pretrained("cogint/in-boxbart")
43
+ model = AutoModelForSeq2SeqLM.from_pretrained("cogint/in-boxbart")
44
+
45
+ # Input shows how we have appended instruction from our file for HoC dataset with instance.
46
+
47
+ input = "Instruction: Definition: In this task, you are given a medical text related to cancer. Your job is to classify into zero or more classes from (1) Sustaining proliferative signaling, (2) Resisting cell death, (3) Genomic instability and mutation, (4) Activating invasion and metastasis, (5) Tumor promoting inflammation, (6) Evading growth suppressors, (7) Inducing angiogenesis (8) Enabling replicative immortality, (9) Avoiding immune destruction and (10) Cellular energetics., Positive Examples: [[input: Studies of cell-cycle progression showed that the anti-proliferative effect of Fan was associated with an increase in the G1/S phase of PC3 cells ., output: Evading growth suppressors, Sustaining proliferative signaling, explanation: Given text is classified into two categories, hence, generated label is 'Evading growth suppressors, Sustaining proliferative signaling'.] ]; Instance: input: Similar to previous studies utilizing IGF-1 , pretreatment with Roscovitine leads to a significant up-regulation of p21 expression and a significant decrease in the number of PCNA positive cells ., output: ?"
48
+
49
+ tokenized_input= tokenizer(input)
50
+
51
+ # Ideal output for this input is 'Sustaining proliferative signaling'
52
+
53
+ output = model(tokenized_input)
54
+ ```
55
+
56
+
57
  BibTeX Entry and Citation Info
58
  ===============
59
  If you are using our model, please cite our paper: