|
import gradio as gr |
|
from ukrainian_accentor_transformer import Accentor |
|
|
|
|
|
|
|
accentor = Accentor() |
|
|
|
|
|
|
|
def accentification(sentence): |
|
accented_sentence = accentor(sentence) |
|
return accented_sentence |
|
|
|
|
|
|
|
iface = gr.Interface( |
|
fn=accentification, |
|
inputs=gr.inputs.Textbox(label="Input"), |
|
outputs=gr.outputs.Textbox(label="Stressed"), |
|
examples=[ |
|
"Помилки вчать людей. Молодець, ти не зробив жодної помилки.", |
|
"Роботи підкорять світ, але від роботи не втечеш", |
|
"Золоті яйця, але нема ні яйця", |
|
"Треба ще пошукати такий міцний замок. А це Замок Вінгерський.", |
|
], |
|
title="Ukrainian Accentor Transformer", |
|
article="Trained on dataset - [News corpus](https://lang.org.ua/en/corpora/#anchor5) by [Dmytro Chaplynskyi](https://github.com/dchaplinsky) from [lang-uk](https://github.com/lang-uk) \n" |
|
+ "Stressed using [ukrainian-word-stress](https://github.com/lang-uk/ukrainian-word-stress) by [Oleksiy Syvokon](https://github.com/asivokon) \n" |
|
) |
|
iface.launch() |