Git Product home page Git Product logo

feature_extraction's Introduction

feature_extraction 文本特征提取算法实现-java

使用java,实现了卡方校验(chi-square)和信息增益算法提取文本特征算法

包说明

1. com.ivan.sentiment.beans

特征提取中使用到的java bean,对文档对象的封装

2. com.ivan.sentiment.feature_extraction

核心算法包,包含特征提取接口、抽象类以及特征提取实现类

3. com.ivan.sentiment.utils

工具类

4. com.ivan.sentiment.main

测试类

使用说明

//创建特征提取对象,可以使用卡方校验或者信息增益两种方法
IFeatureExtraction featureExtraction = new CHIFeatureExtractionImpl();
//IFeatureExtraction featureExtraction = new IGFeatureExtractionImpl();
//构造样本集 map的key是样本的标签,value 是对应的每个类别下的样本分词结果
Map<String,List<List<String>>> datas = new HashMap<String, List<List<String>>>();
//调用特征提取方法  第二个参数特征的个数,也可以不写,默认是300
List<String> features = featureExtraction.featureExtraction(datas, 500);  

原理参考

文本特征词提取算法
文本分类入门(十一)特征选择方法之信息增益

feature_extraction's People

Contributors

jfanzhao avatar

Watchers

 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.