retarfi / language-pretraining Goto Github PK
View Code? Open in Web Editor NEWPre-training Language Models for Japanese
License: MIT License
Pre-training Language Models for Japanese
License: MIT License
line_per_file: int = line_all // num_files
ではなく、line_per_file: int = line_all // num_files + 5
である理由についてお伺いしたいです。
この行においてnode_rank=-1
のとき、
indices
の長さに比べて、expand_idx
が大きいため、落ちてしまう。
Thank you for releasing bert-small-japanese-fin and other Electra models for FinTech. But I've found they tokenize "四半期連結会計期間末日満期手形" in bad way:
>>> from transformers import AutoTokenizer
>>> tokenizer=AutoTokenizer.from_pretrained("izumi-lab/bert-small-japanese-fin")
>>> tokenizer.tokenize("四半期連結会計期間末日満期手形")
['四半期', '連結', '会計', '期間', '末日', '満期', '手形']
>>> tokenizer.tokenize("第3四半期連結会計期間末日満期手形")
['第', '3', '四半期連結会計期間末日満期手形']
This is because of the bug of ipadic
on 名詞,数 tokenization for 漢字-strings which begin with 漢数字.
>>> import fugashi,ipadic
>>> parser=fugashi.GenericTagger(ipadic.MECAB_ARGS).parse
>>> print(parser("四半期連結会計期間末日満期手形"))
四半期 名詞,一般,*,*,*,*,四半期,シハンキ,シハンキ
連結 名詞,サ変接続,*,*,*,*,連結,レンケツ,レンケツ
会計 名詞,サ変接続,*,*,*,*,会計,カイケイ,カイケイ
期間 名詞,一般,*,*,*,*,期間,キカン,キカン
末日 名詞,一般,*,*,*,*,末日,マツジツ,マツジツ
満期 名詞,一般,*,*,*,*,満期,マンキ,マンキ
手形 名詞,一般,*,*,*,*,手形,テガタ,テガタ
EOS
>>> print(parser("第3四半期連結会計期間末日満期手形"))
第 接頭詞,数接続,*,*,*,*,第,ダイ,ダイ
3 名詞,数,*,*,*,*,*
四半期連結会計期間末日満期手形 名詞,数,*,*,*,*,*
EOS
I recommend you to use another tokenizer than BertJapaneseTokenizer
+ipadic
. See detail in my diary written in Japanese.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.