|
|
|
|
|
from transformers import pipeline |
|
import gradio as gr |
|
|
|
model = "Aansh123/test_trainer" |
|
classifier = pipeline("Classification", model = model) |
|
|
|
def classification(sentence): |
|
return classifier(sentence)[0]['text-classification'] |
|
|
|
iface = gr.Interface( |
|
fn = classification, |
|
inputs = gr.inputs.Textbox(label="Input your Review"), |
|
outputs = gr.outputs.Textbox(label="Rating"), |
|
title = "Review Rating", |
|
description = "Sentiment Analysis of Review and provision of final Ratings using a fine-tuned model." |
|
) |
|
|
|
iface.launch() |