Git Product home page Git Product logo

neural_name_tagging's Introduction

Dynamic Feature Composition for Name Tagging

Code for our ACL2019 paper Reliability-aware Dynamic Feature Composition for Name Tagging.

Input Data Set Directory Structure

  • <input_dir>
    • embed.vocab.tsv (embedding vocab file, 1st column: token, 2nd column: index)
    • embed.count.tsv (embedding token frequency file, 1st column: token, 2nd column: frequency)
    • bc
      • train.tsv (training set)
      • dev.tsv (development set)
      • test.tsv (test set)
      • token.vocab.tsv (token vocab file, 1st column: token, 2nd column: index)
      • char.vocab.tsv (character vocab file: 1st column: character, 2nd column: index)
      • label.vocab.tsv (label vocab file: 1st column: label, 2nd column: index)
    • bn
    • mz
    • nw
    • tc
    • wb

Note:

  • Other subsets have train.tsv, dev.tsv, test.tsv, token.vocab.tsv, char.vocab.tsv, and label.vocab.tsv in their directories.
  • In our experiments, we generated *.vocab.tsv from a merged data set of all subsets.
  • In our experiments, we use CoNLL format files generated from OntoNotes 5.0 with Pradhan et al.'s scripts, which can be found at https://cemantix.org/data/ontonotes.html.

Pre-processing

The following functions in proprocess.py can be used to create vocab and frequency files.

  • build_all_vocabs takes as input a list of CoNLL format files, and generate {token,char,label}.vocab.tsv in output_dir.
  • build_embed_vocab takes a pre-trained embedding file as input and return the embedding vocab.
  • build_embed_token_count takes a pre-trained embedding file as input and generate an embedding token frequency file.

Train LSTM-CNN

python train_lstmcnn_all.py -d 0 -i <input_dir> -o <output_dir> -e <embedding_file>
  --embed_vocab <embedding_vocab_file> --char_dim 50 --seed <random_seed>

This script train a model for each subset (which can be specified with the --datasets argument) and report within-subset (within-genre) and cross-subset (cross-genre) performance.

Train LSTM-CNN with Dynamic Feature Composition

python train_lstmcnn_dfc_all.py -d 0 -i <input_dir> -o <output_dir> -e <embedding_file>
  --embed_vocab <embedding_vocab_file> --embed_count <embedding_freq_file> --char_dim 50 --seed <random_seed>

Requirement

  • Python 3.5+
  • Pytorch 1.0

Resources

Reference

Lin, Y., Liu, L., Ji, H., Yu, D., Han, J. (2019) Reliability-aware Dynamic Feature Composition for Name Tagging. Proceedings of The 57th Annual Meeting of the Association for Computational Linguistics.

@article{lin2019reliability,
  title={Reliability-aware Dynamic Feature Composition for Name Tagging},
  author={Lin, Ying and Liu, Liyuan and Ji, Heng and Yu, Dong and Han, Jiawei},
  booktitle={Proceedings of The 57th Annual Meeting of the Association for Computational Linguistics (ACL2019)},
  year={2019}
}

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.