pszemraj commited on
Commit
9ef85a9
1 Parent(s): b3c3822

Update README.md

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