Update README.md
Browse files
README.md
CHANGED
@@ -25,19 +25,19 @@ Enhanced version from version 1.0 with larger dataset.
|
|
25 |
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
26 |
Step 1: Map all Chinese word from original text to Sino-Vietnamese with [map.json](https://huggingface.co/haruyuu/viT5_han-vie_v1.1/blob/main/map.json) file
|
27 |
|
28 |
-
|
29 |
-
with open('/kaggle/input/chingchongdingdong/map.json', encoding = 'utf-8') as f
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
|
42 |
Step 2: Load model and generate
|
43 |
|
|
|
25 |
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
26 |
Step 1: Map all Chinese word from original text to Sino-Vietnamese with [map.json](https://huggingface.co/haruyuu/viT5_han-vie_v1.1/blob/main/map.json) file
|
27 |
|
28 |
+
'''python
|
29 |
+
with open('/kaggle/input/chingchongdingdong/map.json', encoding = 'utf-8') as f:
|
30 |
+
map = json.load(f)
|
31 |
+
global map
|
32 |
+
def mapping(text):
|
33 |
+
for i in text:
|
34 |
+
try:
|
35 |
+
x = ' ' + map[i] + ' '
|
36 |
+
text = text.replace(i, x)
|
37 |
+
except:
|
38 |
+
continue
|
39 |
+
return text.strip()
|
40 |
+
'''
|
41 |
|
42 |
Step 2: Load model and generate
|
43 |
|