Spaces:
Running
Running
Yurii Paniv
commited on
Commit
·
f99f689
1
Parent(s):
8812d27
Lowercase symbols for accentor model
Browse files
stress.py
CHANGED
|
@@ -23,7 +23,7 @@ def accent_word(word):
|
|
| 23 |
return plused_words[0]
|
| 24 |
|
| 25 |
def sentence_to_stress(sentence):
|
| 26 |
-
words = sentence.split()
|
| 27 |
words = sum([[word, " "] for word in words], start=[])
|
| 28 |
new_list = []
|
| 29 |
for word in words:
|
|
@@ -64,6 +64,10 @@ if __name__ == "__main__":
|
|
| 64 |
print(sentence_to_stress(sentence))
|
| 65 |
sentence = "Привіт, як тебе звати?"
|
| 66 |
print(sentence_to_stress(sentence))
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
#test_words1 = ["словотворення", "архаїчний", "програма", "а-ля-фуршет"]
|
| 68 |
|
| 69 |
stressed_words = accentor.predict(["привіт"], mode='stress')
|
|
|
|
| 23 |
return plused_words[0]
|
| 24 |
|
| 25 |
def sentence_to_stress(sentence):
|
| 26 |
+
words = sentence.lower().split()
|
| 27 |
words = sum([[word, " "] for word in words], start=[])
|
| 28 |
new_list = []
|
| 29 |
for word in words:
|
|
|
|
| 64 |
print(sentence_to_stress(sentence))
|
| 65 |
sentence = "Привіт, як тебе звати?"
|
| 66 |
print(sentence_to_stress(sentence))
|
| 67 |
+
sentence = "АННА - український панк-рок гурт"
|
| 68 |
+
print(sentence_to_stress(sentence))
|
| 69 |
+
sentence = "Не тільки в Україні таке може бути."
|
| 70 |
+
print(sentence_to_stress(sentence))
|
| 71 |
#test_words1 = ["словотворення", "архаїчний", "програма", "а-ля-фуршет"]
|
| 72 |
|
| 73 |
stressed_words = accentor.predict(["привіт"], mode='stress')
|