c96426399886503e71a4501d308bd7f7ef2aa9e9,tests/models/semantic_role_labeler_test.py,SemanticRoleLabelerTest,setUp,#SemanticRoleLabelerTest#,19

Before Change


        super(SemanticRoleLabelerTest, self).setUp()

        dataset = SrlReader().read("tests/fixtures/conll_2012/")
        vocab = Vocabulary.from_dataset(dataset)
        self.vocab = vocab
        dataset.index_instances(vocab)
        self.dataset = dataset

        params = Params({
                "text_field_embedder": {
                        "tokens": {
                                "type": "embedding",
                                "embedding_dim": 5
                                }
                        },
                "stacked_encoder": {
                        "type": "lstm",
                        "input_size": 8,
                        "hidden_size": 7,
                        "num_layers": 2
                        },
                "binary_feature_dim": 3,
                })

        self.model = SemanticRoleLabeler.from_params(self.vocab, params)

    def test_srl_model_can_train_save_and_load(self):
        self.ensure_model_can_train_save_and_load(self.model, self.dataset)

After Change


class SemanticRoleLabelerTest(ModelTestCase):
    def setUp(self):
        super(SemanticRoleLabelerTest, self).setUp()
        self.set_up_model("tests/fixtures/srl/experiment.json", "tests/fixtures/conll_2012")

    def test_srl_model_can_train_save_and_load(self):
        self.ensure_model_can_train_save_and_load(self.param_file)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 13

Instances


Project Name: allenai/allennlp
Commit Name: c96426399886503e71a4501d308bd7f7ef2aa9e9
Time: 2017-08-28
Author: mattg@allenai.org
File Name: tests/models/semantic_role_labeler_test.py
Class Name: SemanticRoleLabelerTest
Method Name: setUp


Project Name: allenai/allennlp
Commit Name: c96426399886503e71a4501d308bd7f7ef2aa9e9
Time: 2017-08-28
Author: mattg@allenai.org
File Name: tests/models/semantic_role_labeler_test.py
Class Name: SemanticRoleLabelerTest
Method Name: setUp


Project Name: allenai/allennlp
Commit Name: c96426399886503e71a4501d308bd7f7ef2aa9e9
Time: 2017-08-28
Author: mattg@allenai.org
File Name: tests/models/simple_tagger_test.py
Class Name: SimpleTaggerTest
Method Name: setUp


Project Name: allenai/allennlp
Commit Name: c96426399886503e71a4501d308bd7f7ef2aa9e9
Time: 2017-08-28
Author: mattg@allenai.org
File Name: tests/models/bidaf_test.py
Class Name: BidirectionalAttentionFlowTest
Method Name: setUp