Code Monkey home page Code Monkey logo

neuralsum's Introduction

NeuralSum

Neural Network Summarizer

Features(to be included)

  • Hierarchical encoder ..* CNN sentence encoder ..* LSTM document encoder ..* Bidirectional LSTM document encoder
  • Sentence extraction ..* Extraction with LSTM decoder ..* Prediction on top of BiLSTM encoder
  • Word generator ..* Vanilla decoder ..* Hierarchical attention decoder ..* Beam-search decoder ..* External language model
  • Post-process ..* LR Ranker ..* MERT feature-tuning ..* RL feature-tuning

Dependencies

  • numpy
  • scipy
  • tensorflow
  • scikit-learn

Quick-start

  • Data
  • You can change the data_dir in the code train.py, this directory should have three files, train.json, test.json and valid.json
  • The preprocessing folder contains finding_similar_sentence.py this code generates the json files from general legal documents
  • Pretrain a general-purpose encoder: python pretrain.py
  • Training python train.py
  • Evaluate python evaluate.py, here you can set the load_model argument to specify the latest model that should be used to generate scores of the test data
  • Run evaluate.py for train and test data to get scores for both the files. We need those to perform logistic regression to determine the probability of each sentence in the test data being in the final summary.
  • Run python ranking/lr.py with the appropriate file names in place of scores_train and scores_test in arguments.
  • Run python find_rouge.py to finally calculate the rouge score of each generated summary as compared to the original summary. Change the filenames test_summary.txt and original_summary.txt appropriately

Visualize scores

Sentence scores are stored during evaluation.

score.png

Citation

@InProceedings{cheng-lapata:2016:P16-1, 
  author = {Cheng, Jianpeng and Lapata, Mirella}, 
  title = {Neural Summarization by Extracting Sentences and Words}, 
  booktitle = {Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)}, 
  year = {2016}, 
  address = {Berlin, Germany}, 
  publisher = {Association for Computational Linguistics}, 
  pages = {484--494} 
 }

Reference

Liscense

MIT

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.