| | import pandas as pd |
| | import gradio as gr |
| | from transformers import pipeline |
| |
|
| | |
| | csv_url = "https://huggingface.co/spaces/kataniccc/tekst/blob/main/submission.csv" |
| |
|
| | |
| | df = pd.read_csv(csv_url) |
| |
|
| | |
| | model_nm = 'microsoft/deberta-v3-small' |
| | classifier = pipeline("text-classification", model=model_nm) |
| |
|
| | |
| | def predict_text(input_text): |
| | prediction = classifier(input_text) |
| | return prediction |
| |
|
| | |
| | text_input = gr.inputs.Textbox(lines=7, label="Unesite tekst") |
| | output_text = gr.outputs.Textbox(label="Predikcija") |
| | gr.Interface(predict_text, inputs=text_input, outputs=output_text).launch() |
| |
|
| |
|