Views
No views yet
tokenizer_config.json for the setting details.SudachiTra in advance.$ pip install -U torch transformers sudachitra1from transformers import AutoModel, AutoTokenizer
2model = AutoModel.from_pretrained("megagonlabs/electra-base-japanese-discriminator")
3tokenizer = AutoTokenizer.from_pretrained("megagonlabs/electra-base-japanese-discriminator", trust_remote_code=True)
4model(**tokenizer("まさにオールマイティーな商品だ。", return_tensors="pt")).last_hidden_state
5tensor([[[-0.0498, -0.0285, 0.1042, ..., 0.0062, -0.1253, 0.0338],
6 [-0.0686, 0.0071, 0.0087, ..., -0.0210, -0.1042, -0.0320],
7 [-0.0636, 0.1465, 0.0263, ..., 0.0309, -0.1841, 0.0182],
8 ...,
9 [-0.1500, -0.0368, -0.0816, ..., -0.0303, -0.1653, 0.0650],
10 [-0.0457, 0.0770, -0.0183, ..., -0.0108, -0.1903, 0.0694],
11 [-0.0981, -0.0387, 0.1009, ..., -0.0150, -0.0702, 0.0455]]],
12 grad_fn=<NativeLayerNormBackward>)mC4 which is made available under the ODC Attribution License.@article{2019t5,
author = {Colin Raffel and Noam Shazeer and Adam Roberts and Katherine Lee and Sharan Narang and Michael Matena and Yanqi Zhou and Wei Li and Peter J. Liu},
title = {Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer},
journal = {arXiv e-prints},
year = {2019},
archivePrefix = {arXiv},
eprint = {1910.10683},
}