| 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() | |