howanching-clara
commited on
Commit
•
210a301
1
Parent(s):
fea72f8
Update README.md
Browse files
README.md
CHANGED
@@ -51,7 +51,13 @@ Limitations:
|
|
51 |
```python
|
52 |
from transformers import pipeline
|
53 |
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
# Perform inference on your input text
|
57 |
your_text = "your text here."
|
|
|
51 |
```python
|
52 |
from transformers import pipeline
|
53 |
|
54 |
+
# return
|
55 |
+
# eg. [{'label': 'EXAMPLE', 'score': 0.9601941108703613}]
|
56 |
+
classifier = pipeline("text-classification", model="howanching-clara/classifier_for_academic_texts", tokenizer="howanching-clara/classifier_for_academic_texts", return_all_scores=True)
|
57 |
+
|
58 |
+
# return output for all labels
|
59 |
+
# eg. [[{'label': 'OUT OF SCOPE', 'score': 0.011086337268352509}, {'label': 'MAIN TEXT', 'score': 0.7917709350585938}, {'label': 'EXAMPLE', 'score': 0.1910761147737503}, {'label': 'REFERENCE', 'score': 0.0060666087083518505}]]
|
60 |
+
classifier = pipeline("text-classification", model="howanching-clara/classifier_for_academic_texts", tokenizer="howanching-clara/classifier_for_academic_texts", return_all_scores=True)
|
61 |
|
62 |
# Perform inference on your input text
|
63 |
your_text = "your text here."
|