Code Monkey home page Code Monkey logo

multi-label-text-classification's Introduction

Multi-Label-Text-Classification

Tensorflow+bilstm+attention+multi label text classify (support Chinese text)

#Network:

Word Embedding + bi-lstm + attention + Variable batch_size

#Requirements

Python 3.5 (> 3.0)

Tensorflow 1.2

#Introduction

  1. This is a multi-label text classification (sentence classification) problem. For example, the format of label is [0,1,0,1,1].
  2. This model was built with bi-lstm, attention and Word Embeddings(word2vec) on Tensorflow.
  3. It supports the variable batch size.(the batch size of test code(prediction) is 1)
(在训练和测试时,每个epoch样本被分成很多batches,最后一个batch的size小于batch_size时也是可以去训练和测试的,不用舍弃这些样本)
  1. It supports Chinese text classification, but you need the pretrained word2vector model.
(通过word2vector训练中文的词向量)
  1. input_helpers.py is my data processing code , and you can write it according to yourself dataset.
(根据自己的数据集来写input_helpers.py, 将数据集写到trainset 和devset两个变量即可,trainset 和devset中包括所有样本的数据和对应的label)

#python file

Lstm_Attention_network.py: define the network

My_Attention.py: attention code

train.py: train the network

input_helpers.py : data helper code , data processing

注: 欢迎指正讨论.

multi-label-text-classification's People

Contributors

chenzhi1992 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.