Coder Social home page Coder Social logo

ml-lab / cnn-sentence-classifier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shagunsodhani/cnn-sentence-classifier

0.0 3.0 0.0 488 KB

Implementation of "Convolutional Neural Networks for Sentence Classification" paper

License: MIT License

Python 100.00%

cnn-sentence-classifier's Introduction

CNN-Sentence-Classifier

Simplified implementation of "Convolutional Neural Networks for Sentence Classification" paper

Usage

  • Install Keras
  • Repository contains "Movie reviews with one sentence per review" (Pang and Lee, 2005) dataset in sample_dataset.
  • Alternatively, to use some other dataset, make two files
    • input.txt where each line is a sentence to be classified
    • label.txt where each line is the label for corresponding line in input.txt
  • Make model folder by running mkdir model
  • Refer this to train or download Glove embeddings and this for Word2Vec embeddings.
  • Run python3 app/train.py --data_dir=path_to_folder_containing_input.txt_and_label.txt --embedding_file_path=path_to_embedding_vectors_file --model_name=name_of_model_from_the_paper
  • For example, if data is in data folder, embedding file is vectors.txt and model is cnn_static, run python3 app/train.py --data_dir=data --embedding_file_path=vectors.txt --model_name=cnn_static
  • To define your own model, pass model_name as self, define your model in app/model/model.py and invoke from model_selector function (in model.py).
  • All supported arguments can be seen in here

References

cnn-sentence-classifier's People

Contributors

shagunsodhani avatar

Watchers

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