| | import pandas as pd |
| | from fastai.text.all import * |
| | from datasets import load_dataset |
| |
|
| | try: |
| | import transformers |
| | except ImportError: |
| | os.system('pip install transformers') |
| | import transformers |
| |
|
| | from transformers import pipeline |
| | import gradio as gr |
| |
|
| | |
| | |
| | |
| | |
| |
|
| | |
| | |
| | |
| | |
| |
|
| | classifier = pipeline('text-classification', model='maviced/clasificador-rotten-tomatoes') |
| |
|
| | def predict(text): |
| | |
| | |
| | |
| | return classifier(text)[0]['label'] |
| | |
| | gr.Interface(fn=predict, inputs="text", outputs="text",examples=['A visually stunning and emotionally resonant film that leaves a lasting impact.', |
| | 'The film, while visually stunning, falls short with a predictable plot and underdeveloped characters, leaving the audience craving more substance.']).launch(share=True) |