Skip to content

Commit e4480de

Browse files
committed
-
1 parent 7167ebd commit e4480de

File tree

1 file changed

+17
-24
lines changed

1 file changed

+17
-24
lines changed

README.md

+17-24
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ syntaxnet
6464

6565
### how to test
6666
```shell
67-
(after installing syntaxnet)
67+
# after installing syntaxnet
6868
$ pwd
6969
/path/to/models/syntaxnet
7070
$ git clone https://github.com/dsindex/syntaxnet.git work
7171
$ cd work
7272
$ echo "hello syntaxnet" | ./demo.sh
73-
(training parser only with parsed corpus)
73+
# training parser only with parsed corpus
7474
$ ./parser_trainer_test.sh
7575
```
7676

@@ -79,16 +79,16 @@ $ ./parser_trainer_test.sh
7979
$ cd work
8080
$ mkdir corpus
8181
$ cd corpus
82-
(downloading ud-treebanks-v2.0.tgz)
82+
# downloading ud-treebanks-v2.0.tgz
8383
$ tar -zxvf ud-treebanks-v2.0.tgz
8484
$ ls universal-dependencies-2.0
8585
$ UD_Ancient_Greek UD_Basque UD_Czech ....
8686
```
8787

8888
### training tagger and parser with another corpus
8989
```shell
90-
(for example, training UD_English)
91-
(detail instructions can be found in https://github.com/tensorflow/models/tree/master/syntaxnet)
90+
# for example, training UD_English
91+
# detail instructions can be found in https://github.com/tensorflow/models/tree/master/syntaxnet
9292
$ ./train.sh -v -v
9393
...
9494
#preprocessing with tagger
@@ -116,8 +116,7 @@ INFO:tensorflow:Seconds elapsed in evaluation: 34.97, eval metric: 83.49%
116116

117117
### training parser only
118118
```shell
119-
(in case you have other pos-tagger
120-
and want to build parser only from the parsed corpus)
119+
# in case you have other pos-tagger and want to build parser only from the parsed corpus
121120
$ ./train_p.sh -v -v
122121
...
123122
#pretrain parser
@@ -150,7 +149,7 @@ tagger NN ROOT
150149
+-- and CC cc
151150
+-- parser NN conj
152151

153-
* original model
152+
# original model
154153
$ echo "this is my own tagger and parser" | ./demo.sh
155154
Input: this is my own tagger and parser
156155
Parse:
@@ -173,7 +172,7 @@ brought VBD ROOT
173172
| +-- to IN case
174173
+-- . . punct
175174

176-
* original model
175+
# original model
177176
$ echo "Bob brought the pizza to Alice ." | ./demo.sh
178177
Input: Bob brought the pizza to Alice .
179178
Parse:
@@ -272,7 +271,7 @@ Parse:
272271
```
273272
### apply korean POS tagger(Komoran via konlpy)
274273
```shell
275-
* install konlpy ( http://konlpy.org/ko/v0.4.3/ )
274+
# after installing konlpy ( http://konlpy.org/ko/v0.4.3/ )
276275
$ python sejong/tagger.py
277276
나는 학교에 간다.
278277
1 나 나 NP NP _ 0 _ _ _
@@ -316,6 +315,7 @@ Parsing :
316315
```shell
317316
# download models from http://download.tensorflow.org/models/parsey_universal/<language>.zip
318317

318+
# for `English`
319319
$ echo "Bob brought the pizza to Alice." | ./parse.sh
320320

321321
# tokenizing
@@ -390,23 +390,16 @@ the hyperparameters for POS tagger :
390390
$ cd ../
391391
$ pwd
392392
/path/to/models/syntaxnet
393-
$ bazel --output_user_root=bazel_root build --nocheck_visibility -c opt -s //examples/dragnn:tutorial_1 --genrule_strategy=standalone --spawn_strategy=standalone --verbose_failures
393+
$ bazel build -c opt //examples/dragnn:tutorial_1
394394
```
395395
- training tagger and parser with CoNLL corpus
396396
```
397-
* prepare corpus
398-
$ mkdir -p work/dragnn_examples/data
399-
$ cp -rf work/UD_English/en-ud-train.conllu work/dragnn_examples/data
400-
$ cp -rf work/UD_English/en-ud-dev.conllu work/dragnn_examples/data
401-
$ python work/convert.py < work/dragnn_examples/data/en-ud-train.conllu > work/dragnn_examples/data/en-ud-train.conllu.conv
402-
$ python work/convert.py < work/dragnn_examples/data/en-ud-dev.conllu > work/dragnn_examples/data/en-ud-dev.conllu.conv
403-
404-
$ cp -rf work/dragnn_examples/BUILD examples/dragnn/
405-
$ cp -rf work/dragnn_examples/test_dragnn.py examples/dragnn/
406-
$ bazel --output_user_root=bazel_root build --nocheck_visibility -c opt -s //examples/dragnn:test_dragnn --genrule_strategy=standalone --spawn_strategy=standalone --verbose_failures
407-
$ ./bazel-bin/examples/dragnn/test_dragnn --data_dir=work/dragnn_examples/data --train_file=work/dragnn_examples/data/en-ud-train.conllu.conv --dev_file=work/dragnn_examples/data/en-ud-dev.conllu.conv
408-
* trained model
409-
$ ls -al ls -al work/dragnn_examples/data
397+
$ pwd
398+
/path/to/models/syntaxnet/work
399+
$ ./dragnn.sh -v -v
400+
```
401+
- test CoNLL2017 baseline
402+
```
410403
```
411404
- docker version
412405
- [dragnn/syntaxnet docker](https://hub.docker.com/r/tensorflow/syntaxnet/)

0 commit comments

Comments
 (0)