Update README.md
Browse files
README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
|
| 5 |
# modernbert-base-chinese
|
|
@@ -22,20 +24,20 @@ fill_mask = pipeline(
|
|
| 22 |
tokenizer="ming030890/modernbert-base-chinese"
|
| 23 |
)
|
| 24 |
|
| 25 |
-
# Simplified Chinese
|
| 26 |
-
result = fill_mask("今天天
|
| 27 |
print(result)
|
| 28 |
|
| 29 |
-
# Traditional Chinese Example
|
| 30 |
-
result = fill_mask("
|
| 31 |
print(result)
|
| 32 |
|
| 33 |
-
# Cantonese Example
|
| 34 |
-
result = fill_mask("
|
| 35 |
print(result)
|
| 36 |
|
| 37 |
-
# Mixed Chinese and English Example
|
| 38 |
-
result = fill_mask("我
|
| 39 |
print(result)
|
| 40 |
```
|
| 41 |
|
|
@@ -46,4 +48,4 @@ from transformers import AutoTokenizer, AutoModelForMaskedLM
|
|
| 46 |
|
| 47 |
tokenizer = AutoTokenizer.from_pretrained("ming030890/modernbert-base-chinese")
|
| 48 |
model = AutoModelForMaskedLM.from_pretrained("ming030890/modernbert-base-chinese")
|
| 49 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- zh
|
| 5 |
---
|
| 6 |
|
| 7 |
# modernbert-base-chinese
|
|
|
|
| 24 |
tokenizer="ming030890/modernbert-base-chinese"
|
| 25 |
)
|
| 26 |
|
| 27 |
+
# Mainland Mandarin (Simplified Chinese)
|
| 28 |
+
result = fill_mask("今天天[MASK]真好。")
|
| 29 |
print(result)
|
| 30 |
|
| 31 |
+
# Traditional Chinese Example — food
|
| 32 |
+
result = fill_mask("這碗牛[MASK]麵好吃。")
|
| 33 |
print(result)
|
| 34 |
|
| 35 |
+
# Cantonese Example — slang
|
| 36 |
+
result = fill_mask("你咁樣做真係[MASK]衰。")
|
| 37 |
print(result)
|
| 38 |
|
| 39 |
+
# Mixed Chinese and English Example — code switching
|
| 40 |
+
result = fill_mask("我啱啱買咗[MASK]新laptop。")
|
| 41 |
print(result)
|
| 42 |
```
|
| 43 |
|
|
|
|
| 48 |
|
| 49 |
tokenizer = AutoTokenizer.from_pretrained("ming030890/modernbert-base-chinese")
|
| 50 |
model = AutoModelForMaskedLM.from_pretrained("ming030890/modernbert-base-chinese")
|
| 51 |
+
```
|