conll_parser_trainer.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh
  2. # Copyright 2016 Google Inc. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # ==============================================================================
  16. # A script to train the CONLL2017 baseline.
  17. set -e
  18. language=English
  19. output_dir=./trained-"$language"
  20. training_corpus=$1
  21. dev_corpus=$2
  22. bazel build -c opt //dragnn/tools:trainer //dragnn/conll2017:make_parser_spec
  23. mkdir -p $output_dir
  24. bazel-bin/dragnn/conll2017/make_parser_spec \
  25. --spec_file="$output_dir/parser_spec.textproto"
  26. bazel-bin/dragnn/tools/trainer \
  27. --logtostderr \
  28. --compute_lexicon \
  29. --dragnn_spec="$output_dir/parser_spec.textproto" \
  30. --resource_path="$output_dir/resources" \
  31. --training_corpus_path="$training_corpus" \
  32. --tune_corpus_path="$dev_corpus" \
  33. --tensorboard_dir="$output_dir/tensorboard" \
  34. --checkpoint_filename="$output_dir/checkpoint.model"