Giter Site home page Giter Site logo

idea15 / convseg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chqiwang/convseg

0.0 1.0 0.0 37 KB

Convolutional neural network and word embeddings for Chinese word segmentation

Home Page: https://arxiv.org/abs/1711.04411

License: MIT License

Python 83.21% Perl 13.33% Shell 3.46%

convseg's Introduction

CONV-SEG

Convolutional neural network for Chinese word segmentation (CWS). The corresponding paper Convolutional Neural Network with Word Embeddings for Chinese Word Segmentation has been accepted by IJCNLP2017.

Author

The code is written and maintained by Chunqi Wang. If you have any problem in using this code, please email to [email protected].

Dependencies

It is better to use a nvidia GPU to accelerate the training procedure.

Data

Downlaod data.zip from here (Note that the SIGHAN datasets should only be used for research purposes). Extract data.zip to this directory. So the file tree would be:

convseg
|	data
|	|	datasets
|	|	|	sighan2005-pku
|	|	|	|	train.txt
|	|	|	|	dev.txt
|	|	|	|	test.txt
|	|	|	sighan2005-msr
|	|	|	|	train.txt
|	|	|	|	dev.txt
|	|	|	|	test.txt
|	|	embeddings
|	|	|	news_tensite.w2v200
|	|	|	news_tensite.pku.words.w2v50
|	|	|	news_tensite.msr.words.w2v50
|	tagger.py
|	train_cws.py
|	train_cws.sh
|	train_cws_wemb.sh
|	score.perl
|	README.md

How to use

First, give execute permission to scripts:

chmod +x train_cws.sh train_cws_wemb.sh

Train a preliminary model (CONV-SEG):

./train_cws.sh WHICH_DATASET WHICH_GPU

Train a model with word embeddings (WE-CONV-SEG):

./train_cws_wemb.sh WHICH_DATASET WHICH_GPU

We have two optional datasets: pku and msr. If you run the program in CPU environment, just leave the second argument empty.

For example, if you want to train the model CONV-SEG on the pku dataset and on gpu0, you should run:

./train_cws.sh pku 0

More arguments can be set in train.py.

Test Score

Model PKU(dev) PKU(test) MSR(dev) MSR(test)
CONV-SEG 96.8 95.7 97.2 97.3
WE-CONV-SEG 97.5 96.5 98.1 98.0

convseg's People

Contributors

chqiwang avatar

Watchers

 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.