<jupyter_start><jupyter_text>Kobart tokenizer sampleTokenizer를 간단하게 살펴봅니다.<jupyter_code>from kobart import get_kobart_tokenizer<jupyter_output><empty_output><jupyter_text>tokenize<jupyter_code>tok = get_kobart_tokenizer()
# only tokenize
tokenized = tok.tokenize('비정형데이터분석 팀 식사과정입니다. 무야호!')
tokenized
# convert to indice
tok.convert_tokens_to_ids(tokenized)
# encode = tokenize + convert_tokens_to_ids
tok.encode('비정형데이터분석 팀 식사과정입니다. 무야호!')<jupyter_output><empty_output><jupyter_text>check vocab<jupyter_code>vocab = dict(sorted(tok.vocab.items(), key=lambda item: item[1]))
len(vocab)
vocab<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1111111111111111, 'fraction_numerical': 0.001610305958132045, 'mean_word_length': 11.196078431372548, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '668493', 'license': 'Apache-2.0', 'n_tokens_mistral': 292, 'n_tokens_neox': 329, 'n_words': 35, 'path': 'src/summarization/2. tokenizer_sample.ipynb', 'repo_name': 'youngerous/kobart-voice-summarization', 'size': '621'}