Permalink
Please sign in to comment.
Browse files
Update the DRAGNN (#1191)
* Release DRAGNN * Update CoNLL evaluation table & evaluator.py * Update documentation & tutorial for DRAGNN * Update the DRAGNN * Tutorial link
- Loading branch information...
Showing
with
86,578 additions
and 4,360 deletions.
- +3 −2 syntaxnet/Dockerfile
- +18 −8 syntaxnet/README.md
- BIN syntaxnet/beam_search_training.png
- +66 −0 syntaxnet/docker-devel/Dockerfile.min
- +64 −0 syntaxnet/docker-devel/README.txt
- +1 −0 syntaxnet/docker-devel/build_devel.sh
- +4 −10 syntaxnet/dragnn/protos/spec.proto
- +1 −0 syntaxnet/dragnn/python/BUILD
- +29 −6 syntaxnet/dragnn/python/visualization.py
- +16 −1 syntaxnet/dragnn/python/visualization_test.py
- +19 −0 syntaxnet/dragnn/viz/dragnn_layout.js
- +1,545 −0 syntaxnet/dragnn/viz/dragnn_tutorial_2.html
- +2,261 −0 syntaxnet/dragnn/viz/example_with_lookahead.html
- +13 −7 syntaxnet/dragnn/viz/visualize.js
- BIN syntaxnet/dragnn/viz/viz.min.js.gz
- +51 −0 syntaxnet/examples/dragnn/BUILD
- +1 −0 syntaxnet/examples/dragnn/data/en/category-map
- +100 −0 syntaxnet/examples/dragnn/data/en/char-map
- +11,990 −0 syntaxnet/examples/dragnn/data/en/char-ngram-map
- BIN syntaxnet/examples/dragnn/data/{es → en}/checkpoint
- +50 −0 syntaxnet/examples/dragnn/data/en/label-map
- +15,388 −0 syntaxnet/examples/dragnn/data/en/lcword-map
- 0 syntaxnet/examples/dragnn/data/{es → en}/parser_spec.textproto
- BIN syntaxnet/examples/dragnn/data/en/prefix-table
- +18 −0 syntaxnet/examples/dragnn/data/en/segmenter/category-map
- +100 −0 syntaxnet/examples/dragnn/data/en/segmenter/char-map
- +2,018 −0 syntaxnet/examples/dragnn/data/en/segmenter/char-ngram-map
- BIN syntaxnet/examples/dragnn/data/en/segmenter/checkpoint.data-00000-of-00001
- BIN syntaxnet/examples/dragnn/data/en/segmenter/checkpoint.index
- BIN syntaxnet/examples/dragnn/data/{es → en}/segmenter/checkpoint.meta
- +50 −0 syntaxnet/examples/dragnn/data/en/segmenter/label-map
- +15,388 −0 syntaxnet/examples/dragnn/data/en/segmenter/lcword-map
- BIN syntaxnet/examples/dragnn/data/en/segmenter/prefix-table
- 0 syntaxnet/examples/dragnn/data/{es → en}/segmenter/spec.textproto
- BIN syntaxnet/examples/dragnn/data/en/segmenter/suffix-table
- +51 −0 syntaxnet/examples/dragnn/data/en/segmenter/tag-map
- +50 −0 syntaxnet/examples/dragnn/data/en/segmenter/tag-to-category
- +18,257 −0 syntaxnet/examples/dragnn/data/en/segmenter/word-map
- BIN syntaxnet/examples/dragnn/data/en/suffix-table
- +157 −0 syntaxnet/examples/dragnn/data/en/tag-map
- +156 −0 syntaxnet/examples/dragnn/data/en/tag-to-category
- +18,257 −0 syntaxnet/examples/dragnn/data/en/word-map
- +0 −292 syntaxnet/examples/dragnn/data/es/char-map
- 0 syntaxnet/examples/dragnn/data/{ → es}/es-universal-dev.conll
- 0 syntaxnet/examples/dragnn/data/{ → es}/es-universal-train.conll
- +0 −33 syntaxnet/examples/dragnn/data/es/label-map
- +0 −292 syntaxnet/examples/dragnn/data/es/segmenter/char-map
- +0 −2,622 syntaxnet/examples/dragnn/data/es/segmenter/char-ngram-map
- BIN syntaxnet/examples/dragnn/data/es/segmenter/checkpoint.data-00000-of-00001
- BIN syntaxnet/examples/dragnn/data/es/segmenter/checkpoint.index
- +0 −33 syntaxnet/examples/dragnn/data/es/segmenter/label-map
- +0 −5 syntaxnet/examples/dragnn/data/es/segmenter/tag-map
- +0 −5 syntaxnet/examples/dragnn/data/es/segmenter/tag-to-category
- +0 −397 syntaxnet/examples/dragnn/data/es/tag-map
- +0 −396 syntaxnet/examples/dragnn/data/es/tag-to-category
- BIN syntaxnet/examples/dragnn/data/mini-english.checkpoint
- BIN syntaxnet/examples/dragnn/data/mini-english.checkpoint.meta
- +28 −26 syntaxnet/examples/dragnn/interactive_text_analyzer.ipynb
- +27 −0 syntaxnet/examples/dragnn/test_run_all_tutorials.sh
- +53 −45 syntaxnet/examples/dragnn/{basic_parser_tutorial.ipynb → trainer_tutorial.ipynb}
- +77 −0 syntaxnet/examples/dragnn/tutorial_1.py
- +104 −0 syntaxnet/examples/dragnn/tutorial_2.py
- +90 −0 syntaxnet/examples/dragnn/tutorial_data/sentence.prototext
- BIN syntaxnet/ff_nn_schematic.png
- +1 −2 syntaxnet/g3doc/CLOUD.md
- +74 −72 syntaxnet/g3doc/conll2017/README.md
- +2 −2 syntaxnet/g3doc/conll2017/cooking.md
- BIN syntaxnet/looping-parser.gif
- BIN syntaxnet/sawman.png
- 0 syntaxnet/syntaxnet/demo.sh
- +0 −104 syntaxnet/universal.md
Deleted file not rendered
| @@ -0,0 +1,66 @@ | ||
| +# You need to build wheels before building this image. Please consult | ||
| +# docker-devel/README.txt. | ||
| + | ||
| +# This is the base of the openjdk image. | ||
| +# | ||
| +# It might be more efficient to use a minimal distribution, like Alpine. But | ||
| +# the upside of this being popular is that people might already have it. | ||
| +FROM buildpack-deps:jessie-curl | ||
| + | ||
| +ENV SYNTAXNETDIR=/opt/tensorflow PATH=$PATH:/root/bin | ||
| + | ||
| +RUN apt-get update \ | ||
| + && apt-get install -y \ | ||
| + file \ | ||
| + git \ | ||
| + graphviz \ | ||
| + libcurl3 \ | ||
| + libfreetype6 \ | ||
| + libgraphviz-dev \ | ||
| + liblapack3 \ | ||
| + libopenblas-base \ | ||
| + libpng12-0 \ | ||
| + libxft2 \ | ||
| + python-dev \ | ||
| + python-mock \ | ||
| + python-pip \ | ||
| + python2.7 \ | ||
| + zlib1g-dev \ | ||
| + && apt-get clean \ | ||
| + && (rm -f /var/cache/apt/archives/*.deb \ | ||
| + /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true) | ||
| + | ||
| +# Install common Python dependencies. Similar to above, remove caches | ||
| +# afterwards to help keep Docker images smaller. | ||
| +RUN pip install --ignore-installed pip \ | ||
| + && python -m pip install numpy \ | ||
| + && rm -rf /root/.cache/pip /tmp/pip* | ||
| +RUN python -m pip install \ | ||
| + asciitree \ | ||
| + ipykernel \ | ||
| + jupyter \ | ||
| + matplotlib \ | ||
| + pandas \ | ||
| + protobuf \ | ||
| + scipy \ | ||
| + sklearn \ | ||
| + && python -m ipykernel.kernelspec \ | ||
| + && python -m pip install pygraphviz \ | ||
| + --install-option="--include-path=/usr/include/graphviz" \ | ||
| + --install-option="--library-path=/usr/lib/graphviz/" \ | ||
| + && rm -rf /root/.cache/pip /tmp/pip* | ||
| + | ||
| +COPY syntaxnet_with_tensorflow-0.2-cp27-none-linux_x86_64.whl $SYNTAXNETDIR/ | ||
| +RUN python -m pip install \ | ||
| + $SYNTAXNETDIR/syntaxnet_with_tensorflow-0.2-cp27-none-linux_x86_64.whl \ | ||
| + && rm -rf /root/.cache/pip /tmp/pip* | ||
| + | ||
| +# This makes the IP exposed actually "*"; we'll do host restrictions by passing | ||
| +# a hostname to the `docker run` command. | ||
| +COPY tensorflow/tensorflow/tools/docker/jupyter_notebook_config.py /root/.jupyter/ | ||
| +EXPOSE 8888 | ||
| + | ||
| +# This does not need to be compiled, only copied. | ||
| +COPY examples $SYNTAXNETDIR/syntaxnet/examples | ||
| +# For some reason, this works if we run it in a bash shell :/ :/ :/ | ||
| +CMD /bin/bash -c "python -m jupyter_core.command notebook --debug --notebook-dir=/opt/tensorflow/syntaxnet/examples" |
| @@ -0,0 +1,64 @@ | ||
| +Docker is used for packaging the SyntaxNet. There are three primary things we | ||
| +build with Docker, | ||
| + | ||
| +1. A development image, which contains all source built with Bazel. | ||
| +2. Python/pip wheels, built by running a command in the development container. | ||
| +3. A minified image, which only has the compiled version of TensorFlow and | ||
| + SyntaxNet, by installing the wheel built by the above step. | ||
| + | ||
| + | ||
| +Important info (please read) | ||
| +------------------------------ | ||
| + | ||
| +One thing to be wary of is that YOU CAN LOSE DATA IF YOU DEVELOP IN A DOCKER | ||
| +CONTAINER. Please be very careful to mount data you care about to Docker | ||
| +volumes, or use a volume mount so that it's mapped to your host filesystem. | ||
| + | ||
| +Another note, especially relevant to training models, is that Docker sends the | ||
| +whole source tree to the Docker daemon every time you try to build an image. | ||
| +This can take some time if you have large temporary model files lying around. | ||
| +You can exclude your model files by editing .dockerignore, or just don't store | ||
| +them in the base directory. | ||
| + | ||
| + | ||
| +Step 1: Building the development image | ||
| +------------------------------ | ||
| + | ||
| +Simply run `docker build -t dragnn-oss .` in the base directory. Make sure you | ||
| +have all the source checked out correctly, including git submodules. | ||
| + | ||
| + | ||
| +Step 2: Building wheels | ||
| +------------------------------ | ||
| + | ||
| +Please run, | ||
| + | ||
| + bash ./docker-devel/build_wheels.sh | ||
| + | ||
| +This actually builds the image from Step 1 as well. | ||
| + | ||
| + | ||
| +Step 3: Building the development image | ||
| +------------------------------ | ||
| + | ||
| +First, ensure you have the file | ||
| + | ||
| + syntaxnet_with_tensorflow-0.2-cp27-none-linux_x86_64.whl | ||
| + | ||
| +in your working directory, from step 2. Then run, | ||
| + | ||
| + docker build -t dragnn-oss:latest-minimal -f docker-devel/Dockerfile.min | ||
| + | ||
| +If the filename changes (e.g. you are on a different architecture), just update | ||
| +Dockerfile.min. | ||
| + | ||
| + | ||
| +Developing in Docker | ||
| +------------------------------ | ||
| + | ||
| +We recommend developing in Docker by using the `./docker-devel/build_devel.sh` | ||
| +script; it will set up a few volume mounts, and port mappings automatically. | ||
| +You may want to add more port mappings on your own. If you want to drop into a | ||
| +shell instead of launching the notebook, simply run, | ||
| + | ||
| + ./docker-devel/build_devel.sh /bin/bash |
Oops, something went wrong.
0 comments on commit
e8464d3