Update README.md
Browse files
README.md
CHANGED
@@ -24,6 +24,26 @@ widget:
|
|
24 |
- This is a fine-tuned checkpoint of `microsoft/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext` for document section text classification
|
25 |
- possible document section classes are:BACKGROUND, CONCLUSIONS, METHODS, OBJECTIVE, RESULTS,
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
## metadata
|
28 |
|
29 |
|
|
|
24 |
- This is a fine-tuned checkpoint of `microsoft/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext` for document section text classification
|
25 |
- possible document section classes are:BACKGROUND, CONCLUSIONS, METHODS, OBJECTIVE, RESULTS,
|
26 |
|
27 |
+
## usage in python
|
28 |
+
|
29 |
+
```
|
30 |
+
from transformers import pipeline
|
31 |
+
|
32 |
+
model_tag = "ml4pubmed/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext_pub_section"
|
33 |
+
classifier = pipeline(
|
34 |
+
'text-classification',
|
35 |
+
model=model_tag,
|
36 |
+
)
|
37 |
+
|
38 |
+
prompt = """
|
39 |
+
Experiments on two machine translation tasks show these models to be superior in quality while being more parallelizable and requiring significantly less time to train.
|
40 |
+
"""
|
41 |
+
|
42 |
+
classifier(
|
43 |
+
prompt,
|
44 |
+
) # classify the sentence
|
45 |
+
|
46 |
+
```
|
47 |
## metadata
|
48 |
|
49 |
|