Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part-of-Speech Tagging #175

Closed
Naazanean opened this issue Jun 2, 2016 · 11 comments
Closed

Part-of-Speech Tagging #175

Naazanean opened this issue Jun 2, 2016 · 11 comments

Comments

@Naazanean
Copy link

Hi everyone I got so confused by SyntaxNet. Sorry if the problem is so easy but I don't know why it is not working,I tried fore 16 hours.

In SyntaxNet tutorial it is said and I quote:

To train the model, first edit syntaxnet/context.pbtxt so that the inputs training-corpus, tuning-corpus, and dev-corpus point to the location of your training data.

So I changed context.pbtxt in my directory path /home/ubuntu/models/syntaxnet/syntaxnet,like this:

input {
name: 'training-corpus'
record_format: 'conll-sentence'
Part {
file_pattern: '/home/ubuntu/models/syntaxnet/syntaxnet/testdata/test.conll' # changed from file_pattern: '<your-dataset>/treebank-train.trees.conll'
 }

I repeated the same changes for testing-corpus and tuning-corpus. Then I changed parser_trainer_test.sh in directory /home/ubuntu/models/syntaxnet/syntaxnet and changed from line 36 to 45 like this:

BINDIR=$TEST_SRCDIR/syntaxnet
CONTEXT=$BINDIR/testdata/context.pbtxt
TMP_DIR=/tmp/syntaxnet-output
mkdir -p $TMP_DIR
sed "s=SRCDIR=$TEST_SRCDIR=" "$CONTEXT" | \
sed "s=OUTPATH=$TMP_DIR=" > $TMP_DIR/context
PARAMS=128-0.08-3600-0.9-0
"$BINDIR/parser_trainer" \
**--arg_prefix=brain_pos \   #change from --arg_prefix=brain_parser \**
....
**--task_context=syntaxnet/context.pbtxt \ # change from --training_corpus=training-corpus \**
....
--seed=0 \ # I added this
--logtostderr

when I ran bazel test //syntaxnet:parser_trainer_test
in terminal, it gave me this massage:

INFO: Found 1 test target...
FAIL: //syntaxnet:parser_trainer_test (see   /home/ubuntu/.cache/bazel/_bazel_ubuntu/496ef57d77987a9f471821c181b6cf0f/syntaxn et/bazel-out/local-opt/testlogs/syntaxnet/parser_trainer_test/test.log).
Target //syntaxnet:parser_trainer_test up-to-date:
 bazel-bin/syntaxnet/parser_trainer_test
 INFO: Elapsed time: 5.775s, Critical Path: 5.31s
 //syntaxnet:parser_trainer_test                                             FAILED in 5.3s    /home/ubuntu/.cache/bazel/_bazel_ubuntu/496ef57d77987a9f471821c181b6cf0f/syntaxn et/bazel-out/local-opt/testlogs/syntaxnet/parser_trainer_test/test.log
Executed 1 out of 1 tests: 1 fails locally.

I changed everything on and off and it remained Failed. Sorry if it is too long but I wanted to explain evrything. What should I do?

@dsindex
Copy link

dsindex commented Jun 5, 2016

@Nazanintajik i hope this script may help, https://github.com/dsindex/syntaxnet
i thought you want to train pos-tagger. if then, run ./train.sh

convert_corpus
train_pos_tagger
preprocess_with_tagger

@Naazanean
Copy link
Author

@dsindex I don't know how to thank you. you really saved me. Thank you so much for your fantastic documentation

@kskp
Copy link

kskp commented Jun 6, 2016

This is a good documentation. Thank you!

@Naazanean
Copy link
Author

Naazanean commented Jun 6, 2016

@dsindex I just have a quick question. I start running ./train_p.sh -v -v and after 6 hours it is still running on epoch=14 numsteps=29350 and ... Is it normal for SyntaxNet to be that much slow?

@Naazanean Naazanean reopened this Jun 6, 2016
@kskp
Copy link

kskp commented Jun 6, 2016

@Nazanintajik I think yes, I have been running the same since 2 hours too.

@Naazanean
Copy link
Author

@kskp Thank you so much for responding. I did not know it takes that much long

@dsindex
Copy link

dsindex commented Jun 6, 2016

@Nazanintajik train_p.sh will try to train parser only. greedy parser and then structured parser. the greedy parser takes relatively faster to train. but the structured parser with beam search is much much slower. i spent 1 day(?). so i decided to use gpu server. it takes 5~6 hours.

@Naazanean
Copy link
Author

@dsindex Thank you so much. Yes you were right it took 1 day for me to train it. I really appreciate your respond and support.

@manuchis
Copy link

Hello There, I appreciate the test code, it's much more clear than the official docs. But unfortunately, when I do ./train_p.sh -v -v I always have `Usage: train_p.sh [-v] [-v] [--dry-run] [-h] [--help]

Options -
-v enables verbose mode 1
-v -v enables verbose mode 2
--dry-run show what would have been dumped
-h, --help shows this help message`

There is no way for me to make it run... any guess ?
Thanks in advance!

@dsindex
Copy link

dsindex commented Jun 21, 2016

@manuchis
i guess you are in os x env.

try to modify train_p.sh :

#if [ ${#} != 0 ]; then print_usage_and_exit 1; fi

# current dir of this script
#CDIR=$(readlink -f $(dirname $(readlink -f ${BASH_SOURCE[0]})))
#PDIR=$(readlink -f $(dirname $(readlink -f ${BASH_SOURCE[0]}))/..)
CDIR=$(greadlink -f $(dirname $(greadlink -f ${BASH_SOURCE[0]})))
PDIR=$(greadlink -f $(dirname $(greadlink -f ${BASH_SOURCE[0]}))/..)

${#} is number of arguments to the script, but it seems not working.
and install greadlink

brew install coreutils

hope all work fine :)

@manuchis
Copy link

Thanks a lot, I think it worked. I'm not having any verbose, but seems that is running something. I will let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants