trace.proto 2.32 KB
Newer Older
Ivan Bogatyy's avatar
Ivan Bogatyy committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
syntax = "proto2";

import "dragnn/protos/data.proto";


package syntaxnet.dragnn;

// Describes single embedding "group", e.g., 'words', 'tags'. Each group shares
// an embedding space.
message FixedFeatureChannelTrace {
  // string-valued name of the group, e.g., 'words'.
  optional string name = 1;

  // The feature functions active in this embedding group.
  repeated FixedFeatures value_trace = 2;
}

// Trace for an entire linked feature channel.
message LinkedFeatureChannelTrace {
  // Name of the embedding space.
  optional string name = 1;

  // The component that this feature links to.
  optional string source_component = 2;

  // The string-valued name of the translator function that maps a feature value
  // to a step index.
  optional string source_translator = 3;

  // The name of the layer that we are extracting from the identified step.
  optional string source_layer = 4;

  // Individual features within this group.
  repeated LinkFeatures value_trace = 5;
}

// The trace for a single step of a single Component.
message ComponentStepTrace {
  // A caption/description to describe this step. This should fit in a graphical
  // node rendered to the screen.
  optional string caption = 1;

  repeated FixedFeatureChannelTrace fixed_feature_trace = 2;
  repeated LinkedFeatureChannelTrace linked_feature_trace = 3;

  // An *HTML-language* representation of the current state.
  optional string html_representation = 4;

  // The scores for each potential decision. (The mapping from index to name is
  // managed by the component.)
  repeated double outcome_score = 5;

  // Set to true once the step is finished. (This allows us to open a step after
  // each transition, without having to know if it will be used.)
  optional bool step_finished = 6 [default = false];
}

// The traces for all steps for a single Component.
message ComponentTrace {
  // Name of the component; should match the ComponentSpec.
  optional string name = 1;

  // The steps that have been taken by this Component.
  repeated ComponentStepTrace step_trace = 2;
}

// The traces for all Components.
message MasterTrace {
  repeated ComponentTrace component_trace = 1;
}

// Main proto being used to trace parsing.
message DragnnTrace {

  // For each sentence, there is a sequence of state sets storing tracing
  // information.
  repeated MasterTrace master_trace = 1;
}