def setup_method(self): EvalbBracketingScorer.compile_evalb() super().setup_method() self.set_up_model( FIXTURES_ROOT / "syntax" / "constituency_parser" / "constituency_parser.json", FIXTURES_ROOT / "syntax" / "example_ptb.trees", )
def setUp(self): EvalbBracketingScorer.compile_evalb() super(SpanConstituencyParserTest, self).setUp() self.set_up_model( self.FIXTURES_ROOT / u"constituency_parser" / u"constituency_parser.json", self.FIXTURES_ROOT / u"data" / u"example_ptb.trees")
def setup_method(self): super().setup_method() EvalbBracketingScorer.compile_evalb()
logger.info("Changing directory to %s", module_root) os.chdir(module_root) if len(sys.argv) >= 2 and sys.argv[1].lower() == "gpu": train_fixture_gpu("allennlp/tests/fixtures/srl/") else: models = [ 'biaffine_dependency_parser', 'bidaf', 'dialog_qa', 'constituency_parser', 'coref', 'decomposable_attention', 'encoder_decoder/composed_seq2seq', 'encoder_decoder/simple_seq2seq', 'encoder_decoder/copynet_seq2seq', 'semantic_parsing/nlvr_coverage_semantic_parser', 'semantic_parsing/nlvr_direct_semantic_parser', 'semantic_parsing/wikitables', 'semantic_parsing/quarel', 'semantic_parsing/quarel/zeroshot', 'semantic_parsing/quarel/tagger', 'semantic_parsing/atis', 'srl', ] for model in models: if model == 'constituency_parser': EvalbBracketingScorer.compile_evalb() train_fixture(f"allennlp/tests/fixtures/{model}/") logger.info("Changing directory back to %s", initial_working_dir) os.chdir(initial_working_dir)
def setUp(self): super().setUp() EvalbBracketingScorer.compile_evalb()
def setUp(self): super().setUp() EvalbBracketingScorer.compile_evalb()
def setUp(self): EvalbBracketingScorer.compile_evalb() super(SpanConstituencyParserTest, self).setUp() self.set_up_model(self.FIXTURES_ROOT / "constituency_parser" / "constituency_parser.json", self.FIXTURES_ROOT / "data" / "example_ptb.trees")
def setUp(self): EvalbBracketingScorer.compile_evalb() super(SpanConstituencyParserTest, self).setUp() self.set_up_model("tests/fixtures/constituency_parser/constituency_parser.json", "tests/fixtures/data/example_ptb.trees")
if __name__ == "__main__": initial_working_dir = os.getcwd() module_root = _get_module_root().parent logger.info("Changing directory to %s", module_root) os.chdir(module_root) if len(sys.argv) >= 2 and sys.argv[1].lower() == "gpu": train_fixture_gpu("allennlp/tests/fixtures/srl/") else: models = [ 'biaffine_dependency_parser', 'bidaf', 'dialog_qa', 'constituency_parser', 'coref', 'decomposable_attention', 'encoder_decoder/simple_seq2seq', 'semantic_parsing/nlvr_coverage_semantic_parser', 'semantic_parsing/nlvr_direct_semantic_parser', 'semantic_parsing/wikitables', 'semantic_parsing/atis', 'srl', ] for model in models: if model == 'constituency_parser': EvalbBracketingScorer.compile_evalb() train_fixture(f"allennlp/tests/fixtures/{model}/") logger.info("Changing directory back to %s", initial_working_dir) os.chdir(initial_working_dir)