Skip to content

Commit

Permalink
Enable train & test with yoavg's code
Browse files Browse the repository at this point in the history
  • Loading branch information
hailiang-wang committed Mar 16, 2018
1 parent bf25cc1 commit 606de01
Show file tree
Hide file tree
Showing 9 changed files with 261 additions and 179 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*.pyc
jmeter.log
__pycache__
tmp/
node_modules/
sftp-config.json
.DS_Store
Expand Down
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# text-dependency-parser
依存关系分析

![](https://camo.githubusercontent.com/ae91a5698ad80d3fe8e0eb5a4c6ee7170e088a7d/687474703a2f2f37786b6571692e636f6d312e7a302e676c622e636c6f7564646e2e636f6d2f61692f53637265656e25323053686f74253230323031372d30342d30342532306174253230382e32302e3437253230504d2e706e67)

## Data
format: [CoNLL-2009 Shared Task](http://ufal.mff.cuni.cz/conll2009-st/task-description.html)

### universaldependencies
### Universal Dependencies
http://universaldependencies.org/

### 采用清华大学语义依存网络语料的20000句作为训练集。
Expand All @@ -13,5 +15,26 @@ http://www.hankcs.com/nlp/corpus/chinese-treebank.html#h3-6
### 汉语树库
http://www.hankcs.com/nlp/corpus/chinese-treebank.html

### Transition-based dependency parsers
https://www.cs.bgu.ac.il/~yoavg/software/transitionparser/
## Run

Train model.

```
admin/train.sh
```

Test model.

```
admin/test.sh
```

# Give credits to

[Transition Based Dependency Parsers](https://www.cs.bgu.ac.il/~yoavg/software/transitionparser/)

References:
~~~~~~~~~~~
[1] Liang Huang, Wenbin Jiang and Qun Liu. 2009.
Bilingually-Constrained (Monolingual) Shift-Reduce Parsing.
18 changes: 18 additions & 0 deletions admin/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#! /bin/bash
###########################################
#
###########################################

# constants
baseDir=$(cd `dirname "$0"`;pwd)
# functions

# main
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
cd $baseDir/../app
python eager.py \
--verbosity=1 \
--test=True \
--model=$baseDir/../tmp/eager.model \
--test_data=$baseDir/../data/UD_English-EWT/en-ud-test.conllu \
--test_results=$baseDir/../tmp/en-ud-test.results \
6 changes: 5 additions & 1 deletion admin/dev.sh → admin/train.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ baseDir=$(cd `dirname "$0"`;pwd)
# main
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
cd $baseDir/../app
python parser.py Test.test_UD_English_EWT
python eager.py \
--verbosity=1 \
--train=True \
--train_data=$baseDir/../data/UD_English-EWT/en-ud-train.conllu \
--model=$baseDir/../tmp/eager.model \
43 changes: 0 additions & 43 deletions app/README

This file was deleted.

Loading

0 comments on commit 606de01

Please sign in to comment.