import torch from transformers import pipeline import gradio as gr classifier = pipeline(model="marsgrins/moby") def POS_pipe(word): pos = classifier(word)[0]['entity'] return 'I think the part-of-speech of "' + word + '" is "' + pos + '".' title = "Part-of-Speech Classifier" description = "Type in a single English word and I'll try to guess what kind of word it is!" article="

by Marshall Grinstead

Blog

Twitter

" gr.Interface( fn=POS_pipe, inputs=gr.Textbox(), outputs=gr.Textbox(), title=title, description=description, article=article ).launch()