Downloads · 30 days
59
9% of all-time downloads
kiddothe2b/hierarchical-transformer-EC2-mini-1024
hierarchical-transformer-EC2-mini-1024 is a fill-mask model from kiddothe2b. Use it when you need the model to fill a missing word. It is set up for transformers. The card lists the license as cc-by-sa-4.0.
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).
Downloads · 30 days
59
9% of all-time downloads
All-time downloads
668
Public
Repo size
101 MB
Likes
0
Public
Click a slice to open those files.
.bin101 MB · 99%
From the Hugging Face model README
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 been warm-started re-using the weights of miniature BERT (Turc et al., 2019), and continued pre-trained for MLM following the paradigm of Longformer released by Beltagy et al. (2020). It supports sequences of length up to 1,024.
HAT uses hierarchical attention, which is a combination of segment-wise and cross-segment attention operations. You can think of segments as paragraphs or sentences.
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 other versions of HAT or fine-tuned versions of 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.
You can use this model directly for masked language modeling:
from transformers import AutoTokenizer, AutoModelforForMaskedLM
tokenizer = AutoTokenizer.from_pretrained("kiddothe2b/hierarchical-transformer-EC2-mini-1024", trust_remote_code=True)
mlm_model = AutoModelforForMaskedLM(kiddothe2b/hierarchical-transformer-EC2-mini-1024", trust_remote_code=True)
You can also fine-tune it for SequenceClassification, SequentialSentenceClassification, and MultipleChoice down-stream tasks:
from transformers import AutoTokenizer, AutoModelforSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("kiddothe2b/hierarchical-transformer-EC2-mini-1024", trust_remote_code=True)
doc_classifier = AutoModelforSequenceClassification("kiddothe2b/hierarchical-transformer-EC2-mini-1024", trust_remote_code=True)
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.
The model has been warm-started from google/bert_uncased_L-6_H-256_A-4 checkpoint and has been continued pre-trained for additional 50k steps on English Wikipedia.
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 2.3798 | 0.2 | 10000 | 2.2014 |
| 2.3267 | 0.4 | 20000 | 2.1535 |
| 2.2976 | 0.6 | 30000 | 2.1234 |
| 2.2649 | 0.8 | 40000 | 2.1010 |
| 2.254 | 1.14 | 50000 | 2.0870 |
If you use HAT in your research, please cite:
An Exploration of Hierarchical Attention Transformers for Efficient Long Document Classification. Ilias Chalkidis, Xiang Dai, Manos Fergadiotis, Prodromos Malakasiotis, and Desmond Elliott. 2022. arXiv:2210.05529 (Preprint).
@misc{chalkidis-etal-2022-hat,
url = {https://arxiv.org/abs/2210.05529},
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},
}