license: cc-by-nc-sa-4.0
pipeline_tag: fill-mask
language: en
tags:
- long_documents
datasets:
- c4
model-index:
- name: kiddothe2b/adhoc-hat-base-4096
results: []
Hierarchical Attention Transformer (HAT) / adhoc-hat-base-4096
Model description
This is a Hierarchical Attention Transformer (HAT) model as presented in An Exploration of Hierarchical Attention Transformers for Efficient Long Document Classification (Chalkidis et al., 2022).
The model has not been warm-started re-using the weights of RoBERTa (Liu et al., 2019), BUT has not been continued pre-trained. It supports sequences of length up to 4,096.
HAT use a hierarchical attention, which is a combination of segment-wise and cross-segment attention operations. You can think segments as paragraphs or sentences.
Note: If you wish to use a fully pre-trained HAT model, you have to use kiddothe2b/adhoc-hat-base-4096.
Intended uses & limitations
You can use the raw model for masked language modeling, but it's mostly intended to be fine-tuned on a downstream task. See the model hub to look for fine-tuned versions on a task that interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole document to make decisions, such as document classification, sequential sentence classification or question answering.
How to use
You can fine-tune it for SequenceClassification, SequentialSentenceClassification, and MultipleChoice down-stream tasks:
from transformers import AutoTokenizer, AutoModelforSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("kiddothe2b/adhoc-hat-base-4096", trust_remote_code=True)
doc_classifier = AutoModelforSequenceClassification(model='kiddothe2b/adhoc-hat-base-4096', trust_remote_code=True)
Note: If you wish to use a fully pre-trained HAT model, you have to use kiddothe2b/adhoc-hat-base-4096.
Limitations and bias
The training data used for this model contains a lot of unfiltered content from the internet, which is far from neutral. Therefore, the model can have biased predictions.
Training procedure
Training and evaluation data
The model has been warm-started from roberta-base checkpoint.
Framework versions
- Transformers 4.19.0.dev0
- Pytorch 1.11.0+cu102
- Datasets 2.0.0
- Tokenizers 0.11.6
##Citing If you use HAT in your research, please cite An Exploration of Hierarchical Attention Transformers for Efficient Long Document Classification
@misc{chalkidis-etal-2022-hat,
url = {https://arxiv.org/abs/xxx},
author = {Chalkidis, Ilias and Dai, Xiang and Fergadiotis, Manos and Malakasiotis, Prodromos and Elliott, Desmond},
title = {An Exploration of Hierarchical Attention Transformers for Efficient Long Document Classification},
publisher = {arXiv},
year = {2022},
}