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

def plagiarism(input):
    
    AutoModelForSequenceClassification("jpelhaw/longformer-base-plagiarism-detection")
    AutoTokenizer.from_pretrained("jpelhaw/longformer-base-plagiarism-detection")

    example = tokenizer.tokenize(input, add_special_tokens=True)

    answer = model(**example)

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