File size: 2,178 Bytes
1aa2131
74ab718
 
 
 
 
 
 
 
 
94ddefa
1aa2131
74ab718
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
af5500d
74ab718
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
51
52
53
54
---
language:
- en
- fr
- it
- pt
tags:
- formality
licenses:
- cc-by-nc-sa
license: cc-by-nc-sa-4.0
---


**Model Overview**

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

The original model is [mDistilBERT (base)](https://huggingface.co/distilbert-base-multilingual-cased). Then, it was fine-tuned on the multilingual corpus for fomality classiication [X-FORMAL](https://arxiv.org/abs/2104.04108) that consists of 4 languages -- English (from [GYAFC](https://arxiv.org/abs/1803.06535)), French, Italian, and Brazilian Portuguese.
In our experiments, the model showed the best results within Transformer-based models for the cross-lingual formality classification knowledge transfer 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. We report accuracy score for two setups -- multilingual model fine-tuned for each language separately and then fine-tuned on all languages.
For cross-lingual experiments results, please, refer to the paper.

|                  | En   |  It  |  Po  |  Fr  |  All  |
|------------------|------|------|------|------|-------|
| bag-of-words     | 79.1 | 71.3 | 70.6 | 72.5 |  ---  |
| CharBiLSTM       | 87.0 | 79.1 | 75.9 | 81.3 |  82.7 |
| mDistilBERT-cased| 86.6 | 76.8 | 75.9 | 79.1 |  79.4 |
| mDeBERTa-base    | 87.3 | 76.6 | 75.8 | 78.9 |  79.9 |

**How to use**
```python
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_name = 'mdistilbert-base-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