Commit edea2b67 authored by Terry Koo's avatar Terry Koo
Browse files

Remove runtime because reasons.

parent a4bb31d0
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// =============================================================================
#ifndef DRAGNN_RUNTIME_TEST_NETWORK_TEST_BASE_H_
#define DRAGNN_RUNTIME_TEST_NETWORK_TEST_BASE_H_
#include <stddef.h>
#include <functional>
#include <string>
#include <utility>
#include <vector>
#include "dragnn/core/test/mock_compute_session.h"
#include "dragnn/runtime/extensions.h"
#include "dragnn/runtime/math/types.h"
#include "dragnn/runtime/network_states.h"
#include "dragnn/runtime/session_state.h"
#include "dragnn/runtime/test/fake_variable_store.h"
#include "syntaxnet/base.h"
#include <gmock/gmock.h>
#include "tensorflow/core/platform/test.h"
namespace syntaxnet {
namespace dragnn {
namespace runtime {
// Base class for tests that depend on network structure. Provides utils for
// adding/accessing network states and extracting features.
class NetworkTestBase : public ::testing::Test {
protected:
// Default component name for tests.
static constexpr char kTestComponentName[] = "test_component";
// A functor version of ComputeSession::GetTranslatedLinkFeatures().
using GetTranslatedLinkFeaturesFunctor =
std::function<std::vector<LinkFeatures>(const string &component_name,
int channel_id)>;
// A functor version of ComputeSession::GetInputFeatures().
using GetInputFeaturesFunctor = std::function<int(
const string &component_name,
std::function<int32 *(int)> allocate_indices,
std::function<int64 *(int)> allocate_ids,
std::function<float *(int)> allocate_weights, int channel_id)>;
// A feature to be extracted.
struct Feature {
// Creates a feature with index 0.
Feature(int64 id, float weight) : Feature(0, id, weight) {}
// Creates a fully-specified feature.
Feature(int32 index, int64 id, float weight)
: index(index), id(id), weight(weight) {}
// Respectively appended to "indices", "ids", and "weights".
const int32 index;
const int64 id;
const float weight;
};
// Discards test data structures.
void TearDown() override;
// Returns a functor that expects to be called with the |expected_channel_id|
// and extracts the text-format LinkFeatures in |features_text|. Useful for
// mocking the behavior of the |compute_session_|.
static GetTranslatedLinkFeaturesFunctor ExtractLinks(
int expected_channel_id, const std::vector<string> &features_text);
// Returns a functor that extracts the |features| and expects to be called
// with the |expected_channel_id|. Useful for mocking the behavior of the
// |compute_session_|.
static GetInputFeaturesFunctor ExtractFeatures(
int expected_channel_id, const std::vector<Feature> &features);
// Creates a vector or matrix with the |name| and dimensions, fills it with
// the |fill_value|, and adds it to the |variable_store_|.
void AddVectorVariable(const string &name, size_t dimension,
float fill_value);
void AddMatrixVariable(const string &name, size_t num_rows,
size_t num_columns, float fill_value);
// Creates an embedding matrix for the |channel_id| with the given dimensions,
// fills it with the |fill_value|, and adds it to the |variable_store_|.
void AddFixedEmbeddingMatrix(int channel_id, size_t vocabulary_size,
size_t embedding_dim, float fill_value);
// Creates a linked weight matrix or out-of-bounds vector for the |channel_id|
// with the given dimensions, fills it with the |fill_value|, and adds it to
// the |variable_store_|.
void AddLinkedWeightMatrix(int channel_id, size_t source_dim,
size_t embedding_dim, float fill_value);
void AddLinkedOutOfBoundsVector(int channel_id, size_t embedding_dim,
float fill_value);
// Adds a component named |component_name| to the |network_state_manager_|.
void AddComponent(const string &component_name);
// Adds a float layer named |layer_name| to the current component of the
// |network_state_manager_|.
void AddLayer(const string &layer_name, size_t dimension);
// As above, but for pairwise layers.
void AddPairwiseLayer(const string &layer_name, size_t dimension);
// Starts the next component of the |network_states_| and advances it by
// |num_steps| steps.
void StartComponent(size_t num_steps);
// Returns the content of the layer named |layer_name| in the component named
// |component_name|.
MutableMatrix<float> GetLayer(const string &component_name,
const string &layer_name) const;
// As above, but for pairwise layers.
MutableMatrix<float> GetPairwiseLayer(const string &component_name,
const string &layer_name) const;
// Fills the layer named |layer_name| in the component named |component_name|
// in the |network_states_| with the |fill_value|.
void FillLayer(const string &component_name, const string &layer_name,
float fill_value) const;
// Adds call expectations and return values to the control methods of the
// |compute_session_| that execute a loop of |num_steps| transitions.
void SetupTransitionLoop(size_t num_steps);
// Expects that the |vector| has the given dimensions and is filled with the
// |expected_value|.
static void ExpectVector(Vector<float> vector, size_t dimension,
float expected_value);
// Expects that the |matrix| has the given dimensions and is filled with the
// |expected_value|.
static void ExpectMatrix(Matrix<float> matrix, size_t num_rows,
size_t num_columns, float expected_value);
FakeVariableStore variable_store_;
NetworkStateManager network_state_manager_;
ExtensionManager extension_manager_;
::testing::StrictMock<MockComputeSession> compute_session_;
SessionState session_state_;
NetworkStates &network_states_ = session_state_.network_states;
};
} // namespace runtime
} // namespace dragnn
} // namespace syntaxnet
#endif // DRAGNN_RUNTIME_TEST_NETWORK_TEST_BASE_H_
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// =============================================================================
#include "dragnn/runtime/test/term_map_helpers.h"
#include <set>
#include <utility>
#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/lib/io/path.h"
#include "tensorflow/core/lib/strings/strcat.h"
#include "tensorflow/core/platform/env.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/test.h"
namespace syntaxnet {
namespace dragnn {
namespace runtime {
string WriteTermMap(const std::map<string, int> &term_frequencies) {
// Sort by frequency (descending) then term (ascending).
std::set<std::pair<int, string>> ordered_terms;
for (const auto &it : term_frequencies) {
CHECK(ordered_terms.emplace(-it.second, it.first).second);
}
// Build the text file specifying the TermFrequencyMap.
string content = tensorflow::strings::StrCat(ordered_terms.size(), "\n");
for (const auto &it : ordered_terms) {
const int frequency = -it.first;
const string &term = it.second;
tensorflow::strings::StrAppend(&content, term, " ", frequency, "\n");
}
// Use a counter to uniquify file names.
static int counter = 0;
const string path = tensorflow::io::JoinPath(
tensorflow::testing::TmpDir(),
tensorflow::strings::StrCat("term_map_", counter++));
TF_CHECK_OK(
tensorflow::WriteStringToFile(tensorflow::Env::Default(), path, content));
return path;
}
void AddTermMapResource(const string &name, const string &path,
ComponentSpec *component_spec) {
Resource *resource = component_spec->add_resource();
resource->set_name(name);
Part *part = resource->add_part();
part->set_file_pattern(path);
part->set_file_format("text");
}
} // namespace runtime
} // namespace dragnn
} // namespace syntaxnet
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// =============================================================================
// Helpers for tests that use TermFrequencyMaps.
#ifndef DRAGNN_RUNTIME_TEST_TERM_MAP_HELPERS_H_
#define DRAGNN_RUNTIME_TEST_TERM_MAP_HELPERS_H_
#include <map>
#include <string>
#include "dragnn/protos/spec.pb.h"
#include "syntaxnet/base.h"
namespace syntaxnet {
namespace dragnn {
namespace runtime {
// Writes a term map containing the |term_frequencies| to a temporary file and
// returns its path. Not thread-safe.
string WriteTermMap(const std::map<string, int> &term_frequencies);
// Adds a resource named |name| to the |component_spec| that provides a term map
// at the |path|.
void AddTermMapResource(const string &name, const string &path,
ComponentSpec *component_spec);
} // namespace runtime
} // namespace dragnn
} // namespace syntaxnet
#endif // DRAGNN_RUNTIME_TEST_TERM_MAP_HELPERS_H_
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// =============================================================================
#include "dragnn/runtime/test/term_map_helpers.h"
#include <map>
#include <string>
#include "dragnn/core/test/generic.h"
#include "dragnn/protos/spec.pb.h"
#include "syntaxnet/base.h"
#include "syntaxnet/term_frequency_map.h"
#include "tensorflow/core/platform/test.h"
namespace syntaxnet {
namespace dragnn {
namespace runtime {
namespace {
// Tests that a term map can be successfully written and read.
TEST(TermMapHelpersTest, WriteTermMap) {
const string path = WriteTermMap({{"hello", 1}, {"world", 2}});
TermFrequencyMap term_map(path, 0, 0);
// Terms are sorted by descending frequency, so "world" has index 0.
EXPECT_EQ(term_map.Size(), 2);
EXPECT_EQ(term_map.LookupIndex("hello", -1), 1);
EXPECT_EQ(term_map.LookupIndex("world", -1), 0);
EXPECT_EQ(term_map.LookupIndex("unknown", -1), -1);
}
// Tests that a term map resource can be added to a ComponentSpec.
TEST(TermMapHelpersTest, AddTermMapResource) {
ComponentSpec component_spec;
AddTermMapResource("foo-map", "/foo/bar/baz", &component_spec);
ComponentSpec expected_spec;
CHECK(TextFormat::ParseFromString(
"resource { name:'foo-map' "
"part { file_format:'text' file_pattern:'/foo/bar/baz' } }",
&expected_spec));
EXPECT_THAT(component_spec, test::EqualsProto(expected_spec));
}
} // namespace
} // namespace runtime
} // namespace dragnn
} // namespace syntaxnet
version: 0
alignment_bytes: 32
is_little_endian: true
variable {
name: "foo"
format: FORMAT_ROW_MAJOR_MATRIX
num_views: 4
view_size: 12
dimension: 4
dimension: 3
}
variable {
name: "baz"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 4
view_size: 32
dimension: 2
dimension: 8
dimension: 4
}
version: 0
alignment_bytes: 32
is_little_endian: true
variable {
name: "rnn/x_to_ico/matrix/blocked48"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 1280
view_size: 192
dimension: 160
dimension: 384
dimension: 48
}
variable {
name: "rnn/h_to_ico/matrix/blocked48"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 1024
view_size: 192
dimension: 128
dimension: 384
dimension: 48
}
variable {
name: "rnn/c2i/matrix/blocked48"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 384
view_size: 192
dimension: 128
dimension: 144
dimension: 48
}
variable {
name: "rnn/c2o/matrix/blocked48"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 384
view_size: 192
dimension: 128
dimension: 144
dimension: 48
}
variable {
name: "rnn/ico_bias"
format: FORMAT_FLAT
num_views: 1
view_size: 1536
dimension: 384
}
variable {
name: "rnn/fixed_embedding_matrix_0/trimmed"
format: FORMAT_ROW_MAJOR_MATRIX
num_views: 25788
view_size: 128
dimension: 25788
dimension: 32
}
variable {
name: "rnn/fixed_embedding_matrix_1/trimmed"
format: FORMAT_ROW_MAJOR_MATRIX
num_views: 23769
view_size: 256
dimension: 23769
dimension: 64
}
variable {
name: "tagger/bias_0"
format: FORMAT_FLAT
num_views: 1
view_size: 256
dimension: 64
}
variable {
name: "tagger/weights_0/FlexibleMatrixKernel"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 320
view_size: 128
dimension: 160
dimension: 64
dimension: 32
}
variable {
name: "tagger/bias_1"
format: FORMAT_FLAT
num_views: 1
view_size: 256
dimension: 64
}
variable {
name: "tagger/weights_1/FlexibleMatrixKernel"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 128
view_size: 128
dimension: 64
dimension: 64
dimension: 32
}
variable {
name: "tagger/bias_softmax"
format: FORMAT_FLAT
num_views: 1
view_size: 180
dimension: 45
}
variable {
name: "tagger/weights_softmax/FlexibleMatrixKernel"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 64
view_size: 192
dimension: 64
dimension: 48
dimension: 48
}
variable {
name: "tagger/linked_embedding_matrix_0/weights/FlexibleMatrixKernel"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 64
view_size: 128
dimension: 64
dimension: 32
dimension: 32
}
variable {
name: "tagger/linked_embedding_matrix_0/out_of_bounds"
format: FORMAT_FLAT
num_views: 1
view_size: 128
dimension: 32
}
version: 0
alignment_bytes: 32
is_little_endian: true
variable {
name: "rnn/fixed_embedding_matrix_0/trimmed"
format: FORMAT_ROW_MAJOR_MATRIX
num_views: 25788
view_size: 128
dimension: 25788
dimension: 32
}
variable {
name: "rnn/fixed_embedding_matrix_1/trimmed"
format: FORMAT_ROW_MAJOR_MATRIX
num_views: 23769
view_size: 256
dimension: 23769
dimension: 64
}
variable {
name: "rnn/x_to_ico/matrix/blocked48"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 1280
view_size: 192
dimension: 160
dimension: 384
dimension: 48
}
variable {
name: "rnn/h_to_ico/matrix/blocked48"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 1024
view_size: 192
dimension: 128
dimension: 384
dimension: 48
}
variable {
name: "rnn/c2i/matrix/blocked48"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 384
view_size: 192
dimension: 128
dimension: 144
dimension: 48
}
variable {
name: "rnn/c2o/matrix/blocked48"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 384
view_size: 192
dimension: 128
dimension: 144
dimension: 48
}
variable {
name: "rnn/ico_bias"
format: FORMAT_FLAT
num_views: 1
view_size: 1536
dimension: 384
}
variable {
name: "tagger/bias_0"
format: FORMAT_FLAT
num_views: 1
view_size: 256
dimension: 64
}
variable {
name: "tagger/weights_0/FlexibleMatrixKernel"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 320
view_size: 128
dimension: 160
dimension: 64
dimension: 32
}
variable {
name: "tagger/bias_1"
format: FORMAT_FLAT
num_views: 1
view_size: 256
dimension: 64
}
variable {
name: "tagger/weights_1/FlexibleMatrixKernel"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 128
view_size: 128
dimension: 64
dimension: 64
dimension: 32
}
variable {
name: "tagger/bias_softmax"
format: FORMAT_FLAT
num_views: 1
view_size: 180
dimension: 45
}
variable {
name: "tagger/weights_softmax/FlexibleMatrixKernel"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 64
view_size: 192
dimension: 64
dimension: 48
dimension: 48
}
variable {
name: "tagger/linked_embedding_matrix_0/weights/FlexibleMatrixKernel"
format: FORMAT_COLUMN_BLOCKED_ROW_MAJOR_MATRIX
num_views: 64
view_size: 128
dimension: 64
dimension: 32
dimension: 32
}
variable {
name: "tagger/linked_embedding_matrix_0/out_of_bounds"
format: FORMAT_FLAT
num_views: 1
view_size: 128
dimension: 32
}
component {
name: "rnn"
transition_system {
registered_name: "shift-only"
parameters {
key: "left_to_right"
value: "false"
}
parameters {
key: "parser_skip_deterministic"
value: "false"
}
}
resource {
name: "words-embedding-input"
part {
file_pattern: "resources/component_0_rnn/resource_0_words-embedding-input/part_0"
file_format: "tf-records"
record_format: "syntaxnet.TokenEmbedding"
}
}
resource {
name: "words-vocab-input"
part {
file_pattern: "resources/component_0_rnn/resource_1_words-vocab-input/part_0"
file_format: "text"
record_format: ""
}
}
resource {
name: "char-ngram-map"
part {
file_pattern: "resources/component_0_rnn/resource_2_char-ngram-map/part_0"
file_format: "text"
record_format: ""
}
}
resource {
name: "word-map"
part {
file_pattern: "resources/component_0_rnn/resource_3_word-map/part_0"
file_format: "text"
record_format: ""
}
}
resource {
name: "label-map"
part {
file_pattern: "resources/component_0_rnn/resource_4_label-map/part_0"
file_format: "text"
record_format: ""
}
}
fixed_feature {
name: "char_ngrams"
fml: "input.token { offset(-1).char-ngram(min-length=1,max-length=3,mark-boundaries=true) offset(0).char-ngram(min-length=1,max-length=3,mark-boundaries=true) offset(1).char-ngram(min-length=1,max-length=3,mark-boundaries=true) }"
embedding_dim: 32
vocabulary_size: 25788
size: 3
}
fixed_feature {
name: "words"
fml: "input.token.word(min-freq=2)"
embedding_dim: 64
vocabulary_size: 23769
size: 1
}
network_unit {
registered_name: "LSTMNetwork"
parameters {
key: "hidden_layer_sizes"
value: "128"
}
parameters {
key: "omit_logits"
value: "true"
}
}
backend {
registered_name: "SyntaxNetComponent"
}
num_actions: 1
attention_component: ""
component_builder {
registered_name: "BulkDynamicComponent"
}
}
component {
name: "tagger"
transition_system {
registered_name: "tagger"
parameters {
key: "parser_skip_deterministic"
value: "false"
}
}
resource {
name: "tag-map"
part {
file_pattern: "resources/component_1_tagger/resource_0_tag-map/part_0"
file_format: "text"
record_format: ""
}
}
resource {
name: "tag-to-category"
part {
file_pattern: "resources/component_1_tagger/resource_1_tag-to-category/part_0"
file_format: "text"
record_format: ""
}
}
resource {
name: "label-map"
part {
file_pattern: "resources/component_0_rnn/resource_4_label-map/part_0"
file_format: "text"
record_format: ""
}
}
linked_feature {
name: "recurrence"
fml: "bias(0)"
embedding_dim: 32
size: 1
source_component: "tagger"
source_translator: "history"
source_layer: "layer_0"
}
linked_feature {
name: "rnn"
fml: "input.focus"
embedding_dim: -1
size: 1
source_component: "rnn"
source_translator: "reverse-token"
source_layer: "layer_0"
}
network_unit {
registered_name: "FeedForwardNetwork"
parameters {
key: "hidden_layer_sizes"
value: "64,64"
}
}
backend {
registered_name: "SyntaxNetComponent"
}
num_actions: 45
attention_component: ""
component_builder {
registered_name: "DynamicComponent"
}
}
component {
name: "rnn"
transition_system {
registered_name: "shift-only"
parameters {
key: "left_to_right"
value: "false"
}
parameters {
key: "parser_skip_deterministic"
value: "false"
}
}
resource {
name: "words-embedding-input"
part {
file_pattern: "resources/component_0_rnn/resource_0_words-embedding-input/part_0"
file_format: "tf-records"
record_format: "syntaxnet.TokenEmbedding"
}
}
resource {
name: "words-vocab-input"
part {
file_pattern: "resources/component_0_rnn/resource_1_words-vocab-input/part_0"
file_format: "text"
record_format: ""
}
}
resource {
name: "char-ngram-map"
part {
file_pattern: "resources/component_0_rnn/resource_2_char-ngram-map/part_0"
file_format: "text"
record_format: ""
}
}
resource {
name: "word-map"
part {
file_pattern: "resources/component_0_rnn/resource_3_word-map/part_0"
file_format: "text"
record_format: ""
}
}
resource {
name: "label-map"
part {
file_pattern: "resources/component_0_rnn/resource_4_label-map/part_0"
file_format: "text"
record_format: ""
}
}
fixed_feature {
name: "char_ngrams"
fml: "input.token { offset(-1).char-ngram(min-length=1,max-length=3,mark-boundaries=true) offset(0).char-ngram(min-length=1,max-length=3,mark-boundaries=true) offset(1).char-ngram(min-length=1,max-length=3,mark-boundaries=true) }"
embedding_dim: 32
vocabulary_size: 25788
size: 3
}
fixed_feature {
name: "words"
fml: "input.token.word(min-freq=2)"
embedding_dim: 64
vocabulary_size: 23769
size: 1
}
network_unit {
registered_name: "LSTMNetwork"
parameters {
key: "hidden_layer_sizes"
value: "128"
}
parameters {
key: "omit_logits"
value: "true"
}
}
backend {
registered_name: "SyntaxNetComponent"
}
num_actions: 1
attention_component: ""
component_builder {
registered_name: "DynamicComponentBuilder"
}
}
component {
name: "tagger"
transition_system {
registered_name: "tagger"
parameters {
key: "parser_skip_deterministic"
value: "false"
}
}
resource {
name: "tag-map"
part {
file_pattern: "resources/component_1_tagger/resource_0_tag-map/part_0"
file_format: "text"
record_format: ""
}
}
resource {
name: "tag-to-category"
part {
file_pattern: "resources/component_1_tagger/resource_1_tag-to-category/part_0"
file_format: "text"
record_format: ""
}
}
resource {
name: "label-map"
part {
file_pattern: "resources/component_0_rnn/resource_4_label-map/part_0"
file_format: "text"
record_format: ""
}
}
linked_feature {
name: "recurrence"
fml: "bias(0)"
embedding_dim: 32
size: 1
source_component: "tagger"
source_translator: "history"
source_layer: "layer_0"
}
linked_feature {
name: "rnn"
fml: "input.focus"
embedding_dim: -1
size: 1
source_component: "rnn"
source_translator: "reverse-token"
source_layer: "layer_0"
}
network_unit {
registered_name: "FeedForwardNetwork"
parameters {
key: "hidden_layer_sizes"
value: "64,64"
}
}
backend {
registered_name: "SyntaxNetComponent"
}
num_actions: 45
attention_component: ""
component_builder {
registered_name: "DynamicComponentBuilder"
}
}
45
punct 109728
prep 91843
pobj 89563
det 78291
nn 73846
nsubj 66976
amod 60381
ROOT 39832
dobj 39508
aux 33877
advmod 28875
conj 24320
cc 23999
num 21755
poss 16794
ccomp 15435
dep 13752
xcomp 11631
mark 10368
cop 9854
number 9684
possessive 8717
rcmod 7639
auxpass 7513
appos 6850
nsubjpass 6717
advcl 6035
partmod 5799
pcomp 5079
neg 4591
tmod 4284
quantmod 3626
prt 2628
infmod 2485
npadvmod 1632
parataxis 1510
mwe 1309
expl 855
acomp 669
iobj 576
csubj 378
predet 362
preconj 345
discourse 106
csubjpass 11
45
NN 132998
IN 98554
NNP 91466
DT 81832
JJ 61217
NNS 59856
, 48727
. 39478
CD 36568
RB 30907
VBD 29889
VB 26438
CC 23959
TO 22357
VBZ 21672
VBN 20024
PRP 17436
VBG 14846
VBP 12491
MD 9803
POS 8701
PRP$ 8407
$ 7372
`` 7092
'' 6919
: 4772
WDT 4294
JJR 3238
NNPS 2673
RP 2662
WP 2363
WRB 2143
JJS 1947
RBR 1768
-RRB- 1376
-LRB- 1366
EX 863
RBS 451
PDT 368
FW 234
WP$ 168
# 142
UH 97
SYM 58
LS 36
# #
$ $
'' ''
, ,
-LRB- -LRB-
-RRB- -RRB-
. .
: :
CC CC
CD CD
DT DT
EX EX
FW FW
IN IN
JJ JJ
JJR JJR
JJS JJS
LS LS
MD MD
NN NN
NNP NNP
NNPS NNPS
NNS NNS
PDT PDT
POS POS
PRP PRP
PRP$ PRP$
RB RB
RBR RBR
RBS RBS
RP RP
SYM SYM
TO TO
UH UH
VB VB
VBD VBD
VBG VBG
VBN VBN
VBP VBP
VBZ VBZ
WDT WDT
WP WP
WP$ WP$
WRB WRB
`` ``
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment