File size: 1,703 Bytes
eefa6a5
0bef4b0
 
 
 
 
 
 
 
eefa6a5
0bef4b0
 
 
 
 
 
 
a201deb
0bef4b0
cb24533
 
 
 
 
 
 
 
 
 
0bef4b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
language:
- en

tags:
- formality

licenses:
- cc-by-nc-sa
---


**Model Overview**

This is the model presented in the paper "Detecting Text Formality: A Study of Text Classification Approaches". 

The original model is [DeBERTa (large)](https://huggingface.co/microsoft/deberta-v3-large). Then, it was fine-tuned on the English corpus for fomality classiication [GYAFC](https://arxiv.org/abs/1803.06535). 
In our experiments, the model showed the best results within Transformer-based models for the task. More details, code and data can be found [here](https://github.com/s-nlp/formality).

**Evaluation Results**

Here, we provide several metrics of the best models from each category participated in the comparison to understand the ranks of values.
|                  | acc  | f1-formal | f1-informal |
|------------------|------|-----------|-------------|
| bag-of-words     | 79.1 |    81.8   |     75.6    |
| CharBiLSTM       | 87.0 |    89.0   |     84.0    |
| DistilBERT-cased | 80.1 |    83.0   |     75.6    |
| DeBERTa-large    | 87.8 |    89.0   |     86.1    |

**How to use**
```python
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_name = 'deberta-large-formality-ranker'
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
```

**Citation**
```
TBD
```

## Licensing Information

[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].

[![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]

[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
[cc-by-nc-sa-image]: https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png