File size: 521 Bytes
2b9940a
01e798e
2b9940a
01e798e
2041000
 
01e798e
2b9940a
01e798e
 
 
 
2b9940a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import gradio as gr
from transformers import AutoTokenizer, AutoModelForSequenceClassification

def plagiarism(input):
    tokenizer = AutoTokenizer.from_pretrained("jpelhaw/longformer-base-plagiarism-detection")
    model = AutoModelForSequenceClassification.from_pretrained("jpelhaw/longformer-base-plagiarism-detection")
    example = tokenizer.tokenize(input, add_special_tokens=True)

    answer = model(**example)
    return answer

iface = gr.Interface(fn=plagiarism, inputs="text", outputs="text")
iface.launch()