Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import pipeline | |
| model = "fasherr/toxicity_rubert" | |
| pipe = pipeline("text-classification", model=model) | |
| def predict(text): | |
| res = pipe(text) | |
| return f"{res[0]['label']} - {res[0]['score']:.2%}" | |
| site = gr.Interface( | |
| fn=predict, | |
| inputs=gr.Textbox(placeholder="Введите текст"), | |
| outputs="text", | |
| title="Классификатор токсичности", | |
| description="Определение токсичноти текста на русском языке" | |
| ) | |
| site.launch() |