🚀 FlauBERT: フランス語向けの教師なし言語モデル事前学習
FlauBERT は、非常に大規模かつ多様なフランス語コーパスで学習されたフランス語版のBERTです。異なるサイズのモデルは、新しいCNRS(フランス国立科学研究センター)の Jean Zay スーパーコンピュータを使用して学習されています。
FlauBERTとともに FLUE が提供されています。これは、人気のあるGLUEベンチマークに似たフランス語NLPシステムの評価セットアップです。目的は、将来的に再現可能な実験を可能にし、フランス語に関するモデルと進歩を共有することです。詳細については、公式ウェブサイト を参照してください。
✨ 主な機能
FlauBERTモデル
モデル名 |
レイヤー数 |
アテンションヘッド数 |
埋め込み次元 |
総パラメータ数 |
flaubert-small-cased |
6 |
8 |
512 |
54 M |
flaubert-base-uncased |
12 |
12 |
768 |
137 M |
flaubert-base-cased |
12 |
12 |
768 |
138 M |
flaubert-large-cased |
24 |
16 |
1024 |
373 M |
注意: flaubert-small-cased
は部分的に学習されているため、性能は保証されません。デバッグ目的でのみ使用することを検討してください。
📦 インストール
このセクションでは、FlauBERTを使用するためのインストールに関する情報は提供されていません。
💻 使用例
基本的な使用法
import torch
from transformers import FlaubertModel, FlaubertTokenizer
modelname = 'flaubert/flaubert_base_cased'
flaubert, log = FlaubertModel.from_pretrained(modelname, output_loading_info=True)
flaubert_tokenizer = FlaubertTokenizer.from_pretrained(modelname, do_lowercase=False)
sentence = "Le chat mange une pomme."
token_ids = torch.tensor([flaubert_tokenizer.encode(sentence)])
last_layer = flaubert(token_ids)[0]
print(last_layer.shape)
cls_embedding = last_layer[:, 0, :]
注意: transformers
のバージョンが <=2.10.0 の場合、modelname
は以下の値のいずれかを取る必要があります。
['flaubert-small-cased', 'flaubert-base-uncased', 'flaubert-base-cased', 'flaubert-large-cased']
📚 ドキュメント
このセクションでは、追加のドキュメント情報は提供されていません。
🔧 技術詳細
このセクションでは、技術的な詳細情報は提供されていません。
📄 ライセンス
このプロジェクトはMITライセンスの下で提供されています。
参考文献
FlauBERTまたはFLUEベンチマークを科学的な出版物で使用する場合、またはこのリポジトリ内のリソースが有用であると思われる場合は、以下の論文のいずれかを引用してください。
LREC論文
@InProceedings{le2020flaubert,
author = {Le, Hang and Vial, Lo\"{i}c and Frej, Jibril and Segonne, Vincent and Coavoux, Maximin and Lecouteux, Benjamin and Allauzen, Alexandre and Crabb\'{e}, Beno\^{i}t and Besacier, Laurent and Schwab, Didier},
title = {FlauBERT: Unsupervised Language Model Pre-training for French},
booktitle = {Proceedings of The 12th Language Resources and Evaluation Conference},
month = {May},
year = {2020},
address = {Marseille, France},
publisher = {European Language Resources Association},
pages = {2479--2490},
url = {https://www.aclweb.org/anthology/2020.lrec-1.302}
}
TALN論文
@inproceedings{le2020flaubert,
title = {FlauBERT: des mod{\`e}les de langue contextualis{\'e}s pr{\'e}-entra{\^\i}n{\'e}s pour le fran{\c{c}}ais},
author = {Le, Hang and Vial, Lo{\"\i}c and Frej, Jibril and Segonne, Vincent and Coavoux, Maximin and Lecouteux, Benjamin and Allauzen, Alexandre and Crabb{\'e}, Beno{\^\i}t and Besacier, Laurent and Schwab, Didier},
booktitle = {Actes de la 6e conf{\'e}rence conjointe Journ{\'e}es d'{\'E}tudes sur la Parole (JEP, 31e {\'e}dition), Traitement Automatique des Langues Naturelles (TALN, 27e {\'e}dition), Rencontre des {\'E}tudiants Chercheurs en Informatique pour le Traitement Automatique des Langues (R{\'E}CITAL, 22e {\'e}dition). Volume 2: Traitement Automatique des Langues Naturelles},
pages = {268--278},
year = {2020},
organization = {ATALA}
}