NorBERT / app.py
jeromex1's picture
Create app.py
0a8d6cb verified
raw
history blame
571 Bytes
import gradio as gr
from transformers import pipeline
# Charge ton modèle NorBERT depuis le hub
clf = pipeline("text-classification", model="jeromex1/NorBERT_Chti")
def predict(text):
return clf(text)
# Interface utilisateur web
demo = gr.Interface(
fn=predict,
inputs=gr.Textbox(lines=2, placeholder="Écris une phrase en Chti..."),
outputs="label",
title="NorBERT – Analyse de sentiments en Chti",
description="Fine-tuning de CamemBERT pour la classification (positif / neutre / négatif)."
)
if __name__ == "__main__":
demo.launch()