Spaces:
Runtime error
Runtime error
Commit ·
af3d42a
0
Parent(s):
first commit
Browse filesFiles changed (27)
- .gitignoreAdded+6
- app.pyAdded+165
- bert/bert-large-cantonese/README.mdAdded+82
- bert/bert-large-cantonese/added_tokens.jsonAdded+502
- bert/bert-large-cantonese/config.jsonAdded+24
- bert/bert-large-cantonese/generation_config.jsonAdded+5
- bert/bert-large-cantonese/special_tokens_map.jsonAdded+37
- bert/bert-large-cantonese/tokenizer.jsonAdded
- bert/bert-large-cantonese/tokenizer_config.jsonAdded+4062
- bert/bert_models.jsonAdded+15
- bert/deberta-v3-large/.gitattributesAdded+27
- bert/deberta-v3-large/README.mdAdded+93
- bert/deberta-v3-large/config.jsonAdded+22
- bert/deberta-v3-large/generator_config.jsonAdded+22
- bert/deberta-v3-large/spm.modelAdded+3
- bert/deberta-v3-large/tokenizer_config.jsonAdded+4
- infer.pyAdded+135
- requirements.txtAdded+6
- text/__init__.pyAdded+30
- text/cantonese.pyAdded+273
- text/cantonese_bert.pyAdded+121
- text/cleaner.pyAdded+28
- text/english.pyAdded+494
- text/english_bert_mock.pyAdded+58
- text/jyutping.csvAdded
- text/symbols.pyAdded+152
- text/yue_dict.txtAdded
123456__pycache__pytorch_model.binonnx/*.cachecmudict.repcmudict_cache.pickle123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165from infer import OnnxInferenceSessionfrom text import cleaned_text_to_sequence, get_bertfrom text.cleaner import clean_textimport numpy as npfrom huggingface_hub import hf_hub_downloadimport asynciofrom pathlib import Path
OnnxSession = None
models = [ { "local_path": "./bert/bert-large-cantonese", "repo_id": "hon9kon9ize/bert-large-cantonese", "files": [ "pytorch_model.bin" ] }, { "local_path": "./bert/deberta-v3-large", "repo_id": "microsoft/deberta-v3-large", "files": [ "spm.model", "pytorch_model.bin" ] }, { "local_path": "./onnx", "repo_id": "hon9kon9ize/bert-vits-zoengjyutgaai-onnx", "files": [ "BertVits2.2PT.json", "BertVits2.2PT/BertVits2.2PT_enc_p.onnx", "BertVits2.2PT/BertVits2.2PT_emb.onnx", "BertVits2.2PT/BertVits2.2PT_dp.onnx", "BertVits2.2PT/BertVits2.2PT_sdp.onnx", "BertVits2.2PT/BertVits2.2PT_flow.onnx", "BertVits2.2PT/BertVits2.2PT_dec.onnx" ] }]
def get_onnx_session(): global OnnxSession
if OnnxSession is not None: return OnnxSession
OnnxSession = OnnxInferenceSession( { "enc": "onnx/BertVits2.2PT/BertVits2.2PT_enc_p.onnx", "emb_g": "onnx/BertVits2.2PT/BertVits2.2PT_emb.onnx", "dp": "onnx/BertVits2.2PT/BertVits2.2PT_dp.onnx", "sdp": "onnx/BertVits2.2PT/BertVits2.2PT_sdp.onnx", "flow": "onnx/BertVits2.2PT/BertVits2.2PT_flow.onnx", "dec": "onnx/BertVits2.2PT/BertVits2.2PT_dec.onnx", }, Providers=["CPUExecutionProvider"], ) return OnnxSession
def download_model_files(repo_id, files, local_path): for file in files: if not Path(local_path).joinpath(file).exists(): hf_hub_download( repo_id, file, local_dir=local_path, local_dir_use_symlinks=False )
def download_models(): for data in models: download_model_files(data["repo_id"], data["files"], data["local_path"])
def intersperse(lst, item): result = [item] * (len(lst) * 2 + 1) result[1::2] = lst return result
def get_text(text, language_str, style_text=None, style_weight=0.7): style_text = None if style_text == "" else style_text # 在此处实现当前版本的get_text norm_text, phone, tone, word2ph = clean_text(text, language_str) phone, tone, language = cleaned_text_to_sequence(phone, tone, language_str)
# add blank phone = intersperse(phone, 0) tone = intersperse(tone, 0) language = intersperse(language, 0) for i in range(len(word2ph)): word2ph[i] = word2ph[i] * 2 word2ph[0] += 1
bert_ori = get_bert( norm_text, word2ph, language_str, "cpu", style_text, style_weight ) del word2ph assert bert_ori.shape[-1] == len(phone), phone
if language_str == "EN": en_bert = bert_ori yue_bert = np.random.randn(1024, len(phone)) elif language_str == "YUE": en_bert = np.random.randn(1024, len(phone)) yue_bert = bert_ori else: raise ValueError("language_str should be EN or YUE")
assert yue_bert.shape[-1] == len( phone ), f"Bert seq len {yue_bert.shape[-1]} != {len(phone)}"
phone = np.asarray(phone) tone = np.asarray(tone) language = np.asarray(language) en_bert = np.asarray(en_bert.T) yue_bert = np.asarray(yue_bert.T)
return en_bert, yue_bert, phone, tone, language
# Text-to-speech functionasync def text_to_speech(text, sid=0, language="YUE"): Session = get_onnx_session() if not text.strip(): return None, gr.Warning("Please enter text to convert.") en_bert, yue_bert, x, tone, language = get_text(text, language) sid = np.array([sid]) audio = Session(x, tone, language, en_bert, yue_bert, sid)
return audio[0][0]
# Create Gradio applicationimport gradio as gr
# Gradio interface functiondef tts_interface(text): audio = asyncio.run(text_to_speech(text, 0, "YUE")) return 44100, audio
async def create_demo(): description = """廣東話語音生成器,基於Bert-VITS2模型
注意:model 本身支持廣東話同英文,但呢個 space 未實現中英夾雜生成。""" demo = gr.Interface( fn=tts_interface, inputs=[ gr.Textbox(label="Input Text", lines=5), ], outputs=[ gr.Audio(label="Generated Audio"), ], title="Cantonese TTS Text-to-Speech", description=description, analytics_enabled=False, allow_flagging=False ) return demo
# Run the applicationif __name__ == "__main__": download_models()
demo = asyncio.run(create_demo()) demo.launch()12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182---library_name: transformerslanguage: - yuelicense: cc-by-4.0tags: - generated_from_trainerpipeline_tag: fill-maskwidget: - text: 香港原本[MASK]一個人煙稀少嘅漁港。 example_title: 係model-index: - name: bert-large-cantonese results: []---
# bert-large-cantonese
## Description
This model is tranied from scratch on Cantonese text. It is a BERT model with a large architecture (24-layer, 1024-hidden, 16-heads, 326M parameters).
The first training stage is to pre-train the model on 128 length sequences with a batch size of 512 for 1 epoch. the second stage is to continued pre-train the model on 512 length sequences with a batch size of 512 for one more epoch.
## How to use
You can use this model directly with a pipeline for masked language modeling:
```pythonfrom transformers import pipeline
mask_filler = pipeline( "fill-mask", model="hon9kon9ize/bert-large-cantonese")
mask_filler("雞蛋六隻,糖呢就兩茶匙,仲有[MASK]橙皮添。")
; [{'score': 0.08160534501075745,; 'token': 943,; 'token_str': '個',; 'sequence': '雞 蛋 六 隻 , 糖 呢 就 兩 茶 匙 , 仲 有 個 橙 皮 添 。'},; {'score': 0.06182105466723442,; 'token': 1576,; 'token_str': '啲',; 'sequence': '雞 蛋 六 隻 , 糖 呢 就 兩 茶 匙 , 仲 有 啲 橙 皮 添 。'},; {'score': 0.04600336775183678,; 'token': 1646,; 'token_str': '嘅',; 'sequence': '雞 蛋 六 隻 , 糖 呢 就 兩 茶 匙 , 仲 有 嘅 橙 皮 添 。'},; {'score': 0.03743772581219673,; 'token': 3581,; 'token_str': '橙',; 'sequence': '雞 蛋 六 隻 , 糖 呢 就 兩 茶 匙 , 仲 有 橙 橙 皮 添 。'},; {'score': 0.031560592353343964,; 'token': 5148,; 'token_str': '紅',; 'sequence': '雞 蛋 六 隻 , 糖 呢 就 兩 茶 匙 , 仲 有 紅 橙 皮 添 。'}]```
## Training hyperparameters
The following hyperparameters were used during first training:
- Batch size: 512- Learning rate: 1e-4- Learning rate scheduler: linear decay- 1 Epoch- Warmup ratio: 0.1
Loss plot on [WanDB](https://api.wandb.ai/links/indiejoseph/v3ljlpmp)
The following hyperparameters were used during second training:
- Batch size: 512- Learning rate: 5e-5- Learning rate scheduler: linear decay- 1 Epoch- Warmup ratio: 0.1
Loss plot on [WanDB](https://api.wandb.ai/links/indiejoseph/vcm3q1ef)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502{ "㔷": 21620, "㖭": 21330, "㚻": 21255, "㞗": 21216, "㞘": 21384, "㦸": 21493, "㨂": 21307, "㩒": 21182, "㴓": 21485, "㷫": 21265, "乸": 21143, "仼": 21501, "佮": 21234, "侘": 21537, "偲": 21220, "僆": 21421, "僞": 21471, "僳": 21564, "儁": 21422, "儍": 21388, "兗": 21368, "冚": 21138, "冧": 21137, "凖": 21454, "勷": 21522, "卌": 21284, "卽": 21186, "厏": 21439, "厓": 21449, "厠": 21256, "厹": 21285, "吔": 21205, "吲": 21403, "吿": 21547, "呑": 21331, "呔": 21204, "咃": 21533, "咇": 21300, "咼": 21565, "哚": 21376, "唂": 21402, "唒": 21250, "唓": 21401, "唞": 21175, "唥": 21144, "唨": 21159, "唪": 21146, "唻": 21223, "啋": 21428, "啩": 21178, "啹": 21482, "喐": 21165, "喥": 21316, "喼": 21192, "嗌": 21129, "嗮": 21130, "嗱": 21145, "嘥": 21151, "噃": 21197, "噉": 21128, "噏": 21170, "噚": 21135, "嚙": 21282, "嚡": 21236, "嚦": 21455, "嚫": 21346, "嚹": 21158, "嚿": 21134, "囇": 21612, "囖": 21140, "囘": 21504, "坭": 21315, "垻": 21538, "埐": 21294, "埞": 21180, "埲": 21288, "堊": 21309, "塡": 21511, "塱": 21187, "塲": 21445, "塹": 21481, "奀": 21306, "奭": 21492, "妺": 21465, "姵": 21536, "娸": 21569, "媺": 21431, "嫗": 21311, "嫰": 21323, "嬋": 21400, "嬲": 21131, "孭": 21179, "孲": 21210, "孻": 21264, "尐": 21157, "尙": 21520, "尢": 21619, "屘": 21484, "屙": 21160, "岃": 21392, "嶠": 21267, "幗": 21269, "幪": 21279, "廡": 21530, "廸": 21217, "廻": 21479, "彊": 21446, "彖": 21335, "徂": 21155, "忟": 21301, "惗": 21353, "愃": 21527, "愨": 21562, "慇": 21603, "慤": 21389, "憓": 21477, "戇": 21181, "戙": 21281, "戥": 21162, "扤": 21541, "扲": 21549, "扺": 21293, "抆": 21266, "抌": 21258, "抺": 21238, "拃": 21188, "拏": 21271, "拕": 21476, "挐": 21524, "捽": 21212, "掕": 21166, "掗": 21486, "掟": 21153, "掹": 21214, "揈": 21251, "揞": 21429, "揦": 21371, "揼": 21184, "揾": 21132, "搣": 21222, "搦": 21383, "搲": 21317, "搾": 21398, "摑": 21268, "摱": 21438, "摷": 21209, "撘": 21224, "撣": 21615, "撳": 21141, "撾": 21183, "擗": 21589, "擧": 21521, "擸": 21334, "攆": 21544, "攰": 21139, "攷": 21270, "旚": 21582, "旯": 21280, "旼": 21399, "昃": 21483, "昅": 21528, "昪": 21377, "昰": 21459, "昺": 21380, "暎": 21558, "暪": 21437, "曱": 21185, "朏": 21557, "朳": 21572, "柙": 21551, "栢": 21193, "栱": 21581, "梘": 21219, "椏": 21385, "椗": 21618, "榘": 21560, "榚": 21369, "樋": 21601, "樖": 21150, "樨": 21475, "樴": 21413, "橛": 21156, "檠": 21272, "櫈": 21173, "櫟": 21516, "櫳": 21215, "欏": 21500, "殮": 21295, "殻": 21207, "氘": 21616, "氚": 21574, "氬": 21447, "氼": 21329, "沊": 21509, "沔": 21552, "沚": 21490, "泂": 21461, "涷": 21340, "淥": 21235, "淸": 21363, "湉": 21443, "湞": 21626, "湴": 21407, "滘": 21161, "漖": 21627, "潁": 21396, "潯": 21241, "澌": 21292, "濰": 21394, "濶": 21468, "瀡": 21435, "瀦": 21535, "灃": 21625, "灕": 21420, "炆": 21172, "炑": 21474, "炘": 21621, "烚": 21189, "烴": 21229, "焫": 21248, "煇": 21227, "煬": 21247, "煱": 21347, "燶": 21163, "燾": 21386, "牀": 21168, "牘": 21600, "猁": 21226, "猢": 21609, "猻": 21540, "獌": 21198, "獴": 21415, "珓": 21370, "琚": 21597, "琤": 21393, "琿": 21494, "瑂": 21423, "瑭": 21573, "璘": 21555, "璠": 21240, "璣": 21299, "璦": 21556, "璩": 21508, "瓘": 21554, "瓚": 21318, "甂": 21457, "甑": 21539, "甴": 21190, "畧": 21322, "畵": 21416, "疎": 21460, "疴": 21338, "痲": 21576, "痾": 21164, "癆": 21503, "癈": 21333, "癗": 21433, "癦": 21610, "癩": 21410, "睺": 21296, "砬": 21568, "砵": 21194, "硃": 21570, "硏": 21342, "硤": 21201, "礮": 21375, "祆": 21472, "祼": 21417, "禕": 21542, "禰": 21514, "稈": 21367, "穏": 21341, "窰": 21230, "竈": 21286, "竉": 21289, "竪": 21550, "笪": 21147, "筧": 21605, "篋": 21359, "簋": 21277, "簒": 21418, "粢": 21586, "糉": 21263, "糭": 21253, "糴": 21425, "紇": 21470, "紥": 21252, "綉": 21575, "綟": 21260, "綣": 21512, "綷": 21441, "緡": 21245, "緲": 21517, "縉": 21297, "縹": 21587, "繑": 21448, "繙": 21246, "缐": 21553, "罅": 21191, "罉": 21430, "罟": 21324, "羕": 21507, "羶": 21378, "翕": 21456, "耖": 21390, "肶": 21351, "胐": 21332, "脧": 21303, "脷": 21148, "腍": 21167, "膥": 21228, "膶": 21257, "臏": 21566, "舘": 21374, "舢": 21563, "舨": 21592, "艶": 21593, "苺": 21488, "茘": 21624, "菴": 21312, "蒴": 21343, "蓀": 21458, "蔴": 21177, "蕓": 21518, "藪": 21302, "蘄": 21613, "蘅": 21478, "蚧": 21579, "蛺": 21391, "蜑": 21358, "蝻": 21259, "螈": 21291, "蟈": 21419, "蟧": 21360, "蟶": 21233, "蠄": 21326, "蠏": 21467, "蠑": 21328, "衊": 21469, "裇": 21304, "褦": 21221, "褸": 21171, "覈": 21290, "覲": 21453, "觜": 21496, "訃": 21571, "訌": 21412, "訢": 21466, "詏": 21244, "詒": 21531, "誒": 21152, "謖": 21473, "謚": 21237, "謳": 21278, "谿": 21580, "豕": 21491, "趷": 21424, "跣": 21206, "踎": 21202, "踭": 21203, "踼": 21404, "躂": 21426, "躄": 21195, "躝": 21274, "軚": 21196, "軛": 21357, "軫": 21349, "軭": 21497, "軻": 21434, "輋": 21239, "迾": 21325, "逄": 21594, "逑": 21611, "逳": 21211, "邴": 21310, "郃": 21604, "鄕": 21406, "鄴": 21287, "酎": 21546, "釙": 21450, "鈷": 21548, "鈹": 21545, "鉍": 21584, "鉞": 21525, "鉬": 21588, "鉸": 21308, "鉼": 21387, "銥": 21462, "銨": 21365, "銫": 21440, "銻": 21532, "銼": 21432, "鋇": 21614, "鋯": 21590, "錀": 21499, "錒": 21498, "錕": 21372, "錡": 21199, "鍔": 21515, "鍚": 21273, "鍠": 21261, "鍬": 21379, "鍶": 21344, "鎅": 21339, "鎘": 21529, "鎢": 21362, "鏇": 21397, "鏐": 21585, "鏝": 21218, "鏵": 21444, "鏹": 21502, "鐡": 21505, "鑌": 21452, "鑭": 21567, "閂": 21154, "閆": 21463, "閙": 21366, "閤": 21381, "閪": 21200, "閭": 21409, "闐": 21591, "闓": 21442, "靑": 21405, "靭": 21262, "靱": 21599, "韃": 21242, "韞": 21354, "韮": 21254, "頊": 21348, "頴": 21327, "顓": 21427, "顥": 21411, "顳": 21319, "飮": 21561, "餬": 21276, "餸": 21133, "饀": 21414, "饉": 21534, "馱": 21480, "駖": 21356, "駙": 21617, "駟": 21489, "駡": 21598, "騫": 21314, "騭": 21364, "騮": 21174, "騾": 21487, "驃": 21336, "驄": 21337, "骹": 21355, "髀": 21142, "髹": 21350, "鬅": 21213, "鬈": 21408, "鬩": 21543, "鬭": 21495, "鬲": 21320, "魨": 21464, "鮋": 21596, "鮟": 21232, "鮫": 21352, "鯇": 21305, "鯡": 21623, "鯪": 21243, "鯭": 21382, "鰂": 21169, "鰹": 21345, "鱇": 21231, "鱘": 21395, "鱟": 21583, "鱲": 21208, "鳯": 21451, "鴞": 21275, "鴣": 21607, "鴴": 21622, "鵐": 21321, "鵞": 21510, "鵪": 21283, "鶉": 21249, "鶻": 21608, "鶿": 21559, "鷂": 21298, "鷄": 21176, "鷓": 21606, "鷸": 21373, "鸕": 21526, "鸛": 21361, "麪": 21149, "麫": 21577, "麿": 21225, "黐": 21136, "鼆": 21313, "鼇": 21602, "鼴": 21436, "鼷": 21506, "齲": 21519, "齶": 21578, "龑": 21523, "龠": 21595, "龢": 21513}123456789101112131415161718192021222324{ "architectures": [ "BertForMaskedLM" ], "attention_probs_dropout_prob": 0.1, "classifier_dropout": null, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "hidden_size": 1024, "initializer_range": 0.02, "intermediate_size": 4096, "layer_norm_eps": 1e-12, "max_position_embeddings": 512, "model_type": "bert", "num_attention_heads": 16, "num_hidden_layers": 24, "pad_token_id": 0, "position_embedding_type": "absolute", "torch_dtype": "float32", "transformers_version": "4.40.1", "type_vocab_size": 2, "use_cache": true, "vocab_size": 21628}12345{ "_from_model_config": true, "pad_token_id": 0, "transformers_version": "4.40.1"}12345678910111213141516171819202122232425262728293031323334353637{ "cls_token": { "content": "[CLS]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "mask_token": { "content": "[MASK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "pad_token": { "content": "[PAD]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "sep_token": { "content": "[SEP]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "unk_token": { "content": "[UNK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062{ "added_tokens_decoder": { "0": { "content": "[PAD]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "100": { "content": "[UNK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "101": { "content": "[CLS]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "102": { "content": "[SEP]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "103": { "content": "[MASK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "21128": { "content": "噉", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21129": { "content": "嗌", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21130": { "content": "嗮", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21131": { "content": "嬲", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21132": { "content": "揾", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21133": { "content": "餸", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21134": { "content": "嚿", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21135": { "content": "噚", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21136": { "content": "黐", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21137": { "content": "冧", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21138": { "content": "冚", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21139": { "content": "攰", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21140": { "content": "囖", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21141": { "content": "撳", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21142": { "content": "髀", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21143": { "content": "乸", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21144": { "content": "唥", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21145": { "content": "嗱", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21146": { "content": "唪", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21147": { "content": "笪", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21148": { "content": "脷", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21149": { "content": "麪", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21150": { "content": "樖", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21151": { "content": "嘥", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21152": { "content": "誒", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21153": { "content": "掟", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21154": { "content": "閂", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21155": { "content": "徂", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21156": { "content": "橛", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21157": { "content": "尐", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21158": { "content": "嚹", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21159": { "content": "唨", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21160": { "content": "屙", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21161": { "content": "滘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21162": { "content": "戥", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21163": { "content": "燶", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21164": { "content": "痾", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21165": { "content": "喐", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21166": { "content": "掕", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21167": { "content": "腍", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21168": { "content": "牀", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21169": { "content": "鰂", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21170": { "content": "噏", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21171": { "content": "褸", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21172": { "content": "炆", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21173": { "content": "櫈", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21174": { "content": "騮", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21175": { "content": "唞", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21176": { "content": "鷄", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21177": { "content": "蔴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21178": { "content": "啩", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21179": { "content": "孭", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21180": { "content": "埞", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21181": { "content": "戇", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21182": { "content": "㩒", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21183": { "content": "撾", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21184": { "content": "揼", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21185": { "content": "曱", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21186": { "content": "卽", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21187": { "content": "塱", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21188": { "content": "拃", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21189": { "content": "烚", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21190": { "content": "甴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21191": { "content": "罅", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21192": { "content": "喼", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21193": { "content": "栢", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21194": { "content": "砵", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21195": { "content": "躄", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21196": { "content": "軚", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21197": { "content": "噃", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21198": { "content": "獌", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21199": { "content": "錡", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21200": { "content": "閪", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21201": { "content": "硤", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21202": { "content": "踎", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21203": { "content": "踭", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21204": { "content": "呔", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21205": { "content": "吔", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21206": { "content": "跣", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21207": { "content": "殻", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21208": { "content": "鱲", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21209": { "content": "摷", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21210": { "content": "孲", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21211": { "content": "逳", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21212": { "content": "捽", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21213": { "content": "鬅", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21214": { "content": "掹", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21215": { "content": "櫳", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21216": { "content": "㞗", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21217": { "content": "廸", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21218": { "content": "鏝", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21219": { "content": "梘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21220": { "content": "偲", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21221": { "content": "褦", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21222": { "content": "搣", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21223": { "content": "唻", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21224": { "content": "撘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21225": { "content": "麿", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21226": { "content": "猁", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21227": { "content": "煇", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21228": { "content": "膥", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21229": { "content": "烴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21230": { "content": "窰", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21231": { "content": "鱇", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21232": { "content": "鮟", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21233": { "content": "蟶", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21234": { "content": "佮", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21235": { "content": "淥", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21236": { "content": "嚡", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21237": { "content": "謚", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21238": { "content": "抺", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21239": { "content": "輋", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21240": { "content": "璠", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21241": { "content": "潯", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21242": { "content": "韃", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21243": { "content": "鯪", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21244": { "content": "詏", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21245": { "content": "緡", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21246": { "content": "繙", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21247": { "content": "煬", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21248": { "content": "焫", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21249": { "content": "鶉", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21250": { "content": "唒", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21251": { "content": "揈", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21252": { "content": "紥", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21253": { "content": "糭", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21254": { "content": "韮", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21255": { "content": "㚻", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21256": { "content": "厠", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21257": { "content": "膶", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21258": { "content": "抌", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21259": { "content": "蝻", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21260": { "content": "綟", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21261": { "content": "鍠", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21262": { "content": "靭", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21263": { "content": "糉", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21264": { "content": "孻", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21265": { "content": "㷫", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21266": { "content": "抆", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21267": { "content": "嶠", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21268": { "content": "摑", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21269": { "content": "幗", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21270": { "content": "攷", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21271": { "content": "拏", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21272": { "content": "檠", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21273": { "content": "鍚", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21274": { "content": "躝", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21275": { "content": "鴞", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21276": { "content": "餬", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21277": { "content": "簋", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21278": { "content": "謳", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21279": { "content": "幪", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21280": { "content": "旯", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21281": { "content": "戙", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21282": { "content": "嚙", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21283": { "content": "鵪", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21284": { "content": "卌", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21285": { "content": "厹", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21286": { "content": "竈", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21287": { "content": "鄴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21288": { "content": "埲", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21289": { "content": "竉", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21290": { "content": "覈", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21291": { "content": "螈", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21292": { "content": "澌", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21293": { "content": "扺", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21294": { "content": "埐", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21295": { "content": "殮", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21296": { "content": "睺", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21297": { "content": "縉", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21298": { "content": "鷂", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21299": { "content": "璣", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21300": { "content": "咇", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21301": { "content": "忟", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21302": { "content": "藪", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21303": { "content": "脧", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21304": { "content": "裇", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21305": { "content": "鯇", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21306": { "content": "奀", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21307": { "content": "㨂", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21308": { "content": "鉸", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21309": { "content": "堊", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21310": { "content": "邴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21311": { "content": "嫗", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21312": { "content": "菴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21313": { "content": "鼆", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21314": { "content": "騫", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21315": { "content": "坭", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21316": { "content": "喥", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21317": { "content": "搲", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21318": { "content": "瓚", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21319": { "content": "顳", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21320": { "content": "鬲", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21321": { "content": "鵐", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21322": { "content": "畧", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21323": { "content": "嫰", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21324": { "content": "罟", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21325": { "content": "���", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21326": { "content": "蠄", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21327": { "content": "頴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21328": { "content": "蠑", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21329": { "content": "氼", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21330": { "content": "㖭", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21331": { "content": "呑", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21332": { "content": "胐", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21333": { "content": "癈", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21334": { "content": "擸", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21335": { "content": "彖", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21336": { "content": "驃", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21337": { "content": "驄", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21338": { "content": "疴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21339": { "content": "鎅", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21340": { "content": "涷", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21341": { "content": "穏", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21342": { "content": "硏", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21343": { "content": "蒴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21344": { "content": "鍶", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21345": { "content": "鰹", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21346": { "content": "嚫", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21347": { "content": "煱", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21348": { "content": "頊", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21349": { "content": "軫", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21350": { "content": "髹", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21351": { "content": "肶", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21352": { "content": "鮫", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21353": { "content": "惗", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21354": { "content": "韞", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21355": { "content": "骹", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21356": { "content": "駖", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21357": { "content": "軛", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21358": { "content": "蜑", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21359": { "content": "篋", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21360": { "content": "蟧", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21361": { "content": "鸛", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21362": { "content": "鎢", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21363": { "content": "淸", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21364": { "content": "騭", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21365": { "content": "銨", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21366": { "content": "閙", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21367": { "content": "稈", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21368": { "content": "兗", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21369": { "content": "榚", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21370": { "content": "珓", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21371": { "content": "揦", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21372": { "content": "錕", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21373": { "content": "鷸", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21374": { "content": "舘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21375": { "content": "礮", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21376": { "content": "哚", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21377": { "content": "昪", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21378": { "content": "羶", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21379": { "content": "鍬", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21380": { "content": "昺", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21381": { "content": "閤", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21382": { "content": "鯭", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21383": { "content": "搦", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21384": { "content": "㞘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21385": { "content": "椏", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21386": { "content": "燾", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21387": { "content": "鉼", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21388": { "content": "儍", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21389": { "content": "慤", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21390": { "content": "耖", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21391": { "content": "蛺", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21392": { "content": "岃", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21393": { "content": "琤", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21394": { "content": "濰", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21395": { "content": "鱘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21396": { "content": "潁", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21397": { "content": "鏇", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21398": { "content": "搾", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21399": { "content": "旼", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21400": { "content": "嬋", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21401": { "content": "唓", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21402": { "content": "唂", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21403": { "content": "吲", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21404": { "content": "踼", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21405": { "content": "靑", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21406": { "content": "鄕", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21407": { "content": "湴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21408": { "content": "鬈", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21409": { "content": "閭", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21410": { "content": "癩", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21411": { "content": "顥", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21412": { "content": "訌", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21413": { "content": "樴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21414": { "content": "饀", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21415": { "content": "獴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21416": { "content": "畵", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21417": { "content": "祼", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21418": { "content": "簒", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21419": { "content": "蟈", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21420": { "content": "灕", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21421": { "content": "僆", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21422": { "content": "儁", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21423": { "content": "瑂", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21424": { "content": "趷", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21425": { "content": "糴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21426": { "content": "躂", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21427": { "content": "顓", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21428": { "content": "啋", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21429": { "content": "揞", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21430": { "content": "罉", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21431": { "content": "媺", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21432": { "content": "銼", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21433": { "content": "癗", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21434": { "content": "軻", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21435": { "content": "瀡", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21436": { "content": "鼴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21437": { "content": "暪", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21438": { "content": "摱", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21439": { "content": "厏", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21440": { "content": "銫", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21441": { "content": "綷", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21442": { "content": "闓", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21443": { "content": "湉", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21444": { "content": "鏵", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21445": { "content": "塲", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21446": { "content": "彊", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21447": { "content": "氬", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21448": { "content": "繑", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21449": { "content": "厓", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21450": { "content": "釙", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21451": { "content": "鳯", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21452": { "content": "鑌", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21453": { "content": "覲", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21454": { "content": "凖", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21455": { "content": "嚦", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21456": { "content": "翕", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21457": { "content": "甂", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21458": { "content": "蓀", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21459": { "content": "昰", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21460": { "content": "疎", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21461": { "content": "泂", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21462": { "content": "銥", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21463": { "content": "閆", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21464": { "content": "魨", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21465": { "content": "妺", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21466": { "content": "訢", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21467": { "content": "蠏", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21468": { "content": "濶", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21469": { "content": "衊", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21470": { "content": "紇", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21471": { "content": "僞", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21472": { "content": "祆", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21473": { "content": "謖", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21474": { "content": "炑", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21475": { "content": "樨", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21476": { "content": "拕", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21477": { "content": "憓", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21478": { "content": "蘅", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21479": { "content": "廻", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21480": { "content": "馱", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21481": { "content": "塹", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21482": { "content": "啹", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21483": { "content": "昃", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21484": { "content": "屘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21485": { "content": "㴓", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21486": { "content": "掗", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21487": { "content": "騾", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21488": { "content": "苺", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21489": { "content": "駟", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21490": { "content": "沚", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21491": { "content": "豕", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21492": { "content": "奭", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21493": { "content": "㦸", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21494": { "content": "琿", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21495": { "content": "鬭", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21496": { "content": "觜", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21497": { "content": "軭", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21498": { "content": "錒", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21499": { "content": "錀", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21500": { "content": "欏", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21501": { "content": "仼", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21502": { "content": "鏹", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21503": { "content": "癆", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21504": { "content": "囘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21505": { "content": "鐡", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21506": { "content": "鼷", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21507": { "content": "羕", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21508": { "content": "璩", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21509": { "content": "沊", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21510": { "content": "鵞", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21511": { "content": "塡", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21512": { "content": "綣", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21513": { "content": "龢", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21514": { "content": "禰", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21515": { "content": "鍔", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21516": { "content": "櫟", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21517": { "content": "緲", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21518": { "content": "蕓", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21519": { "content": "齲", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21520": { "content": "尙", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21521": { "content": "擧", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21522": { "content": "勷", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21523": { "content": "龑", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21524": { "content": "挐", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21525": { "content": "鉞", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21526": { "content": "鸕", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21527": { "content": "愃", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21528": { "content": "昅", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21529": { "content": "鎘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21530": { "content": "廡", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21531": { "content": "詒", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21532": { "content": "銻", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21533": { "content": "咃", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21534": { "content": "饉", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21535": { "content": "瀦", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21536": { "content": "姵", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21537": { "content": "侘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21538": { "content": "垻", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21539": { "content": "甑", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21540": { "content": "猻", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21541": { "content": "扤", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21542": { "content": "禕", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21543": { "content": "鬩", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21544": { "content": "攆", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21545": { "content": "鈹", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21546": { "content": "酎", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21547": { "content": "吿", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21548": { "content": "鈷", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21549": { "content": "扲", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21550": { "content": "竪", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21551": { "content": "柙", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21552": { "content": "沔", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21553": { "content": "缐", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21554": { "content": "瓘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21555": { "content": "璘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21556": { "content": "璦", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21557": { "content": "朏", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21558": { "content": "暎", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21559": { "content": "鶿", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21560": { "content": "榘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21561": { "content": "飮", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21562": { "content": "愨", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21563": { "content": "舢", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21564": { "content": "僳", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21565": { "content": "咼", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21566": { "content": "臏", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21567": { "content": "鑭", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21568": { "content": "砬", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21569": { "content": "娸", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21570": { "content": "硃", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21571": { "content": "訃", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21572": { "content": "朳", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21573": { "content": "瑭", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21574": { "content": "氚", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21575": { "content": "綉", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21576": { "content": "痲", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21577": { "content": "麫", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21578": { "content": "齶", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21579": { "content": "蚧", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21580": { "content": "谿", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21581": { "content": "栱", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21582": { "content": "旚", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21583": { "content": "鱟", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21584": { "content": "鉍", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21585": { "content": "鏐", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21586": { "content": "粢", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21587": { "content": "縹", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21588": { "content": "鉬", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21589": { "content": "擗", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21590": { "content": "鋯", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21591": { "content": "闐", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21592": { "content": "舨", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21593": { "content": "艶", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21594": { "content": "逄", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21595": { "content": "龠", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21596": { "content": "鮋", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21597": { "content": "琚", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21598": { "content": "駡", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21599": { "content": "靱", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21600": { "content": "牘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21601": { "content": "樋", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21602": { "content": "鼇", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21603": { "content": "慇", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21604": { "content": "郃", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21605": { "content": "筧", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21606": { "content": "鷓", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21607": { "content": "鴣", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21608": { "content": "鶻", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21609": { "content": "猢", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21610": { "content": "癦", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21611": { "content": "逑", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21612": { "content": "囇", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21613": { "content": "蘄", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21614": { "content": "鋇", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21615": { "content": "撣", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21616": { "content": "氘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21617": { "content": "駙", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21618": { "content": "椗", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21619": { "content": "尢", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21620": { "content": "㔷", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21621": { "content": "炘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21622": { "content": "鴴", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21623": { "content": "鯡", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21624": { "content": "茘", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21625": { "content": "灃", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21626": { "content": "湞", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "21627": { "content": "漖", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false } }, "clean_up_tokenization_spaces": true, "cls_token": "[CLS]", "do_lower_case": false, "mask_token": "[MASK]", "max_length": 512, "model_max_length": 512, "pad_to_multiple_of": null, "pad_token": "[PAD]", "pad_token_type_id": 0, "padding_side": "right", "sep_token": "[SEP]", "stride": 0, "strip_accents": null, "tokenize_chinese_chars": true, "tokenizer_class": "BertTokenizer", "truncation_side": "right", "truncation_strategy": "longest_first", "unk_token": "[UNK]"}123456789101112131415{ "bert-large-cantonese": { "repo_id": "hon9kon9ize/bert-large-cantonese", "files": [ "pytorch_model.bin" ] }, "deberta-v3-large": { "repo_id": "microsoft/deberta-v3-large", "files": [ "spm.model", "pytorch_model.bin" ] }}123456789101112131415161718192021222324252627*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bin.* filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zstandard filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293---language: entags: - deberta - deberta-v3 - fill-maskthumbnail: https://huggingface.co/front/thumbnails/microsoft.pnglicense: mit---
## DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing
[DeBERTa](https://arxiv.org/abs/2006.03654) improves the BERT and RoBERTa models using disentangled attention and enhanced mask decoder. With those two improvements, DeBERTa out perform RoBERTa on a majority of NLU tasks with 80GB training data.
In [DeBERTa V3](https://arxiv.org/abs/2111.09543), we further improved the efficiency of DeBERTa using ELECTRA-Style pre-training with Gradient Disentangled Embedding Sharing. Compared to DeBERTa, our V3 version significantly improves the model performance on downstream tasks. You can find more technique details about the new model from our [paper](https://arxiv.org/abs/2111.09543).
Please check the [official repository](https://github.com/microsoft/DeBERTa) for more implementation details and updates.
The DeBERTa V3 large model comes with 24 layers and a hidden size of 1024. It has 304M backbone parameters with a vocabulary containing 128K tokens which introduces 131M parameters in the Embedding layer. This model was trained using the 160GB data as DeBERTa V2.
#### Fine-tuning on NLU tasks
We present the dev results on SQuAD 2.0 and MNLI tasks.
| Model |Vocabulary(K)|Backbone #Params(M)| SQuAD 2.0(F1/EM) | MNLI-m/mm(ACC)||-------------------|----------|-------------------|-----------|----------|| RoBERTa-large |50 |304 | 89.4/86.5 | 90.2 || XLNet-large |32 |- | 90.6/87.9 | 90.8 || DeBERTa-large |50 |- | 90.7/88.0 | 91.3 || **DeBERTa-v3-large**|128|304 | **91.5/89.0**| **91.8/91.9**|
#### Fine-tuning with HF transformers
```bash#!/bin/bash
cd transformers/examples/pytorch/text-classification/
pip install datasetsexport TASK_NAME=mnli
output_dir="ds_results"
num_gpus=8
batch_size=8
python -m torch.distributed.launch --nproc_per_node=${num_gpus} \ run_glue.py \ --model_name_or_path microsoft/deberta-v3-large \ --task_name $TASK_NAME \ --do_train \ --do_eval \ --evaluation_strategy steps \ --max_seq_length 256 \ --warmup_steps 50 \ --per_device_train_batch_size ${batch_size} \ --learning_rate 6e-6 \ --num_train_epochs 2 \ --output_dir $output_dir \ --overwrite_output_dir \ --logging_steps 1000 \ --logging_dir $output_dir
```
### Citation
If you find DeBERTa useful for your work, please cite the following papers:
``` latex@misc{he2021debertav3, title={DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing}, author={Pengcheng He and Jianfeng Gao and Weizhu Chen}, year={2021}, eprint={2111.09543}, archivePrefix={arXiv}, primaryClass={cs.CL}}```
``` latex@inproceedings{he2021deberta,title={DEBERTA: DECODING-ENHANCED BERT WITH DISENTANGLED ATTENTION},author={Pengcheng He and Xiaodong Liu and Jianfeng Gao and Weizhu Chen},booktitle={International Conference on Learning Representations},year={2021},url={https://openreview.net/forum?id=XPZIaotutsD}}```12345678910111213141516171819202122{ "model_type": "deberta-v2", "attention_probs_dropout_prob": 0.1, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "hidden_size": 1024, "initializer_range": 0.02, "intermediate_size": 4096, "max_position_embeddings": 512, "relative_attention": true, "position_buckets": 256, "norm_rel_ebd": "layer_norm", "share_att_key": true, "pos_att_type": "p2c|c2p", "layer_norm_eps": 1e-7, "max_relative_positions": -1, "position_biased_input": false, "num_attention_heads": 16, "num_hidden_layers": 24, "type_vocab_size": 0, "vocab_size": 128100}12345678910111213141516171819202122{ "model_type": "deberta-v2", "attention_probs_dropout_prob": 0.1, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "hidden_size": 1024, "initializer_range": 0.02, "intermediate_size": 4096, "max_position_embeddings": 512, "relative_attention": true, "position_buckets": 256, "norm_rel_ebd": "layer_norm", "share_att_key": true, "pos_att_type": "p2c|c2p", "layer_norm_eps": 1e-7, "max_relative_positions": -1, "position_biased_input": false, "num_attention_heads": 16, "num_hidden_layers": 12, "type_vocab_size": 0, "vocab_size": 128100}123version https://git-lfs.github.com/spec/v1oid sha256:c679fbf93643d19aab7ee10c0b99e460bdbc02fedf34b92b05af343b4af586fdsize 24646161234{ "do_lower_case": false, "vocab_type": "spm"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135import numpy as npimport onnxruntime as ortfrom text import cantonese, english, cleaned_text_to_sequence
language_module_map = {"EN": english, "YUE": cantonese}
def clean_text(text, language): language_module = language_module_map[language] norm_text = language_module.text_normalize(text) phones, tones, word2ph = language_module.g2p(norm_text) return norm_text, phones, tones, word2ph
def convert_pad_shape(pad_shape): layer = pad_shape[::-1] pad_shape = [item for sublist in layer for item in sublist] return pad_shape
def sequence_mask(length, max_length=None): if max_length is None: max_length = length.max() x = np.arange(max_length, dtype=length.dtype) return np.expand_dims(x, 0) < np.expand_dims(length, 1)
def generate_path(duration, mask): """ duration: [b, 1, t_x] mask: [b, 1, t_y, t_x] """
b, _, t_y, t_x = mask.shape cum_duration = np.cumsum(duration, -1)
cum_duration_flat = cum_duration.reshape(b * t_x) path = sequence_mask(cum_duration_flat, t_y) path = path.reshape(b, t_x, t_y) path = path ^ np.pad(path, ((0, 0), (1, 0), (0, 0)))[:, :-1] path = np.expand_dims(path, 1).transpose(0, 1, 3, 2) return path
class OnnxInferenceSession: def __init__(self, path, Providers=["CPUExecutionProvider"]): self.enc = ort.InferenceSession(path["enc"], providers=Providers) self.emb_g = ort.InferenceSession(path["emb_g"], providers=Providers) self.dp = ort.InferenceSession(path["dp"], providers=Providers) self.sdp = ort.InferenceSession(path["sdp"], providers=Providers) self.flow = ort.InferenceSession(path["flow"], providers=Providers) self.dec = ort.InferenceSession(path["dec"], providers=Providers)
def __call__( self, seq, tone, language, bert_en, bert_yue, sid, seed=114514, seq_noise_scale=0.8, sdp_noise_scale=0.6, length_scale=1.0, sdp_ratio=0.0, ): if seq.ndim == 1: seq = np.expand_dims(seq, 0) if tone.ndim == 1: tone = np.expand_dims(tone, 0) if language.ndim == 1: language = np.expand_dims(language, 0) assert (seq.ndim == 2, tone.ndim == 2, language.ndim == 2) g = self.emb_g.run( None, { "sid": sid.astype(np.int64), }, )[0] g = np.expand_dims(g, -1)
enc_rtn = self.enc.run( None, { "x": seq.astype(np.int64), "t": tone.astype(np.int64), "language": language.astype(np.int64), "bert_0": bert_en.astype(np.float32), "bert_1": bert_yue.astype(np.float32), "g": g.astype(np.float32), }, ) x, m_p, logs_p, x_mask = enc_rtn[0], enc_rtn[1], enc_rtn[2], enc_rtn[3] np.random.seed(seed) zinput = np.random.randn(x.shape[0], 2, x.shape[2]) * sdp_noise_scale logw = self.sdp.run( None, {"x": x, "x_mask": x_mask, "zin": zinput.astype(np.float32), "g": g} )[0] * (sdp_ratio) + self.dp.run(None, {"x": x, "x_mask": x_mask, "g": g})[ 0 ] * ( 1 - sdp_ratio ) w = np.exp(logw) * x_mask * length_scale w_ceil = np.ceil(w) y_lengths = np.clip(np.sum(w_ceil, (1, 2)), a_min=1.0, a_max=100000).astype( np.int64 ) y_mask = np.expand_dims(sequence_mask(y_lengths, None), 1) attn_mask = np.expand_dims(x_mask, 2) * np.expand_dims(y_mask, -1) attn = generate_path(w_ceil, attn_mask) m_p = np.matmul(attn.squeeze(1), m_p.transpose(0, 2, 1)).transpose( 0, 2, 1 ) # [b, t', t], [b, t, d] -> [b, d, t'] logs_p = np.matmul(attn.squeeze(1), logs_p.transpose(0, 2, 1)).transpose( 0, 2, 1 ) # [b, t', t], [b, t, d] -> [b, d, t']
z_p = ( m_p + np.random.randn(m_p.shape[0], m_p.shape[1], m_p.shape[2]) * np.exp(logs_p) * seq_noise_scale )
z = self.flow.run( None, { "z_p": z_p.astype(np.float32), "y_mask": y_mask.astype(np.float32), "g": g, }, )[0]
return self.dec.run(None, {"z_in": z.astype(np.float32), "g": g})[0]123456gardio==4.39.0pycantonese==3.4.0cn2an==0.5.22jieba==0.42.1transformers[onnx]==4.42.4torch==2.3.1123456789101112131415161718192021222324252627282930from text.symbols import *
_symbol_to_id = {s: i for i, s in enumerate(symbols)}
def cleaned_text_to_sequence(cleaned_text, tones, language): """Converts a string of text to a sequence of IDs corresponding to the symbols in the text. Args: text: string to convert to a sequence Returns: List of integers corresponding to the symbols in the text """ phones = [_symbol_to_id[symbol] for symbol in cleaned_text] tone_start = language_tone_start_map[language] tones = [i + tone_start for i in tones] lang_id = language_id_map[language] lang_ids = [lang_id for i in phones] return phones, tones, lang_ids
def get_bert(norm_text, word2ph, language, device, style_text=None, style_weight=0.7): from .english_bert_mock import get_bert_feature as en_bert from .cantonese_bert import get_bert_feature as yue_bert
lang_bert_func_map = {"EN": en_bert, "YUE": yue_bert} bert = lang_bert_func_map[language]( norm_text, word2ph, device, style_text, style_weight ) return bert
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273from text.symbols import punctuationimport reimport unicodedataimport cn2animport pycantoneseimport jiebaimport csv
jieba.load_userdict("./text/yue_dict.txt")
jyutping_dict = {}
with open("./text/jyutping.csv", "r", encoding="utf-8") as f: for line in f: line = line.strip() if not line: continue word, jyutping = line.split(",")
if word not in jyutping_dict: jyutping_dict[word] = [jyutping] else: jyutping_dict[word].append(jyutping)
def normalizer(x): x = cn2an.transform(x, "an2cn")
return x
def word2jyutping(word): jyutpings = [pycantonese.characters_to_jyutping( w)[0][1] for w in word if unicodedata.name(w, "").startswith("CJK UNIFIED IDEOGRAPH")]
for i, j in enumerate(jyutpings): if re.search(r"^(la|ga)[1-6]$", j): # la1 -> laa1, ga1 -> gaa1 jyutpings[i] = jyutpings[i].replace('a', 'aa')
if None in jyutpings: raise ValueError(f"Failed to convert {word} to jyutping: {jyutpings}")
return " ".join(jyutpings)
INITIALS = ["", "b", "c", "d", "f", "g", "gw", "h", "j", "k", "kw", "l", "m", "n", "ng", "p", "s", "t", "w", "z"]FINALS = ["aa", "aai", "aau", "aam", "aan", "aang", "aap", "aat", "aak", "ai", "au", "am", "an", "ang", "ap", "at", "ak", "e", "ei", "eu", "em", "eng", "ep", "ek", "i", "iu", "im", "in", "ing", "ip", "it", "ik", "o", "oi", "ou", "on", "ong", "ot", "ok", "oe", "oeng", "oek", "eoi", "eon", "eot", "u", "ui", "un", "ung", "ut", "uk", "yu", "yun", "yut", "m", "ng"]
rep_map = { ":": ",", "︰": ",", ";": ",", ",": ",", "﹐": ",", "。": ".", "!": "!", "?": "?", "﹖": "?", "﹗": "!", "\n": ".", "·": ",", "、": ",", "丶": ",", "...": "…", "⋯": "…", "$": ".", "“": "'", "”": "'", '"': "'", "‘": "'", "’": "'", "(": "'", ")": "'", "(": "'", ")": "'", "《": "'", "》": "'", "【": "'", "】": "'", "[": "'", "]": "'", "—": "-", "~": "-", "~": "-", "「": "'", "」": "'", "_": "-",}
replacement_chars = { "\n": " ", 'ㄧ': '一', '—': '一', '更': '更', '不': '不', '料': '料', '聯': '聯', '行': '行', '利': '利', '謢': '護', '岀': '出', '鎭': '鎮', '戯': '戲', '旣': '既', '立': '立', '來': '來', '年': '年', '㗇': '蝦',}
def replace_punctuation(text): pattern = re.compile("|".join(re.escape(p) for p in rep_map.keys())) replaced_text = pattern.sub(lambda x: rep_map[x.group()], text) replaced_text = "".join( c for c in replaced_text if unicodedata.name(c, "").startswith("CJK UNIFIED IDEOGRAPH") or c in punctuation )
return replaced_text
def replace_chars(text): for k, v in replacement_chars.items(): text = text.replace(k, v) return text
def word_segmentation(text): words = jieba.cut(text) return words
def text_normalize(text): text = text.strip() text = normalizer(text) text = replace_punctuation(text) text = replace_chars(text) return text
def jyuping_to_initials_finals_tones(jyuping_syllables): initials_finals = [] tones = [] word2ph = []
for syllable in jyuping_syllables: if syllable in punctuation: initials_finals.append(syllable) tones.append(0) word2ph.append(1) # Add 1 for punctuation else: init, final, tone = parse_jyutping(syllable) initials_finals.extend([init, final]) tones.extend([tone, tone]) word2ph.append(2)
assert len(initials_finals) == len(tones) return initials_finals, tones, word2ph
wordshk_juytping = {}
# with open("/notebooks/bert-vits2/Bert-VITS2-Cantonese/wordshk_juytping.csv", "r") as csv_file:# csv_reader = csv.reader(csv_file, delimiter=',')
# for row in csv_reader:# wordshk_juytping[text_normalize(row[0])] = row[1]
def get_jyutping(text): if text in wordshk_juytping: return wordshk_juytping[text].split(" ")
words = word_segmentation(text) jyutping_array = []
for word in words: if word in punctuation: jyutping_array.append(word) else: jyutpings = ""
if word in jyutping_dict: jyutpings = jyutping_dict[word][0] else: jyutpings = word2jyutping(word)
if 'la1' in jyutpings: print(text, words, jyutpings)
# match multple jyutping eg: liu4 ge3, or single jyutping eg: liu4 if not re.search(r"^([a-z]+[1-6]+[ ]?)+$", jyutpings): raise ValueError( f"Failed to convert {word} to jyutping: {jyutpings}")
jyutping_array.extend(jyutpings.split(" "))
return jyutping_array
def get_bert_feature(text, word2ph): from text import cantonese_bert
return cantonese_bert.get_bert_feature(text, word2ph)
def parse_jyutping(jyutping): orig_jyutping = jyutping
if len(jyutping) < 2: raise ValueError(f"Jyutping string too short: {jyutping}") init = "" if jyutping[0] == 'n' and jyutping[1] == 'g' and len(jyutping) == 3: init = "" elif jyutping[0] == 'm' and len(jyutping) == 2: init = "" elif jyutping[0] == 'n' and jyutping[1] == 'g': init = 'ng' jyutping = jyutping[2:] elif jyutping[0] == 'g' and jyutping[1] == 'w': init = 'gw' jyutping = jyutping[2:] elif jyutping[0] == 'k' and jyutping[1] == 'w': init = 'kw' jyutping = jyutping[2:] elif jyutping[0] in 'bpmfdtnlgkhwzcsj': init = jyutping[0] jyutping = jyutping[1:] else: jyutping = jyutping try: tone = int(jyutping[-1]) jyutping = jyutping[:-1] except: raise ValueError( f"Jyutping string does not end with a tone number, in {orig_jyutping}") final = jyutping
assert init in INITIALS, f"Invalid initial: {init}, in {orig_jyutping}"
if final not in FINALS: raise ValueError(f"Invalid final: {final}, in {orig_jyutping}")
return [init, final, tone]
def g2p(text): word2ph = [] jyuping = get_jyutping(text) phones, tones, word2ph = jyuping_to_initials_finals_tones(jyuping) phones = ["_"] + phones + ["_"] tones = [0] + tones + [0] word2ph = [1] + word2ph + [1] return phones, tones, word2ph
if __name__ == "__main__": from text.cantonese_bert import get_bert_feature
# text = "Apple BB 你點解會咁柒㗎?我真係唔該晒你呀!123" text = "佢邊係想辭工吖,跳下草裙舞想加人工之嘛。" # text = "我個 app 嘅介紹文想由你寫,因為我唔知從一般用家角度要細緻到乜程度" # text = "佢哋最叻咪就係去㗇人傷害人,得個殼咋!" text = text_normalize(text) print('normalized text', text) phones, tones, word2ph = g2p(text) print(phones, tones, word2ph) bert = get_bert_feature(text, word2ph) print(bert.shape)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121import sys
import torchfrom transformers import AutoModelForMaskedLM, AutoTokenizer
LOCAL_PATH = "./bert/bert-large-cantonese"
tokenizer = AutoTokenizer.from_pretrained(LOCAL_PATH)
models = dict()
def get_bert_feature( text, word2ph, device="cpu", style_text=None, style_weight=0.7,): if ( sys.platform == "darwin" and torch.backends.mps.is_available() and device == "cpu" ): device = "mps" if not device: device = "cuda" if device not in models.keys(): models[device] = AutoModelForMaskedLM.from_pretrained( LOCAL_PATH).to(device) with torch.no_grad(): inputs = tokenizer(text, return_tensors="pt") for i in inputs: inputs[i] = inputs[i].to(device) res = models[device](**inputs, output_hidden_states=True) res = torch.cat(res["hidden_states"][-3:-2], -1)[0].cpu() if style_text: style_inputs = tokenizer(style_text, return_tensors="pt") for i in style_inputs: style_inputs[i] = style_inputs[i].to(device) style_res = models[device]( **style_inputs, output_hidden_states=True) style_res = torch.cat( style_res["hidden_states"][-3:-2], -1)[0].cpu() style_res_mean = style_res.mean(0) assert len(word2ph) == len(text) + \ 2, f"{len(word2ph)} != {len(text) + 2}, {word2ph}, {text}" word2phone = word2ph phone_level_feature = [] for i in range(len(word2phone)): if style_text: repeat_feature = ( res[i].repeat(word2phone[i], 1) * (1 - style_weight) + style_res_mean.repeat(word2phone[i], 1) * style_weight ) else: repeat_feature = res[i].repeat(word2phone[i], 1) phone_level_feature.append(repeat_feature)
phone_level_feature = torch.cat(phone_level_feature, dim=0)
return phone_level_feature.T
if __name__ == "__main__": word_level_feature = torch.rand(38, 1024) # 12个词,每个词1024维特征 word2phone = [ 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, ]
# 计算总帧数 total_frames = sum(word2phone) print(word_level_feature.shape) print(word2phone) phone_level_feature = [] for i in range(len(word2phone)): print(word_level_feature[i].shape)
# 对每个词重复word2phone[i]次 repeat_feature = word_level_feature[i].repeat(word2phone[i], 1) phone_level_feature.append(repeat_feature)
phone_level_feature = torch.cat(phone_level_feature, dim=0) print(phone_level_feature.shape) # torch.Size([36, 1024])12345678910111213141516171819202122232425262728from text import cantonese, english, cleaned_text_to_sequence
language_module_map = {"EN": english, "YUE": cantonese}
def clean_text(text, language): language_module = language_module_map[language] norm_text = language_module.text_normalize(text) phones, tones, word2ph = language_module.g2p(norm_text) return norm_text, phones, tones, word2ph
def clean_text_bert(text, language): language_module = language_module_map[language] norm_text = language_module.text_normalize(text) phones, tones, word2ph = language_module.g2p(norm_text) bert = language_module.get_bert_feature(norm_text, word2ph) return phones, tones, bert
def text_to_sequence(text, language): norm_text, phones, tones, word2ph = clean_text(text, language) return cleaned_text_to_sequence(phones, tones, language)
if __name__ == "__main__": pass123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494import pickleimport osimport refrom g2p_en import G2pfrom transformers import DebertaV2Tokenizer
from text import symbolsfrom text.symbols import punctuation
current_file_path = os.path.dirname(__file__)CMU_DICT_PATH = os.path.join(current_file_path, "cmudict.rep")CACHE_PATH = os.path.join(current_file_path, "cmudict_cache.pickle")_g2p = G2p()LOCAL_PATH = "./bert/deberta-v3-large"tokenizer = DebertaV2Tokenizer.from_pretrained(LOCAL_PATH)
arpa = { "AH0", "S", "AH1", "EY2", "AE2", "EH0", "OW2", "UH0", "NG", "B", "G", "AY0", "M", "AA0", "F", "AO0", "ER2", "UH1", "IY1", "AH2", "DH", "IY0", "EY1", "IH0", "K", "N", "W", "IY2", "T", "AA1", "ER1", "EH2", "OY0", "UH2", "UW1", "Z", "AW2", "AW1", "V", "UW2", "AA2", "ER", "AW0", "UW0", "R", "OW1", "EH1", "ZH", "AE0", "IH2", "IH", "Y", "JH", "P", "AY1", "EY0", "OY2", "TH", "HH", "D", "ER0", "CH", "AO1", "AE1", "AO2", "OY1", "AY2", "IH1", "OW0", "L", "SH",}
def post_replace_ph(ph): rep_map = { ":": ",", ";": ",", ",": ",", "。": ".", "!": "!", "?": "?", "\n": ".", "·": ",", "、": ",", "…": "...", "···": "...", "・・・": "...", "v": "V", } if ph in rep_map.keys(): ph = rep_map[ph] if ph in symbols: return ph if ph not in symbols: ph = "UNK" return ph
rep_map = { ":": ",", ";": ",", ",": ",", "。": ".", "!": "!", "?": "?", "\n": ".", ".": ".", "…": "...", "···": "...", "・・・": "...", "·": ",", "・": ",", "、": ",", "$": ".", "“": "'", "”": "'", '"': "'", "‘": "'", "’": "'", "(": "'", ")": "'", "(": "'", ")": "'", "《": "'", "》": "'", "【": "'", "】": "'", "[": "'", "]": "'", "—": "-", "−": "-", "~": "-", "~": "-", "「": "'", "」": "'",}
def replace_punctuation(text): pattern = re.compile("|".join(re.escape(p) for p in rep_map.keys()))
replaced_text = pattern.sub(lambda x: rep_map[x.group()], text)
# replaced_text = re.sub( # r"[^\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FFF\u3400-\u4DBF\u3005" # + "".join(punctuation) # + r"]+", # "", # replaced_text, # )
return replaced_text
def read_dict(): g2p_dict = {} start_line = 49 with open(CMU_DICT_PATH) as f: line = f.readline() line_index = 1 while line: if line_index >= start_line: line = line.strip() word_split = line.split(" ") word = word_split[0]
syllable_split = word_split[1].split(" - ") g2p_dict[word] = [] for syllable in syllable_split: phone_split = syllable.split(" ") g2p_dict[word].append(phone_split)
line_index = line_index + 1 line = f.readline()
return g2p_dict
def cache_dict(g2p_dict, file_path): with open(file_path, "wb") as pickle_file: pickle.dump(g2p_dict, pickle_file)
def get_dict(): if os.path.exists(CACHE_PATH): with open(CACHE_PATH, "rb") as pickle_file: g2p_dict = pickle.load(pickle_file) else: g2p_dict = read_dict() cache_dict(g2p_dict, CACHE_PATH)
return g2p_dict
eng_dict = get_dict()
def refine_ph(phn): tone = 0 if re.search(r"\d$", phn): tone = int(phn[-1]) + 1 phn = phn[:-1] else: tone = 3 return phn.lower(), tone
def refine_syllables(syllables): tones = [] phonemes = [] for phn_list in syllables: for i in range(len(phn_list)): phn = phn_list[i] phn, tone = refine_ph(phn) phonemes.append(phn) tones.append(tone) return phonemes, tones
import inflect
_inflect = inflect.engine()_comma_number_re = re.compile(r"([0-9][0-9\,]+[0-9])")_decimal_number_re = re.compile(r"([0-9]+\.[0-9]+)")_pounds_re = re.compile(r"£([0-9\,]*[0-9]+)")_dollars_re = re.compile(r"\$([0-9\.\,]*[0-9]+)")_ordinal_re = re.compile(r"[0-9]+(st|nd|rd|th)")_number_re = re.compile(r"[0-9]+")
# List of (regular expression, replacement) pairs for abbreviations:_abbreviations = [ (re.compile("\\b%s\\." % x[0], re.IGNORECASE), x[1]) for x in [ ("mrs", "misess"), ("mr", "mister"), ("dr", "doctor"), ("st", "saint"), ("co", "company"), ("jr", "junior"), ("maj", "major"), ("gen", "general"), ("drs", "doctors"), ("rev", "reverend"), ("lt", "lieutenant"), ("hon", "honorable"), ("sgt", "sergeant"), ("capt", "captain"), ("esq", "esquire"), ("ltd", "limited"), ("col", "colonel"), ("ft", "fort"), ]]
# List of (ipa, lazy ipa) pairs:_lazy_ipa = [ (re.compile("%s" % x[0]), x[1]) for x in [ ("r", "ɹ"), ("æ", "e"), ("ɑ", "a"), ("ɔ", "o"), ("ð", "z"), ("θ", "s"), ("ɛ", "e"), ("ɪ", "i"), ("ʊ", "u"), ("ʒ", "ʥ"), ("ʤ", "ʥ"), ("ˈ", "↓"), ]]
# List of (ipa, lazy ipa2) pairs:_lazy_ipa2 = [ (re.compile("%s" % x[0]), x[1]) for x in [ ("r", "ɹ"), ("ð", "z"), ("θ", "s"), ("ʒ", "ʑ"), ("ʤ", "dʑ"), ("ˈ", "↓"), ]]
# List of (ipa, ipa2) pairs_ipa_to_ipa2 = [ (re.compile("%s" % x[0]), x[1]) for x in [("r", "ɹ"), ("ʤ", "dʒ"), ("ʧ", "tʃ")]]
def _expand_dollars(m): match = m.group(1) parts = match.split(".") if len(parts) > 2: return match + " dollars" # Unexpected format dollars = int(parts[0]) if parts[0] else 0 cents = int(parts[1]) if len(parts) > 1 and parts[1] else 0 if dollars and cents: dollar_unit = "dollar" if dollars == 1 else "dollars" cent_unit = "cent" if cents == 1 else "cents" return "%s %s, %s %s" % (dollars, dollar_unit, cents, cent_unit) elif dollars: dollar_unit = "dollar" if dollars == 1 else "dollars" return "%s %s" % (dollars, dollar_unit) elif cents: cent_unit = "cent" if cents == 1 else "cents" return "%s %s" % (cents, cent_unit) else: return "zero dollars"
def _remove_commas(m): return m.group(1).replace(",", "")
def _expand_ordinal(m): return _inflect.number_to_words(m.group(0))
def _expand_number(m): num = int(m.group(0)) if num > 1000 and num < 3000: if num == 2000: return "two thousand" elif num > 2000 and num < 2010: return "two thousand " + _inflect.number_to_words(num % 100) elif num % 100 == 0: return _inflect.number_to_words(num // 100) + " hundred" else: return _inflect.number_to_words( num, andword="", zero="oh", group=2 ).replace(", ", " ") else: return _inflect.number_to_words(num, andword="")
def _expand_decimal_point(m): return m.group(1).replace(".", " point ")
def normalize_numbers(text): text = re.sub(_comma_number_re, _remove_commas, text) text = re.sub(_pounds_re, r"\1 pounds", text) text = re.sub(_dollars_re, _expand_dollars, text) text = re.sub(_decimal_number_re, _expand_decimal_point, text) text = re.sub(_ordinal_re, _expand_ordinal, text) text = re.sub(_number_re, _expand_number, text) return text
def text_normalize(text): text = normalize_numbers(text) text = replace_punctuation(text) text = re.sub(r"([,;.\?\!])([\w])", r"\1 \2", text) return text
def distribute_phone(n_phone, n_word): phones_per_word = [0] * n_word for task in range(n_phone): min_tasks = min(phones_per_word) min_index = phones_per_word.index(min_tasks) phones_per_word[min_index] += 1 return phones_per_word
def sep_text(text): words = re.split(r"([,;.\?\!\s+])", text) words = [word for word in words if word.strip() != ""] return words
def text_to_words(text): tokens = tokenizer.tokenize(text) words = [] for idx, t in enumerate(tokens): if t.startswith("▁"): words.append([t[1:]]) else: if t in punctuation: if idx == len(tokens) - 1: words.append([f"{t}"]) else: if ( not tokens[idx + 1].startswith("▁") and tokens[idx + 1] not in punctuation ): if idx == 0: words.append([]) words[-1].append(f"{t}") else: words.append([f"{t}"]) else: if idx == 0: words.append([]) words[-1].append(f"{t}") return words
def g2p(text): phones = [] tones = [] phone_len = [] # words = sep_text(text) # tokens = [tokenizer.tokenize(i) for i in words] words = text_to_words(text)
for word in words: temp_phones, temp_tones = [], [] if len(word) > 1: if "'" in word: word = ["".join(word)] for w in word: if w in punctuation: temp_phones.append(w) temp_tones.append(0) continue if w.upper() in eng_dict: phns, tns = refine_syllables(eng_dict[w.upper()]) temp_phones += [post_replace_ph(i) for i in phns] temp_tones += tns # w2ph.append(len(phns)) else: phone_list = list(filter(lambda p: p != " ", _g2p(w))) phns = [] tns = [] for ph in phone_list: if ph in arpa: ph, tn = refine_ph(ph) phns.append(ph) tns.append(tn) else: phns.append(ph) tns.append(0) temp_phones += [post_replace_ph(i) for i in phns] temp_tones += tns phones += temp_phones tones += temp_tones phone_len.append(len(temp_phones)) # phones = [post_replace_ph(i) for i in phones]
word2ph = [] for token, pl in zip(words, phone_len): word_len = len(token)
aaa = distribute_phone(pl, word_len) word2ph += aaa
phones = ["_"] + phones + ["_"] tones = [0] + tones + [0] word2ph = [1] + word2ph + [1] assert len(phones) == len(tones), text assert len(phones) == sum(word2ph), text
return phones, tones, word2ph
def get_bert_feature(text, word2ph): from text import english_bert_mock
return english_bert_mock.get_bert_feature(text, word2ph)
if __name__ == "__main__": # print(get_dict()) # print(eng_word_to_phoneme("hello")) print(g2p("In this paper, we propose 1 DSPGAN, a GAN-based universal vocoder.")) # all_phones = set() # for k, syllables in eng_dict.items(): # for group in syllables: # for ph in group: # all_phones.add(ph) # print(all_phones)12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758import sys
import torchfrom transformers import DebertaV2Model, DebertaV2Tokenizer
LOCAL_PATH = "./bert/deberta-v3-large"
tokenizer = DebertaV2Tokenizer.from_pretrained(LOCAL_PATH)
models = dict()
def get_bert_feature( text, word2ph, device="cpu", style_text=None, style_weight=0.7,): if ( sys.platform == "darwin" and torch.backends.mps.is_available() and device == "cpu" ): device = "mps" if not device: device = "cuda" if device not in models.keys(): models[device] = DebertaV2Model.from_pretrained(LOCAL_PATH).to(device) with torch.no_grad(): inputs = tokenizer(text, return_tensors="pt") for i in inputs: inputs[i] = inputs[i].to(device) res = models[device](**inputs, output_hidden_states=True) res = torch.cat(res["hidden_states"][-3:-2], -1)[0].cpu() if style_text: style_inputs = tokenizer(style_text, return_tensors="pt") for i in style_inputs: style_inputs[i] = style_inputs[i].to(device) style_res = models[device](**style_inputs, output_hidden_states=True) style_res = torch.cat(style_res["hidden_states"][-3:-2], -1)[0].cpu() style_res_mean = style_res.mean(0) assert len(word2ph) == res.shape[0], (text, res.shape[0], len(word2ph)) word2phone = word2ph phone_level_feature = [] for i in range(len(word2phone)): if style_text: repeat_feature = ( res[i].repeat(word2phone[i], 1) * (1 - style_weight) + style_res_mean.repeat(word2phone[i], 1) * style_weight ) else: repeat_feature = res[i].repeat(word2phone[i], 1) phone_level_feature.append(repeat_feature)
phone_level_feature = torch.cat(phone_level_feature, dim=0)
return phone_level_feature.T123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152punctuation = ["!", "?", "…", ",", ".", "'", "-"]pu_symbols = punctuation + ["SP", "UNK"]pad = "_"
# Englishen_symbols = [ "aa", "ae", "ah", "ao", "aw", "ay", "b", "ch", "d", "dh", "eh", "er", "ey", "f", "g", "hh", "ih", "iy", "jh", "k", "l", "m", "n", "ng", "ow", "oy", "p", "r", "s", "sh", "t", "th", "uh", "uw", "V", "w", "y", "z", "zh",]num_en_tones = 4
# Cantoneseyue_symbols = [ "", "aa", "aai", "aak", "aam", "aan", "aang", "aap", "aat", "aau", "ai", "ak", "am", "an", "ang", "ap", "at", "au", "b", "c", "d", "e", "ei", "ek", "em", "eng", "eoi", "eon", "eot", "ep", "eu", "f", "g", "gw", "h", "i", "ik", "im", "in", "ing", "ip", "it", "iu", "j", "k", "kw", "l", "m", "m", "n", "ng", "ng", "o", "oe", "oek", "oeng", "oi", "ok", "on", "ong", "ot", "ou", "p", "s", "t", "u", "ui", "uk", "un", "ung", "ut", "w", "yu", "yun", "yut", "z"]
num_yue_tones = 7
# combine all symbolsnormal_symbols = sorted( set(en_symbols + yue_symbols))symbols = [pad] + normal_symbols + pu_symbolssil_phonemes_ids = [symbols.index(i) for i in pu_symbols]
# combine all tonesnum_tones = num_en_tones + num_yue_tones
# language mapslanguage_id_map = {"EN": 0, "YUE": 1}num_languages = len(language_id_map.keys())
language_tone_start_map = { "EN": 0, "YUE": num_en_tones,}
if __name__ == "__main__": a = set(yue_symbols) b = set(en_symbols) print(sorted(a & b)).gitignoreAdded+6
app.pyAdded+165
bert/bert-large-cantonese/README.mdAdded+82
bert/bert-large-cantonese/added_tokens.jsonAdded+502
bert/bert-large-cantonese/config.jsonAdded+24
bert/bert-large-cantonese/generation_config.jsonAdded+5
bert/bert-large-cantonese/special_tokens_map.jsonAdded+37
bert/bert-large-cantonese/tokenizer.jsonAdded
bert/bert-large-cantonese/tokenizer_config.jsonAdded+4062
bert/bert_models.jsonAdded+15
bert/deberta-v3-large/.gitattributesAdded+27
bert/deberta-v3-large/README.mdAdded+93
bert/deberta-v3-large/config.jsonAdded+22
bert/deberta-v3-large/generator_config.jsonAdded+22
bert/deberta-v3-large/spm.modelAdded+3
bert/deberta-v3-large/tokenizer_config.jsonAdded+4
infer.pyAdded+135
requirements.txtAdded+6
text/__init__.pyAdded+30
text/cantonese.pyAdded+273
text/cantonese_bert.pyAdded+121
text/cleaner.pyAdded+28
text/english.pyAdded+494
text/english_bert_mock.pyAdded+58
text/jyutping.csvAdded
text/symbols.pyAdded+152
text/yue_dict.txtAdded