interpret lm knowledge
1.0.0
아이디어 : 언어 모델이 학습의 다양한 단계에서 학습하는 내용을 어떻게 해석합니까? 언어 모델은 최근 개방형 지식 기반으로 설명되었습니다. 지식 획득 프로세스를 조사하기 위해 순차적인 시대 또는 아키텍처 변형의 마스크된 언어 모델에서 관계 트리플을 추출하여 지식 그래프를 생성할 수 있습니다.
데이터 세트 : Squad, Google-RE(3가지 버전)
모델 : BERT, RoBeRTa, DistilBert, 처음부터 RoBERTa 교육
저자 : Vinitra Swamy, Angelika Romanou, Martin Jaggi
이 저장소는 "지식 그래프 추출을 통한 언어 모델 해석"이라는 제목의 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 }
}