Coder Social home page Coder Social logo

naivelstmcrf's Introduction

BiLSTM-CRF

This project is based on idad of paper https://arxiv.org/pdf/1508.01991.pdf on EMNLP'16, and with the assistance of the fastNLP, (https://github.com/fastnlp/fastNLP), which can facilitate the development of deep learning project based on NLP.

Requirement

pip install fastNLP

Usage

CRF-LSTM Model

python main.py -h
usage: main.py [-h] [--epoch [EPOCH]] [--rnn_hidden [RNN_HIDDEN]]
               [--word_emb [WORD_EMB]] [--batch_size [BATCH_SIZE]] [--op [OP]]
               [--lr [LR]] [--cuda [CUDA]] [--bilstm [BILSTM]] [--cont [CONT]]
               [--mode [MODE]] [--device [DEVICE]]

CRF-LSTM Model

optional arguments:
  -h, --help            show this help message and exit
  --epoch [EPOCH]       The epoch times of training
  --rnn_hidden [RNN_HIDDEN]
                        The hidden dimension of the LSTM
  --word_emb [WORD_EMB]
                        The embedding size of vocab
  --batch_size [BATCH_SIZE]
                        The batch_size of trainer
  --op [OP]             The optimizer for trainer, 0 for Adam, 1 for SGD
  --lr [LR]             The learning rate of optimizer
  --cuda [CUDA]         Whether use cuda
  --bilstm [BILSTM]     bilstm or lstm
  --cont [CONT]         Whether continue from the saved model or from scratch
  --mode [MODE]         Choose the mode: train&test
  --device [DEVICE]     Choose the free device

Pretrained Model

The pretrained model is saved at the save/ directory, you can use it by: python main.py --cont="save/

Jupyter Tutorial

The jupyter file will walk you through the whole process step by step

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.