Quotation Recommendation and Interpretation Based on Transformation from Queries to Quotations

Lingzhi Wang, Xingshan Zeng, Kam-Fai Wong

Introduction

In interpersonal communication, a well-placed quotation can be a powerful tool for persuasion or explanation. However, finding the right quote in the heat of a conversation is difficult for humans and machines alike. The core challenge is a semantic gap: quotations are often concise, ancient, or highly figurative (e.g., "A fool and his money are soon parted"), while the surrounding conversation is informal and literal. Previous research often modeled queries and quotations separately, failing to account for the fact that they exist in different "pseudo-languages." This paper seeks to bridge that gap by explicitly learning a mapping between these two semantic spaces.

Methodology

The authors propose a model architecture designed to align the informal "query" space with the formal "quotation" space. The architecture consists of several key components:

  1. Hierarchical Conversation Encoder: A Transformer encoder processes individual turns to capture local context, followed by a Bidirectional GRU (Bi-GRU) that aggregates these representations to model the dialogue flow.
  2. Quotation Encoder: A separate Transformer encoder represents quotations, acknowledging their unique linguistic style.
  3. The Transformation Matrix ($M$): This is the core innovation. Instead of just comparing embeddings, the model uses a matrix $M$ to project the query representation directly into the quotation's semantic space.
  4. Dual-Loss Training: The model is optimized using a combination of Recommendation Loss ($L_{rec}$) for ranking and Mapping Loss ($L_{map}$) to minimize the distance between transformed queries and ground-truth quotations.
The proposed model architecture featuring a dual-encoder setup and a transformation matrix $M$.

Additionally, an Interpretation Module uses "quotation-aware attention" to identify "indicator words" in the conversation history (e.g., "spends," "money," "buying") that explain why a specific figurative quote was recommended.

Experimental Evaluation

The model was evaluated on two large-scale datasets: Weibo (Chinese social media) and Reddit (English discussion). Both datasets consist of multi-turn conversations where the final turn is a quotation.

Key Results

The proposed model achieved new state-of-the-art (SOTA) results across all metrics, including MAP, P@1, P@3, and nDCG@5.

Performance comparison of the proposed model against several baselines on Weibo and Reddit datasets.
  • On Reddit: The model achieved a MAP of 31.8%, significantly outperforming the BERT baseline (26.4%) and the previous SOTA, CTIQ (21.9%).
  • On Weibo: The model reached a MAP of 34.9%, compared to 31.4% for BERT and 30.3% for CTIQ.

Ablation studies confirmed that removing the transformation matrix ($M$) or the mapping loss ($L_{map}$) led to a noticeable drop in performance, proving that the explicit alignment of semantic spaces is the primary driver of the model's success.

Discussion and Future Work

The authors' approach treats quotations as a "pseudo-language," respecting the linguistic differences between daily chat and figurative wisdom. By using a transformation matrix rather than simple matching, the model acts as a translator between literal descriptions and figurative concepts.

While successful, the model currently operates on a static quotation list and does not handle out-of-vocabulary wisdom. Future work could involve generating natural language explanations for quotes or integrating the system into real-time writing assistants.

Summary updated

BibTeX
@inproceedings{wang2021quotation,
  author = {Lingzhi Wang and Xingshan Zeng and Kam-Fai Wong},
  title = {{Quotation Recommendation and Interpretation Based on Transformation from Queries to Quotations}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-short.95},
}
Figure