qanastek's picture
Update
3542965
raw
history blame
541 Bytes
import gradio as gr
from flair.data import Sentence
from flair.models import SequenceTagger
# Load the model
model = SequenceTagger.load("qanastek/pos-french")
def greet(content):
# George Washington est allé à Washington
# res = "Hello " + content + "!!"
sentence = Sentence(content)
# predict tags
model.predict(sentence)
# print predicted pos tags
res = sentence.to_tagged_string()
return res
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()