pszemraj commited on
Commit
c5d512c
1 Parent(s): e6db87e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -0
README.md CHANGED
@@ -24,6 +24,31 @@ widget:
24
  - This is a fine-tuned checkpoint of `microsoft/xtremedistil-l12-h384-uncased` 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/xtremedistil-l12-h384-uncased` for document section text classification
25
  - possible document section classes are:BACKGROUND, CONCLUSIONS, METHODS, OBJECTIVE, RESULTS,
26
 
27
+ ## usage in python
28
+
29
+ install transformers as needed: `pip install -U transformers`
30
+
31
+ run the following, changing the example text to your use case:
32
+
33
+ ```
34
+ from transformers import pipeline
35
+
36
+ model_tag = "ml4pubmed/xtremedistil-l12-h384-uncased_pub_section"
37
+ classifier = pipeline(
38
+ 'text-classification',
39
+ model=model_tag,
40
+ )
41
+
42
+ prompt = """
43
+ 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.
44
+ """
45
+
46
+ classifier(
47
+ prompt,
48
+ ) # classify the sentence
49
+
50
+ ```
51
+
52
  ## metadata
53
 
54