Matheus Frata
Add transformers lib
257a521
raw
history blame
No virus
370 Bytes
import gradio as gr
from transformers import pipeline
classifier = pipeline("sentiment-analysis")
def check_sentiment(phrase: str) -> str:
classification = classifier(phrase)
return classification[0]["label"]
def main():
iface = gr.Interface(fn=check_sentiment, inputs="text", outputs="text")
iface.launch()
if __name__ == "__main__":
main()