Update README.md
Browse files
README.md
CHANGED
@@ -89,7 +89,6 @@ def insert_accents(text, model, tokenizer):
|
|
89 |
|
90 |
|
91 |
text = "Nhin nhung mua thu di, em nghe sau len trong nang."
|
92 |
-
|
93 |
tokens, predictions = insert_accents(text, model, tokenizer)
|
94 |
```
|
95 |
|
@@ -171,7 +170,10 @@ Obtained:
|
|
171 |
[('Nhin', {217}), ('nhung', {388}), ('mua', {407}), ('thu', {378}), ('di,', {120, 0}), ('em', {185}), ('nghe', {185}), ('sau', {41}), ('len', {188}), ('trong', {302}), ('nang.', {0, 14})]
|
172 |
```
|
173 |
|
174 |
-
|
|
|
|
|
|
|
175 |
|
176 |
```python
|
177 |
def get_accented_words(merged_tokens_preds, label_list):
|
@@ -211,7 +213,8 @@ In this example, the model made 1 mistake with the word "sầu" (but predicted "
|
|
211 |
More info can be found <a href="https://peterhung.org/tech/insert-vietnamese-accent-transformer-model/#vs-hmm" target="_blank">here</a>.
|
212 |
|
213 |
|
|
|
214 |
## Live Demo
|
215 |
There is a live demo of this model available <a href="https://ai.vietnameseaccent.com/" target="_blank">here</a>.
|
216 |
|
217 |
-
This demo is run on CPU so the speed is
|
|
|
89 |
|
90 |
|
91 |
text = "Nhin nhung mua thu di, em nghe sau len trong nang."
|
|
|
92 |
tokens, predictions = insert_accents(text, model, tokenizer)
|
93 |
```
|
94 |
|
|
|
170 |
[('Nhin', {217}), ('nhung', {388}), ('mua', {407}), ('thu', {378}), ('di,', {120, 0}), ('em', {185}), ('nghe', {185}), ('sau', {41}), ('len', {188}), ('trong', {302}), ('nang.', {0, 14})]
|
171 |
```
|
172 |
|
173 |
+
For each word, we now have a set of tag indexes to apply to it.
|
174 |
+
For ex, for the first word "Nhin" above, we'd apply the tag at index `217` in our tags set.
|
175 |
+
|
176 |
+
The following is our final part:
|
177 |
|
178 |
```python
|
179 |
def get_accented_words(merged_tokens_preds, label_list):
|
|
|
213 |
More info can be found <a href="https://peterhung.org/tech/insert-vietnamese-accent-transformer-model/#vs-hmm" target="_blank">here</a>.
|
214 |
|
215 |
|
216 |
+
|
217 |
## Live Demo
|
218 |
There is a live demo of this model available <a href="https://ai.vietnameseaccent.com/" target="_blank">here</a>.
|
219 |
|
220 |
+
This demo is run on CPU so the speed is expected to be not as fast as when run on GPU.
|