infinitive / app.py
pip64
test
adff43b
raw
history blame contribute delete
378 Bytes
import gradio as gr
import pymorphy3
morph = pymorphy3.MorphAnalyzer()
morph = pymorphy3.MorphAnalyzer(lang='ru')
def infinitive(text):
words = text.split()
newstr = ""
for word in words:
p = morph.parse(str(word))[0]
newstr += f"{p.normal_form} "
return newstr
iface = gr.Interface(fn=infinitive, inputs="text", outputs="text")
iface.launch()