Git Product home page Git Product logo

pytorch_joint-word-segmentation-and-pos-tagging's Introduction

JointPS

A re-implementation of A Simple and Effective Neural Model for Joint Word Segmentation and POS Tagging based on PyTorch.

The C++ Code [zhangmeishan/NNTranJSTagger].

PyTorch-0.3.1 Code release on here. [PyTorch-0.3.1]

Requirement

pip3 install -r requirements.txt
Python  == 3.6  
PyTorch == 1.0.1

Usage

modify the config file, detail see the Config directory
Train:
(1) sh run_train_p.sh
(2) python -u main.py --config ./Config/config.cfg --device cuda:0--train -p 
    [device: "cpu", "cuda:0", "cuda:1", ......]

Config

optimizer: Adam
lr: 0.001
dropout: 0.25
embed_char_dim: 200
embed_bichar_dim: 200
rnn_dim: 200
rnn_hidden_dim: 200
pos_dim: 100
oov: avg 
Refer to config.cfg file for more details.

Network Structure

Performance

CTB5 CTB6 CTB7 PKU NCC
Model SEG      POS SEG      POS SEG      POS SEG      POS SEG      POS
Our Model (No External Embeddings) 97.69    94.16 95.37    90.83 95.32    90.25 95.22    92.62 93.97    89.47
Our Model (Basic Embeddings) 97.93    94.44 95.78    91.79 95.77    91.12 95.82    93.42 94.52    89.82
Our Model (Word-context Embeddings) 98.50    94.95 96.36    92.51 96.25    91.87 96.35    94.14 95.30    90.42

Cite

@Article{zhang2018jointposseg,  
  author    = {Zhang, Meishan and Yu, Nan and Fu, Guohong},  
  title     = {A Simple and Effective Neural Model for Joint Word Segmentation and POS Tagging},  
  journal   = {IEEE/ACM Transactions on Audio, Speech and Language Processing (TASLP)},  
  year      = {2018},  
  volume    = {26},  
  number    = {9},
  pages     = {1528--1538},
  publisher = {IEEE Press},
}

Question

  • if you have any question, you can open a issue or email [email protected][email protected]bamtercelboo@{gmail.com, 163.com}.

  • if you have any good suggestions, you can PR or email me.

pytorch_joint-word-segmentation-and-pos-tagging's People

Contributors

dalinvip 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  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pytorch_joint-word-segmentation-and-pos-tagging's Issues

IndexError: list index out of range,怎么解决,求指点

Traceback (most recent call last):
File "main.py", line 157, in
main()
File "main.py", line 74, in main
train_iter, dev_iter, test_iter, alphabet, alphabet_static = load_data(config=config)
File "/home/zgy/wll/tibetan_Segand-POS-Tag/DataUtils/mainHelp.py", line 242, in load_data
train_iter, dev_iter, test_iter, alphabet, alphabet_static = preprocessing(config)
File "/home/zgy/wll/tibetan_Segand-POS-Tag/DataUtils/mainHelp.py", line 168, in preprocessing
train_iter, dev_iter, test_iter = create_iter.createIterator()
File "/home/zgy/wll/tibetan_Segand-POS-Tag/DataUtils/Batch_Iterator.py", line 84, in createIterator
self._convert_word2id(self.data[id_data], self.operator, self.operator_static)
File "/home/zgy/wll/tibetan_Segand-POS-Tag/DataUtils/Batch_Iterator.py", line 112, in _convert_word2id
pos = inst.pos[index]
IndexError: list index out of range

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.