interpret lm knowledge
1.0.0
アイデア: 言語モデルがトレーニングのさまざまな段階で学習したものをどのように解釈すればよいでしょうか?言語モデルは最近、オープンな知識ベースとして説明されています。連続したエポックまたはアーキテクチャバリアントでマスクされた言語モデルから関係トリプルを抽出することによって知識グラフを生成し、知識獲得プロセスを調べることができます。
データセット: Squad、Google-RE (3 種類)
モデル: BERT、RoBeRTa、DistilBert、RoBERTa をゼロからトレーニング
著者: ヴィニトラ・スワミー、アンジェリカ・ロマヌー、マーティン・ジャギ
このリポジトリは、「ナレッジ グラフ抽出による言語モデルの解釈」というタイトルの NeurIPS 2021 XAI4Debugging 論文の公式実装です。この作業は役に立ちましたか?私たちの論文を引用してください。
git clone https://github.com/epfml/interpret-lm-knowledge.git
pip install git+https://github.com/huggingface/transformers
pip install textacy
cd interpret-lm-knowledge/scripts
python run_knowledge_graph_experiments.py <dataset> <model> <use_spacy>
squad Bert spacy
re-place-birth Roberta
オプションのパラメータ:
dataset=squad - "squad", "re-place-birth", "re-date-birth", "re-place-death"
model=Roberta - "Bert", "Roberta", "DistilBert"
extractor=spacy - "spacy", "textacy", "custom"
例については、 run_lm_experiments notebook
を参照してください。
!pip install git+https://github.com/huggingface/transformers
!pip list | grep -E 'transformers|tokenizers'
!pip install textacy
wikipedia_train_from_scratch_lm.ipynb
を実行します。 from run_training_kg_experiments import *
run_experiments(tokenizer, model, unmasker, "Roberta3e")
@inproceedings { swamy2021interpreting ,
author = { Swamy, Vinitra and Romanou, Angelika and Jaggi, Martin } ,
booktitle = { Advances in Neural Information Processing Systems (NeurIPS), 1st Workshop on eXplainable AI Approaches for Debugging and Diagnosis } ,
title = { Interpreting Language Models Through Knowledge Graph Extraction } ,
year = { 2021 }
}