mkulkarni24
commited on
Commit
·
7423e6d
1
Parent(s):
7eaf138
Update README.md
Browse files
README.md
CHANGED
@@ -1,4 +1,93 @@
|
|
1 |
-
---
|
2 |
-
license: cc-by-4.0
|
3 |
-
---
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-4.0
|
3 |
+
---
|
4 |
+
# Keyphrase Boundary Infilling with Replacement (KBIR)
|
5 |
+
The KBIR model as described in Learning Rich Representations of Keyphrases from Text (https://arxiv.org/pdf/2112.08547.pdf) builds on top of the RoBERTa architecture by adding an Infilling head and a Replacement Classification head that is used during pre-training. However, these heads are not used during the downstream evaluation of the model and we only leverage the pre-trained embeddings. Discarding the heads thereby allows us to be compatible with all AutoModel classes that RoBERTa supports.
|
6 |
+
|
7 |
+
We provide examples on how to perform downstream evaluation on some of the tasks reported in the paper.
|
8 |
+
## Downstream Evaluation
|
9 |
+
|
10 |
+
### Keyphrase Extraction
|
11 |
+
```
|
12 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
13 |
+
|
14 |
+
tokenizer = AutoTokenizer.from_pretrained("bloomberg/KBIR")
|
15 |
+
model = AutoModelForTokenClassification.from_pretrained("bloomberg/KBIR")
|
16 |
+
|
17 |
+
from datasets import load_dataset
|
18 |
+
|
19 |
+
dataset = load_dataset("midas/semeval2017_ke_tagged")
|
20 |
+
```
|
21 |
+
|
22 |
+
Reported Results:
|
23 |
+
|
24 |
+
| Model | Inspec | SE10 | SE17 |
|
25 |
+
|-----------------------|--------|-------|-------|
|
26 |
+
| RoBERTa+BiLSTM-CRF | 59.5 | 27.8 | 50.8 |
|
27 |
+
| RoBERTa+TG-CRF | 60.4 | 29.7 | 52.1 |
|
28 |
+
| SciBERT+Hypernet-CRF | 62.1 | 36.7 | 54.4 |
|
29 |
+
| RoBERTa+Hypernet-CRF | 62.3 | 34.8 | 53.3 |
|
30 |
+
| RoBERTa-extended-CRF* | 62.09 | 40.61 | 52.32 |
|
31 |
+
| KBI-CRF* | 62.61 | 40.81 | 59.7 |
|
32 |
+
| KBIR-CRF* | 62.72 | 40.15 | 62.56 |
|
33 |
+
|
34 |
+
### Named Entity Recognition
|
35 |
+
```
|
36 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
37 |
+
|
38 |
+
tokenizer = AutoTokenizer.from_pretrained("bloomberg/KBIR")
|
39 |
+
model = AutoModelForTokenClassification.from_pretrained("bloomberg/KBIR")
|
40 |
+
|
41 |
+
from datasets import load_dataset
|
42 |
+
|
43 |
+
dataset = load_dataset("conll2003")
|
44 |
+
```
|
45 |
+
|
46 |
+
Reported Results:
|
47 |
+
|
48 |
+
| Model | F1 |
|
49 |
+
|---------------------------------|-------|
|
50 |
+
| LSTM-CRF (Lample et al., 2016) | 91.0 |
|
51 |
+
| ELMo (Peters et al., 2018) | 92.2 |
|
52 |
+
| BERT (Devlin et al., 2018) | 92.8 |
|
53 |
+
| (Akbik et al., 2019) | 93.1 |
|
54 |
+
| (Baevski et al., 2019) | 93.5 |
|
55 |
+
| LUKE (Yamada et al., 2020) | 94.3 |
|
56 |
+
| LUKE w/o entity attention | 94.1 |
|
57 |
+
| RoBERTa (Yamada et al., 2020) | 92.4 |
|
58 |
+
| RoBERTa-extended* | 92.54 |
|
59 |
+
| KBI* | 92.73 |
|
60 |
+
| KBIR* | 92.97 |
|
61 |
+
|
62 |
+
### Question Answering
|
63 |
+
```
|
64 |
+
from transformers import AutoTokenizer, AutoModelForQuestionAnswering
|
65 |
+
|
66 |
+
tokenizer = AutoTokenizer.from_pretrained("bloomberg/KBIR")
|
67 |
+
model = AutoModelForQuestionAnswering.from_pretrained("bloomberg/KBIR")
|
68 |
+
|
69 |
+
from datasets import load_dataset
|
70 |
+
|
71 |
+
dataset = load_dataset("squad")
|
72 |
+
```
|
73 |
+
Reported Results:
|
74 |
+
|
75 |
+
| Model | EM | F1 |
|
76 |
+
|------------------------|-------|-------|
|
77 |
+
| BERT | 84.2 | 91.1 |
|
78 |
+
| XLNet | 89.0 | 94.5 |
|
79 |
+
| ALBERT | 89.3 | 94.8 |
|
80 |
+
| LUKE | 89.8 | 95.0 |
|
81 |
+
| LUKE w/o entity attention | 89.2 | 94.7 |
|
82 |
+
| RoBERTa | 88.9 | 94.6 |
|
83 |
+
| RoBERTa-extended* | 88.88 | 94.55 |
|
84 |
+
| KBI* | 88.97 | 94.7 |
|
85 |
+
| KBIR* | 89.04 | 94.75 |
|
86 |
+
|
87 |
+
## Any other classification task
|
88 |
+
As mentioned above since KBIR is built on top of the RoBERTa architecture, it is compatible with any AutoModel setting that RoBERTa is also compatible with.
|
89 |
+
|
90 |
+
We encourage you to try fine-tuning KBIR on different datasets and report the downstream results.
|
91 |
+
|
92 |
+
## Contact
|
93 |
+
For any questions contact [email protected]
|