Coder Social home page Coder Social logo

tmn's Introduction

Topic Memory Networks for Short Text Classification

Topic Memory Networks (TMN) employs a novel topic memory mechanism to encode latent topic representations indicative of class labels in short text classification. TMN jointly explores topic inference and text classification with memory networks in an end-to-end manner.

Requirements

  • TensorFlow >= 1.2.1
  • Keras >= 2.0.8
  • gensim >= 2.1.0

Input data format

A sampled data is provided in data/tmn/tmn_data.txt from TagMyNews. One data sample per line, the text and the label are separated by ######.

text1######label1
text2######label2
text3######label3
...

How to run

Preprocess data:

$ cd scripts/
$ python process_tmn.py <input_data_file>    
e.g. python process_tmn.py ../data/tmn/tmn_data.txt

Run TMN:

$ python tmn_run.py <input_data_dir> <embedding_file> <output_dir> <topic_num>     
e.g. python tmn_run.py ../data/tmn /emb/glove.6B.200d.txt ../output 50

More detailed configurations can be found in tmn_run.py.

Cite

@inproceedings{DBLP:conf/emnlp/Zeng18,
        author    = {Jichuan Zeng and
                    Jing Li and
                    Yan Song and
                    Cuiyun Gao and
		            Michael R. Lyu and
		            Irwin King},
        title     = "{Topic Memory Networks for Short Text Classification}",
        booktitle = {Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, {EMNLP} 2018, Brussels, Belgium, October 31–November 4, 2018},
        year      = {2018},
}

Disclaimer

The code is for research purpose only and released under the Apache License, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0).

tmn's People

Contributors

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