kiddothe2b commited on
Commit
b1f0da1
1 Parent(s): 2438a16

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +17 -16
README.md CHANGED
@@ -1,9 +1,10 @@
1
  ---
2
- license: cc-by-nc-sa-4.0
3
  pipeline_tag: fill-mask
4
  language: en
 
5
  tags:
6
- - long_documents
7
  datasets:
8
  - wikipedia
9
  model-index:
@@ -15,27 +16,27 @@ model-index:
15
 
16
  ## Model description
17
 
18
- 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)](https://arxiv.org/abs/xxx).
19
 
20
- The model has been warm-started re-using the weights of miniature BERT [(Turc et al., 2019)](https://arxiv.org/abs/1908.08962), and continued pre-trained for MLM following the paradigm of Longformer released by [Beltagy et al. (2020)](](https://arxiv.org/abs/1908.08962)). It supports sequences of length up to 1,024.
21
 
22
- 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.
23
 
24
  ## Intended uses & limitations
25
 
26
  You can use the raw model for masked language modeling, but it's mostly intended to be fine-tuned on a downstream task.
27
- See the [model hub](https://huggingface.co/models?other=hierarchical-transformer) to look for fine-tuned versions on a task that interests you.
28
 
29
- 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.
30
 
31
  ## How to use
32
 
33
- You can use this model directly with a pipeline for masked language modeling:
34
 
35
  ```python
36
- from transformers import pipeline
37
- mlm_model = pipeline('fill-mask', model='kiddothe2b/hierarchical-transformer-LC1-mini-1024', trust_remote_code=True)
38
- mlm_model("Hello I'm a <mask> model.")
39
  ```
40
 
41
  You can also fine-tun it for SequenceClassification, SequentialSentenceClassification, and MultipleChoice down-stream tasks:
@@ -43,7 +44,7 @@ You can also fine-tun it for SequenceClassification, SequentialSentenceClassific
43
  ```python
44
  from transformers import AutoTokenizer, AutoModelforSequenceClassification
45
  tokenizer = AutoTokenizer.from_pretrained("kiddothe2b/hierarchical-transformer-LC1-mini-1024", trust_remote_code=True)
46
- doc_classifier = AutoModelforSequenceClassification(model='kiddothe2b/hierarchical-transformer-LC1-mini-1024', trust_remote_code=True)
47
  ```
48
 
49
  ## Limitations and bias
@@ -96,12 +97,12 @@ The following hyperparameters were used during training:
96
  - Tokenizers 0.11.6
97
 
98
 
99
- ##Citing
100
- If you use HAT in your research, please cite [An Exploration of Hierarchical Attention Transformers for Efficient Long Document Classification](https://arxiv.org/abs/xxx)
101
-
102
  ```
103
  @misc{chalkidis-etal-2022-hat,
104
- url = {https://arxiv.org/abs/xxx},
105
  author = {Chalkidis, Ilias and Dai, Xiang and Fergadiotis, Manos and Malakasiotis, Prodromos and Elliott, Desmond},
106
  title = {An Exploration of Hierarchical Attention Transformers for Efficient Long Document Classification},
107
  publisher = {arXiv},
 
1
  ---
2
+ license: cc-by-sa-4.0
3
  pipeline_tag: fill-mask
4
  language: en
5
+ arxiv: 2210.05529
6
  tags:
7
+ - long-documents
8
  datasets:
9
  - wikipedia
10
  model-index:
 
16
 
17
  ## Model description
18
 
19
+ 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)](https://arxiv.org/abs/2210.05529).
20
 
21
+ 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.
22
 
23
+ 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.
24
 
25
  ## Intended uses & limitations
26
 
27
  You can use the raw model for masked language modeling, but it's mostly intended to be fine-tuned on a downstream task.
28
+ See the [model hub](https://huggingface.co/models?other=hierarchical-transformer) to look for other versions of HAT, or fine-tuned versions on a task that interests you.
29
 
30
+ 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.
31
 
32
  ## How to use
33
 
34
+ You can use this model directly for masked language modeling:
35
 
36
  ```python
37
+ from transformers import AutoTokenizer, AutoModelforForMaskedLM
38
+ tokenizer = AutoTokenizer.from_pretrained("kiddothe2b/hierarchical-transformer-LC1-mini-1024", trust_remote_code=True)
39
+ mlm_model = AutoModelforForMaskedLM("kiddothe2b/hierarchical-transformer-LC1-mini-1024", trust_remote_code=True)
40
  ```
41
 
42
  You can also fine-tun it for SequenceClassification, SequentialSentenceClassification, and MultipleChoice down-stream tasks:
 
44
  ```python
45
  from transformers import AutoTokenizer, AutoModelforSequenceClassification
46
  tokenizer = AutoTokenizer.from_pretrained("kiddothe2b/hierarchical-transformer-LC1-mini-1024", trust_remote_code=True)
47
+ doc_classifier = AutoModelforSequenceClassification("kiddothe2b/hierarchical-transformer-LC1-mini-1024", trust_remote_code=True)
48
  ```
49
 
50
  ## Limitations and bias
 
97
  - Tokenizers 0.11.6
98
 
99
 
100
+ ## Citing
101
+ If you use HAT in your research, please cite:
102
+ [An Exploration of Hierarchical Attention Transformers for Efficient Long Document Classification](https://arxiv.org/abs/2210.05529). Ilias Chalkidis, Xiang Dai, Manos Fergadiotis, Prodromos Malakasiotis, and Desmond Elliott. 2022. arXiv:2210.05529 (Preprint).
103
  ```
104
  @misc{chalkidis-etal-2022-hat,
105
+ url = {https://arxiv.org/abs/2210.05529},
106
  author = {Chalkidis, Ilias and Dai, Xiang and Fergadiotis, Manos and Malakasiotis, Prodromos and Elliott, Desmond},
107
  title = {An Exploration of Hierarchical Attention Transformers for Efficient Long Document Classification},
108
  publisher = {arXiv},