🚀 NorBERT 3 xs
論文 NorBench — A Benchmark for Norwegian Language Models で説明されている、新世代のNorBERT言語モデルの公式リリースです。モデルの詳細については、論文をご覧ください。
🚀 クイックスタート
NorBERT 3 xsは、ノルウェー語の言語モデルで、Transformerベースのエンコーダー構造を持っています。このモデルは、ノルウェー語の自然言語処理タスクに特化しています。
✨ 主な機能
- ノルウェー語の言語理解に特化したモデルです。
- 複数のサイズのモデルが用意されており、ユースケースに応じて選択できます。
- 生成型のNorT5シリーズのモデルも用意されています。
📦 インストール
このモデルを使用するには、transformers
ライブラリが必要です。以下のコマンドでインストールできます。
pip install transformers
💻 使用例
基本的な使用法
import torch
from transformers import AutoTokenizer, AutoModelForMaskedLM
tokenizer = AutoTokenizer.from_pretrained("ltg/norbert3-xs")
model = AutoModelForMaskedLM.from_pretrained("ltg/norbert3-xs", trust_remote_code=True)
mask_id = tokenizer.convert_tokens_to_ids("[MASK]")
input_text = tokenizer("Nå ønsker de seg en[MASK] bolig.", return_tensors="pt")
output_p = model(**input_text)
output_text = torch.where(input_text.input_ids == mask_id, output_p.logits.argmax(-1), input_text.input_ids)
print(tokenizer.decode(output_text[0].tolist()))
高度な使用法
現在、以下のクラスが実装されています: AutoModel
, AutoModelMaskedLM
, AutoModelForSequenceClassification
, AutoModelForTokenClassification
, AutoModelForQuestionAnswering
および AutoModeltForMultipleChoice
。
📚 ドキュメント
他のサイズ
生成型のNorT5シリーズ
📄 ライセンス
このモデルは、Apache 2.0ライセンスの下で公開されています。
📄 引用
@inproceedings{samuel-etal-2023-norbench,
title = "{N}or{B}ench {--} A Benchmark for {N}orwegian Language Models",
author = "Samuel, David and
Kutuzov, Andrey and
Touileb, Samia and
Velldal, Erik and
{\O}vrelid, Lilja and
R{\o}nningstad, Egil and
Sigdel, Elina and
Palatkina, Anna",
booktitle = "Proceedings of the 24th Nordic Conference on Computational Linguistics (NoDaLiDa)",
month = may,
year = "2023",
address = "T{\'o}rshavn, Faroe Islands",
publisher = "University of Tartu Library",
url = "https://aclanthology.org/2023.nodalida-1.61",
pages = "618--633",
abstract = "We present NorBench: a streamlined suite of NLP tasks and probes for evaluating Norwegian language models (LMs) on standardized data splits and evaluation metrics. We also introduce a range of new Norwegian language models (both encoder and encoder-decoder based). Finally, we compare and analyze their performance, along with other existing LMs, across the different benchmark tests of NorBench.",
}