-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e658ed5
commit 02e2de7
Showing
9 changed files
with
199,407 additions
and
7 deletions.
There are no files selected for viewing
Empty file.
49,825 changes: 49,825 additions & 0 deletions
49,825
multi_tokenizer/pretrained/chinese_tokenizer.json
Large diffs are not rendered by default.
Oops, something went wrong.
49,824 changes: 49,824 additions & 0 deletions
49,824
multi_tokenizer/pretrained/english_tokenizer.json
Large diffs are not rendered by default.
Oops, something went wrong.
49,824 changes: 49,824 additions & 0 deletions
49,824
multi_tokenizer/pretrained/hindi_tokenizer.json
Large diffs are not rendered by default.
Oops, something went wrong.
49,825 changes: 49,825 additions & 0 deletions
49,825
multi_tokenizer/pretrained/spanish_tokenizer.json
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from multi_tokenizer import MultiTokenizer, PretrainedTokenizers" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"lang_tokenizers = [\n", | ||
" PretrainedTokenizers.ENGLISH,\n", | ||
" PretrainedTokenizers.CHINESE,\n", | ||
" PretrainedTokenizers.SPANISH\n", | ||
"]\n", | ||
"tokenizer = MultiTokenizer(lang_tokenizers)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"[('<ZH>', (0, 1)),\n", | ||
" ('æĪijçĪ±èĩªçĦ¶è¯Ńè¨Ģå¤ĦçIJĨ', (1, 9)),\n", | ||
" ('.', (9, 10)),\n", | ||
" ('Ġ', (10, 11)),\n", | ||
" ('</ZH>', (9, 10)),\n", | ||
" ('<ES>', (10, 11)),\n", | ||
" ('Me', (11, 13)),\n", | ||
" ('Ġencanta', (13, 21)),\n", | ||
" ('ĠNLP', (21, 25)),\n", | ||
" ('.', (25, 26)),\n", | ||
" ('</ES>', (24, 25))]" | ||
] | ||
}, | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"tokenizer.pre_tokenize(\"我爱自然语言处理. Me encanta NLP.\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "multi-tokenizer", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |