Update README.md
Browse files
README.md
CHANGED
@@ -41,7 +41,27 @@ A fine-tuned Galactica model to detect machine-generated scientific papers based
|
|
41 |
|
42 |
### Direct Use
|
43 |
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
[More Information Needed]
|
47 |
|
|
|
41 |
|
42 |
### Direct Use
|
43 |
|
44 |
+
```{python}
|
45 |
+
from transformers import AutoTokenizer, OPTForSequenceClassification, pipeline
|
46 |
+
|
47 |
+
model = OPTForSequenceClassification.from_pretrained("tum-nlp/IDMGSP-Galactica-TRAIN")
|
48 |
+
|
49 |
+
tokenizer = AutoTokenizer.from_pretrained("tum-nlp/IDMGSP")
|
50 |
+
|
51 |
+
reader = pipeline("text-classification", model=model, tokenizer = tokenizer)
|
52 |
+
|
53 |
+
reader(
|
54 |
+
'''
|
55 |
+
Abstract:
|
56 |
+
....
|
57 |
+
|
58 |
+
Introduction:
|
59 |
+
....
|
60 |
+
|
61 |
+
Conclusion:
|
62 |
+
...'''
|
63 |
+
)
|
64 |
+
```
|
65 |
|
66 |
[More Information Needed]
|
67 |
|