ggallipoli commited on
Commit
5ac2f6a
·
verified ·
1 Parent(s): 6e3c627

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +109 -0
README.md ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ ---
5
+ # Text Style Transfer using CycleGANs
6
+
7
+ This repository contains the models from the paper "Self-supervised Text Style Transfer using Cycle-Consistent Adversarial Networks" (ACM TIST 2024).\
8
+ The work introduces a novel approach to Text Style Transfer using CycleGANs with sequence-level supervision and Transformer architectures.
9
+
10
+ ## Available Models
11
+
12
+ ### Formality transfer
13
+ #### GYAFC dataset (Family & Relationships)
14
+
15
+ | model | checkpoint |
16
+ |:----------:|:------------------------------------------------------:|
17
+ | BART base | [informal-to-formal](https://huggingface.co/ggallipoli/bart-base_inf2for_family), [formal-to-informal](https://huggingface.co/ggallipoli/bart-base_for2inf_family) |
18
+ | BART large | [informal-to-formal](https://huggingface.co/ggallipoli/bart-large_inf2for_family), [formal-to-informal](https://huggingface.co/ggallipoli/bart-large_for2inf_family) |
19
+ | T5 small | [informal-to-formal](https://huggingface.co/ggallipoli/t5-small_inf2for_family), [formal-to-informal](https://huggingface.co/ggallipoli/t5-small_for2inf_family) |
20
+ | T5 base | [informal-to-formal](https://huggingface.co/ggallipoli/t5-base_inf2for_family), [formal-to-informal](https://huggingface.co/ggallipoli/t5-base_for2inf_family) |
21
+ | T5 large | [informal-to-formal](https://huggingface.co/ggallipoli/t5-large_inf2for_family), [formal-to-informal](https://huggingface.co/ggallipoli/t5-large_for2inf_family) |
22
+ | BERT base | [style classifier](https://huggingface.co/ggallipoli/formality_classifier_gyafc_family) |
23
+
24
+ #### GYAFC dataset (Entertainment & Music)
25
+
26
+ | model | checkpoint |
27
+ |:----------:|:------------------------------------------------------:|
28
+ | BART base | [informal-to-formal](https://huggingface.co/ggallipoli/bart-base_inf2for_music), [formal-to-informal](https://huggingface.co/ggallipoli/bart-base_for2inf_music) |
29
+ | BART large | [informal-to-formal](https://huggingface.co/ggallipoli/bart-large_inf2for_music), [formal-to-informal](https://huggingface.co/ggallipoli/bart-large_for2inf_music) |
30
+ | T5 small | [informal-to-formal](https://huggingface.co/ggallipoli/t5-small_inf2for_music), [formal-to-informal](https://huggingface.co/ggallipoli/t5-small_for2inf_music) |
31
+ | T5 base | [informal-to-formal](https://huggingface.co/ggallipoli/t5-base_inf2for_music), [formal-to-informal](https://huggingface.co/ggallipoli/t5-base_for2inf_music) |
32
+ | T5 large | [informal-to-formal](https://huggingface.co/ggallipoli/t5-large_inf2for_music), [formal-to-informal](https://huggingface.co/ggallipoli/t5-large_for2inf_music) |
33
+ | BERT base | [style classifier](https://huggingface.co/ggallipoli/formality_classifier_gyafc_music) |
34
+
35
+ ### Sentiment transfer
36
+ #### Yelp dataset
37
+
38
+ | model | checkpoint |
39
+ |:----------:|:------------------------------------------------------:|
40
+ | BART base | [negative-to-positive](https://huggingface.co/ggallipoli/bart-base_neg2pos), [positive-to-negative](https://huggingface.co/ggallipoli/bart-base_pos2neg) |
41
+ | BART large | [negative-to-positive](https://huggingface.co/ggallipoli/bart-large_neg2pos), [positive-to-negative](https://huggingface.co/ggallipoli/bart-large_pos2neg) |
42
+ | T5 small | [negative-to-positive](https://huggingface.co/ggallipoli/t5-small_neg2pos), [positive-to-negative](https://huggingface.co/ggallipoli/t5-small_pos2neg) |
43
+ | T5 base | [negative-to-positive](https://huggingface.co/ggallipoli/t5-base_neg2pos), [positive-to-negative](https://huggingface.co/ggallipoli/t5-base_pos2neg) |
44
+ | T5 large | [negative-to-positive](https://huggingface.co/ggallipoli/t5-large_neg2pos), [positive-to-negative](https://huggingface.co/ggallipoli/t5-large_pos2neg) |
45
+ | BERT base | [style classifier](https://huggingface.co/ggallipoli/sentiment_classifier_yelp) |
46
+
47
+ ## Model Description
48
+
49
+ The models implement a CycleGAN architecture for Text Style Transfer that:
50
+ - Applies self-supervision directly at sequence level
51
+ - Maintains content while transferring style attributes
52
+ - Employs pre-trained style classifiers to guide generation
53
+ - Uses Transformer-based generators and discriminators
54
+
55
+ The models achieve state-of-the-art results on both formality and sentiment transfer tasks.
56
+
57
+ ## Usage
58
+
59
+ Both generators and style classifiers can be used with the Hugging Face 🤗 transformers library:
60
+
61
+ Each generator model can be loaded as:
62
+
63
+ ```python
64
+ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
65
+
66
+ model = AutoModelForSeq2SeqLM.from_pretrained("[GENERATOR_MODEL]")
67
+ tokenizer = AutoTokenizer.from_pretrained("[GENERATOR_MODEL]")
68
+ ```
69
+
70
+ The style classifiers can be loaded as:
71
+
72
+ ```python
73
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
74
+
75
+ classifier = AutoModelForSequenceClassification.from_pretrained("[CLASSIFIER_MODEL]")
76
+ tokenizer = AutoTokenizer.from_pretrained("[CLASSIFIER_MODEL]")
77
+ ```
78
+
79
+ ## Citation
80
+ For more details, you can refer to the [paper](https://dl.acm.org/doi/10.1145/3678179).
81
+
82
+ ```bibtex
83
+ @article{10.1145/3678179,
84
+ author = {La Quatra, Moreno and Gallipoli, Giuseppe and Cagliero, Luca},
85
+ title = {Self-supervised Text Style Transfer Using Cycle-Consistent Adversarial Networks},
86
+ year = {2024},
87
+ issue_date = {October 2024},
88
+ publisher = {Association for Computing Machinery},
89
+ address = {New York, NY, USA},
90
+ volume = {15},
91
+ number = {5},
92
+ issn = {2157-6904},
93
+ url = {https://doi.org/10.1145/3678179},
94
+ doi = {10.1145/3678179},
95
+ journal = {ACM Trans. Intell. Syst. Technol.},
96
+ month = nov,
97
+ articleno = {110},
98
+ numpages = {38},
99
+ keywords = {Text Style Transfer, Sentiment transfer, Formality transfer, Cycle-consistent Generative Adversarial Networks, Transformers}
100
+ }
101
+ ```
102
+
103
+ ## Code
104
+
105
+ The full implementation is available at: https://github.com/gallipoligiuseppe/TST-CycleGAN.
106
+
107
+ ## License
108
+
109
+ This work is licensed under the <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.