首页 > 其他分享 >论文解读《KNN-Contrastive Learning for Out-of-Domain Intent Classification》

论文解读《KNN-Contrastive Learning for Out-of-Domain Intent Classification》

时间:2023-03-20 11:01:09浏览次数:42  
标签:KNN Domain right frac Contrastive mathcal left mathrm

论文信息

论文标题:KNN-Contrastive Learning for Out-of-Domain Intent Classification
论文作者:Yunhua Zhou, Peiju Liu, Xipeng Qiu
论文来源:ArXiv 2021
论文地址:download 
论文代码:download
引用次数:

1 前言

  意图检测;

2 方法

  方法对比:

  

  整体框架:

    

  Note:

    • 问题:以往的方法通过将属于同一类的 IND 样本汇集在一起,推远不同类别的样本,间接降低了开放空间风险。然而,这些方法可能会增加识别 OOD 意图为 IND 意图的风险;
    • 思路:不需要将属于同一类的所有 IND 意图样本集合在一起,只需要将 $k$ 个最近邻集合在一起,同时将它们从不同的类意图样本中分开;

  文本表示

    $Z_{i}=\text { Mean-Pooling }\left(\left[[\mathrm{CLS}], T_{1}, \ldots T_{N}\right]\right)$

  计算交叉熵

    $\mathcal{L}_{\mathrm{ce}}=-\frac{1}{N} \sum_{i=1}^{N} \log \frac{\exp \left(\phi_{y_{i}}\left(z_{i}\right)\right)}{\sum_{j \in[K]} \exp \left(\phi_{j}\left(z_{i}\right)\right)}$

  K 近邻对比损失

    $\mathcal{L}_{\mathrm{knn}-\mathrm{cl}}=\sum_{i=1}^{N} \frac{1}{\left|\mathcal{X}_{k}\right|} \sum_{z_{j} \in \mathcal{X}_{k}}-\log \frac{\exp \left(\frac{z_{i} \cdot z_{j}}{\tau}\right)}{\sum_{z_{q} \in I} \exp \left(\frac{z_{q} \cdot z_{i}}{\tau}\right)}$

  训练目标:

    $\mathcal{L}_{o b j}=\lambda \cdot \mathcal{L}_{\mathrm{knn}-\mathrm{cl}}+(1-\lambda) \cdot \mathcal{L}_{\mathrm{ce}}$

  基于 KNN 的对比学习方法存在的问题:

    • 批量大,可以选择的样本越多,就越有可能找到 k-近邻。同时,也需要足够的负样本来区分;
    • k-最近邻在训练过程中要保持一致,否则,KNN 对比学习的训练可能不稳定;

  解决办法:MoCo

标签:KNN,Domain,right,frac,Contrastive,mathcal,left,mathrm
From: https://www.cnblogs.com/BlairGrowing/p/17235244.html

相关文章