Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f1a4892

Browse files
committed
Updating TF submodule to latest and adding a Dockerfile example. (tensorflow#117)
* Updating TF submodule to latest and adding a Dockerfile example. * Extra \n in ./configure. * Updating Dockerfile to use bazel 0.2.2b. * Replacing a mention of treebank_union with PMP in the README.
1 parent b1f7d54 commit f1a4892

13 files changed

+62
-19
lines changed

syntaxnet/Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM java:8
2+
3+
ENV SYNTAXNETDIR=/opt/tensorflow PATH=$PATH:/root/bin
4+
5+
RUN mkdir -p $SYNTAXNETDIR \
6+
&& cd $SYNTAXNETDIR \
7+
&& apt-get update \
8+
&& apt-get install git zlib1g-dev file swig python2.7 python-dev python-pip -y \
9+
&& pip install --upgrade pip \
10+
&& pip install -U protobuf==3.0.0b2 \
11+
&& pip install asciitree \
12+
&& pip install numpy \
13+
&& wget https://github.com/bazelbuild/bazel/releases/download/0.2.2b/bazel-0.2.2b-installer-linux-x86_64.sh \
14+
&& chmod +x bazel-0.2.2b-installer-linux-x86_64.sh \
15+
&& ./bazel-0.2.2b-installer-linux-x86_64.sh --user \
16+
&& git clone --recursive https://github.com/tensorflow/models.git \
17+
&& cd $SYNTAXNETDIR/models/syntaxnet/tensorflow \
18+
&& echo "\n\n\n" | ./configure
19+
20+
RUN cd $SYNTAXNETDIR/models/syntaxnet \
21+
&& bazel test --genrule_strategy=standalone syntaxnet/... util/utf8/... \
22+
&& apt-get autoremove -y \
23+
&& apt-get clean
24+
25+
WORKDIR $SYNTAXNETDIR/models/syntaxnet
26+
27+
CMD [ "sh", "-c", "echo 'Bob brought the pizza to Alice.' | syntaxnet/demo.sh" ]
28+
29+
# COMMANDS to build and run
30+
# ===============================
31+
# mkdir build && cp Dockerfile build/ && cd build
32+
# docker build -t syntaxnet .
33+
# docker run syntaxnet

syntaxnet/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@ Running and training SyntaxNet models requires building this package from
7373
source. You'll need to install:
7474

7575
* bazel:
76+
* **versions 0.2.0 - 0.2.2b, NOT 0.2.3**
7677
* follow the instructions [here](http://bazel.io/docs/install.html)
77-
* **Note: You must use bazel version 0.2.2, NOT 0.2.2b, due to a WORKSPACE
78-
issue**
7978
* swig:
8079
* `apt-get install swig` on Ubuntu
8180
* `brew install swig` on OSX
@@ -86,7 +85,7 @@ source. You'll need to install:
8685
* `pip install asciitree`
8786
* numpy, package for scientific computing:
8887
* `pip install numpy`
89-
88+
9089
Once you completed the above steps, you can build and test SyntaxNet with the
9190
following commands:
9291

@@ -103,6 +102,9 @@ following commands:
103102

104103
Bazel should complete reporting all tests passed.
105104

105+
You can also compile SyntaxNet in a [Docker](https://www.docker.com/what-docker)
106+
container using this [Dockerfile](Dockerfile).
107+
106108
## Getting Started
107109

108110
Once you have successfully built SyntaxNet, you can start parsing text right
@@ -144,7 +146,8 @@ To change the pipeline to read and write to specific files (as opposed to piping
144146
through stdin and stdout), we have to modify the `demo.sh` to point to the files
145147
we want. The SyntaxNet models are configured via a combination of run-time flags
146148
(which are easy to change) and a text format `TaskSpec` protocol buffer. The
147-
spec file used in the demo is in `syntaxnet/models/treebank_union/context`.
149+
spec file used in the demo is in
150+
`syntaxnet/models/parsey_mcparseface/context.pbtxt`.
148151

149152
To use corpora instead of stdin/stdout, we have to:
150153

syntaxnet/syntaxnet/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ py_test(
626626

627627
sh_test(
628628
name = "parser_trainer_test",
629-
size = "medium",
629+
size = "large",
630630
srcs = ["parser_trainer_test.sh"],
631631
data = [
632632
":parser_eval",

syntaxnet/syntaxnet/beam_reader_ops_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from tensorflow.python.framework import test_util
2525
from tensorflow.python.platform import googletest
26-
from tensorflow.python.platform import logging
26+
from tensorflow.python.platform import tf_logging as logging
2727

2828
from syntaxnet import structured_graph_builder
2929
from syntaxnet.ops import gen_parser_ops

syntaxnet/syntaxnet/conll2tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import syntaxnet.load_parser_ops
2323

24-
from tensorflow.python.platform import logging
24+
from tensorflow.python.platform import tf_logging as logging
2525
from syntaxnet import sentence_pb2
2626
from syntaxnet.ops import gen_parser_ops
2727

syntaxnet/syntaxnet/graph_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from tensorflow.python.ops import control_flow_ops as cf
2323
from tensorflow.python.ops import state_ops
24-
from tensorflow.python.platform import logging
24+
from tensorflow.python.platform import tf_logging as logging
2525

2626
from syntaxnet.ops import gen_parser_ops
2727

syntaxnet/syntaxnet/lexicon_builder_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
from tensorflow.python.framework import test_util
2828
from tensorflow.python.platform import googletest
29-
from tensorflow.python.platform import logging
29+
from tensorflow.python.platform import tf_logging as logging
3030

3131
from syntaxnet import sentence_pb2
3232
from syntaxnet import task_spec_pb2

syntaxnet/syntaxnet/parser_eval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import tensorflow as tf
2424

2525
from tensorflow.python.platform import gfile
26-
from tensorflow.python.platform import logging
26+
from tensorflow.python.platform import tf_logging as logging
2727
from syntaxnet import sentence_pb2
2828
from syntaxnet import graph_builder
2929
from syntaxnet import structured_graph_builder

syntaxnet/syntaxnet/parser_trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import tensorflow as tf
2525

2626
from tensorflow.python.platform import gfile
27-
from tensorflow.python.platform import logging
27+
from tensorflow.python.platform import tf_logging as logging
2828

2929
from google.protobuf import text_format
3030

syntaxnet/syntaxnet/reader_ops_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from tensorflow.python.framework import test_util
2525
from tensorflow.python.ops import control_flow_ops as cf
2626
from tensorflow.python.platform import googletest
27-
from tensorflow.python.platform import logging
27+
from tensorflow.python.platform import tf_logging as logging
2828

2929
from syntaxnet import dictionary_pb2
3030
from syntaxnet import graph_builder

0 commit comments

Comments
 (0)