models icon indicating copy to clipboard operation
models copied to clipboard

some question of syntaxnet dependency parsing model

Open wq343580510 opened this issue 9 years ago • 2 comments

@calberti hello! Can you tell me that what is the default eval metric in the output of the program? UAS LAS or f1score. if the metric is UAS , How do I change the metric to LAS in the program? And now I want to get k-best of the parsing result , Is there some parameter to control the output number of the parsing result?

thank you very much!

wq343580510 avatar Dec 03 '16 13:12 wq343580510

Syntaxnet has a bunch of layers of abstraction.

  • sentence.proto defines the token class and what fields a token has.
  • text_formats.cc will read conll or another format and populate tokens this is were the tag is populated
  • sentence_features.h/.cc defines a Tag input type for using as input output
  • parser_transitions.h defines a class other transition types inherit from tag and gold_tag are key here
  • tagger_transition.cc implements ParserTransitionSystem and its tag and gold_tag pull from the tag field of the conll
  • reader_ops.cc defines a few tensorflow operators and uses tag and gold_tag functions for its metrics.
  • ops/parser_ops.cc defines the cpp to python interfaces for the custom tensorflow operators above
  • graph_builder.py will use those operators to build the model
  • parser_eval.py and parser_trainer.py will use the model building functions to train and evaluate
  • context.pbtxt and command line flags define what transistion system is used along with many other things

If you want to change what it validates you will likely have to add/modify classes at a bunch of levels of abstraction.

Here is where the tag is pulled. https://github.com/tensorflow/models/blob/a9133ae914b44602c5f26afbbd7dd794ff9c6637/syntaxnet/syntaxnet/tagger_transitions.cc#L62

Hope this helps. Nathan

nburn42 avatar Dec 24 '16 01:12 nburn42

@nburn42 thank you for the reply.

wq343580510 avatar Dec 26 '16 08:12 wq343580510