pritamdeka commited on
Commit
122e499
·
1 Parent(s): 3653b0d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -1
README.md CHANGED
@@ -24,7 +24,29 @@ More information needed
24
 
25
  ## Intended uses & limitations
26
 
27
- More information needed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  ## Training and evaluation data
30
 
 
24
 
25
  ## Intended uses & limitations
26
 
27
+ The model can be used for NLI tasks related to biomedical data and even be adapted to fact-checking tasks. It can be used from the Huggingface pipeline method as follows:
28
+
29
+
30
+ ```
31
+ from transformers import TextClassificationPipeline, AutoModel, AutoTokenizer, AutoModelForSequenceClassification
32
+ model = AutoModelForSequenceClassification.from_pretrained("pritamdeka/PubMedBERT-MNLI-MedNLI", num_labels=3, id2label = {1: 'entailment', 0: 'contradiction',2:'neutral'})
33
+ tokenizer = AutoTokenizer.from_pretrained("pritamdeka/PubMedBERT-MNLI-MedNLI")
34
+ pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True, device=0, batch_size=128)
35
+
36
+ pipe(['ALDH1 expression is associated with better breast cancer outcomes',
37
+ 'In a series of 577 breast carcinomas, expression of ALDH1 detected by immunostaining correlated with poor prognosis.'])
38
+ ```
39
+
40
+ The output for the above will be:
41
+
42
+ ```
43
+ [[{'label': 'contradiction', 'score': 0.10193759202957153},
44
+ {'label': 'entailment', 'score': 0.2933262586593628},
45
+ {'label': 'neutral', 'score': 0.6047361493110657}],
46
+ [{'label': 'contradiction', 'score': 0.21726925671100616},
47
+ {'label': 'entailment', 'score': 0.24485822021961212},
48
+ {'label': 'neutral', 'score': 0.5378724932670593}]]
49
+ ```
50
 
51
  ## Training and evaluation data
52