Abstract
Text attribute transfer using non-parallel data requires methods that can perform disentanglement of content and linguistic attributes. In this work, we propose multiple improvements over the existing approaches that enable the encoder-decoder framework to cope with the text attribute transfer from non-parallel data. We perform experiments on the sentiment transfer task using two datasets. For both datasets, our proposed method outperforms a strong baseline in two of the three employed evaluation metrics.
Introduction
Text attribute transfer aims to modify a specific feature of a sentence—such as flipping sentiment from positive to negative—while preserving the underlying semantic content. Achieving this with non-parallel data is a significant challenge because there is no ground truth target sentence for supervised learning. Furthermore, models often struggle to change the style without inadvertently altering the substance of the sentence. This paper addresses these hurdles by moving away from adversarial training in favor of a collaborative framework that prioritizes content preservation.
Methodology
The proposed architecture utilizes an encoder-decoder framework enhanced by several novel components designed to handle non-parallel data.
Collaborative Architecture
Unlike standard Generative Adversarial Networks (GANs) that rely on competition, this model uses a Collaborative Classifier (CNN). This classifier provides a smooth training signal by estimating the likelihood that a generated sentence belongs to the target attribute.
Loss Functions
The model is trained using a weighted sum of four key loss functions:
- Reconstruction Loss: Ensures the model can reconstruct the original sentence when the target attribute matches the input.
- Content Preservation Loss: A novel contribution that uses attention mechanisms to identify nouns in the original sentence. The model is penalized if these "content anchors" are missing from the transferred output.
- Classification Loss: Forces the output to exhibit the desired target attribute.
- Back-transfer (Cycle) Loss: Inspired by CycleGAN, this ensures that a sentence transferred to a target style and then back to the original style matches the initial input.
Experimental Results
The model was evaluated on the Yelp Restaurant Reviews and Amazon Customer Reviews datasets. Performance was measured across three metrics: sentiment accuracy, content preservation (noun retention), and perplexity (fluency).
As shown in the results table, the proposed method significantly outperforms the baseline (Shen et al., 2017) in sentiment accuracy and content retention. On the Yelp dataset, sentiment accuracy reached 94.4% (vs. 86.5% baseline), and noun retention jumped to 77.1% (vs. 38.3% baseline).
However, there is a clear trade-off: the model's perplexity scores are higher (80.1 vs 27.0 on Yelp), indicating that the generated text is less fluent. This suggests that the model prioritizes keeping original nouns at the expense of perfectly natural-sounding grammar.
Conclusion
This work demonstrates that a collaborative approach combined with explicit content preservation losses can effectively transfer text attributes without parallel data. While the method excels at maintaining the original meaning and achieving high attribute accuracy, future work is needed to improve the fluency of the generated text and extend the framework to more complex linguistic attributes.
Summary updated