Spaces:
Runtime error
Runtime error
Dominick Meady
commited on
Commit
·
01e798e
1
Parent(s):
2b9940a
updated plagiarism
Browse files
app.py
CHANGED
@@ -1,7 +1,13 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
def
|
4 |
-
|
|
|
|
|
5 |
|
6 |
-
|
|
|
|
|
|
|
7 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
3 |
|
4 |
+
def plagiarism(input):
|
5 |
+
tokenizer = AutoTokenizer.from_pretrained("jpelhaw/xlnet-base-plagiarism-detection")
|
6 |
+
model = AutoModelForSequenceClassification.from_pretrained("jpelhaw/xlnet-base-plagiarism-detection")
|
7 |
+
example = tokenizer.tokenize(input, add_special_tokens=True)
|
8 |
|
9 |
+
answer = model(**example)
|
10 |
+
return answer
|
11 |
+
|
12 |
+
iface = gr.Interface(fn=plagiarism, inputs="text", outputs="text")
|
13 |
iface.launch()
|