Giter Site home page Giter Site logo

dialogueclassifier's Introduction

DialogueClassifier

通过分析客户和客服对话,对客户的问题进行一些分类。 具体介绍可以查看CSDN博客,地址如下: http://blog.csdn.net/sinat_31188625/article/details/78490209

实验方法

  1. 基于SVM的分类方法
  2. 基于Naive Bayes的分类方法
  3. 基于LSTM循环神经网络的分类方法
  4. 基于LDA和SVM的分类方法

数据集

约5890个对话文本,每个文本包含三级分类标签,其中一级分类有5类,二级分类有80类。

不同实验中,数据集的划分如下表所示:

实验编号 训练集 验证集 测试集
1 80% 0 20%
2 80% 0 20%
3 60% 20% 20%

实验结果

为一级分类和二级分类分别训练了分类器,实验结果如下:

SVM Bayes LSTM 1based-svm 1based-svm(2) lda_svm mix
一级分类准确率(%) 75.97 68.33 66.46 - - 46.08 74.87
二级分类准确率(%) 65.33 37.84 49.48 60.46 66.11 - 62.40

1based-svm的预测方式: 一级分类有A、B两类,用一级分类器得到的概率分布P1为0.3,0.7 二级分类有a1,a2,b1,b2四类,用二级分类器得到的概率分布P2为0.1, 0.2, 0.3, 0.4 那么1based-svm最终预测的概率分布为0.1*0.3, 0.2*0.3, 0.3*0.7, 0.4*0.7 一级分类对二级分类的指导方式还有待改进。

1based-svm(2)的预测方式: 一级分类有A、B两类,用一级分类器得到的概率分布P1为0.3,0.7 二级分类有a1,a2,b1,b2四类,用二级分类器得到的概率分布P2为0.1, 0.2, 0.3, 0.4 那么1based-svm最终预测的概率分布为0.1*(1+0.3), 0.2*(1+0.3), 0.3*(1+0.7), 0.4*(1+0.7) 该方式与前一种方式相比弱化了一级分类对二级分类概率分布的影响,得到的效果较单独训练的SVM略有上升。

lda_svm的超参数设置: 文档-词共现矩阵选取了500个特征

使用LDA进行降维时,选取的主题个数为50个

实验中的一些问题

  1. 在数据预处理时,只将数据处理成了[文本,一级标签,二级标签,三级标签]的形式,没有建立整理好的数据与原始数据之间的索引,导致在最终输出测试集预测结果到excel时编码难度上升,应该在数据预处理时将数据预处理成[原始数据编号,文本,一级标签,二级标签,三级标签]的形式;
  2. 在数据预处理时,原本是要将数据中非英文的项删除,但是在处理时首先将utf-8编码的文本改用Unicode编码,然后进行了非英文检测,结果处理好的数据中仍然有非英文。仔细研究后发现,在.decode('utf8')后应该在检测非英文时.encoed('utf8'),否则无法检测出非英文;

注:一级分类和二级分类彼此独立,即进行二级分类时没有引入上一级分类信息。

dialogueclassifier's People

Contributors

jx00109 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.