models icon indicating copy to clipboard operation
models copied to clipboard

Can anyone give a example of adding additional output formats to python code ? #SyntaxNet#

Open ColinUNC opened this issue 10 years ago • 2 comments

I've removed a few flags and args of the models/syntaxnet/syntaxnet/demo.sh, the current code like this.

`PARSER_EVAL=bazel-bin/syntaxnet/parser_eval MODEL_DIR=syntaxnet/models/parsey_mcparseface [[ "$1" == "--conll" ]] && INPUT_FORMAT=stdin-conll || INPUT_FORMAT=stdin

$PARSER_EVAL
--input=$INPUT_FORMAT
--output=stdout-conll
--hidden_layer_sizes=64
--arg_prefix=brain_tagger
--graph_builder=structured
--task_context=$MODEL_DIR/context.pbtxt
--model_path=$MODEL_DIR/tagger-params
--slim_model
--batch_size=1024 `

Can anyone give a example of adding additional output formats to the python code ?

ColinUNC avatar May 26 '16 18:05 ColinUNC

f you go through the master/syntaxnet/syntaxnet/conll2tree.py you should see the basic tensorflow session reading the output of the parse_eval into a sentence class and storing the tree as a dictionary. This is exactly the example you are looking for.

smaransmarty avatar May 28 '16 12:05 smaransmarty

Thanks @smaransmarty!

slavpetrov avatar Jun 22 '16 15:06 slavpetrov