Modeling Discriminative Representations for Out-of-Domain Detection with Supervised Contrastive Learning

Zhiyuan Zeng, Keqing He, Yuanmeng Yan, Zijun Liu, Yanan Wu +3 more
5/29/2021
cs.CL
contrastive-ssl

Official code: parZival27/supervised-contrastive-learning-for-out-of-domain-detection (20 stars, Python, last commit 2021-09-06).

Abstract

Detecting Out-of-Domain (OOD) or unknown intents from user queries is essential in a task-oriented dialog system. A key challenge of OOD detection is to learn discriminative semantic features.

Show full abstract

Traditional cross-entropy loss only focuses on whether a sample is correctly classified, and does not explicitly distinguish the margins between categories. In this paper, we propose a supervised contrastive learning objective to minimize intra-class variance by pulling together in-domain intents belonging to the same class and maximize inter-class variance by pushing apart samples from different classes. Besides, we employ an adversarial augmentation mechanism to obtain pseudo diverse views of a sample in the latent space. Experiments on two public datasets prove the effectiveness of our method capturing discriminative representations for OOD detection.

View on arXivView PDF

Code Implementations(1)

Code for paper "Modeling Discriminative Representations for Out-of-Domain Detection with Supervised Contrastive Learning"

203Python, ShellSep 6, 20215 years ago

Similar Papers

Cite this paper

@article{zeng2021modeling,
  title  = {Modeling Discriminative Representations for Out-of-Domain Detection with Supervised Contrastive Learning},
  author = {Zhiyuan Zeng and Keqing He and Yuanmeng Yan and Zijun Liu and Yanan Wu and Hong Xu and Huixing Jiang and Weiran Xu},
  year   = {2021},
  eprint = {2105.14289},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2105.14289}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2105.14289.svg)](https://codeofpaper.com/paper/2105.14289)

Discussion