|
import pandas as pd |
|
from fastai.text.all import * |
|
from datasets import load_dataset |
|
from transformers import pipeline |
|
import gradio as gr |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classifier = pipeline('text-classification', model='edgilr/clasificador-rotten-tomatoes') |
|
|
|
def predict(txt): |
|
|
|
|
|
|
|
|
|
return classifier(txt)[0]['label'] |
|
|
|
gr.Interface(fn=predict, inputs="text", outputs="text", |
|
examples=['the story gives ample opportunity for large-scale action and suspense , which director shekhar kapur supplies with tremendous skill .', |
|
'the thing looks like a made-for-home-video quickie .']).launch(share=True) |