Giter Club home page Giter Club logo

hsln-joint-sentence-classification's Introduction

HSLN-Joint-Sentence-Classification

This is the source code for the paper that will be at EMNLP 2018: Jin, Di, and Peter Szolovits. "Hierarchical Neural Networks for Sequential Sentence Classification in Medical Scientific Abstracts." arXiv preprint arXiv:1808.06161 (2018).

Abstract:

Prevalent models based on artificial neural network (ANN) for sentence classification often classify sentences in isolation without considering the context in which sentences appear. This hampers the traditional sentence classification approaches to the problem of sequential sentence classification, where structured prediction is needed for better overall classification performance. In this work, we present a hierarchical sequential labeling network to make use of the contextual information within surrounding sentences to help classify the current sentence. Our model outperforms the state-of-the-art results by 2%-3% on two benchmarking datasets for sequential sentence classification in medical scientific abstracts.

Requirements:

  • Tensorflow=1.8
  • sklearn>0.18
  • python=2.7
  • numpu

Data

PubMed

The original data comes from: https://github.com/Franck-Dernoncourt/pubmed-rct. If you carefully look at the original data, you can find that in the end of some abstracts, there are some sentences that indicate the funding source of the research and are not relevant to the paper content, and these sentences are labeled as BACKGROUND type, which I think is not that reasonable. So I removed these sentences using the script "pubmed_data_cleaning.py". The command to run this script could be:

python pubmed_data_cleaning.py IN_FILE_PATH OUT_FILE_PATH

I have put the cleaned data files for PubMed-20k dataset inside the folder "data/PubMed-20k-RCT" for references.

NICTA-PIBOSO

The original data is from the ALTA-NICTA Challenge, but it is hard to download from it. So I shared this dataset here. If you carefully look at this dataset, you will find that some sentences have multiple labels, but in our model scenerios, any sentence only accepts one label. So I assigned the label to the sentences that have multiple labels by majority voting, where I first obtained the statistics for each label, then within the label candidates, I chose the label that appears most times. For example, one sentence has three labels: A, B, and C, and in the whole train set, label A appears most frequently, so I chose label A for this sentence. I have put the processed data in the folder "data/nicta_piboso".

Embeddings

The embeddings I mainly used is from here. You'd better convert this binary file into txt file since it would be much more convenient for embedding trim.

Usage

  1. [DO NOT MISS THIS STEP] Build vocab from the data and extract trimmed embedding vectors according to the config in model/config.py.
python build_data.py
  1. Train the model with
python train.py

Words in the end

This project is licensed under the terms of the MIT license. If used for research, citation would be appreciated. If you have any questions, feel free to post them in the issues.

hsln-joint-sentence-classification's People

Contributors

jind11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hsln-joint-sentence-classification's Issues

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.