Projects / Reading customer intent in sales conversations
Reading customer intent in sales conversations
Applied Deep Learning, National Taiwan University
Abstract
The task is to predict which of 10 intents (asking for a price, doubting a claim, finding it too expensive, and so on) a customer expresses in a sales conversation, in Chinese or English, with several labels per message. I fine-tune multilingual Transformer encoders with a multi-label head, compare 23 configurations, and repeat the key comparisons with three training seeds, since the seed-to-seed noise (about 0.01 Macro-F1) is as large as many of the differences. The final system averages two XLM-RoBERTa-large models chosen on my own dev split and reaches Macro-F1 0.8569 and Micro-F1 0.8646 on the public test set. Model size and a class-weighted loss mattered most; the dialogue context did not help.
What I did
Each example is the customer’s current message, often preceded by earlier turns of the dialogue (median: 360 tokens of context against 66 for the message). The model is a pretrained encoder with a linear head and one sigmoid output per label. All runs share one fixed dev split (15% of the training data, stratified by label combination and language); the public test set was only used to report, never to choose. The study follows four questions.
Which model and which loss
XLM-RoBERTa-large [1] beats every base-size encoder by a wide margin (Figure 1): moving from the base to the large model gains 0.070 Macro-F1 with everything else fixed. The second lever is the label imbalance, since the rarest labels have about 200 examples out of 3,000. A class-weighted BCE gains 0.055 over plain BCE, and adding a focal term [2] gains another 0.012:

Backbones compared with the same context handling and plain BCE. The two monolingual models are only meaningful on their own language.
Does the dialogue context help?
I compared four ways of using it, each with three seeds: no context; concatenating context and message with the message protected from truncation; the same input but pooling only over the message tokens; and a gated second encoder for the context. Concatenation hurts the small model (−0.047 public Macro-F1 with plain BCE), the damage shrinks with a weighted loss and a larger model, and no method gives a gain that survives three seeds (Figure 2). Labels that never appear without context in training, such as comparing with a competitor, turn out to be named in the message itself.

Context handling, one dot per training seed and the bar at the mean (top: dev, bottom: public). No method beats using the message alone by more than the seed noise.
Long inputs
About 29% of the inputs exceed XLM-R’s 512 tokens. Truncation is a real problem only when it can cut the message itself: naive right-truncation loses 0.115 Macro-F1 against protecting the message (Figure 3), and simply truncating from the left recovers almost all of it. A no-context control, which truncation cannot affect, shows that long examples are also harder in themselves, and once the message is protected the remaining truncation penalty is not distinguishable from zero.

Protecting the message (left) against naive concatenation with default right-side truncation (right).
Chinese against English
Every multilingual model scores 4 to 7 points higher on Chinese, also at the large size, although the training data is 3:1 Chinese to English. Monolingual models fail completely on the other language, and the English-only model is worse even on English (0.690 against 0.74 to 0.81), because 634 English examples are too few. Chinese data helps English: a model trained on Chinese only reaches 0.790 on English, more than one trained on English only (0.752).

Chinese and English Macro-F1 by pretrained model.
Results
Best single model against the final ensemble, which was selected on dev; public numbers are reported, not used to choose.
| System | Dev Macro-F1 | Dev Micro-F1 | Public Macro-F1 | Public Micro-F1 |
|---|---|---|---|---|
| Best single model (no context, weighted BCE + focal) | 0.8593 | 0.8578 | 0.8528 | 0.8593 |
| Ensemble of two XLM-R-large models | 0.8682 | 0.8717 | 0.8569 | 0.8646 |
The two members differ in context handling and loss, and their averaged probabilities beat every single model on dev. Every label scores above 0.70 F1 (Figure 5); the weakest, finding the product too expensive, is also the rarest.

Per-label F1 of the final ensemble on the public test set.
Findings
- Capacity and the loss mattered most; which multilingual checkpoint mattered far less (mBERT and XLM-R-base differ by about the seed noise).
- More seeds changed conclusions. A single-seed run suggested that context helps the large model; three seeds per setting showed it does not.
- Most remaining errors are shared. 54% of the final errors are made by at least 90% of the 11 large models, and in an audit of 60 of them, four in five were cases where a reasonable annotator could choose differently.
- Error-driven fixes did not hold up: softened class weights helped the base model slightly but not the large one, while label smoothing and a head that predicts the number of labels made things worse.
References
- A. Conneau et al. Unsupervised cross-lingual representation learning at scale. ACL, 2020.
- T.-Y. Lin, P. Goyal, R. Girshick, K. He and P. Dollár. Focal loss for dense object detection. ICCV, 2017.