File size: 2,339 Bytes
3ca52bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4d2cfa4
 
 
 
 
 
 
 
 
a5df191
 
 
4d2cfa4
 
 
 
 
 
 
3ca52bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a5df191
3ca52bf
 
 
 
 
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
55
56
57
58
59
60
61
62
63
64
---
license: cc-by-4.0
language:
- it
---
# GeNTE Evaluator

The **Gender-Neutral Translation (GeNTE) Evaluator** is a sequence classification model used for evaluating inclusive translations into Italian for the [GeNTE corpus](https://huggingface.co/datasets/FBK-MT/GeNTE). 
It is built by fine-tuning the RoBERTa-based [UmBERTo model](https://huggingface.co/Musixmatch/umberto-wikipedia-uncased-v1). 
More details on the training process and the reproducibility can be found in the [official repository](https://github.com/hlt-mt/fbk-NEUTR-evAL/blob/main/solutions/GeNTE.md) ad the [paper](https://aclanthology.org/2023.emnlp-main.873/).

## Usage

You can use the GeNTE Evaluator as follows:

```
from transformers import AutoModelForSequenceClassification, AutoTokenizer

# load the tokenizer of UmBERTo
tokenizer = AutoTokenizer.from_pretrained("Musixmatch/umberto-wikipedia-uncased-v1", do_lower_case=False)

# load GeNTE Evaluator
model = AutoModelForSequenceClassification.from_pretrained("FBK-MT/GeNTE-evaluator")

# neutral example
sample = "Condividiamo il parere di chi ha presentato la relazione
          che ha posto notevole enfasi sull'informazione in relazione ai rischi e sulla trasparenza,
          in particolare nel campo sanitario e della sicurezza."
input = tokenizer(sample, return_tensors='pt')

with torch.no_grad():
  probs = model(**input).logits

predicted_label = torch.argmax(probs, dim=1).item()
print(predicted_label)  # 0 is neutral, 1 is gendered
```

## Citation

```
@inproceedings{piergentili-etal-2023-hi,
    title = "Hi Guys or Hi Folks? Benchmarking Gender-Neutral Machine Translation with the {G}e{NTE} Corpus",
    author = "Piergentili, Andrea  and
      Savoldi, Beatrice  and
      Fucci, Dennis  and
      Negri, Matteo  and
      Bentivogli, Luisa",
    editor = "Bouamor, Houda  and
      Pino, Juan  and
      Bali, Kalika",
    booktitle = "Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing",
    month = dec,
    year = "2023",
    address = "Singapore",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2023.emnlp-main.873",
    doi = "10.18653/v1/2023.emnlp-main.873",
    pages = "14124--14140",
  }
```

## Contributions

Thanks to [@dfucci](https://huggingface.co/dfucci) for adding this model.