├── .gitignore ├── LICENSE ├── README.md ├── allennlp ├── .dockerignore ├── .github │ └── ISSUE_TEMPLATE │ │ ├── bug_report.md │ │ ├── feature_request.md │ │ └── question.md ├── .gitignore ├── .pylintrc ├── CONTRIBUTING.md ├── DEPRECATION.md ├── Dockerfile ├── Dockerfile.pip ├── LICENSE ├── MANIFEST.in ├── MODELS.md ├── README.md ├── STYLE.md ├── allennlp │ ├── __init__.py │ ├── commands │ │ ├── __init__.py │ │ ├── configure.py │ │ ├── dry_run.py │ │ ├── elmo.py │ │ ├── evaluate.py │ │ ├── find_learning_rate.py │ │ ├── fine_tune.py │ │ ├── make_vocab.py │ │ ├── predict.py │ │ ├── print_results.py │ │ ├── subcommand.py │ │ ├── test_install.py │ │ └── train.py │ ├── common │ │ ├── __init__.py │ │ ├── checks.py │ │ ├── configuration.py │ │ ├── file_utils.py │ │ ├── from_params.py │ │ ├── params.py │ │ ├── registrable.py │ │ ├── tee_logger.py │ │ ├── testing │ │ │ ├── __init__.py │ │ │ ├── model_test_case.py │ │ │ └── test_case.py │ │ ├── tqdm.py │ │ └── util.py │ ├── data │ │ ├── __init__.py │ │ ├── dataset.py │ │ ├── dataset_readers │ │ │ ├── __init__.py │ │ │ ├── babi.py │ │ │ ├── ccgbank.py │ │ │ ├── conll2000.py │ │ │ ├── conll2003.py │ │ │ ├── copynet_seq2seq.py │ │ │ ├── coreference_resolution │ │ │ │ ├── __init__.py │ │ │ │ ├── conll.py │ │ │ │ └── winobias.py │ │ │ ├── dataset_reader.py │ │ │ ├── dataset_utils │ │ │ │ ├── __init__.py │ │ │ │ ├── ontonotes.py │ │ │ │ ├── span_utils.py │ │ │ │ └── text2sql_utils.py │ │ │ ├── event2mind.py │ │ │ ├── interleaving_dataset_reader.py │ │ │ ├── language_modeling.py │ │ │ ├── multiprocess_dataset_reader.py │ │ │ ├── ontonotes_ner.py │ │ │ ├── penn_tree_bank.py │ │ │ ├── quora_paraphrase.py │ │ │ ├── reading_comprehension │ │ │ │ ├── __init__.py │ │ │ │ ├── drop.py │ │ │ │ ├── qangaroo.py │ │ │ │ ├── quac.py │ │ │ │ ├── squad.py │ │ │ │ ├── triviaqa.py │ │ │ │ └── util.py │ │ │ ├── semantic_dependency_parsing.py │ │ │ ├── semantic_parsing │ │ │ │ ├── __init__.py │ │ │ │ ├── atis.py │ │ │ │ ├── grammar_based_text2sql.py │ │ │ │ ├── nlvr.py │ │ │ │ ├── quarel.py │ │ │ │ ├── template_text2sql.py │ │ │ │ └── wikitables │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── util.py │ │ │ │ │ └── wikitables.py │ │ │ ├── semantic_role_labeling.py │ │ │ ├── seq2seq.py │ │ │ ├── sequence_tagging.py │ │ │ ├── simple_language_modeling.py │ │ │ ├── snli.py │ │ │ ├── stanford_sentiment_tree_bank.py │ │ │ ├── text_classification_json.py │ │ │ └── universal_dependencies.py │ │ ├── fields │ │ │ ├── __init__.py │ │ │ ├── adjacency_field.py │ │ │ ├── array_field.py │ │ │ ├── field.py │ │ │ ├── index_field.py │ │ │ ├── knowledge_graph_field.py │ │ │ ├── label_field.py │ │ │ ├── list_field.py │ │ │ ├── metadata_field.py │ │ │ ├── multilabel_field.py │ │ │ ├── namespace_swapping_field.py │ │ │ ├── production_rule_field.py │ │ │ ├── sequence_field.py │ │ │ ├── sequence_label_field.py │ │ │ ├── span_field.py │ │ │ └── text_field.py │ │ ├── instance.py │ │ ├── iterators │ │ │ ├── __init__.py │ │ │ ├── basic_iterator.py │ │ │ ├── bucket_iterator.py │ │ │ ├── data_iterator.py │ │ │ ├── homogeneous_batch_iterator.py │ │ │ └── multiprocess_iterator.py │ │ ├── token_indexers │ │ │ ├── __init__.py │ │ │ ├── dep_label_indexer.py │ │ │ ├── elmo_indexer.py │ │ │ ├── ner_tag_indexer.py │ │ │ ├── openai_transformer_byte_pair_indexer.py │ │ │ ├── pos_tag_indexer.py │ │ │ ├── single_id_token_indexer.py │ │ │ ├── token_characters_indexer.py │ │ │ ├── token_indexer.py │ │ │ └── wordpiece_indexer.py │ │ ├── tokenizers │ │ │ ├── __init__.py │ │ │ ├── character_tokenizer.py │ │ │ ├── sentence_splitter.py │ │ │ ├── token.py │ │ │ ├── tokenizer.py │ │ │ ├── word_filter.py │ │ │ ├── word_splitter.py │ │ │ ├── word_stemmer.py │ │ │ └── word_tokenizer.py │ │ └── vocabulary.py │ ├── models │ │ ├── __init__.py │ │ ├── archival.py │ │ ├── basic_classifier.py │ │ ├── bert_for_classification.py │ │ ├── biaffine_dependency_parser.py │ │ ├── biattentive_classification_network.py │ │ ├── bidirectional_lm.py │ │ ├── bimpm.py │ │ ├── constituency_parser.py │ │ ├── coreference_resolution │ │ │ ├── __init__.py │ │ │ └── coref.py │ │ ├── crf_tagger.py │ │ ├── decomposable_attention.py │ │ ├── encoder_decoders │ │ │ ├── __init__.py │ │ │ ├── copynet_seq2seq.py │ │ │ └── simple_seq2seq.py │ │ ├── ensemble.py │ │ ├── esim.py │ │ ├── event2mind.py │ │ ├── graph_parser.py │ │ ├── language_model.py │ │ ├── model.py │ │ ├── reading_comprehension │ │ │ ├── __init__.py │ │ │ ├── bidaf.py │ │ │ ├── bidaf_ensemble.py │ │ │ ├── dialog_qa.py │ │ │ ├── naqanet.py │ │ │ ├── qanet.py │ │ │ └── util.py │ │ ├── semantic_parsing │ │ │ ├── __init__.py │ │ │ ├── atis │ │ │ │ ├── __init__.py │ │ │ │ └── atis_semantic_parser.py │ │ │ ├── nlvr │ │ │ │ ├── __init__.py │ │ │ │ ├── nlvr_coverage_semantic_parser.py │ │ │ │ ├── nlvr_direct_semantic_parser.py │ │ │ │ └── nlvr_semantic_parser.py │ │ │ ├── quarel │ │ │ │ ├── __init__.py │ │ │ │ └── quarel_semantic_parser.py │ │ │ ├── text2sql_parser.py │ │ │ └── wikitables │ │ │ │ ├── __init__.py │ │ │ │ ├── wikitables_erm_semantic_parser.py │ │ │ │ ├── wikitables_mml_semantic_parser.py │ │ │ │ └── wikitables_semantic_parser.py │ │ ├── semantic_role_labeler.py │ │ └── simple_tagger.py │ ├── modules │ │ ├── __init__.py │ │ ├── attention │ │ │ ├── __init__.py │ │ │ ├── attention.py │ │ │ ├── bilinear_attention.py │ │ │ ├── cosine_attention.py │ │ │ ├── dot_product_attention.py │ │ │ ├── legacy_attention.py │ │ │ └── linear_attention.py │ │ ├── augmented_lstm.py │ │ ├── bimpm_matching.py │ │ ├── conditional_random_field.py │ │ ├── elmo.py │ │ ├── elmo_lstm.py │ │ ├── encoder_base.py │ │ ├── feedforward.py │ │ ├── highway.py │ │ ├── input_variational_dropout.py │ │ ├── layer_norm.py │ │ ├── lstm_cell_with_projection.py │ │ ├── masked_layer_norm.py │ │ ├── matrix_attention │ │ │ ├── __init__.py │ │ │ ├── bilinear_matrix_attention.py │ │ │ ├── cosine_matrix_attention.py │ │ │ ├── dot_product_matrix_attention.py │ │ │ ├── legacy_matrix_attention.py │ │ │ ├── linear_matrix_attention.py │ │ │ └── matrix_attention.py │ │ ├── maxout.py │ │ ├── openai_transformer.py │ │ ├── pruner.py │ │ ├── residual_with_layer_dropout.py │ │ ├── sampled_softmax_loss.py │ │ ├── scalar_mix.py │ │ ├── seq2seq_encoders │ │ │ ├── __init__.py │ │ │ ├── bidirectional_language_model_transformer.py │ │ │ ├── feedforward_encoder.py │ │ │ ├── gated_cnn_encoder.py │ │ │ ├── intra_sentence_attention.py │ │ │ ├── multi_head_self_attention.py │ │ │ ├── pass_through_encoder.py │ │ │ ├── pytorch_seq2seq_wrapper.py │ │ │ ├── qanet_encoder.py │ │ │ ├── seq2seq_encoder.py │ │ │ └── stacked_self_attention.py │ │ ├── seq2vec_encoders │ │ │ ├── __init__.py │ │ │ ├── bert_pooler.py │ │ │ ├── boe_encoder.py │ │ │ ├── cnn_encoder.py │ │ │ ├── cnn_highway_encoder.py │ │ │ ├── pytorch_seq2vec_wrapper.py │ │ │ └── seq2vec_encoder.py │ │ ├── similarity_functions │ │ │ ├── __init__.py │ │ │ ├── bilinear.py │ │ │ ├── cosine.py │ │ │ ├── dot_product.py │ │ │ ├── linear.py │ │ │ ├── multiheaded.py │ │ │ └── similarity_function.py │ │ ├── span_extractors │ │ │ ├── __init__.py │ │ │ ├── bidirectional_endpoint_span_extractor.py │ │ │ ├── endpoint_span_extractor.py │ │ │ ├── self_attentive_span_extractor.py │ │ │ └── span_extractor.py │ │ ├── stacked_alternating_lstm.py │ │ ├── stacked_bidirectional_lstm.py │ │ ├── text_field_embedders │ │ │ ├── __init__.py │ │ │ ├── basic_text_field_embedder.py │ │ │ └── text_field_embedder.py │ │ ├── time_distributed.py │ │ └── token_embedders │ │ │ ├── __init__.py │ │ │ ├── bag_of_word_counts_token_embedder.py │ │ │ ├── bert_token_embedder.py │ │ │ ├── bidirectional_language_model_token_embedder.py │ │ │ ├── elmo_token_embedder.py │ │ │ ├── embedding.py │ │ │ ├── language_model_token_embedder.py │ │ │ ├── openai_transformer_embedder.py │ │ │ ├── token_characters_encoder.py │ │ │ └── token_embedder.py │ ├── nn │ │ ├── __init__.py │ │ ├── activations.py │ │ ├── beam_search.py │ │ ├── chu_liu_edmonds.py │ │ ├── initializers.py │ │ ├── regularizers │ │ │ ├── __init__.py │ │ │ ├── regularizer.py │ │ │ ├── regularizer_applicator.py │ │ │ └── regularizers.py │ │ └── util.py │ ├── predictors │ │ ├── __init__.py │ │ ├── atis_parser.py │ │ ├── biaffine_dependency_parser.py │ │ ├── bidaf.py │ │ ├── constituency_parser.py │ │ ├── coref.py │ │ ├── decomposable_attention.py │ │ ├── dialog_qa.py │ │ ├── event2mind.py │ │ ├── nlvr_parser.py │ │ ├── open_information_extraction.py │ │ ├── predictor.py │ │ ├── quarel_parser.py │ │ ├── semantic_role_labeler.py │ │ ├── sentence_tagger.py │ │ ├── seq2seq.py │ │ ├── simple_seq2seq.py │ │ ├── text_classifier.py │ │ └── wikitables_parser.py │ ├── pretrained.py │ ├── run.py │ ├── semparse │ │ ├── __init__.py │ │ ├── action_space_walker.py │ │ ├── contexts │ │ │ ├── __init__.py │ │ │ ├── atis_sql_table_context.py │ │ │ ├── atis_tables.py │ │ │ ├── knowledge_graph.py │ │ │ ├── quarel_utils.py │ │ │ ├── sql_context_utils.py │ │ │ ├── table_question_context.py │ │ │ ├── table_question_knowledge_graph.py │ │ │ └── text2sql_table_context.py │ │ ├── domain_languages │ │ │ ├── __init__.py │ │ │ ├── common │ │ │ │ ├── __init__.py │ │ │ │ └── date.py │ │ │ ├── domain_language.py │ │ │ ├── nlvr_language.py │ │ │ ├── quarel_language.py │ │ │ └── wikitables_language.py │ │ ├── executors │ │ │ ├── __init__.py │ │ │ ├── sql_executor.py │ │ │ └── wikitables_sempre_executor.py │ │ ├── type_declarations │ │ │ ├── __init__.py │ │ │ ├── quarel_type_declaration.py │ │ │ ├── type_declaration.py │ │ │ └── wikitables_lambda_dcs.py │ │ ├── util.py │ │ └── worlds │ │ │ ├── __init__.py │ │ │ ├── atis_world.py │ │ │ ├── quarel_world.py │ │ │ ├── text2sql_world.py │ │ │ ├── wikitables_world.py │ │ │ └── world.py │ ├── service │ │ ├── __init__.py │ │ ├── config_explorer.html │ │ ├── config_explorer.py │ │ ├── predictors │ │ │ ├── __init__.py │ │ │ ├── bidaf.py │ │ │ ├── constituency_parser.py │ │ │ ├── coref.py │ │ │ ├── decomposable_attention.py │ │ │ ├── nlvr_parser.py │ │ │ ├── predictor.py │ │ │ ├── semantic_role_labeler.py │ │ │ ├── sentence_tagger.py │ │ │ ├── simple_seq2seq.py │ │ │ └── wikitables_parser.py │ │ └── server_simple.py │ ├── state_machines │ │ ├── __init__.py │ │ ├── beam_search.py │ │ ├── constrained_beam_search.py │ │ ├── states │ │ │ ├── __init__.py │ │ │ ├── checklist_statelet.py │ │ │ ├── coverage_state.py │ │ │ ├── grammar_based_state.py │ │ │ ├── grammar_statelet.py │ │ │ ├── lambda_grammar_statelet.py │ │ │ ├── rnn_statelet.py │ │ │ └── state.py │ │ ├── trainers │ │ │ ├── __init__.py │ │ │ ├── decoder_trainer.py │ │ │ ├── expected_risk_minimization.py │ │ │ └── maximum_marginal_likelihood.py │ │ ├── transition_functions │ │ │ ├── __init__.py │ │ │ ├── basic_transition_function.py │ │ │ ├── coverage_transition_function.py │ │ │ ├── linking_coverage_transition_function.py │ │ │ ├── linking_transition_function.py │ │ │ └── transition_function.py │ │ └── util.py │ ├── tests │ │ ├── __init__.py │ │ ├── commands │ │ │ ├── __init__.py │ │ │ ├── configure_test.py │ │ │ ├── dry_run_test.py │ │ │ ├── elmo_test.py │ │ │ ├── evaluate_test.py │ │ │ ├── find_learning_rate_test.py │ │ │ ├── fine_tune_test.py │ │ │ ├── main_test.py │ │ │ ├── make_vocab_test.py │ │ │ ├── no_op_train_test.py │ │ │ ├── predict_test.py │ │ │ ├── print_results_test.py │ │ │ ├── test_install_test.py │ │ │ └── train_test.py │ │ ├── common │ │ │ ├── __init__.py │ │ │ ├── configuration_test.py │ │ │ ├── file_utils_test.py │ │ │ ├── from_params_test.py │ │ │ ├── params_test.py │ │ │ ├── registrable_test.py │ │ │ └── test_util.py │ │ ├── data │ │ │ ├── __init__.py │ │ │ ├── dataset_readers │ │ │ │ ├── __init__.py │ │ │ │ ├── babi_reader_test.py │ │ │ │ ├── ccgbank_test.py │ │ │ │ ├── conll2000_dataset_reader_test.py │ │ │ │ ├── conll2003_dataset_reader_test.py │ │ │ │ ├── copynet_test.py │ │ │ │ ├── coreference │ │ │ │ │ ├── coref_reader_test.py │ │ │ │ │ └── winobias_reader_test.py │ │ │ │ ├── dataset_reader_test.py │ │ │ │ ├── dataset_utils │ │ │ │ │ ├── ontonotes_test.py │ │ │ │ │ ├── span_utils_test.py │ │ │ │ │ └── text2sql_utils_test.py │ │ │ │ ├── event2mind_test.py │ │ │ │ ├── interleaving_dataset_reader_test.py │ │ │ │ ├── language_modeling_dataset_test.py │ │ │ │ ├── lazy_dataset_reader_test.py │ │ │ │ ├── multiprocess_dataset_reader_test.py │ │ │ │ ├── ontonotes_ner_test.py │ │ │ │ ├── penn_tree_bank_reader_test.py │ │ │ │ ├── quora_paraphrase_test.py │ │ │ │ ├── reading_comprehension │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── drop_test.py │ │ │ │ │ ├── qangaroo_test.py │ │ │ │ │ ├── quac_test.py │ │ │ │ │ ├── squad_test.py │ │ │ │ │ ├── triviaqa_test.py │ │ │ │ │ └── util_test.py │ │ │ │ ├── semantic_dependency_parsing.py │ │ │ │ ├── semantic_parsing │ │ │ │ │ ├── atis_test.py │ │ │ │ │ ├── grammar_based_text2sql_test.py │ │ │ │ │ ├── nlvr_test.py │ │ │ │ │ ├── template_text2sql_test.py │ │ │ │ │ └── wikitables_test.py │ │ │ │ ├── seq2seq_test.py │ │ │ │ ├── sequence_tagging_test.py │ │ │ │ ├── simple_language_modeling_test.py │ │ │ │ ├── snli_reader_test.py │ │ │ │ ├── srl_dataset_reader_test.py │ │ │ │ ├── stanford_sentiment_tree_bank_test.py │ │ │ │ ├── text_classification_json_test.py │ │ │ │ └── universal_dependencies_dataset_reader_test.py │ │ │ ├── dataset_test.py │ │ │ ├── fields │ │ │ │ ├── __init__.py │ │ │ │ ├── adjacency_field_test.py │ │ │ │ ├── array_field_test.py │ │ │ │ ├── index_field_test.py │ │ │ │ ├── knowledge_graph_field_test.py │ │ │ │ ├── label_field_test.py │ │ │ │ ├── list_field_test.py │ │ │ │ ├── metadata_field_test.py │ │ │ │ ├── multilabel_field_test.py │ │ │ │ ├── production_rule_field_test.py │ │ │ │ ├── sequence_label_field_test.py │ │ │ │ ├── span_field_test.py │ │ │ │ └── text_field_test.py │ │ │ ├── instance_test.py │ │ │ ├── iterators │ │ │ │ ├── __init__.py │ │ │ │ ├── basic_iterator_test.py │ │ │ │ ├── bucket_iterator_test.py │ │ │ │ ├── homogeneous_iterator_test.py │ │ │ │ └── multiprocess_iterator_test.py │ │ │ ├── token_indexers │ │ │ │ ├── __init__.py │ │ │ │ ├── bert_indexer_test.py │ │ │ │ ├── character_token_indexer_test.py │ │ │ │ ├── dep_label_indexer_test.py │ │ │ │ ├── elmo_indexer_test.py │ │ │ │ ├── ner_tag_indexer_test.py │ │ │ │ ├── openai_transformer_byte_pair_indexer_test.py │ │ │ │ ├── pos_tag_indexer_test.py │ │ │ │ └── single_id_token_indexer_test.py │ │ │ ├── tokenizers │ │ │ │ ├── __init__.py │ │ │ │ ├── character_tokenizer_test.py │ │ │ │ ├── sentence_splitter_test.py │ │ │ │ ├── word_filter_test.py │ │ │ │ ├── word_splitter_test.py │ │ │ │ └── word_tokenizer_test.py │ │ │ └── vocabulary_test.py │ │ ├── fixtures │ │ │ ├── basic_classifier │ │ │ │ ├── common.jsonnet │ │ │ │ ├── experiment_seq2seq.jsonnet │ │ │ │ ├── experiment_seq2vec.jsonnet │ │ │ │ └── serialization │ │ │ │ │ ├── best.th │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ └── vocabulary │ │ │ │ │ ├── labels.txt │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ └── tokens.txt │ │ │ ├── bert │ │ │ │ ├── bert_for_classification.jsonnet │ │ │ │ ├── bert_pooler.jsonnet │ │ │ │ ├── config.json │ │ │ │ └── vocab.txt │ │ │ ├── biaffine_dependency_parser │ │ │ │ ├── experiment.json │ │ │ │ └── serialization │ │ │ │ │ ├── best.th │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ └── vocabulary │ │ │ │ │ ├── head_tags.txt │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ ├── pos.txt │ │ │ │ │ └── tokens.txt │ │ │ ├── biattentive_classification_network │ │ │ │ ├── broken_experiments │ │ │ │ │ ├── elmo_in_text_field_embedder.json │ │ │ │ │ └── no_elmo_tokenizer_for_elmo.json │ │ │ │ ├── elmo_experiment.json │ │ │ │ ├── experiment.json │ │ │ │ ├── feedforward_experiment.json │ │ │ │ └── output_only_elmo_experiment.json │ │ │ ├── bidaf │ │ │ │ ├── experiment.json │ │ │ │ └── serialization │ │ │ │ │ ├── best.th │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ └── vocabulary │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ └── tokens.txt │ │ │ ├── bimpm │ │ │ │ └── experiment.json │ │ │ ├── conll_2012 │ │ │ │ ├── subdomain │ │ │ │ │ └── example.gold_conll │ │ │ │ └── subdomain2 │ │ │ │ │ └── example.gold_conll │ │ │ ├── constituency_parser │ │ │ │ ├── constituency_parser.json │ │ │ │ ├── experiment.json │ │ │ │ └── serialization │ │ │ │ │ ├── best.th │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ └── vocabulary │ │ │ │ │ ├── labels.txt │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ └── tokens.txt │ │ │ ├── coref │ │ │ │ ├── coref.gold_conll │ │ │ │ ├── experiment.json │ │ │ │ ├── serialization │ │ │ │ │ ├── best.th │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ └── vocabulary │ │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ │ └── tokens.txt │ │ │ │ └── winobias.sample │ │ │ ├── crf_tagger │ │ │ │ ├── experiment.json │ │ │ │ ├── experiment_ccgbank.json │ │ │ │ └── experiment_conll2000.json │ │ │ ├── data │ │ │ │ ├── atis │ │ │ │ │ └── sample.json │ │ │ │ ├── babi.txt │ │ │ │ ├── brown_corpus.txt │ │ │ │ ├── ccgbank.txt │ │ │ │ ├── conll2000.txt │ │ │ │ ├── conll2003.txt │ │ │ │ ├── copynet │ │ │ │ │ ├── copyover.tsv │ │ │ │ │ ├── source_vocab.txt │ │ │ │ │ └── target_vocab.txt │ │ │ │ ├── corenlp_processed_tables │ │ │ │ │ ├── TEST-1.table │ │ │ │ │ ├── TEST-10.table │ │ │ │ │ ├── TEST-11.table │ │ │ │ │ ├── TEST-2.table │ │ │ │ │ ├── TEST-3.table │ │ │ │ │ ├── TEST-4.table │ │ │ │ │ ├── TEST-5.table │ │ │ │ │ ├── TEST-6.table │ │ │ │ │ ├── TEST-7.table │ │ │ │ │ ├── TEST-8.table │ │ │ │ │ └── TEST-9.table │ │ │ │ ├── dependencies.conllu │ │ │ │ ├── dm.sdp │ │ │ │ ├── drop.json │ │ │ │ ├── event2mind_medium.csv │ │ │ │ ├── event2mind_small.csv │ │ │ │ ├── example_ptb.trees │ │ │ │ ├── language_modeling.txt │ │ │ │ ├── nlvr │ │ │ │ │ ├── sample_grouped_data.jsonl │ │ │ │ │ ├── sample_processed_data.jsonl │ │ │ │ │ └── sample_ungrouped_data.jsonl │ │ │ │ ├── open_information_extraction │ │ │ │ │ └── open_ie.gold_conll │ │ │ │ ├── qangaroo.json │ │ │ │ ├── quac_sample.json │ │ │ │ ├── quarel.jsonl │ │ │ │ ├── quora_paraphrase.tsv │ │ │ │ ├── seahorse_embeddings.gz │ │ │ │ ├── seq2seq_copy.csv │ │ │ │ ├── seq2seq_copy.tsv │ │ │ │ ├── seq2seq_max_marginal_likelihood.tsv │ │ │ │ ├── sequence_tagging.tsv │ │ │ │ ├── snli.jsonl │ │ │ │ ├── snli2.jsonl │ │ │ │ ├── snli_vocab │ │ │ │ │ ├── labels.txt │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ └── tokens.txt │ │ │ │ ├── squad.json │ │ │ │ ├── srl │ │ │ │ │ ├── ._nt_6401.gold_skel │ │ │ │ │ ├── nt_6401.gold_conll │ │ │ │ │ └── nt_6401.gold_skel │ │ │ │ ├── sst.txt │ │ │ │ ├── text2sql │ │ │ │ │ ├── restaurants-schema.csv │ │ │ │ │ ├── restaurants.db │ │ │ │ │ └── restaurants_tiny.json │ │ │ │ ├── text_classification_json │ │ │ │ │ ├── ag_news_corpus.jsonl │ │ │ │ │ ├── imdb_corpus.jsonl │ │ │ │ │ └── integer_labels.jsonl │ │ │ │ ├── triviaqa-sample.tgz │ │ │ │ └── wikitables │ │ │ │ │ ├── dpd_output │ │ │ │ │ ├── nt-0.gz │ │ │ │ │ ├── nt-1.gz │ │ │ │ │ └── nt-64.gz │ │ │ │ │ ├── lots_of_ors_example.examples │ │ │ │ │ ├── sample_data.examples │ │ │ │ │ ├── sample_data_preprocessed.jsonl │ │ │ │ │ ├── sample_table.tagged │ │ │ │ │ ├── sample_table.tsv │ │ │ │ │ ├── sample_table_with_date.tsv │ │ │ │ │ └── tables │ │ │ │ │ ├── 109.tsv │ │ │ │ │ ├── 590.csv │ │ │ │ │ ├── 590.tsv │ │ │ │ │ ├── 622.csv │ │ │ │ │ └── 622.tsv │ │ │ ├── decomposable_attention │ │ │ │ ├── experiment.json │ │ │ │ └── serialization │ │ │ │ │ ├── best.th │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ └── vocabulary │ │ │ │ │ ├── labels.txt │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ └── tokens.txt │ │ │ ├── dialog_qa │ │ │ │ ├── experiment.json │ │ │ │ └── serialization │ │ │ │ │ ├── best.th │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ └── vocabulary │ │ │ │ │ ├── answer_tags.txt │ │ │ │ │ ├── followup_labels.txt │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ └── yesno_labels.txt │ │ │ ├── elmo │ │ │ │ ├── config │ │ │ │ │ └── characters_token_embedder.json │ │ │ │ ├── elmo_token_embeddings.hdf5 │ │ │ │ ├── lm_embeddings_0.hdf5 │ │ │ │ ├── lm_embeddings_1.hdf5 │ │ │ │ ├── lm_embeddings_2.hdf5 │ │ │ │ ├── lm_weights.hdf5 │ │ │ │ ├── options.json │ │ │ │ ├── sentences.json │ │ │ │ └── vocab_test.txt │ │ │ ├── embeddings │ │ │ │ ├── fake_embeddings.5d.txt │ │ │ │ ├── fake_embeddings.5d.txt.bz2 │ │ │ │ ├── fake_embeddings.5d.txt.gz │ │ │ │ ├── fake_embeddings.5d.txt.lzma │ │ │ │ ├── fake_embeddings.5d.txt.tar.gz │ │ │ │ ├── fake_embeddings.5d.txt.zip │ │ │ │ ├── glove.6B.100d.sample.txt.gz │ │ │ │ ├── glove.6B.300d.sample.txt.gz │ │ │ │ ├── multi-file-archive.tar.gz │ │ │ │ └── multi-file-archive.zip │ │ │ ├── encoder_decoder │ │ │ │ ├── copynet_seq2seq │ │ │ │ │ ├── experiment.json │ │ │ │ │ └── serialization │ │ │ │ │ │ ├── best.th │ │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ │ └── vocabulary │ │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ │ ├── source_tokens.txt │ │ │ │ │ │ └── target_tokens.txt │ │ │ │ └── simple_seq2seq │ │ │ │ │ ├── experiment.json │ │ │ │ │ └── serialization │ │ │ │ │ ├── best.th │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ └── vocabulary │ │ │ │ │ ├── dependencies.txt │ │ │ │ │ ├── ner.txt │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ ├── pos.txt │ │ │ │ │ ├── source_tokens.txt │ │ │ │ │ └── target_tokens.txt │ │ │ ├── esim │ │ │ │ └── experiment.json │ │ │ ├── event2mind │ │ │ │ ├── experiment.json │ │ │ │ └── serialization │ │ │ │ │ └── model.tar.gz │ │ │ ├── graph_parser │ │ │ │ └── experiment.json │ │ │ ├── language_model │ │ │ │ ├── bidirectional_lm_characters_token_embedder.jsonnet │ │ │ │ ├── bidirectional_lm_characters_token_embedder_without_bos_eos.jsonnet │ │ │ │ ├── characters_token_embedder.json │ │ │ │ ├── characters_token_embedder_without_bos_eos.jsonnet │ │ │ │ ├── experiment.jsonnet │ │ │ │ ├── experiment_bidirectional.jsonnet │ │ │ │ ├── experiment_bidirectional_unsampled.jsonnet │ │ │ │ ├── experiment_multiprocessing_reader.jsonnet │ │ │ │ ├── experiment_transformer.jsonnet │ │ │ │ ├── experiment_unidirectional.jsonnet │ │ │ │ ├── experiment_unidirectional_transformer.jsonnet │ │ │ │ ├── experiment_unidirectional_unsampled.jsonnet │ │ │ │ ├── experiment_unsampled.jsonnet │ │ │ │ ├── model.tar.gz │ │ │ │ └── sentences.txt │ │ │ ├── language_modeling │ │ │ │ ├── shards │ │ │ │ │ ├── shard0 │ │ │ │ │ ├── shard1 │ │ │ │ │ ├── shard2 │ │ │ │ │ ├── shard3 │ │ │ │ │ ├── shard4 │ │ │ │ │ ├── shard5 │ │ │ │ │ ├── shard6 │ │ │ │ │ ├── shard7 │ │ │ │ │ ├── shard8 │ │ │ │ │ └── shard9 │ │ │ │ └── single_sentence.txt │ │ │ ├── naqanet │ │ │ │ └── experiment.json │ │ │ ├── open_information_extraction │ │ │ │ └── experiment.json │ │ │ ├── openai_transformer │ │ │ │ ├── config_large.jsonnet │ │ │ │ ├── config_small.jsonnet │ │ │ │ ├── expected_embeddings.hdf5 │ │ │ │ ├── indexed_text.json │ │ │ │ ├── text.txt │ │ │ │ └── transformer_small.tar.gz │ │ │ ├── qanet │ │ │ │ └── experiment.json │ │ │ ├── semantic_parsing │ │ │ │ ├── atis │ │ │ │ │ ├── experiment.json │ │ │ │ │ └── serialization │ │ │ │ │ │ ├── best.th │ │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ │ └── vocabulary │ │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ │ ├── rule_labels.txt │ │ │ │ │ │ └── tokens.txt │ │ │ │ ├── nlvr_coverage_semantic_parser │ │ │ │ │ ├── experiment.json │ │ │ │ │ ├── mml_init_experiment.json │ │ │ │ │ ├── serialization │ │ │ │ │ │ ├── best.th │ │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ │ └── vocabulary │ │ │ │ │ │ │ ├── denotations.txt │ │ │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ │ │ ├── rule_labels.txt │ │ │ │ │ │ │ └── tokens.txt │ │ │ │ │ └── ungrouped_experiment.json │ │ │ │ ├── nlvr_direct_semantic_parser │ │ │ │ │ ├── experiment.json │ │ │ │ │ └── serialization │ │ │ │ │ │ ├── best.th │ │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ │ └── vocabulary │ │ │ │ │ │ ├── denotations.txt │ │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ │ ├── rule_labels.txt │ │ │ │ │ │ └── tokens.txt │ │ │ │ ├── quarel │ │ │ │ │ ├── experiment.json │ │ │ │ │ ├── experiment_denotation_only.json │ │ │ │ │ ├── experiment_parser_elmo.json │ │ │ │ │ ├── experiment_parser_entity_bits.json │ │ │ │ │ ├── experiment_parser_friction.json │ │ │ │ │ ├── experiment_parser_friction_zeroshot.json │ │ │ │ │ ├── experiment_parser_w_tagger.json │ │ │ │ │ ├── experiment_parser_wdp_zeroshot.json │ │ │ │ │ ├── serialization │ │ │ │ │ │ ├── best.th │ │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ │ └── vocabulary │ │ │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ │ │ ├── rule_labels.txt │ │ │ │ │ │ │ └── tokens.txt │ │ │ │ │ ├── serialization_parser_zeroshot │ │ │ │ │ │ └── model.tar.gz │ │ │ │ │ ├── serialization_tagger │ │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ │ └── vocabulary │ │ │ │ │ │ │ ├── labels.txt │ │ │ │ │ │ │ └── non_padded_namespaces.txt │ │ │ │ │ ├── tagger │ │ │ │ │ │ ├── experiment.json │ │ │ │ │ │ └── serialization │ │ │ │ │ │ │ ├── best.th │ │ │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ │ │ └── vocabulary │ │ │ │ │ │ │ ├── labels.txt │ │ │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ │ │ └── tokens.txt │ │ │ │ │ └── zeroshot │ │ │ │ │ │ ├── experiment.json │ │ │ │ │ │ └── serialization │ │ │ │ │ │ ├── best.th │ │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ │ └── vocabulary │ │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ │ ├── rule_labels.txt │ │ │ │ │ │ └── tokens.txt │ │ │ │ ├── text2sql │ │ │ │ │ └── experiment.json │ │ │ │ └── wikitables │ │ │ │ │ ├── experiment-elmo-no-features.json │ │ │ │ │ ├── experiment-erm.json │ │ │ │ │ ├── experiment-mixture.json │ │ │ │ │ ├── experiment.json │ │ │ │ │ └── serialization │ │ │ │ │ ├── best.th │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ └── vocabulary │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ ├── rule_labels.txt │ │ │ │ │ └── tokens.txt │ │ │ ├── simple_tagger │ │ │ │ ├── experiment.json │ │ │ │ ├── experiment_with_regularization.json │ │ │ │ └── experiment_with_span_f1.json │ │ │ ├── srl │ │ │ │ ├── experiment.json │ │ │ │ └── serialization │ │ │ │ │ ├── best.th │ │ │ │ │ ├── model.tar.gz │ │ │ │ │ └── vocabulary │ │ │ │ │ ├── labels.txt │ │ │ │ │ ├── non_padded_namespaces.txt │ │ │ │ │ └── tokens.txt │ │ │ └── utf-8_sample │ │ │ │ ├── archives │ │ │ │ ├── utf-8.tar.bz2 │ │ │ │ ├── utf-8.tar.gz │ │ │ │ ├── utf-8.tar.lzma │ │ │ │ └── utf-8.zip │ │ │ │ ├── utf-8_sample.txt │ │ │ │ ├── utf-8_sample.txt.gz │ │ │ │ └── utf-8_sample.txt.zip │ │ ├── models │ │ │ ├── __init__.py │ │ │ ├── archival_test.py │ │ │ ├── atis_semantic_parser_test.py │ │ │ ├── basic_classifier_test.py │ │ │ ├── bert_for_classification_test.py │ │ │ ├── biaffine_dependency_parser_test.py │ │ │ ├── biattentive_classification_network_test.py │ │ │ ├── bidirectional_lm_test.py │ │ │ ├── bimpm_test.py │ │ │ ├── constituency_parser_test.py │ │ │ ├── coreference_resolution │ │ │ │ └── coref_test.py │ │ │ ├── crf_tagger_test.py │ │ │ ├── decomposable_attention_test.py │ │ │ ├── encoder_decoders │ │ │ │ ├── __init__.py │ │ │ │ ├── copynet_seq2seq_test.py │ │ │ │ └── simple_seq2seq_test.py │ │ │ ├── esim_test.py │ │ │ ├── event2mind_test.py │ │ │ ├── graph_parser_test.py │ │ │ ├── language_model_test.py │ │ │ ├── model_test.py │ │ │ ├── reading_comprehension │ │ │ │ ├── __init__.py │ │ │ │ ├── bidaf_ensemble_test.py │ │ │ │ ├── bidaf_test.py │ │ │ │ ├── dialog_qa_test.py │ │ │ │ ├── naqanet_test.py │ │ │ │ ├── qanet_test.py │ │ │ │ └── util_test.py │ │ │ ├── semantic_parsing │ │ │ │ ├── __init__.py │ │ │ │ ├── atis │ │ │ │ │ └── atis_grammar_statelet_test.py │ │ │ │ ├── nlvr │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── nlvr_coverage_semantic_parser_test.py │ │ │ │ │ └── nlvr_direct_semantic_parser_test.py │ │ │ │ ├── quarel │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── quarel_semantic_parser_test.py │ │ │ │ ├── text2sql_parser_test.py │ │ │ │ └── wikitables │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── wikitables_erm_semantic_parser_test.py │ │ │ │ │ └── wikitables_mml_semantic_parser_test.py │ │ │ ├── semantic_role_labeler_test.py │ │ │ ├── simple_tagger_test.py │ │ │ └── sniff_test.py │ │ ├── modules │ │ │ ├── __init__.py │ │ │ ├── attention │ │ │ │ ├── __init__.py │ │ │ │ ├── bilinear_attention_test.py │ │ │ │ ├── cosine_attention_test.py │ │ │ │ ├── dot_product_attention_test.py │ │ │ │ ├── legacy_attention_test.py │ │ │ │ └── linear_attention_test.py │ │ │ ├── augmented_lstm_test.py │ │ │ ├── bimpm_matching_test.py │ │ │ ├── conditional_random_field_test.py │ │ │ ├── elmo_test.py │ │ │ ├── encoder_base_test.py │ │ │ ├── feedforward_test.py │ │ │ ├── highway_test.py │ │ │ ├── lstm_cell_with_projection_test.py │ │ │ ├── masked_layer_norm_test.py │ │ │ ├── matrix_attention │ │ │ │ ├── __init__.py │ │ │ │ ├── bilinear_matrix_attention_test.py │ │ │ │ ├── cosine_matrix_attention_test.py │ │ │ │ ├── dot_product_matrix_attention_test.py │ │ │ │ ├── legacy_matrix_attention_test.py │ │ │ │ └── linear_matrix_attention_test.py │ │ │ ├── maxout_test.py │ │ │ ├── pruner_test.py │ │ │ ├── residual_with_layer_dropout_test.py │ │ │ ├── sampled_softmax_loss_test.py │ │ │ ├── scalar_mix_test.py │ │ │ ├── seq2seq_encoder_test.py │ │ │ ├── seq2seq_encoders │ │ │ │ ├── __init__.py │ │ │ │ ├── bidirectional_language_model_transformer_test.py │ │ │ │ ├── feedforward_encoder_test.py │ │ │ │ ├── gated_cnn_encoder_test.py │ │ │ │ ├── intra_sentence_attention_test.py │ │ │ │ ├── multi_head_self_attention_test.py │ │ │ │ ├── pass_through_encoder_test.py │ │ │ │ ├── pytorch_seq2seq_wrapper_test.py │ │ │ │ ├── qanet_encoder_test.py │ │ │ │ └── stacked_self_attention_test.py │ │ │ ├── seq2vec_encoder_test.py │ │ │ ├── seq2vec_encoders │ │ │ │ ├── __init__.py │ │ │ │ ├── boe_encoder_test.py │ │ │ │ ├── cnn_encoder_test.py │ │ │ │ ├── cnn_highway_encoder_test.py │ │ │ │ └── pytorch_seq2vec_wrapper_test.py │ │ │ ├── similarity_functions │ │ │ │ ├── __init__.py │ │ │ │ ├── bilinear_test.py │ │ │ │ ├── cosine_test.py │ │ │ │ ├── dot_product_test.py │ │ │ │ ├── linear_test.py │ │ │ │ └── multiheaded_test.py │ │ │ ├── span_extractors │ │ │ │ ├── __init__.py │ │ │ │ ├── bidirectional_endpoint_span_extractor_test.py │ │ │ │ ├── endpoint_span_extractor_test.py │ │ │ │ └── self_attentive_span_extractor_test.py │ │ │ ├── stacked_alternating_lstm_test.py │ │ │ ├── stacked_bidirectional_lstm_test.py │ │ │ ├── stacked_elmo_lstm_test.py │ │ │ ├── text_field_embedders │ │ │ │ ├── __init__.py │ │ │ │ └── basic_text_field_embedder_test.py │ │ │ ├── time_distributed_test.py │ │ │ └── token_embedders │ │ │ │ ├── __init__.py │ │ │ │ ├── bag_of_word_counts_token_embedder_test.py │ │ │ │ ├── bert_embedder_test.py │ │ │ │ ├── bidirectional_language_model_token_embedder_test.py │ │ │ │ ├── elmo_token_embedder_test.py │ │ │ │ ├── embedding_test.py │ │ │ │ ├── language_model_token_embedder_test.py │ │ │ │ ├── openai_transformer_embedder_test.py │ │ │ │ └── token_characters_encoder_test.py │ │ ├── nn │ │ │ ├── __init__.py │ │ │ ├── beam_search_test.py │ │ │ ├── chu_liu_edmonds_test.py │ │ │ ├── initializers_test.py │ │ │ ├── pretrained_model_initializer_test.py │ │ │ ├── regularizers_test.py │ │ │ └── util_test.py │ │ ├── predictors │ │ │ ├── __init__.py │ │ │ ├── atis_parser_test.py │ │ │ ├── biaffine_dependency_parser_test.py │ │ │ ├── bidaf_test.py │ │ │ ├── constituency_parser_test.py │ │ │ ├── coref_test.py │ │ │ ├── decomposable_attention_test.py │ │ │ ├── dialog_qa_test.py │ │ │ ├── event2mind_test.py │ │ │ ├── nlvr_parser_test.py │ │ │ ├── open_information_extraction_test.py │ │ │ ├── predictor_test.py │ │ │ ├── quarel_parser_test.py │ │ │ ├── seq2seq_test.py │ │ │ ├── srl_test.py │ │ │ ├── text_classifier_test.py │ │ │ └── wikitables_parser_test.py │ │ ├── semparse │ │ │ ├── __init__.py │ │ │ ├── action_space_walker_test.py │ │ │ ├── contexts │ │ │ │ ├── __init__.py │ │ │ │ ├── quarel_utils_test.py │ │ │ │ ├── table_question_context_test.py │ │ │ │ └── table_question_knowledge_graph_test.py │ │ │ ├── domain_languages │ │ │ │ ├── __init__.py │ │ │ │ ├── common │ │ │ │ │ └── date_test.py │ │ │ │ ├── domain_language_test.py │ │ │ │ ├── nlvr_language_test.py │ │ │ │ ├── quarel_language_test.py │ │ │ │ └── wikitables_language_test.py │ │ │ ├── executors │ │ │ │ ├── __init__.py │ │ │ │ ├── sql_executor_test.py │ │ │ │ └── wikitables_sempre_executor_test.py │ │ │ ├── type_declarations │ │ │ │ ├── __init__.py │ │ │ │ ├── type_declaration_test.py │ │ │ │ └── wikitables_lambda_dcs_test.py │ │ │ ├── util_test.py │ │ │ └── worlds │ │ │ │ ├── __init__.py │ │ │ │ ├── atis_world_test.py │ │ │ │ ├── text2sql_world_test.py │ │ │ │ ├── wikitables_world_test.py │ │ │ │ └── world_test.py │ │ ├── service │ │ │ ├── __init__.py │ │ │ ├── config_explorer_test.py │ │ │ └── server_simple_test.py │ │ ├── state_machines │ │ │ ├── __init__.py │ │ │ ├── beam_search_test.py │ │ │ ├── constrained_beam_search_test.py │ │ │ ├── simple_transition_system.py │ │ │ ├── states │ │ │ │ ├── __init__.py │ │ │ │ ├── grammar_statelet_test.py │ │ │ │ └── lambda_grammar_statelet_test.py │ │ │ ├── trainers │ │ │ │ ├── __init__.py │ │ │ │ ├── expected_risk_minimization_test.py │ │ │ │ └── maximum_marginal_likelihood_test.py │ │ │ ├── transition_functions │ │ │ │ ├── __init__.py │ │ │ │ └── basic_transition_function_test.py │ │ │ └── util_test.py │ │ ├── tools │ │ │ ├── __init__.py │ │ │ └── drop_eval_test.py │ │ ├── training │ │ │ ├── __init__.py │ │ │ ├── checkpointer_test.py │ │ │ ├── gan_trainer_test.py │ │ │ ├── learning_rate_schedulers │ │ │ │ ├── __init__.py │ │ │ │ ├── cosine_test.py │ │ │ │ ├── learning_rate_scheduler_test.py │ │ │ │ └── slanted_triangular_test.py │ │ │ ├── metrics │ │ │ │ ├── __init__.py │ │ │ │ ├── attachment_scores_test.py │ │ │ │ ├── auc_test.py │ │ │ │ ├── bleu_test.py │ │ │ │ ├── boolean_accuracy_test.py │ │ │ │ ├── categorical_accuracy_test.py │ │ │ │ ├── conll_coref_scores_test.py │ │ │ │ ├── covariance_test.py │ │ │ │ ├── entropy_test.py │ │ │ │ ├── evalb_bracketing_scorer_test.py │ │ │ │ ├── f1_measure_test.py │ │ │ │ ├── fbeta_measure_test.py │ │ │ │ ├── mean_absolute_error_test.py │ │ │ │ ├── pearson_correlation_test.py │ │ │ │ ├── sequence_accuracy_test.py │ │ │ │ ├── span_based_f1_measure_test.py │ │ │ │ ├── srl_eval_scorer_test.py │ │ │ │ └── unigram_recall_test.py │ │ │ ├── momentum_schedulers │ │ │ │ ├── __init__.py │ │ │ │ └── inverted_triangular_test.py │ │ │ ├── moving_average_test.py │ │ │ ├── multi_task_trainer_test.py │ │ │ ├── no_op_trainer_test.py │ │ │ ├── optimizer_test.py │ │ │ ├── trainer_test.py │ │ │ └── util_test.py │ │ └── tutorials │ │ │ ├── __init__.py │ │ │ └── tagger │ │ │ ├── __init__.py │ │ │ └── basic_allennlp_test.py │ ├── tools │ │ ├── EVALB │ │ │ ├── COLLINS.prm │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── bug │ │ │ │ ├── bug.gld │ │ │ │ ├── bug.rsl-new │ │ │ │ ├── bug.rsl-old │ │ │ │ └── bug.tst │ │ │ ├── evalb.c │ │ │ ├── new.prm │ │ │ ├── sample │ │ │ │ ├── sample.gld │ │ │ │ ├── sample.prm │ │ │ │ ├── sample.rsl │ │ │ │ └── sample.tst │ │ │ └── tgrep_proc.prl │ │ ├── __init__.py │ │ ├── archive_surgery.py │ │ ├── create_elmo_embeddings_from_vocab.py │ │ ├── drop_eval.py │ │ ├── inspect_cache.py │ │ ├── squad_eval.py │ │ ├── srl-eval.pl │ │ └── wikitables_evaluator.py │ ├── training │ │ ├── __init__.py │ │ ├── checkpointer.py │ │ ├── learning_rate_schedulers │ │ │ ├── __init__.py │ │ │ ├── cosine.py │ │ │ ├── learning_rate_scheduler.py │ │ │ ├── noam.py │ │ │ └── slanted_triangular.py │ │ ├── metric_tracker.py │ │ ├── metrics │ │ │ ├── __init__.py │ │ │ ├── attachment_scores.py │ │ │ ├── auc.py │ │ │ ├── average.py │ │ │ ├── bleu.py │ │ │ ├── boolean_accuracy.py │ │ │ ├── categorical_accuracy.py │ │ │ ├── conll_coref_scores.py │ │ │ ├── covariance.py │ │ │ ├── decode_span_based_f1_measure.py │ │ │ ├── drop_em_and_f1.py │ │ │ ├── entropy.py │ │ │ ├── evalb_bracketing_scorer.py │ │ │ ├── f1_measure.py │ │ │ ├── fbeta_measure.py │ │ │ ├── mean_absolute_error.py │ │ │ ├── mention_recall.py │ │ │ ├── metric.py │ │ │ ├── pearson_correlation.py │ │ │ ├── perplexity.py │ │ │ ├── sequence_accuracy.py │ │ │ ├── span_based_f1_measure.py │ │ │ ├── squad_em_and_f1.py │ │ │ ├── srl_eval_scorer.py │ │ │ └── unigram_recall.py │ │ ├── momentum_schedulers │ │ │ ├── __init__.py │ │ │ ├── inverted_triangular.py │ │ │ └── momentum_scheduler.py │ │ ├── moving_average.py │ │ ├── no_op_trainer.py │ │ ├── optimizers.py │ │ ├── scheduler.py │ │ ├── tensorboard_writer.py │ │ ├── trainer.py │ │ ├── trainer_base.py │ │ └── util.py │ └── version.py ├── codecov.yml ├── doc │ ├── Makefile │ ├── api │ │ ├── allennlp.commands.configure.rst │ │ ├── allennlp.commands.dry_run.rst │ │ ├── allennlp.commands.elmo.rst │ │ ├── allennlp.commands.evaluate.rst │ │ ├── allennlp.commands.find_learning_rate.rst │ │ ├── allennlp.commands.fine_tune.rst │ │ ├── allennlp.commands.make_vocab.rst │ │ ├── allennlp.commands.predict.rst │ │ ├── allennlp.commands.print_results.rst │ │ ├── allennlp.commands.rst │ │ ├── allennlp.commands.subcommand.rst │ │ ├── allennlp.commands.test_install.rst │ │ ├── allennlp.commands.train.rst │ │ ├── allennlp.common.checks.rst │ │ ├── allennlp.common.configuration.rst │ │ ├── allennlp.common.file_utils.rst │ │ ├── allennlp.common.from_params.rst │ │ ├── allennlp.common.params.rst │ │ ├── allennlp.common.registrable.rst │ │ ├── allennlp.common.rst │ │ ├── allennlp.common.tee_logger.rst │ │ ├── allennlp.common.testing.rst │ │ ├── allennlp.common.tqdm.rst │ │ ├── allennlp.common.util.rst │ │ ├── allennlp.data.dataset.rst │ │ ├── allennlp.data.dataset_readers.babi.rst │ │ ├── allennlp.data.dataset_readers.ccgbank.rst │ │ ├── allennlp.data.dataset_readers.conll2000.rst │ │ ├── allennlp.data.dataset_readers.conll2003.rst │ │ ├── allennlp.data.dataset_readers.copynet_seq2seq.rst │ │ ├── allennlp.data.dataset_readers.coreference_resolution.rst │ │ ├── allennlp.data.dataset_readers.dataset_reader.rst │ │ ├── allennlp.data.dataset_readers.dataset_utils.rst │ │ ├── allennlp.data.dataset_readers.event2mind.rst │ │ ├── allennlp.data.dataset_readers.interleaving_dataset_reader.rst │ │ ├── allennlp.data.dataset_readers.language_modeling.rst │ │ ├── allennlp.data.dataset_readers.multiprocess_dataset_reader.rst │ │ ├── allennlp.data.dataset_readers.ontonotes_ner.rst │ │ ├── allennlp.data.dataset_readers.penn_tree_bank.rst │ │ ├── allennlp.data.dataset_readers.quora_paraphrase.rst │ │ ├── allennlp.data.dataset_readers.reading_comprehension.rst │ │ ├── allennlp.data.dataset_readers.rst │ │ ├── allennlp.data.dataset_readers.semantic_dependency_parsing.rst │ │ ├── allennlp.data.dataset_readers.semantic_parsing.rst │ │ ├── allennlp.data.dataset_readers.semantic_parsing.wikitables.rst │ │ ├── allennlp.data.dataset_readers.semantic_role_labeling.rst │ │ ├── allennlp.data.dataset_readers.seq2seq.rst │ │ ├── allennlp.data.dataset_readers.sequence_tagging.rst │ │ ├── allennlp.data.dataset_readers.simple_language_modeling.rst │ │ ├── allennlp.data.dataset_readers.snli.rst │ │ ├── allennlp.data.dataset_readers.stanford_sentiment_tree_bank.rst │ │ ├── allennlp.data.dataset_readers.text_classification_json.rst │ │ ├── allennlp.data.dataset_readers.universal_dependencies.rst │ │ ├── allennlp.data.fields.rst │ │ ├── allennlp.data.instance.rst │ │ ├── allennlp.data.iterators.rst │ │ ├── allennlp.data.rst │ │ ├── allennlp.data.token_indexers.rst │ │ ├── allennlp.data.tokenizers.rst │ │ ├── allennlp.data.vocabulary.rst │ │ ├── allennlp.models.archival.rst │ │ ├── allennlp.models.basic_classifier.rst │ │ ├── allennlp.models.bert_for_classification.rst │ │ ├── allennlp.models.biaffine_dependency_parser.rst │ │ ├── allennlp.models.biattentive_classification_network.rst │ │ ├── allennlp.models.bimpm.rst │ │ ├── allennlp.models.constituency_parser.rst │ │ ├── allennlp.models.coreference_resolution.rst │ │ ├── allennlp.models.crf_tagger.rst │ │ ├── allennlp.models.decomposable_attention.rst │ │ ├── allennlp.models.encoder_decoders.rst │ │ ├── allennlp.models.ensemble.rst │ │ ├── allennlp.models.esim.rst │ │ ├── allennlp.models.event2mind.rst │ │ ├── allennlp.models.graph_parser.rst │ │ ├── allennlp.models.language_model.rst │ │ ├── allennlp.models.model.rst │ │ ├── allennlp.models.reading_comprehension.rst │ │ ├── allennlp.models.rst │ │ ├── allennlp.models.semantic_parsing.atis.rst │ │ ├── allennlp.models.semantic_parsing.nlvr.rst │ │ ├── allennlp.models.semantic_parsing.quarel.rst │ │ ├── allennlp.models.semantic_parsing.rst │ │ ├── allennlp.models.semantic_parsing.wikitables.rst │ │ ├── allennlp.models.semantic_role_labeler.rst │ │ ├── allennlp.models.simple_tagger.rst │ │ ├── allennlp.modules.attention.rst │ │ ├── allennlp.modules.augmented_lstm.rst │ │ ├── allennlp.modules.bimpm_matching.rst │ │ ├── allennlp.modules.conditional_random_field.rst │ │ ├── allennlp.modules.elmo.rst │ │ ├── allennlp.modules.elmo_lstm.rst │ │ ├── allennlp.modules.feedforward.rst │ │ ├── allennlp.modules.highway.rst │ │ ├── allennlp.modules.input_variational_dropout.rst │ │ ├── allennlp.modules.layer_norm.rst │ │ ├── allennlp.modules.lstm_cell_with_projection.rst │ │ ├── allennlp.modules.masked_layer_norm.rst │ │ ├── allennlp.modules.matrix_attention.rst │ │ ├── allennlp.modules.maxout.rst │ │ ├── allennlp.modules.openai_transformer.rst │ │ ├── allennlp.modules.pruner.rst │ │ ├── allennlp.modules.residual_with_layer_dropout.rst │ │ ├── allennlp.modules.rst │ │ ├── allennlp.modules.sampled_softmax_loss.rst │ │ ├── allennlp.modules.scalar_mix.rst │ │ ├── allennlp.modules.seq2seq_encoders.rst │ │ ├── allennlp.modules.seq2vec_encoders.rst │ │ ├── allennlp.modules.similarity_functions.rst │ │ ├── allennlp.modules.span_extractors.rst │ │ ├── allennlp.modules.stacked_alternating_lstm.rst │ │ ├── allennlp.modules.stacked_bidirectional_lstm.rst │ │ ├── allennlp.modules.text_field_embedders.rst │ │ ├── allennlp.modules.time_distributed.rst │ │ ├── allennlp.modules.token_embedders.rst │ │ ├── allennlp.nn.activations.rst │ │ ├── allennlp.nn.beam_search.rst │ │ ├── allennlp.nn.chu_liu_edmonds.rst │ │ ├── allennlp.nn.initializers.rst │ │ ├── allennlp.nn.regularizers.rst │ │ ├── allennlp.nn.rst │ │ ├── allennlp.nn.util.rst │ │ ├── allennlp.predictors.rst │ │ ├── allennlp.pretrained.rst │ │ ├── allennlp.semparse.contexts.rst │ │ ├── allennlp.semparse.domain_languages.rst │ │ ├── allennlp.semparse.executors.rst │ │ ├── allennlp.semparse.rst │ │ ├── allennlp.semparse.type_declarations.rst │ │ ├── allennlp.semparse.util.rst │ │ ├── allennlp.semparse.worlds.rst │ │ ├── allennlp.service.config_explorer.rst │ │ ├── allennlp.service.rst │ │ ├── allennlp.service.server_simple.rst │ │ ├── allennlp.state_machines.rst │ │ ├── allennlp.state_machines.states.rst │ │ ├── allennlp.state_machines.trainers.rst │ │ ├── allennlp.state_machines.transition_functions.rst │ │ ├── allennlp.tools.rst │ │ ├── allennlp.training.checkpointer.rst │ │ ├── allennlp.training.learning_rate_schedulers.rst │ │ ├── allennlp.training.metric_tracker.rst │ │ ├── allennlp.training.metrics.rst │ │ ├── allennlp.training.momentum_schedulers.rst │ │ ├── allennlp.training.moving_average.rst │ │ ├── allennlp.training.no_op_trainer.rst │ │ ├── allennlp.training.optimizers.rst │ │ ├── allennlp.training.rst │ │ ├── allennlp.training.scheduler.rst │ │ ├── allennlp.training.tensorboard_writer.rst │ │ ├── allennlp.training.trainer.rst │ │ ├── allennlp.training.trainer_base.rst │ │ └── allennlp.training.util.rst │ ├── conf.py │ ├── index.rst │ ├── static │ │ ├── allennlp-logo-dark.png │ │ └── custom.css │ └── templates │ │ └── layout.html ├── pytest.ini ├── requirements.txt ├── scripts │ ├── ai2-internal │ │ └── run_with_beaker.py │ ├── build_demo.py │ ├── cache_models.py │ ├── check_docs.py │ ├── check_large_files.sh │ ├── check_links.py │ ├── check_requirements_and_setup.py │ ├── compile_coref_data.sh │ ├── convert_openie_to_conll.py │ ├── examine_sql_coverage.py │ ├── mypy.sh │ ├── nlvr │ │ ├── generate_data_from_erm_model.py │ │ ├── get_nlvr_logical_forms.py │ │ ├── group_nlvr_worlds.py │ │ └── sed_commands.txt │ ├── pylint.sh │ ├── reformat_text2sql_data.py │ ├── regenerate_archived_models.py │ ├── train_fixtures.py │ ├── verify.py │ ├── wikitables │ │ ├── generate_data_from_erm_model.py │ │ ├── preprocess_data.py │ │ └── search_for_logical_forms.py │ └── write_srl_predictions_to_conll_format.py ├── setup.cfg ├── setup.py ├── training_config │ ├── atis_train.json │ ├── biattentive_classification_network.jsonnet │ ├── biattentive_classification_network_elmo.jsonnet │ ├── bidaf.jsonnet │ ├── bidaf_elmo.jsonnet │ ├── bidirectional_language_model.jsonnet │ ├── bimpm.jsonnet │ ├── constituency_parser.jsonnet │ ├── constituency_parser_elmo.jsonnet │ ├── constituency_parser_transformer_elmo.jsonnet │ ├── coref.jsonnet │ ├── decomposable_attention.jsonnet │ ├── dependency_parser.json │ ├── dialog_qa.jsonnet │ ├── esim.jsonnet │ ├── esim_elmo.jsonnet │ ├── event2mind.json │ ├── naqanet.jsonnet │ ├── ner.jsonnet │ ├── ner_elmo.jsonnet │ ├── qanet.jsonnet │ ├── quarel_parser_elmo.json │ ├── quarel_parser_zeroshot_elmo.json │ ├── quarel_tagger.json │ ├── semantic_dependencies.json │ ├── semantic_role_labeler.jsonnet │ ├── semantic_role_labeler_elmo.jsonnet │ ├── srl_elmo_5.5B.jsonnet │ └── wikitables_parser.jsonnet └── tutorials │ ├── Makefile │ ├── README.md │ ├── getting_started │ ├── laziness.md │ ├── predicting_paper_venues │ │ ├── best_paper.png │ │ ├── best_paper_pie.png │ │ ├── predicting_paper_venues_pt1.md │ │ └── predicting_paper_venues_pt2.md │ ├── semantic_parsing.md │ ├── semantic_parsing_example.png │ ├── using_pretrained_models.md │ └── walk_through_allennlp │ │ ├── configuration.md │ │ ├── creating_a_model.md │ │ ├── crf_tagger.json │ │ ├── simple_tagger.json │ │ └── training_and_evaluating.md │ ├── how_to │ ├── configurator_images │ │ ├── configurator.1.png │ │ ├── configurator.2.png │ │ ├── configurator.3.png │ │ ├── configurator.4.png │ │ └── configurator.5.png │ ├── create_a_configuration.md │ ├── debugging_images │ │ ├── attach_to_local_process.png │ │ ├── attach_to_process_1.png │ │ ├── attach_to_process_3.png │ │ ├── breakpoint.png │ │ ├── debug_debug.png │ │ ├── inspect_variable.png │ │ ├── vscode_breakpoint.png │ │ ├── vscode_call_stack.png │ │ ├── vscode_debug_icon.png │ │ ├── vscode_debugging_profile.png │ │ ├── vscode_start_debugging.png │ │ └── vscode_watched_variable.png │ ├── elmo.md │ ├── laziness.md │ ├── span_representations.md │ ├── training_transformer_elmo.md │ ├── using_a_debugger.md │ ├── visualization_images │ │ ├── action_detail.png │ │ ├── action_detail_2.png │ │ ├── bidaf_attention_demo.png │ │ ├── linking_scores.png │ │ ├── predicted_actions.png │ │ └── wikitables_overview.png │ └── visualizing_model_internals.md │ ├── misc │ └── migrating-to-0.4.0.md │ └── tagger │ ├── README.md │ ├── basic_allennlp.html │ ├── basic_allennlp.py │ ├── basic_pytorch.py │ ├── config_allennlp.py │ ├── convert.py │ ├── default-tutorial.html │ ├── exercise.jsonnet │ ├── experiment.jsonnet │ ├── simple_demo.png │ ├── training.txt │ └── validation.txt ├── ner ├── README.md ├── code │ ├── constraints.yml │ ├── create_configs.py │ ├── dataset.py │ ├── dual_decomposition_inference.py │ ├── dual_training.py │ ├── gan_trainer_hm.py │ ├── models.py │ ├── mtl_constraints.py │ ├── penalty.py │ ├── settings.py │ ├── time_taken.csv │ └── utils.py ├── configs │ └── replicate │ │ ├── ner-pos-bs8-cw1-gan_supen.template │ │ ├── ner-pos-bs8-cw1-gan_supen.template_ifa1_ifb1_ddlr0.01_decay0_dlra1.jsonnet │ │ ├── ner-pos-bs8-cw1-gan_supen.template_ifa1_ifb1_ddlr0.05_decay0_dlra1.jsonnet │ │ ├── ner-pos-bs8-cw1-gan_supen.template_ifa1_ifb1_ddlr0.0_decay0_dlra1.jsonnet │ │ ├── ner-pos-bs8-cw1-gan_supen.template_ifa1_ifb1_ddlr0_decay0_dlra1.jsonnet │ │ ├── ner-pos-bs8-cw1-gan_supen.template_ifa1_ifb5_ddlr0.01_decay0_dlra1.jsonnet │ │ ├── ner-pos-bs8-cw1-gan_supen.template_ifa1_ifb5_ddlr0.05_decay0_dlra1.jsonnet │ │ ├── ner-pos-bs8-cw1-gan_supen_semi_min50p.template │ │ ├── ner-pos-bs8-cw1-gan_supen_semi_min50p.template_ifa1_ifb1_ddlr0.01_decay0_dlra1.jsonnet │ │ ├── ner-pos-bs8-cw1-gan_supen_semi_min50p.template_ifa1_ifb1_ddlr0.05_decay0_dlra1.jsonnet │ │ ├── ner-pos-bs8-cw1-gan_supen_semi_min50p.template_ifa1_ifb1_ddlr0_decay0_dlra1.jsonnet │ │ ├── ner-pos-bs8-cw1-gan_supen_semi_min50p.template_ifa1_ifb5_ddlr0.01_decay0_dlra1.jsonnet │ │ └── ner-pos-bs8-cw1-gan_supen_semi_min50p.template_ifa1_ifb5_ddlr0.05_decay0_dlra1.jsonnet └── requirements.txt ├── srl ├── README.md ├── code │ ├── create_configs.py │ ├── custom_span_based_f1_measure.py │ ├── custom_span_utils.py │ ├── dual_training.py │ ├── gan_trainer.py │ ├── helper.py │ ├── penalty.py │ ├── settings.py │ ├── srl_constraints_max_choice.py │ ├── srl_custom_dataset.py │ └── srl_custom_model.py ├── configs │ └── replicate_results │ │ ├── .constr_all_adadelta.template_wd0_dwd0_ifb10_lrd0_ddlr0.01_p1_rs42_gn3.5.jsonnet.swp │ │ ├── constr_all.template │ │ ├── constr_all.template_pct10_ne200_gn10.0_ddlr0.0_ifb0_dlra0.jsonnet │ │ ├── constr_all.template_pct10_ne200_gn3.5_ddlr0.05_ifb10_dlra1.jsonnet │ │ ├── constr_all.template_pct10_ne200_gn3.5_ddlr0.05_ifb10_dlra10.jsonnet │ │ ├── constr_all.template_pct10_ne200_gn3.5_ddlr0.05_ifb10_dlra5.jsonnet │ │ ├── constr_all.template_pct10_ne200_gn3.5_ddlr0.05_ifb1_dlra1.jsonnet │ │ ├── constr_all.template_pct10_ne200_gn3.5_ddlr0.05_ifb1_dlra10.jsonnet │ │ ├── constr_all.template_pct10_ne200_gn3.5_ddlr0.05_ifb1_dlra5.jsonnet │ │ ├── constr_all.template_pct1_ne250_gn10.0_ddlr0.0_ifb0_dlra0.jsonnet │ │ ├── constr_all.template_pct1_ne250_gn3.5_ddlr0.05_ifb10_dlra1.jsonnet │ │ ├── constr_all.template_pct1_ne250_gn3.5_ddlr0.05_ifb10_dlra10.jsonnet │ │ ├── constr_all.template_pct1_ne250_gn3.5_ddlr0.05_ifb10_dlra5.jsonnet │ │ ├── constr_all.template_pct1_ne250_gn3.5_ddlr0.05_ifb1_dlra1.jsonnet │ │ ├── constr_all.template_pct1_ne250_gn3.5_ddlr0.05_ifb1_dlra10.jsonnet │ │ ├── constr_all.template_pct1_ne250_gn3.5_ddlr0.05_ifb1_dlra5.jsonnet │ │ ├── constr_all.template_pct5_ne200_gn10.0_ddlr0.0_ifb0_dlra0.jsonnet │ │ ├── constr_all.template_pct5_ne200_gn3.5_ddlr0.05_ifb10_dlra1.jsonnet │ │ ├── constr_all.template_pct5_ne200_gn3.5_ddlr0.05_ifb10_dlra10.jsonnet │ │ ├── constr_all.template_pct5_ne200_gn3.5_ddlr0.05_ifb10_dlra5.jsonnet │ │ ├── constr_all.template_pct5_ne200_gn3.5_ddlr0.05_ifb1_dlra1.jsonnet │ │ ├── constr_all.template_pct5_ne200_gn3.5_ddlr0.05_ifb1_dlra10.jsonnet │ │ └── constr_all.template_pct5_ne200_gn3.5_ddlr0.05_ifb1_dlra5.jsonnet ├── eval_code │ ├── collate_with_metrics.py │ ├── eval_custom.py │ ├── get_violations.py │ └── srl-eval.pl └── requirements.txt └── typenet ├── README.md ├── environment.yml └── src ├── build_data.py ├── config.py ├── config_mil.py ├── constraints.py ├── data_iterator.py ├── dd_utils.py ├── deploy_mil_constraints.py ├── extract_scores_and_plot.py ├── general_utils.py ├── generate_commands_for_grid_search.py ├── model.py ├── penalty.py └── scheduler.py /README.md: -------------------------------------------------------------------------------- 1 | # Primal Dual Formulation for Deep Learning with Constraints 2 | 3 | This repo contains code (and data, whereever possible) used for replicating experiments in our Neurips 2019 paper: 'Primal Dual Formulation For Deep Learning With Constraints' 4 | 5 | We applied our algorithm on three different problems: Semantic Role Labeling, Named Entity Recognition and Fine Grained Entity Typing. 6 | Instructions to run the code for them are in their respective folders: srl, ner and typenet. 7 | 8 | -------------------------------------------------------------------------------- /allennlp/.dockerignore: -------------------------------------------------------------------------------- 1 | .dockerignore 2 | **.pyc 3 | **/__pycache__ 4 | .gitignore 5 | .git 6 | -------------------------------------------------------------------------------- /allennlp/.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **To Reproduce** 11 | Steps to reproduce the behavior 12 | 1. Go to '...' 13 | 2. Click on '....' 14 | 3. Scroll down to '....' 15 | 4. See error 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **System (please complete the following information):** 21 | - OS: [e.g. OSX, Linux] 22 | - Python version: [if it's not 3.6.1 or later, that's probably your problem] 23 | - AllenNLP version: [e.g. v0.8.3, or "I installed from master"] 24 | - PyTorch version: (if you installed it yourself) 25 | 26 | **Additional context** 27 | Add any other context about the problem here. 28 | -------------------------------------------------------------------------------- /allennlp/.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /allennlp/.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Ask about something you don't understand 4 | 5 | --- 6 | 7 | Please first search our GitHub repository for similar questions. If you don't find a similar example you can use the following template: 8 | 9 | **System (please complete the following information):** 10 | - OS: [e.g. OSX, Linux] 11 | - Python version: [e.g. 3.6.1] 12 | - AllenNLP version: [e.g. v0.8.3, or "I installed from master"] 13 | - PyTorch version: (if you installed it yourself) 14 | 15 | **Question** 16 | Ask about something you don't understand, such as: 17 | 18 | * How can I retrain my own ELMo language model? 19 | 20 | * I'm working on a sentiment classification task and I would like to discard sentences that are longer than 1200 characters (my sentences vary from 400 characters to 1400+). How can I configure my model to discard long sentences? 21 | -------------------------------------------------------------------------------- /allennlp/.gitignore: -------------------------------------------------------------------------------- 1 | # build artifacts 2 | 3 | .eggs/ 4 | .mypy_cache 5 | allennlp.egg-info/ 6 | build/ 7 | dist/ 8 | 9 | 10 | # dev tools 11 | 12 | .envrc 13 | .python-version 14 | .idea 15 | 16 | 17 | # jupyter notebooks 18 | 19 | .ipynb_checkpoints 20 | 21 | 22 | # miscellaneous 23 | 24 | .cache/ 25 | allennlp/tools/EVALB/evalb.dSYM/ 26 | doc/_build/ 27 | *.swp 28 | .DS_Store 29 | 30 | 31 | # python 32 | 33 | *.pyc 34 | *.pyo 35 | __pycache__ 36 | 37 | 38 | # testing and continuous integration 39 | 40 | .coverage 41 | .pytest_cache/ 42 | -------------------------------------------------------------------------------- /allennlp/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | include README.md 3 | include requirements.txt 4 | recursive-include allennlp * 5 | recursive-include scripts * 6 | recursive-include training_config *.json 7 | recursive-include tutorials * 8 | recursive-exclude * __pycache__ 9 | -------------------------------------------------------------------------------- /allennlp/allennlp/commands/subcommand.py: -------------------------------------------------------------------------------- 1 | """ 2 | Base class for subcommands under ``allennlp.run``. 3 | """ 4 | import argparse 5 | 6 | class Subcommand: 7 | """ 8 | An abstract class representing subcommands for allennlp.run. 9 | If you wanted to (for example) create your own custom `special-evaluate` command to use like 10 | 11 | ``allennlp special-evaluate ...`` 12 | 13 | you would create a ``Subcommand`` subclass and then pass it as an override to 14 | :func:`~allennlp.commands.main` . 15 | """ 16 | def add_subparser(self, name: str, parser: argparse._SubParsersAction) -> argparse.ArgumentParser: 17 | # pylint: disable=protected-access 18 | raise NotImplementedError 19 | -------------------------------------------------------------------------------- /allennlp/allennlp/common/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.common.from_params import FromParams 2 | from allennlp.common.params import Params 3 | from allennlp.common.registrable import Registrable 4 | from allennlp.common.tee_logger import TeeLogger 5 | from allennlp.common.tqdm import Tqdm 6 | from allennlp.common.util import JsonDict 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/common/testing/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Utilities and helpers for writing tests. 3 | """ 4 | from allennlp.common.testing.test_case import AllenNlpTestCase 5 | from allennlp.common.testing.model_test_case import ModelTestCase 6 | -------------------------------------------------------------------------------- /allennlp/allennlp/data/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.data.dataset_readers.dataset_reader import DatasetReader 2 | from allennlp.data.fields.field import DataArray, Field 3 | from allennlp.data.instance import Instance 4 | from allennlp.data.iterators.data_iterator import DataIterator 5 | from allennlp.data.token_indexers.token_indexer import TokenIndexer, TokenType 6 | from allennlp.data.tokenizers.token import Token 7 | from allennlp.data.tokenizers.tokenizer import Tokenizer 8 | from allennlp.data.vocabulary import Vocabulary 9 | -------------------------------------------------------------------------------- /allennlp/allennlp/data/dataset_readers/coreference_resolution/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Coreference resolution is defined as follows: given a document, find and cluster entity mentions. 3 | """ 4 | 5 | from allennlp.data.dataset_readers.coreference_resolution.conll import ConllCorefReader 6 | from allennlp.data.dataset_readers.coreference_resolution.winobias import WinobiasReader 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/data/dataset_readers/dataset_utils/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.data.dataset_readers.dataset_utils.ontonotes import Ontonotes 2 | from allennlp.data.dataset_readers.dataset_utils.ontonotes import OntonotesSentence 3 | from allennlp.data.dataset_readers.dataset_utils.span_utils import enumerate_spans 4 | from allennlp.data.dataset_readers.dataset_utils.span_utils import bio_tags_to_spans 5 | from allennlp.data.dataset_readers.dataset_utils.span_utils import to_bioul, iob1_to_bioul 6 | from allennlp.data.dataset_readers.dataset_utils.span_utils import bioul_tags_to_spans 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/data/dataset_readers/reading_comprehension/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Reading comprehension is loosely defined as follows: given a question and a passage of text that 3 | contains the answer, answer the question. 4 | 5 | These submodules contain readers for things that are predominantly reading comprehension datasets. 6 | """ 7 | 8 | from allennlp.data.dataset_readers.reading_comprehension.drop import DropReader 9 | from allennlp.data.dataset_readers.reading_comprehension.squad import SquadReader 10 | from allennlp.data.dataset_readers.reading_comprehension.quac import QuACReader 11 | from allennlp.data.dataset_readers.reading_comprehension.triviaqa import TriviaQaReader 12 | from allennlp.data.dataset_readers.reading_comprehension.qangaroo import QangarooReader 13 | -------------------------------------------------------------------------------- /allennlp/allennlp/data/dataset_readers/semantic_parsing/__init__.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=line-too-long 2 | from allennlp.data.dataset_readers.semantic_parsing.atis import AtisDatasetReader 3 | from allennlp.data.dataset_readers.semantic_parsing.nlvr import NlvrDatasetReader 4 | from allennlp.data.dataset_readers.semantic_parsing.wikitables.wikitables import WikiTablesDatasetReader 5 | from allennlp.data.dataset_readers.semantic_parsing.template_text2sql import TemplateText2SqlDatasetReader 6 | from allennlp.data.dataset_readers.semantic_parsing.grammar_based_text2sql import GrammarBasedText2SqlDatasetReader 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/data/dataset_readers/semantic_parsing/wikitables/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/data/dataset_readers/semantic_parsing/wikitables/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/data/fields/sequence_field.py: -------------------------------------------------------------------------------- 1 | from allennlp.data.fields.field import DataArray, Field 2 | 3 | 4 | class SequenceField(Field[DataArray]): 5 | """ 6 | A ``SequenceField`` represents a sequence of things. This class just adds a method onto 7 | ``Field``: :func:`sequence_length`. It exists so that ``SequenceLabelField``, ``IndexField`` and other 8 | similar ``Fields`` can have a single type to require, with a consistent API, whether they are 9 | pointing to words in a ``TextField``, items in a ``ListField``, or something else. 10 | """ 11 | def sequence_length(self) -> int: 12 | """ 13 | How many elements are there in this sequence? 14 | """ 15 | raise NotImplementedError 16 | 17 | def empty_field(self) -> 'SequenceField': 18 | raise NotImplementedError 19 | -------------------------------------------------------------------------------- /allennlp/allennlp/data/iterators/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | The various :class:`~allennlp.data.iterators.data_iterator.DataIterator` subclasses 3 | can be used to iterate over datasets with different batching and padding schemes. 4 | """ 5 | 6 | from allennlp.data.iterators.data_iterator import DataIterator 7 | from allennlp.data.iterators.basic_iterator import BasicIterator 8 | from allennlp.data.iterators.bucket_iterator import BucketIterator 9 | from allennlp.data.iterators.homogeneous_batch_iterator import HomogeneousBatchIterator 10 | from allennlp.data.iterators.multiprocess_iterator import MultiprocessIterator 11 | -------------------------------------------------------------------------------- /allennlp/allennlp/data/token_indexers/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | A ``TokenIndexer`` determines how string tokens get represented as arrays of indices in a model. 3 | """ 4 | 5 | from allennlp.data.token_indexers.dep_label_indexer import DepLabelIndexer 6 | from allennlp.data.token_indexers.ner_tag_indexer import NerTagIndexer 7 | from allennlp.data.token_indexers.pos_tag_indexer import PosTagIndexer 8 | from allennlp.data.token_indexers.single_id_token_indexer import SingleIdTokenIndexer 9 | from allennlp.data.token_indexers.token_characters_indexer import TokenCharactersIndexer 10 | from allennlp.data.token_indexers.token_indexer import TokenIndexer 11 | from allennlp.data.token_indexers.elmo_indexer import ELMoTokenCharactersIndexer 12 | from allennlp.data.token_indexers.openai_transformer_byte_pair_indexer import OpenaiTransformerBytePairIndexer 13 | from allennlp.data.token_indexers.wordpiece_indexer import WordpieceIndexer, PretrainedBertIndexer 14 | -------------------------------------------------------------------------------- /allennlp/allennlp/data/tokenizers/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | This module contains various classes for performing 3 | tokenization, stemming, and filtering. 4 | """ 5 | 6 | from allennlp.data.tokenizers.tokenizer import Token, Tokenizer 7 | from allennlp.data.tokenizers.word_tokenizer import WordTokenizer 8 | from allennlp.data.tokenizers.character_tokenizer import CharacterTokenizer 9 | from allennlp.data.tokenizers.sentence_splitter import SentenceSplitter 10 | -------------------------------------------------------------------------------- /allennlp/allennlp/models/coreference_resolution/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.models.coreference_resolution.coref import CoreferenceResolver 2 | -------------------------------------------------------------------------------- /allennlp/allennlp/models/encoder_decoders/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.models.encoder_decoders.simple_seq2seq import SimpleSeq2Seq 2 | from allennlp.models.encoder_decoders.copynet_seq2seq import CopyNetSeq2Seq 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/models/reading_comprehension/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Reading comprehension is loosely defined as follows: given a question and a passage of text that 3 | contains the answer, answer the question. 4 | 5 | These submodules contain models for things that are predominantly focused on reading comprehension. 6 | """ 7 | 8 | from allennlp.models.reading_comprehension.bidaf import BidirectionalAttentionFlow 9 | from allennlp.models.reading_comprehension.bidaf_ensemble import BidafEnsemble 10 | from allennlp.models.reading_comprehension.dialog_qa import DialogQA 11 | from allennlp.models.reading_comprehension.naqanet import NumericallyAugmentedQaNet 12 | from allennlp.models.reading_comprehension.qanet import QaNet 13 | -------------------------------------------------------------------------------- /allennlp/allennlp/models/semantic_parsing/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/models/semantic_parsing/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/models/semantic_parsing/atis/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/models/semantic_parsing/atis/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/models/semantic_parsing/nlvr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/models/semantic_parsing/nlvr/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/models/semantic_parsing/quarel/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/models/semantic_parsing/quarel/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/models/semantic_parsing/wikitables/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/models/semantic_parsing/wikitables/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/modules/attention/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.modules.attention.attention import Attention 2 | from allennlp.modules.attention.bilinear_attention import BilinearAttention 3 | from allennlp.modules.attention.cosine_attention import CosineAttention 4 | from allennlp.modules.attention.dot_product_attention import DotProductAttention 5 | from allennlp.modules.attention.legacy_attention import LegacyAttention 6 | from allennlp.modules.attention.linear_attention import LinearAttention 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/modules/attention/cosine_attention.py: -------------------------------------------------------------------------------- 1 | import torch 2 | from overrides import overrides 3 | from allennlp.modules.attention.legacy_attention import Attention 4 | 5 | 6 | @Attention.register("cosine") 7 | class CosineAttention(Attention): 8 | """ 9 | Computes attention between a vector and a matrix using cosine similarity. 10 | """ 11 | @overrides 12 | def _forward_internal(self, vector: torch.Tensor, matrix: torch.Tensor) -> torch.Tensor: 13 | a_norm = vector / (vector.norm(p=2, dim=-1, keepdim=True) + 1e-13) 14 | b_norm = matrix / (matrix.norm(p=2, dim=-1, keepdim=True) + 1e-13) 15 | return torch.bmm(a_norm.unsqueeze(dim=1), b_norm.transpose(-1, -2)).squeeze(1) 16 | -------------------------------------------------------------------------------- /allennlp/allennlp/modules/attention/dot_product_attention.py: -------------------------------------------------------------------------------- 1 | import torch 2 | from overrides import overrides 3 | from allennlp.modules.attention.legacy_attention import Attention 4 | 5 | 6 | @Attention.register("dot_product") 7 | class DotProductAttention(Attention): 8 | """ 9 | Computes attention between a vector and a matrix using dot product. 10 | """ 11 | @overrides 12 | def _forward_internal(self, vector: torch.Tensor, matrix: torch.Tensor) -> torch.Tensor: 13 | return matrix.bmm(vector.unsqueeze(-1)).squeeze(-1) 14 | -------------------------------------------------------------------------------- /allennlp/allennlp/modules/matrix_attention/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.modules.matrix_attention.matrix_attention import MatrixAttention 2 | from allennlp.modules.matrix_attention.bilinear_matrix_attention import BilinearMatrixAttention 3 | from allennlp.modules.matrix_attention.cosine_matrix_attention import CosineMatrixAttention 4 | from allennlp.modules.matrix_attention.dot_product_matrix_attention import DotProductMatrixAttention 5 | from allennlp.modules.matrix_attention.legacy_matrix_attention import LegacyMatrixAttention 6 | from allennlp.modules.matrix_attention.linear_matrix_attention import LinearMatrixAttention 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/modules/matrix_attention/cosine_matrix_attention.py: -------------------------------------------------------------------------------- 1 | import torch 2 | from overrides import overrides 3 | 4 | from allennlp.modules.matrix_attention.matrix_attention import MatrixAttention 5 | 6 | 7 | @MatrixAttention.register("cosine") 8 | class CosineMatrixAttention(MatrixAttention): 9 | """ 10 | Computes attention between every entry in matrix_1 with every entry in matrix_2 using cosine 11 | similarity. 12 | """ 13 | 14 | @overrides 15 | def forward(self, matrix_1: torch.Tensor, matrix_2: torch.Tensor) -> torch.Tensor: 16 | a_norm = matrix_1 / (matrix_1.norm(p=2, dim=-1, keepdim=True) + 1e-13) 17 | b_norm = matrix_2 / (matrix_2.norm(p=2, dim=-1, keepdim=True) + 1e-13) 18 | return torch.bmm(a_norm, b_norm.transpose(-1, -2)) 19 | -------------------------------------------------------------------------------- /allennlp/allennlp/modules/matrix_attention/dot_product_matrix_attention.py: -------------------------------------------------------------------------------- 1 | import torch 2 | from overrides import overrides 3 | 4 | from allennlp.modules.matrix_attention.matrix_attention import MatrixAttention 5 | 6 | 7 | @MatrixAttention.register("dot_product") 8 | class DotProductMatrixAttention(MatrixAttention): 9 | """ 10 | Computes attention between every entry in matrix_1 with every entry in matrix_2 using a dot 11 | product. 12 | """ 13 | 14 | @overrides 15 | def forward(self, matrix_1: torch.Tensor, matrix_2: torch.Tensor) -> torch.Tensor: 16 | return matrix_1.bmm(matrix_2.transpose(2, 1)) 17 | -------------------------------------------------------------------------------- /allennlp/allennlp/modules/matrix_attention/matrix_attention.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | from allennlp.common.registrable import Registrable 4 | 5 | 6 | class MatrixAttention(torch.nn.Module, Registrable): 7 | """ 8 | ``MatrixAttention`` takes two matrices as input and returns a matrix of attentions. 9 | 10 | We compute the similarity between each row in each matrix and return unnormalized similarity 11 | scores. Because these scores are unnormalized, we don't take a mask as input; it's up to the 12 | caller to deal with masking properly when this output is used. 13 | 14 | Input: 15 | - matrix_1: ``(batch_size, num_rows_1, embedding_dim_1)`` 16 | - matrix_2: ``(batch_size, num_rows_2, embedding_dim_2)`` 17 | 18 | Output: 19 | - ``(batch_size, num_rows_1, num_rows_2)`` 20 | """ 21 | def forward(self, # pylint: disable=arguments-differ 22 | matrix_1: torch.Tensor, 23 | matrix_2: torch.Tensor) -> torch.Tensor: 24 | raise NotImplementedError 25 | -------------------------------------------------------------------------------- /allennlp/allennlp/modules/similarity_functions/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | A ``SimilarityFunction`` takes a pair of tensors with the same shape, and computes a similarity 3 | function on the vectors in the last dimension. 4 | """ 5 | from allennlp.modules.similarity_functions.bilinear import BilinearSimilarity 6 | from allennlp.modules.similarity_functions.cosine import CosineSimilarity 7 | from allennlp.modules.similarity_functions.dot_product import DotProductSimilarity 8 | from allennlp.modules.similarity_functions.linear import LinearSimilarity 9 | from allennlp.modules.similarity_functions.multiheaded import MultiHeadedSimilarity 10 | from allennlp.modules.similarity_functions.similarity_function import SimilarityFunction 11 | -------------------------------------------------------------------------------- /allennlp/allennlp/modules/similarity_functions/cosine.py: -------------------------------------------------------------------------------- 1 | from overrides import overrides 2 | import torch 3 | 4 | from allennlp.modules.similarity_functions.similarity_function import SimilarityFunction 5 | 6 | 7 | @SimilarityFunction.register("cosine") 8 | class CosineSimilarity(SimilarityFunction): 9 | """ 10 | This similarity function simply computes the cosine similarity between each pair of vectors. It has 11 | no parameters. 12 | """ 13 | @overrides 14 | def forward(self, tensor_1: torch.Tensor, tensor_2: torch.Tensor) -> torch.Tensor: 15 | normalized_tensor_1 = tensor_1 / tensor_1.norm(dim=-1, keepdim=True) 16 | normalized_tensor_2 = tensor_2 / tensor_2.norm(dim=-1, keepdim=True) 17 | return (normalized_tensor_1 * normalized_tensor_2).sum(dim=-1) 18 | -------------------------------------------------------------------------------- /allennlp/allennlp/modules/span_extractors/__init__.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=line-too-long 2 | from allennlp.modules.span_extractors.span_extractor import SpanExtractor 3 | from allennlp.modules.span_extractors.endpoint_span_extractor import EndpointSpanExtractor 4 | from allennlp.modules.span_extractors.self_attentive_span_extractor import SelfAttentiveSpanExtractor 5 | from allennlp.modules.span_extractors.bidirectional_endpoint_span_extractor import BidirectionalEndpointSpanExtractor 6 | -------------------------------------------------------------------------------- /allennlp/allennlp/modules/text_field_embedders/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | A :class:`~allennlp.modules.text_field_embedders.text_field_embedder.TextFieldEmbedder` 3 | is a ``Module`` that takes as input the ``dict`` of NumPy arrays 4 | produced by a :class:`~allennlp.data.fields.text_field.TextField` and 5 | returns as output an embedded representation of the tokens in that field. 6 | """ 7 | 8 | from allennlp.modules.text_field_embedders.text_field_embedder import TextFieldEmbedder 9 | from allennlp.modules.text_field_embedders.basic_text_field_embedder import BasicTextFieldEmbedder 10 | -------------------------------------------------------------------------------- /allennlp/allennlp/nn/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.nn.activations import Activation 2 | from allennlp.nn.initializers import Initializer, InitializerApplicator 3 | from allennlp.nn.regularizers import RegularizerApplicator 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/nn/regularizers/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | This module contains classes representing regularization schemes 3 | as well as a class for applying regularization to parameters. 4 | """ 5 | 6 | from allennlp.nn.regularizers.regularizer import Regularizer 7 | from allennlp.nn.regularizers.regularizers import L1Regularizer 8 | from allennlp.nn.regularizers.regularizers import L2Regularizer 9 | from allennlp.nn.regularizers.regularizer_applicator import RegularizerApplicator 10 | -------------------------------------------------------------------------------- /allennlp/allennlp/nn/regularizers/regularizer.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | from allennlp.common import Registrable 4 | 5 | class Regularizer(Registrable): 6 | """ 7 | An abstract class representing a regularizer. It must implement 8 | call, returning a scalar tensor. 9 | """ 10 | default_implementation = 'l2' 11 | 12 | def __call__(self, parameter: torch.Tensor) -> torch.Tensor: 13 | raise NotImplementedError 14 | -------------------------------------------------------------------------------- /allennlp/allennlp/nn/regularizers/regularizers.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | from allennlp.nn.regularizers.regularizer import Regularizer 4 | 5 | 6 | @Regularizer.register("l1") 7 | class L1Regularizer(Regularizer): 8 | """Represents a penalty proportional to the sum of the absolute values of the parameters""" 9 | 10 | def __init__(self, alpha: float = 0.01) -> None: 11 | self.alpha = alpha 12 | 13 | def __call__(self, parameter: torch.Tensor) -> torch.Tensor: 14 | return self.alpha * torch.sum(torch.abs(parameter)) 15 | 16 | 17 | @Regularizer.register("l2") 18 | class L2Regularizer(Regularizer): 19 | """Represents a penalty proportional to the sum of squared values of the parameters""" 20 | 21 | def __init__(self, alpha: float = 0.01) -> None: 22 | self.alpha = alpha 23 | 24 | def __call__(self, parameter: torch.Tensor) -> torch.Tensor: 25 | return self.alpha * torch.sum(torch.pow(parameter, 2)) 26 | -------------------------------------------------------------------------------- /allennlp/allennlp/predictors/atis_parser.py: -------------------------------------------------------------------------------- 1 | from overrides import overrides 2 | 3 | from allennlp.common.util import JsonDict 4 | from allennlp.data import Instance 5 | from allennlp.predictors.predictor import Predictor 6 | 7 | @Predictor.register('atis-parser') 8 | class AtisParserPredictor(Predictor): 9 | """ 10 | Predictor for the :class:`~allennlp.models.semantic_parsing.atis.AtisSemanticParser` model. 11 | """ 12 | @overrides 13 | def _json_to_instance(self, json_dict: JsonDict) -> Instance: 14 | """ 15 | Expects JSON that looks like ``{"utterance": "..."}``. 16 | """ 17 | utterance = json_dict["utterance"] 18 | return self._dataset_reader.text_to_instance([utterance]) 19 | -------------------------------------------------------------------------------- /allennlp/allennlp/predictors/seq2seq.py: -------------------------------------------------------------------------------- 1 | from overrides import overrides 2 | 3 | from allennlp.common.util import JsonDict 4 | from allennlp.data import Instance 5 | from allennlp.predictors.predictor import Predictor 6 | 7 | 8 | @Predictor.register('seq2seq') 9 | class Seq2SeqPredictor(Predictor): 10 | """ 11 | Predictor for sequence to sequence models, including 12 | :class:`~allennlp.models.encoder_decoder.simple_seq2seq` and 13 | :class:`~allennlp.models.encoder_decoder.copynet_seq2seq`. 14 | """ 15 | 16 | def predict(self, source: str) -> JsonDict: 17 | return self.predict_json({"source" : source}) 18 | 19 | @overrides 20 | def _json_to_instance(self, json_dict: JsonDict) -> Instance: 21 | """ 22 | Expects JSON that looks like ``{"source": "..."}``. 23 | """ 24 | source = json_dict["source"] 25 | return self._dataset_reader.text_to_instance(source) 26 | -------------------------------------------------------------------------------- /allennlp/allennlp/predictors/simple_seq2seq.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | from allennlp.data import DatasetReader 4 | from allennlp.models import Model 5 | from allennlp.predictors.predictor import Predictor 6 | from allennlp.predictors.seq2seq import Seq2SeqPredictor 7 | 8 | 9 | @Predictor.register('simple_seq2seq') 10 | class SimpleSeq2SeqPredictor(Seq2SeqPredictor): 11 | """ 12 | Predictor for the :class:`~allennlp.models.encoder_decoder.simple_seq2seq` model. 13 | """ 14 | def __init__(self, model: Model, dataset_reader: DatasetReader) -> None: 15 | super().__init__(model, dataset_reader) 16 | warnings.warn("The 'simple_seq2seq' predictor has been deprecated in favor of " 17 | "the 'seq2seq' predictor. This will be removed in version 0.10.", DeprecationWarning) 18 | -------------------------------------------------------------------------------- /allennlp/allennlp/predictors/text_classifier.py: -------------------------------------------------------------------------------- 1 | from overrides import overrides 2 | 3 | from allennlp.common.util import JsonDict 4 | from allennlp.data import Instance 5 | from allennlp.predictors.predictor import Predictor 6 | 7 | 8 | @Predictor.register('text_classifier') 9 | class TextClassifierPredictor(Predictor): 10 | """ 11 | Predictor for any model that takes in a sentence and returns 12 | a single class for it. In particular, it can be used with 13 | the :class:`~allennlp.models.basic_classifier.BasicClassifier` model 14 | """ 15 | def predict(self, sentence: str) -> JsonDict: 16 | return self.predict_json({"sentence": sentence}) 17 | 18 | @overrides 19 | def _json_to_instance(self, json_dict: JsonDict) -> Instance: 20 | """ 21 | Expects JSON that looks like ``{"sentence": "..."}``. 22 | Runs the underlying model, and adds the ``"label"`` to the output. 23 | """ 24 | sentence = json_dict["sentence"] 25 | return self._dataset_reader.text_to_instance(sentence) 26 | -------------------------------------------------------------------------------- /allennlp/allennlp/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import logging 3 | import os 4 | import sys 5 | 6 | if os.environ.get("ALLENNLP_DEBUG"): 7 | LEVEL = logging.DEBUG 8 | else: 9 | LEVEL = logging.INFO 10 | 11 | sys.path.insert(0, os.path.dirname(os.path.abspath(os.path.join(__file__, os.pardir)))) 12 | logging.basicConfig(format='%(asctime)s - %(levelname)s - %(name)s - %(message)s', 13 | level=LEVEL) 14 | 15 | from allennlp.commands import main # pylint: disable=wrong-import-position 16 | 17 | def run(): 18 | main(prog="allennlp") 19 | 20 | if __name__ == "__main__": 21 | run() 22 | -------------------------------------------------------------------------------- /allennlp/allennlp/semparse/contexts/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.semparse.contexts.table_question_knowledge_graph import TableQuestionKnowledgeGraph 2 | from allennlp.semparse.contexts.atis_sql_table_context import AtisSqlTableContext 3 | from allennlp.semparse.contexts.table_question_context import TableQuestionContext 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/semparse/domain_languages/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.semparse.domain_languages.domain_language import (DomainLanguage, ParsingError, 2 | ExecutionError, START_SYMBOL, 3 | predicate, predicate_with_side_args) 4 | from allennlp.semparse.domain_languages.nlvr_language import NlvrLanguage 5 | from allennlp.semparse.domain_languages.quarel_language import QuaRelLanguage 6 | from allennlp.semparse.domain_languages.wikitables_language import WikiTablesLanguage 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/semparse/domain_languages/common/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.semparse.domain_languages.common.date import Date 2 | -------------------------------------------------------------------------------- /allennlp/allennlp/semparse/executors/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Executors are classes that deterministically transform programs in domain specific languages 3 | into denotations. We have one executor defined for each language-domain pair that we handle. 4 | """ 5 | from allennlp.semparse.executors.wikitables_sempre_executor import WikiTablesSempreExecutor 6 | from allennlp.semparse.executors.sql_executor import SqlExecutor 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/semparse/type_declarations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/semparse/type_declarations/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/semparse/util.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | 4 | def lisp_to_nested_expression(lisp_string: str) -> List: 5 | """ 6 | Takes a logical form as a lisp string and returns a nested list representation of the lisp. 7 | For example, "(count (division first))" would get mapped to ['count', ['division', 'first']]. 8 | """ 9 | stack: List = [] 10 | current_expression: List = [] 11 | tokens = lisp_string.split() 12 | for token in tokens: 13 | while token[0] == '(': 14 | nested_expression: List = [] 15 | current_expression.append(nested_expression) 16 | stack.append(current_expression) 17 | current_expression = nested_expression 18 | token = token[1:] 19 | current_expression.append(token.replace(')', '')) 20 | while token[-1] == ')': 21 | current_expression = stack.pop() 22 | token = token[:-1] 23 | return current_expression[0] 24 | -------------------------------------------------------------------------------- /allennlp/allennlp/semparse/worlds/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.semparse.worlds.wikitables_world import WikiTablesWorld 2 | from allennlp.semparse.worlds.atis_world import AtisWorld 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/service/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/service/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/service/predictors/bidaf.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=unused-import 2 | import warnings 3 | 4 | from allennlp.predictors.bidaf import BidafPredictor 5 | 6 | warnings.warn("allennlp.service.predictors.* has been deprecated. " 7 | "Please use allennlp.predictors.*", FutureWarning) 8 | -------------------------------------------------------------------------------- /allennlp/allennlp/service/predictors/constituency_parser.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=unused-import 2 | import warnings 3 | 4 | from allennlp.predictors.constituency_parser import ConstituencyParserPredictor 5 | warnings.warn("allennlp.service.predictors.* has been deprecated. " 6 | "Please use allennlp.predictors.*", FutureWarning) 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/service/predictors/coref.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=unused-import 2 | import warnings 3 | 4 | from allennlp.predictors.coref import CorefPredictor 5 | warnings.warn("allennlp.service.predictors.* has been deprecated. " 6 | " Please use allennlp.predictors.*", FutureWarning) 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/service/predictors/decomposable_attention.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=unused-import 2 | import warnings 3 | 4 | from allennlp.predictors.decomposable_attention import DecomposableAttentionPredictor 5 | warnings.warn("allennlp.service.predictors.* has been deprecated." 6 | " Please use allennlp.predictors.*", FutureWarning) 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/service/predictors/nlvr_parser.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=unused-import 2 | import warnings 3 | 4 | from allennlp.predictors.nlvr_parser import NlvrParserPredictor 5 | warnings.warn("allennlp.service.predictors.* has been deprecated." 6 | " Please use allennlp.predictors.*", FutureWarning) 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/service/predictors/predictor.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=unused-import 2 | import warnings 3 | 4 | from allennlp.predictors.predictor import Predictor, DEFAULT_PREDICTORS 5 | warnings.warn("allennlp.service.predictors.* has been deprecated." 6 | " Please use allennlp.predictors.*", FutureWarning) 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/service/predictors/semantic_role_labeler.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=unused-import 2 | import warnings 3 | 4 | from allennlp.predictors.semantic_role_labeler import SemanticRoleLabelerPredictor 5 | warnings.warn("allennlp.service.predictors.* has been deprecated." 6 | " Please use allennlp.predictors.*", FutureWarning) 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/service/predictors/sentence_tagger.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=unused-import 2 | import warnings 3 | 4 | from allennlp.predictors.sentence_tagger import SentenceTaggerPredictor 5 | warnings.warn("allennlp.service.predictors.* has been deprecated." 6 | " Please use allennlp.predictors.*", FutureWarning) 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/service/predictors/simple_seq2seq.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=unused-import 2 | import warnings 3 | 4 | from allennlp.predictors.simple_seq2seq import SimpleSeq2SeqPredictor 5 | warnings.warn("allennlp.service.predictors.* has been deprecated. " 6 | " Please use allennlp.predictors.*", FutureWarning) 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/service/predictors/wikitables_parser.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=unused-import 2 | import warnings 3 | 4 | from allennlp.predictors.wikitables_parser import WikiTablesParserPredictor 5 | warnings.warn("allennlp.service.predictors.* has been deprecated." 6 | " Please use allennlp.predictors.*", FutureWarning) 7 | -------------------------------------------------------------------------------- /allennlp/allennlp/state_machines/trainers/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.state_machines.trainers.decoder_trainer import DecoderTrainer 2 | from allennlp.state_machines.trainers.expected_risk_minimization import ExpectedRiskMinimization 3 | from allennlp.state_machines.trainers.maximum_marginal_likelihood import MaximumMarginalLikelihood 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/commands/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/commands/test_install_test.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=invalid-name,no-self-use 2 | import os 3 | 4 | from allennlp.common.testing import AllenNlpTestCase 5 | from allennlp.commands.test_install import _get_module_root 6 | 7 | 8 | class TestTestInstall(AllenNlpTestCase): 9 | def test_get_module_root(self): 10 | """ 11 | When a user runs ``allennlp test-install``, we have no idea where 12 | they're running it from, so we do an ``os.chdir`` to the _module_ 13 | root in order to get all the paths in the fixtures to resolve properly. 14 | 15 | The logic within ``allennlp test-install`` is pretty hard to test in 16 | its entirety, so this test is verifies that the ``os.chdir`` component 17 | works properly by checking that we correctly find the path to 18 | ``os.chdir`` to. 19 | """ 20 | project_root = _get_module_root() 21 | assert os.path.exists(os.path.join(project_root, "tests")) 22 | assert os.path.exists(os.path.join(project_root, "run.py")) 23 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/common/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/common/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/data/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/data/dataset_readers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/data/dataset_readers/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/data/dataset_readers/reading_comprehension/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/data/dataset_readers/reading_comprehension/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/data/fields/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/data/fields/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/data/instance_test.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=no-self-use,invalid-name 2 | from allennlp.common.testing import AllenNlpTestCase 3 | from allennlp.data import Instance 4 | from allennlp.data.fields import TextField, LabelField 5 | from allennlp.data.tokenizers import Token 6 | 7 | class TestInstance(AllenNlpTestCase): 8 | def test_instance_implements_mutable_mapping(self): 9 | words_field = TextField([Token("hello")], {}) 10 | label_field = LabelField(1, skip_indexing=True) 11 | instance = Instance({"words": words_field, "labels": label_field}) 12 | 13 | assert instance["words"] == words_field 14 | assert instance["labels"] == label_field 15 | assert len(instance) == 2 16 | 17 | keys = {k for k, v in instance.items()} 18 | assert keys == {"words", "labels"} 19 | 20 | values = [v for k, v in instance.items()] 21 | assert words_field in values 22 | assert label_field in values 23 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/data/iterators/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/data/iterators/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/data/token_indexers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/data/token_indexers/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/data/tokenizers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/data/tokenizers/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/basic_classifier/experiment_seq2vec.jsonnet: -------------------------------------------------------------------------------- 1 | local COMMON = import 'common.jsonnet'; 2 | 3 | { 4 | "dataset_reader": COMMON['dataset_reader'], 5 | "datasets_for_vocab_creation": ["train"], 6 | "train_data_path": COMMON['train_data_path'], 7 | "validation_data_path": COMMON['train_data_path'], 8 | "model": { 9 | "type": "basic_classifier", 10 | "text_field_embedder": { 11 | "token_embedders": { 12 | "tokens": { 13 | "type": "embedding", 14 | "embedding_dim": 10, 15 | "trainable": true 16 | } 17 | } 18 | }, 19 | "seq2vec_encoder": { 20 | "type": "cnn", 21 | "num_filters": 8, 22 | "embedding_dim": 10, 23 | "output_dim": 16 24 | } 25 | }, 26 | "iterator": COMMON['iterator'], 27 | "trainer": COMMON['trainer'], 28 | } 29 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/basic_classifier/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/basic_classifier/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/basic_classifier/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/basic_classifier/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/basic_classifier/serialization/vocabulary/labels.txt: -------------------------------------------------------------------------------- 1 | neg 2 | pos 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/basic_classifier/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | *tags 2 | *labels 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/bert/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "vocab_size": 18, 3 | "hidden_size": 12, 4 | "num_hidden_layers": 2, 5 | "num_attention_heads": 3, 6 | "intermediate_size": 6, 7 | "hidden_act": "gelu", 8 | "hidden_dropout_prob": 0.1, 9 | "attention_probs_dropout_prob": 0.1, 10 | "max_position_embeddings": 64, 11 | "type_vocab_size": 2, 12 | "initializer_range": 0.02 13 | } 14 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/bert/vocab.txt: -------------------------------------------------------------------------------- 1 | [PAD] 2 | [UNK] 3 | the 4 | quick 5 | ##est 6 | brown 7 | fox 8 | ##iest 9 | jumped 10 | over 11 | ##zie 12 | ##st 13 | dog 14 | . 15 | lazy 16 | la 17 | [CLS] 18 | [SEP] 19 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/biaffine_dependency_parser/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/biaffine_dependency_parser/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/biaffine_dependency_parser/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/biaffine_dependency_parser/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/biaffine_dependency_parser/serialization/vocabulary/head_tags.txt: -------------------------------------------------------------------------------- 1 | punct 2 | case 3 | root 4 | obl 5 | compound 6 | advmod 7 | mark 8 | nsubj 9 | advcl 10 | cc 11 | conj 12 | flat 13 | nmod:poss 14 | det 15 | amod 16 | nmod 17 | nummod 18 | nsubj:pass 19 | aux:pass 20 | xcomp 21 | orphan 22 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/biaffine_dependency_parser/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | *labels 2 | *tags 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/biaffine_dependency_parser/serialization/vocabulary/pos.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | PROPN 3 | PUNCT 4 | ADP 5 | NOUN 6 | ADV 7 | PRON 8 | VERB 9 | ADJ 10 | SCONJ 11 | CCONJ 12 | NUM 13 | DET 14 | AUX 15 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/biaffine_dependency_parser/serialization/vocabulary/tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | What 3 | if 4 | Google 5 | ? 6 | - 7 | and 8 | Morphed 9 | Into 10 | GoogleOS 11 | expanded 12 | on 13 | its 14 | search 15 | engine 16 | ( 17 | now 18 | e-mail 19 | ) 20 | wares 21 | into 22 | a 23 | full 24 | fledged 25 | operating 26 | system 27 | [ 28 | via 29 | Microsoft 30 | Watch 31 | from 32 | Mary 33 | Jo 34 | Foley 35 | ] 36 | Over 37 | 300 38 | Iraqis 39 | are 40 | reported 41 | dead 42 | 500 43 | wounded 44 | in 45 | Fallujah 46 | alone 47 | . 48 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/bidaf/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/bidaf/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/bidaf/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/bidaf/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/bidaf/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | *labels 2 | *tags 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/constituency_parser/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/constituency_parser/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/constituency_parser/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/constituency_parser/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/constituency_parser/serialization/vocabulary/labels.txt: -------------------------------------------------------------------------------- 1 | NO-LABEL 2 | NP 3 | VP 4 | S 5 | S-VP 6 | ADVP 7 | SBAR 8 | PP 9 | ADJP 10 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/constituency_parser/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | *labels 2 | *tags 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/constituency_parser/serialization/vocabulary/tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | the 3 | to 4 | , 5 | UAL 6 | and 7 | other 8 | be 9 | him 10 | . 11 | Also 12 | because 13 | Chairman 14 | Stephen 15 | Wolf 16 | executives 17 | have 18 | joined 19 | pilots 20 | ' 21 | bid 22 | board 23 | might 24 | forced 25 | exclude 26 | from 27 | its 28 | deliberations 29 | in 30 | order 31 | fair 32 | bidders 33 | That 34 | could 35 | cost 36 | chance 37 | influence 38 | outcome 39 | perhaps 40 | join 41 | winning 42 | bidder 43 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/coref/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/coref/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/coref/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/coref/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/coref/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | *labels 2 | *tags 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/coref/serialization/vocabulary/tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | . 3 | Hong 4 | Kong 5 | the 6 | of 7 | , 8 | to 9 | The 10 | a 11 | people 12 | have 13 | - 14 | will 15 | is 16 | resources 17 | In 18 | summer 19 | 2005 20 | picture 21 | that 22 | long 23 | been 24 | looking 25 | forward 26 | started 27 | emerging 28 | with 29 | frequency 30 | in 31 | various 32 | major 33 | media 34 | With 35 | their 36 | unique 37 | charm 38 | these 39 | well 40 | known 41 | cartoon 42 | images 43 | once 44 | again 45 | caused 46 | be 47 | focus 48 | worldwide 49 | attention 50 | world 51 | 's 52 | fifth 53 | Disney 54 | park 55 | soon 56 | open 57 | public 58 | here 59 | area 60 | only 61 | one 62 | thousand 63 | plus 64 | square 65 | kilometers 66 | population 67 | dense 68 | Natural 69 | are 70 | relatively 71 | scarce 72 | However 73 | clever 74 | utilize 75 | all 76 | they 77 | created 78 | for 79 | developing 80 | tourism 81 | industry 82 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/coref/winobias.sample: -------------------------------------------------------------------------------- 1 | The designer argued with [the developer] and slapped [her] in the face. 2 | [The salesperson] sold (some books) to the librarian because [she] was trying to sell (them). 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/babi.txt: -------------------------------------------------------------------------------- 1 | 1 Gertrude is a cat. 2 | 2 Cats are afraid of sheep. 3 | 3 Jessica is a sheep. 4 | 4 Mice are afraid of wolves. 5 | 5 Emily is a wolf. 6 | 6 Winona is a mouse. 7 | 7 Wolves are afraid of sheep. 8 | 8 Sheep are afraid of wolves. 9 | 9 What is Gertrude afraid of? sheep 1 2 10 | 10 What is Winona afraid of? wolf 4 6 11 | 11 What is Emily afraid of? sheep 5 7 12 | 12 What is Jessica afraid of? wolf 3 8 13 | 1 Mice are afraid of wolves. 14 | 2 Gertrude is a mouse. 15 | 3 Sheep are afraid of mice. 16 | 4 Winona is a cat. 17 | 5 Wolves are afraid of mice. 18 | 6 Emily is a sheep. 19 | 7 Jessica is a wolf. 20 | 8 Cats are afraid of mice. 21 | 9 What is Emily afraid of? mouse 3 6 22 | 10 What is Winona afraid of? mouse 4 8 23 | 11 What is Gertrude afraid of? wolf 1 2 24 | 12 What is Jessica afraid of? mouse 5 7 25 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/brown_corpus.txt: -------------------------------------------------------------------------------- 1 | 2 | cats/N are/V animals/N ./N 3 | 4 | 5 | dogs/N are/V animals/N ./N 6 | 7 | 8 | snakes/N are/V animals/N ./N 9 | 10 | 11 | birds/N are/V animals/N ./N 12 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/conll2003.txt: -------------------------------------------------------------------------------- 1 | -DOCSTART- -X- -X- O 2 | 3 | U.N. NNP I-NP I-ORG 4 | official NN I-NP O 5 | Ekeus NNP I-NP I-PER 6 | heads VBZ I-VP O 7 | for IN I-PP O 8 | Baghdad NNP I-NP I-LOC 9 | . . O O 10 | 11 | -DOCSTART- -X- -X- O 12 | 13 | AI2 NNP I-NP I-ORG 14 | engineer NN I-NP O 15 | Joel NNP I-NP I-PER 16 | lives VBZ I-VP O 17 | in IN I-PP O 18 | Seattle NNP I-NP I-LOC 19 | . . O O 20 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/copynet/copyover.tsv: -------------------------------------------------------------------------------- 1 | these tokens should be copied over : hello world the tokens " hello world " were copied 2 | these should also be copied : copynet is cool the tokens " copynet is cool " were copied 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/copynet/source_vocab.txt: -------------------------------------------------------------------------------- 1 | these 0 2 | tokens 0 3 | should 0 4 | be 0 5 | copied 0 6 | over 0 7 | : 0 8 | hello 0 9 | word 0 10 | also 0 11 | copynet 0 12 | is 0 13 | cool 0 14 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/copynet/target_vocab.txt: -------------------------------------------------------------------------------- 1 | the 0 2 | tokens 0 3 | " 0 4 | were 0 5 | copied 0 6 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/event2mind_small.csv: -------------------------------------------------------------------------------- 1 | Source,Event,Xintent,Xemotion,Otheremotion,Xsent,Osent 2 | it_events,It is PersonX's favorite animal,"[""none""]","[""excited to see it"", ""happy"", ""lucky""]","[""none""]",,4.0 3 | rocstory,PersonX drives Person Y's truck,"[""to move"", ""to steal""]","[""grateful"", ""guilty""]","[""charitable"", ""enraged""]",3.0,5.0 4 | rocstory,PersonX gets PersonY's mother,"[""to be helpful""]","[""useful""]","[""grateful""]",3.0,4.0 5 | rocstory,PersonX drives Person Y's truck,"[""for fun""]","[""happy""]","[""like a good friend""]",3.0,5.0 6 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/example_ptb.trees: -------------------------------------------------------------------------------- 1 | (VROOT(S(ADVP(RB Also))(, ,)(SBAR-PRP(IN because)(S(NP-SBJ(NP(NNP UAL)(NNP Chairman)(NNP Stephen)(NNP Wolf))(CC and)(NP(JJ other)(NNP UAL)(NNS executives)))(VP(VBP have)(VP(VBN joined)(NP(NP(DT the)(NNS pilots)(POS '))(NN bid))))))(, ,)(NP-SBJ(DT the)(NN board))(VP(MD might)(VP(VB be)(VP(VBN forced)(S(VP(TO to)(VP(VB exclude)(NP(PRP him))(PP-CLR(IN from)(NP(PRP$ its)(NNS deliberations)))(SBAR-PRP(IN in)(NN order)(S(VP(TO to)(VP(VB be)(ADJP-PRD(JJ fair)(PP(TO to)(NP(JJ other)(NNS bidders))))))))))))))(. .))) 2 | (VROOT(S(NP-SBJ(DT That))(VP(MD could)(VP(VB cost)(NP(PRP him))(NP(DT the)(NN chance)(S(VP(TO to)(VP(VP(VB influence)(NP(DT the)(NN outcome)))(CC and)(VP(ADVP(RB perhaps))(VB join)(NP(DT the)(VBG winning)(NN bidder)))))))))(. .))) 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/language_modeling.txt: -------------------------------------------------------------------------------- 1 | This is a sentence for language modelling. 2 | Here's another one for extra language modelling. 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/quora_paraphrase.tsv: -------------------------------------------------------------------------------- 1 | 1 What should I do to avoid sleeping in class ? How do I not sleep in a boring class ? 50018 2 | 0 Do women support each other more than men do ? Do women need more compliments than men ? 126924 3 | 1 How can one root android devices ? How do I root an Android device ? 391187 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/seahorse_embeddings.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/data/seahorse_embeddings.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/seq2seq_copy.csv: -------------------------------------------------------------------------------- 1 | "this is a sentence","this is a sentence" 2 | "this is another","this is another" 3 | "all these sentences should get copied","all these sentences should get copied" 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/seq2seq_copy.tsv: -------------------------------------------------------------------------------- 1 | this is a sentence this is a sentence 2 | this is another this is another 3 | all these sentences should get copied all these sentences should get copied 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/seq2seq_max_marginal_likelihood.tsv: -------------------------------------------------------------------------------- 1 | thisisasentence this is a sentence thisis a sentence 2 | thisisanother this is another this isanother this1sanother 3 | allthesesentencesshouldgetcopied all these sentences should get copied 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/sequence_tagging.tsv: -------------------------------------------------------------------------------- 1 | cats###N are###V animals###N .###N 2 | dogs###N are###V animals###N .###N 3 | snakes###N are###V animals###N .###N 4 | birds###N are###V animals###N .###N 5 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/snli2.jsonl: -------------------------------------------------------------------------------- 1 | {"annotator_labels": ["neutral"],"captionID": "3416050480.jpg#4", "gold_label": "neutral", "pairID": "3416050480.jpg#4r1n", "sentence1": "A person on a horse jumps over a broken down airplane.", "sentence1_binary_parse": "( ( ( A person ) ( on ( a seahorse ) ) ) ( ( jumps ( over ( a ( broken ( down airplane ) ) ) ) ) . ) )", "sentence1_parse": "(ROOT (S (NP (NP (DT A) (NN person)) (PP (IN on) (NP (DT a) (NN seahorse)))) (VP (VBZ jumps) (PP (IN over) (NP (DT a) (JJ broken) (JJ down) (NN airplane)))) (. .)))", "sentence2": "A person is training his seahorse for a competition.", "sentence2_binary_parse": "( ( A person ) ( ( is ( ( training ( his horse ) ) ( for ( a competition ) ) ) ) . ) )", "sentence2_parse": "(ROOT (S (NP (DT A) (NN person)) (VP (VBZ is) (VP (VBG training) (NP (PRP$ his) (NN seahorse)) (PP (IN for) (NP (DT a) (NN competition))))) (. .)))"} 2 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/snli_vocab/labels.txt: -------------------------------------------------------------------------------- 1 | neutral 2 | contradiction 3 | entailment 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/snli_vocab/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | *tags 2 | *labels 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/snli_vocab/tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | a 3 | person 4 | . 5 | horse 6 | on 7 | jumps 8 | over 9 | broken 10 | down 11 | airplane 12 | is 13 | , 14 | training 15 | his 16 | for 17 | competition 18 | at 19 | diner 20 | ordering 21 | an 22 | omelette 23 | outdoors 24 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/srl/._nt_6401.gold_skel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/data/srl/._nt_6401.gold_skel -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/sst.txt: -------------------------------------------------------------------------------- 1 | (4 (2 (2 The) (2 actors)) (3 (4 (2 are) (3 fantastic)) (2 .))) 2 | (0 (2 It) (0 (1 (2 was) (0 terrible)) (2 .))) 3 | (2 (2 Chomp) (2 (2 chomp) (2 !))) 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/text2sql/restaurants-schema.csv: -------------------------------------------------------------------------------- 1 | Table, Field, Primary Key, Foreign Key, Type 2 | RESTAURANT, RESTAURANT_ID, y, n, int(11) 3 | RESTAURANT, NAME, n, n, varchar(255) 4 | RESTAURANT, FOOD_TYPE, n, n, varchar(255) 5 | RESTAURANT, CITY_NAME, n, y, varchar(255) 6 | RESTAURANT, RATING, n, n, "decimal(1,1)" 7 | -, -, -, -, - 8 | LOCATION, RESTAURANT_ID, y, y, int(11) 9 | LOCATION, HOUSE_NUMBER, n, n, int(11) 10 | LOCATION, STREET_NAME, n, n, varchar(255) 11 | LOCATION, CITY_NAME, n, y, varchar(255) 12 | -, -, -, -, - 13 | GEOGRAPHIC, CITY_NAME, y, n, varchar(255) 14 | GEOGRAPHIC, COUNTY, n, n, varchar(255) 15 | GEOGRAPHIC, REGION, n, n, varchar(255) 16 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/text2sql/restaurants.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/data/text2sql/restaurants.db -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/text_classification_json/ag_news_corpus.jsonl: -------------------------------------------------------------------------------- 1 | {"label":2,"text":"Memphis Rout Still Stings for No. 14 Louisville; Coach Petrino Vows to Have Team Better Prepared. NASHVILLE, Tenn. Nov 3, 2004 - Louisville #39;s 30-point loss at home to Memphis last season is still a painful memory for the Cardinals.","headline":"Memphis Rout Still Stings for Louisville"} 2 | {"label":2,"text":"AP - Eli Manning has replaced Kurt Warner as the New York Giants' starting quarterback.","headline":"Manning Replaces Warner As Giants QB (AP)"} 3 | {"label":4,"text":"A conference dedicated to online journalism explores the effect blogs have on news reporting. Some say they draw attention to under-reported stories. Others struggle to establish the credibility enjoyed by professionals.","headline":"Do Blogs Change the News?"} 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/text_classification_json/integer_labels.jsonl: -------------------------------------------------------------------------------- 1 | {"label": 0, "text": "This text has label 0"} 2 | {"label": 1, "text": "This text has label 1"} -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/triviaqa-sample.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/data/triviaqa-sample.tgz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/wikitables/dpd_output/nt-0.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/data/wikitables/dpd_output/nt-0.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/wikitables/dpd_output/nt-1.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/data/wikitables/dpd_output/nt-1.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/wikitables/dpd_output/nt-64.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/data/wikitables/dpd_output/nt-64.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/wikitables/lots_of_ors_example.examples: -------------------------------------------------------------------------------- 1 | (example (id nt-64) (utterance "how many districts are there in virginia?") (context (graph tables.TableKnowledgeGraph csv/204-csv/109.csv)) (targetValue (list (description "22")))) 2 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/wikitables/sample_data.examples: -------------------------------------------------------------------------------- 1 | (example (id nt-0) (utterance "what was the last year where this team was a part of the usl a-league?") (context (graph tables.TableKnowledgeGraph tables/590.csv)) (targetValue (list (description "2004")))) 2 | (example (id nt-1) (utterance "in what city did piotr's last 1st place finish occur?") (context (graph tables.TableKnowledgeGraph tables/622.csv)) (targetValue (list (description "Bangkok, Thailand")))) 3 | (example (id nt-2) (utterance "When did piotr's last 1st place finish occur?") (context (graph tables.TableKnowledgeGraph tables/622.csv)) (targetValue (list (description "2007")))) 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/wikitables/sample_table.tsv: -------------------------------------------------------------------------------- 1 | Year Division League Regular Season Playoffs Open Cup Avg. Attendance 2 | 2001 2 USL-A-League 4th, Western Quarterfinals Did not qualify 7,169 3 | 2005 2 USL First Division 5th Quarterfinals 4th Round 6,028 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/wikitables/sample_table_with_date.tsv: -------------------------------------------------------------------------------- 1 | Date Division League Regular Season Playoffs Open Cup Avg. Attendance 2 | January 2001 2 USL-A-League 4th, Western Quarterfinals Did not qualify 7,169 3 | March 2005 2 USL First Division 5th Quarterfinals 4th Round 6,028 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/wikitables/tables/590.csv: -------------------------------------------------------------------------------- 1 | "Year","Division","League","Regular Season","Playoffs","Open Cup","Avg. Attendance" 2 | "2001","2","USL A-League","4th, Western","Quarterfinals","Did not qualify","7,169" 3 | "2002","2","USL A-League","2nd, Pacific","1st Round","Did not qualify","6,260" 4 | "2003","2","USL A-League","3rd, Pacific","Did not qualify","Did not qualify","5,871" 5 | "2004","2","USL A-League","1st, Western","Quarterfinals","4th Round","5,628" 6 | "2005","2","USL First Division","5th","Quarterfinals","4th Round","6,028" 7 | "2006","2","USL First Division","11th","Did not qualify","3rd Round","5,575" 8 | "2007","2","USL First Division","2nd","Semifinals","2nd Round","6,851" 9 | "2008","2","USL First Division","11th","Did not qualify","1st Round","8,567" 10 | "2009","2","USL First Division","1st","Semifinals","3rd Round","9,734" 11 | "2010","2","USSF D-2 Pro League","3rd, USL (3rd)","Quarterfinals","3rd Round","10,727" 12 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/data/wikitables/tables/590.tsv: -------------------------------------------------------------------------------- 1 | Year Division League Regular Season Playoffs Open Cup Avg. Attendance 2 | 2001 2 USL A-League 4th, Western Quarterfinals Did not qualify 7,169 3 | 2002 2 USL A-League 2nd, Pacific 1st Round Did not qualify 6,260 4 | 2003 2 USL A-League 3rd, Pacific Did not qualify Did not qualify 5,871 5 | 2004 2 USL A-League 1st, Western Quarterfinals 4th Round 5,628 6 | 2005 2 USL First Division 5th Quarterfinals 4th Round 6,028 7 | 2006 2 USL First Division 11th Did not qualify 3rd Round 5,575 8 | 2007 2 USL First Division 2nd Semifinals 2nd Round 6,851 9 | 2008 2 USL First Division 11th Did not qualify 1st Round 8,567 10 | 2009 2 USL First Division 1st Semifinals 3rd Round 9,734 11 | 2010 2 USSF D-2 Pro League 3rd, USL (3rd) Quarterfinals 3rd Round 10,727 12 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/decomposable_attention/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/decomposable_attention/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/decomposable_attention/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/decomposable_attention/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/decomposable_attention/serialization/vocabulary/labels.txt: -------------------------------------------------------------------------------- 1 | neutral 2 | contradiction 3 | entailment 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/decomposable_attention/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | *labels 2 | *tags 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/decomposable_attention/serialization/vocabulary/tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | a 3 | person 4 | . 5 | horse 6 | on 7 | jumps 8 | over 9 | broken 10 | down 11 | airplane 12 | is 13 | , 14 | training 15 | his 16 | for 17 | competition 18 | at 19 | diner 20 | ordering 21 | an 22 | omelette 23 | outdoors 24 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/dialog_qa/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/dialog_qa/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/dialog_qa/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/dialog_qa/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/dialog_qa/serialization/vocabulary/answer_tags.txt: -------------------------------------------------------------------------------- 1 | O 2 | <1_in> 3 | <2_in> 4 | <1_start> 5 | <1_end> 6 | <2_start> 7 | <2_end> 8 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/dialog_qa/serialization/vocabulary/followup_labels.txt: -------------------------------------------------------------------------------- 1 | m 2 | y 3 | n 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/dialog_qa/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | *labels 2 | *tags 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/dialog_qa/serialization/vocabulary/yesno_labels.txt: -------------------------------------------------------------------------------- 1 | x 2 | y 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/elmo/elmo_token_embeddings.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/elmo/elmo_token_embeddings.hdf5 -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/elmo/lm_embeddings_0.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/elmo/lm_embeddings_0.hdf5 -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/elmo/lm_embeddings_1.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/elmo/lm_embeddings_1.hdf5 -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/elmo/lm_embeddings_2.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/elmo/lm_embeddings_2.hdf5 -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/elmo/lm_weights.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/elmo/lm_weights.hdf5 -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/elmo/options.json: -------------------------------------------------------------------------------- 1 | { 2 | "lstm": { 3 | "cell_clip": 3, 4 | "use_skip_connections": true, 5 | "n_layers": 2, 6 | "proj_clip": 3, 7 | "projection_dim": 16, 8 | "dim": 64 9 | }, 10 | "char_cnn": { 11 | "embedding": { 12 | "dim": 4 13 | }, 14 | "filters": [ 15 | [1, 4], 16 | [2, 8], 17 | [3, 16], 18 | [4, 32], 19 | [5, 64] 20 | ], 21 | "n_highway": 2, 22 | "n_characters": 262, 23 | "max_characters_per_token": 50, 24 | "activation": "relu" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/embeddings/fake_embeddings.5d.txt: -------------------------------------------------------------------------------- 1 | If 0.798 0.817 0.213 0.501 0.712 2 | you 0.723 0.626 0.850 0.024 0.715 3 | think 0.143 0.189 0.555 0.361 0.472 4 | are 0.095 0.023 0.760 0.773 0.501 5 | too 0.424 0.834 0.341 0.550 0.250 6 | small 0.072 0.154 0.410 0.436 0.417 7 | to 0.510 0.358 0.086 0.459 0.024 8 | make 0.878 0.651 0.044 0.264 0.872 9 | a 0.267 0.036 0.937 0.782 0.331 10 | difference 0.053 0.162 0.671 0.110 0.259 11 | try 0.929 0.813 0.396 0.053 0.049 12 | sleeping 0.991 0.532 0.972 0.165 0.203 13 | with 0.042 0.408 0.231 0.294 0.237 14 | mosquito 0.017 0.479 0.909 0.488 0.296 15 | àèìòù 1.0 2.0 3.0 4.0 5.0 16 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/embeddings/fake_embeddings.5d.txt.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/embeddings/fake_embeddings.5d.txt.bz2 -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/embeddings/fake_embeddings.5d.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/embeddings/fake_embeddings.5d.txt.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/embeddings/fake_embeddings.5d.txt.lzma: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/embeddings/fake_embeddings.5d.txt.lzma -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/embeddings/fake_embeddings.5d.txt.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/embeddings/fake_embeddings.5d.txt.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/embeddings/fake_embeddings.5d.txt.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/embeddings/fake_embeddings.5d.txt.zip -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/embeddings/glove.6B.100d.sample.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/embeddings/glove.6B.100d.sample.txt.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/embeddings/glove.6B.300d.sample.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/embeddings/glove.6B.300d.sample.txt.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/embeddings/multi-file-archive.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/embeddings/multi-file-archive.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/embeddings/multi-file-archive.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/embeddings/multi-file-archive.zip -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/encoder_decoder/copynet_seq2seq/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/encoder_decoder/copynet_seq2seq/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/encoder_decoder/copynet_seq2seq/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/encoder_decoder/copynet_seq2seq/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/encoder_decoder/copynet_seq2seq/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | *labels 2 | *tags 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/encoder_decoder/copynet_seq2seq/serialization/vocabulary/source_tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | these 3 | should 4 | be 5 | copied 6 | : 7 | tokens 8 | over 9 | hello 10 | also 11 | copynet 12 | is 13 | cool 14 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/encoder_decoder/copynet_seq2seq/serialization/vocabulary/target_tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | " 3 | the 4 | tokens 5 | were 6 | copied 7 | @COPY@ 8 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/encoder_decoder/simple_seq2seq/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/encoder_decoder/simple_seq2seq/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/encoder_decoder/simple_seq2seq/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/encoder_decoder/simple_seq2seq/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/encoder_decoder/simple_seq2seq/serialization/vocabulary/dependencies.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | NONE 3 | ROOT 4 | nsubj 5 | det 6 | attr 7 | predet 8 | nsubjpass 9 | aux 10 | auxpass 11 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/encoder_decoder/simple_seq2seq/serialization/vocabulary/ner.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | NONE 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/encoder_decoder/simple_seq2seq/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | *labels 2 | *tags 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/encoder_decoder/simple_seq2seq/serialization/vocabulary/pos.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | NONE 3 | DT 4 | VBZ 5 | NN 6 | PDT 7 | NNS 8 | MD 9 | VB 10 | VBN 11 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/encoder_decoder/simple_seq2seq/serialization/vocabulary/source_tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | @start@ 3 | @end@ 4 | this 5 | is 6 | a 7 | sentence 8 | another 9 | all 10 | these 11 | sentences 12 | should 13 | get 14 | copied 15 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/encoder_decoder/simple_seq2seq/serialization/vocabulary/target_tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | @start@ 3 | @end@ 4 | this 5 | is 6 | a 7 | sentence 8 | another 9 | all 10 | these 11 | sentences 12 | should 13 | get 14 | copied 15 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/event2mind/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/event2mind/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/language_model/bidirectional_lm_characters_token_embedder.jsonnet: -------------------------------------------------------------------------------- 1 | local config = import "characters_token_embedder.json"; 2 | 3 | config + { 4 | "model"+: { 5 | "text_field_embedder"+: { 6 | "token_embedders"+: { 7 | "elmo"+: { 8 | "type": "bidirectional_lm_token_embedder", 9 | } 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/language_model/bidirectional_lm_characters_token_embedder_without_bos_eos.jsonnet: -------------------------------------------------------------------------------- 1 | local config = import "bidirectional_lm_characters_token_embedder.jsonnet"; 2 | 3 | config + { 4 | "model"+: { 5 | "text_field_embedder"+: { 6 | "token_embedders"+: { 7 | "elmo"+: { 8 | "bos_eos_tokens": null, 9 | "remove_bos_eos": false 10 | } 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/language_model/characters_token_embedder_without_bos_eos.jsonnet: -------------------------------------------------------------------------------- 1 | local config = import "characters_token_embedder.json"; 2 | 3 | config + { 4 | "model"+: { 5 | "text_field_embedder"+: { 6 | "token_embedders"+: { 7 | "elmo"+: { 8 | "bos_eos_tokens": null, 9 | "remove_bos_eos": false 10 | } 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/language_model/experiment.jsonnet: -------------------------------------------------------------------------------- 1 | local config = import "experiment_unsampled.jsonnet"; 2 | 3 | config + { 4 | "model"+: { 5 | "num_samples": 10, 6 | "sparse_embeddings": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/language_model/experiment_bidirectional.jsonnet: -------------------------------------------------------------------------------- 1 | local config = import "experiment_bidirectional_unsampled.jsonnet"; 2 | 3 | config + { 4 | "model"+: { 5 | "num_samples": 10, 6 | "sparse_embeddings": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/language_model/experiment_bidirectional_unsampled.jsonnet: -------------------------------------------------------------------------------- 1 | local config = import "experiment_unsampled.jsonnet"; 2 | 3 | config + { 4 | "model"+: { 5 | "type": "bidirectional_language_model", 6 | // Hide the bidirectional field, since the bidirectional_language_model 7 | // does not accept it. 8 | bidirectional:: super.bidirectional, 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/language_model/experiment_transformer.jsonnet: -------------------------------------------------------------------------------- 1 | local config = import "experiment_unsampled.jsonnet"; 2 | 3 | config + { 4 | "model"+: { 5 | "num_samples": 10, 6 | "sparse_embeddings": true, 7 | "contextualizer": { 8 | "type": "bidirectional_language_model_transformer", 9 | "input_dim": 16, 10 | "hidden_dim": 7, 11 | "num_layers": 3, 12 | "dropout": 0.1, 13 | "input_dropout": 0.1 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/language_model/experiment_unidirectional.jsonnet: -------------------------------------------------------------------------------- 1 | local config = import "experiment_unidirectional_unsampled.jsonnet"; 2 | 3 | config + { 4 | "model"+: { 5 | "num_samples": 10, 6 | "sparse_embeddings": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/language_model/experiment_unidirectional_transformer.jsonnet: -------------------------------------------------------------------------------- 1 | local config = import "experiment_unidirectional_unsampled.jsonnet"; 2 | 3 | config + { 4 | "model"+: { 5 | "num_samples": 10, 6 | "sparse_embeddings": true, 7 | "contextualizer": { 8 | "type": "stacked_self_attention", 9 | "input_dim": 16, 10 | "hidden_dim": 20, 11 | "projection_dim": 6, 12 | "feedforward_hidden_dim": 5, 13 | "num_attention_heads": 3, 14 | "num_layers": 3, 15 | "dropout_prob": 0.1 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/language_model/experiment_unidirectional_unsampled.jsonnet: -------------------------------------------------------------------------------- 1 | local config = import "experiment_unsampled.jsonnet"; 2 | 3 | config + { 4 | "model"+: { 5 | "bidirectional": false, 6 | "contextualizer" +: { 7 | "bidirectional": false 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/language_model/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/language_model/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/language_model/sentences.txt: -------------------------------------------------------------------------------- 1 | This is the first sentence. 2 | This is yet another sentence. 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/language_modeling/single_sentence.txt: -------------------------------------------------------------------------------- 1 | The U.S. Centers for Disease Control and Prevention initially advised school systems to close if outbreaks occurred , then reversed itself , saying the apparent mildness of the virus meant most schools and day care centers should stay open , even if they had confirmed cases of swine flu . 2 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/openai_transformer/expected_embeddings.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/openai_transformer/expected_embeddings.hdf5 -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/openai_transformer/indexed_text.json: -------------------------------------------------------------------------------- 1 | [[249, 1925, 485, 6231, 246, 4121, 669, 1662, 939, 715, 1009, 995, 239, 861, 1081, 822, 37700, 606, 1925, 504, 20267, 239], [2703, 13819, 566, 2795, 525, 487, 980, 538, 999, 524, 1114, 589, 850, 239, 246, 267, 305, 285, 267, 67, 3906, 23, 18493, 13103, 43, 38380, 49, 50, 54, 53, 48, 31446, 13103, 43, 13103, 43, 13103, 43, 13103, 15870, 239]] -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/openai_transformer/text.txt: -------------------------------------------------------------------------------- 1 | I decided to rent a movie when friends came over last night. After looking through selections we decided on comedy. 2 | James realizes one afternoon that he hasn't left his house all day. A !@#!@OOVTOKEN 1234567890551231231231231. 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/openai_transformer/transformer_small.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/openai_transformer/transformer_small.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/atis/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/atis/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/atis/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/atis/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/atis/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | *labels 2 | *tags 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/atis/serialization/vocabulary/tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | the 3 | from 4 | to 5 | show 6 | me 7 | one 8 | way 9 | detroit 10 | westchester 11 | county 12 | are 13 | fare 14 | flight 15 | fares 16 | tacoma 17 | montreal 18 | flights 19 | what 20 | most 21 | expensive 22 | there 23 | with 24 | highest 25 | how 26 | many 27 | is 28 | prices 29 | of 30 | these 31 | all 32 | any 33 | other 34 | that 35 | salt 36 | lake 37 | city 38 | milwaukee 39 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/nlvr_coverage_semantic_parser/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/nlvr_coverage_semantic_parser/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/nlvr_coverage_semantic_parser/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/nlvr_coverage_semantic_parser/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/nlvr_coverage_semantic_parser/serialization/vocabulary/denotations.txt: -------------------------------------------------------------------------------- 1 | true 2 | false 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/nlvr_coverage_semantic_parser/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | denotations 2 | rule_labels 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/nlvr_coverage_semantic_parser/serialization/vocabulary/tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | a 3 | There 4 | is 5 | circle 6 | closely 7 | touching 8 | corner 9 | of 10 | box 11 | . 12 | are 13 | 2 14 | yellow 15 | blocks 16 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/nlvr_direct_semantic_parser/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/nlvr_direct_semantic_parser/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/nlvr_direct_semantic_parser/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/nlvr_direct_semantic_parser/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/nlvr_direct_semantic_parser/serialization/vocabulary/denotations.txt: -------------------------------------------------------------------------------- 1 | true 2 | false 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/nlvr_direct_semantic_parser/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | denotations 2 | rule_labels 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/nlvr_direct_semantic_parser/serialization/vocabulary/tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | a 3 | There 4 | is 5 | circle 6 | closely 7 | touching 8 | corner 9 | of 10 | box 11 | . 12 | are 13 | 2 14 | yellow 15 | blocks 16 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | actions 2 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/serialization/vocabulary/rule_labels.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | >> -> infer 3 | > -> and 4 | > -> acceleration 5 | > -> amountSweat 6 | > -> apparentSize 7 | > -> breakability 8 | > -> brightness 9 | > -> distance 10 | > -> exerciseIntensity 11 | > -> flexibility 12 | > -> friction 13 | > -> gravity 14 | > -> heat 15 | > -> loudness 16 | > -> mass 17 | > -> smoothness 18 | > -> speed 19 | > -> strength 20 | > -> thickness 21 | > -> time 22 | > -> weight 23 | @start@ -> n 24 | a -> [>, a, a] 25 | a -> [>, r, w] 26 | n -> [>>, a, a, a] 27 | r -> high 28 | r -> higher 29 | r -> low 30 | r -> lower 31 | w -> world1 32 | w -> world2 33 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/serialization/vocabulary/tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | the 3 | a 4 | . 5 | worldtwo 6 | is 7 | juan 8 | on 9 | worldone 10 | his 11 | arm 12 | when 13 | he 14 | answeroptiona 15 | answeroptionb 16 | placeholder 17 | car 18 | it 19 | , 20 | to 21 | was 22 | of 23 | because 24 | as 25 | drives 26 | up 27 | friction 28 | less 29 | in 30 | hospital 31 | stay 32 | strength 33 | healthy 34 | throw 35 | 's 36 | mike 37 | snowboarding 38 | and 39 | hit 40 | piece 41 | went 42 | much 43 | faster 44 | blankblank 45 | smoother 46 | gets 47 | very 48 | hot 49 | but 50 | stays 51 | cool 52 | warms 53 | has 54 | more 55 | injured 56 | accident 57 | which 58 | necessitates 59 | where 60 | unable 61 | maintain 62 | notices 63 | that 64 | throwing 65 | feels 66 | extremely 67 | frail 68 | compared 69 | level 70 | had 71 | if 72 | decides 73 | ball 74 | with 75 | friend 76 | will 77 | travel 78 | distance 79 | ? 80 | weak 81 | after 82 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/serialization_parser_zeroshot/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/serialization_parser_zeroshot/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/serialization_tagger/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/serialization_tagger/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/serialization_tagger/vocabulary/labels.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | O 3 | I-world 4 | B-world 5 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/serialization_tagger/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | actions 2 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/tagger/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/tagger/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/tagger/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/tagger/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/tagger/serialization/vocabulary/labels.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | O 3 | I-world 4 | B-world 5 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/tagger/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | actions 2 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/tagger/serialization/vocabulary/tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | the 3 | a 4 | . 5 | worldtwo 6 | is 7 | juan 8 | on 9 | worldone 10 | his 11 | arm 12 | when 13 | he 14 | answeroptiona 15 | answeroptionb 16 | car 17 | it 18 | , 19 | to 20 | was 21 | of 22 | because 23 | as 24 | drives 25 | up 26 | friction 27 | less 28 | in 29 | hospital 30 | stay 31 | strength 32 | healthy 33 | throw 34 | 's 35 | mike 36 | snowboarding 37 | and 38 | hit 39 | piece 40 | went 41 | much 42 | faster 43 | blankblank 44 | smoother 45 | gets 46 | very 47 | hot 48 | but 49 | stays 50 | cool 51 | warms 52 | has 53 | more 54 | injured 55 | accident 56 | which 57 | necessitates 58 | where 59 | unable 60 | maintain 61 | notices 62 | that 63 | throwing 64 | feels 65 | extremely 66 | frail 67 | compared 68 | level 69 | had 70 | if 71 | decides 72 | ball 73 | with 74 | friend 75 | will 76 | travel 77 | distance 78 | ? 79 | weak 80 | after 81 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/zeroshot/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/zeroshot/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/zeroshot/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/zeroshot/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/zeroshot/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | actions 2 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/quarel/zeroshot/serialization/vocabulary/rule_labels.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | >> -> infer 3 | > -> and 4 | > -> placeholder 5 | @start@ -> n 6 | a -> [>, a, a] 7 | a -> [>, r, w] 8 | n -> [>>, a, a, a] 9 | r -> high 10 | r -> higher 11 | r -> low 12 | r -> lower 13 | w -> world1 14 | w -> world2 15 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/wikitables/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/wikitables/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/wikitables/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/semantic_parsing/wikitables/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/wikitables/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | *labels 2 | *tags 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/semantic_parsing/wikitables/serialization/vocabulary/tokens.txt: -------------------------------------------------------------------------------- 1 | @@UNKNOWN@@ 2 | what 3 | was 4 | the 5 | last 6 | a 7 | ? 8 | year 9 | where 10 | this 11 | team 12 | part 13 | of 14 | usl 15 | - 16 | league 17 | in 18 | city 19 | did 20 | piotr 21 | 's 22 | 1st 23 | place 24 | finish 25 | occur 26 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/srl/serialization/best.th: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/srl/serialization/best.th -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/srl/serialization/model.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/srl/serialization/model.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/srl/serialization/vocabulary/labels.txt: -------------------------------------------------------------------------------- 1 | O 2 | I-ARG1 3 | B-V 4 | B-ARG1 5 | B-ARG0 6 | I-ARG2 7 | B-ARG2 8 | I-ARGM-TMP 9 | B-ARGM-TMP 10 | B-ARGM-DIS 11 | I-ARG0 12 | B-ARGM-NEG 13 | B-ARGM-MOD 14 | I-ARGM-MNR 15 | I-ARGM-DIS 16 | B-ARGM-MNR 17 | B-ARGM-ADV 18 | I-ARGM-PRP 19 | I-ARGM-ADV 20 | B-ARG3 21 | I-ARG3 22 | B-ARGM-GOL 23 | I-ARGM-GOL 24 | B-R-ARG2 25 | B-ARGM-PRP 26 | B-R-ARG1 27 | B-R-ARG0 28 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/srl/serialization/vocabulary/non_padded_namespaces.txt: -------------------------------------------------------------------------------- 1 | *labels 2 | *tags 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/utf-8_sample/archives/utf-8.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/utf-8_sample/archives/utf-8.tar.bz2 -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/utf-8_sample/archives/utf-8.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/utf-8_sample/archives/utf-8.tar.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/utf-8_sample/archives/utf-8.tar.lzma: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/utf-8_sample/archives/utf-8.tar.lzma -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/utf-8_sample/archives/utf-8.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/utf-8_sample/archives/utf-8.zip -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/utf-8_sample/utf-8_sample.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/utf-8_sample/utf-8_sample.txt.gz -------------------------------------------------------------------------------- /allennlp/allennlp/tests/fixtures/utf-8_sample/utf-8_sample.txt.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/fixtures/utf-8_sample/utf-8_sample.txt.zip -------------------------------------------------------------------------------- /allennlp/allennlp/tests/models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/models/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/models/encoder_decoders/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/models/encoder_decoders/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/models/esim_test.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=no-self-use,invalid-name 2 | import numpy 3 | from numpy.testing import assert_almost_equal 4 | 5 | from allennlp.common.testing import ModelTestCase 6 | 7 | 8 | class TestESIM(ModelTestCase): 9 | def setUp(self): 10 | super(TestESIM, self).setUp() 11 | self.set_up_model(self.FIXTURES_ROOT / 'esim' / 'experiment.json', 12 | self.FIXTURES_ROOT / 'data' / 'snli.jsonl') 13 | 14 | def test_forward_pass_runs_correctly(self): 15 | training_tensors = self.dataset.as_tensor_dict() 16 | output_dict = self.model(**training_tensors) 17 | assert_almost_equal(numpy.sum(output_dict["label_probs"][0].data.numpy(), -1), 1, decimal=6) 18 | 19 | def test_model_can_train_save_and_load(self): 20 | self.ensure_model_can_train_save_and_load(self.param_file) 21 | 22 | def test_batch_predictions_are_consistent(self): 23 | self.ensure_batch_predictions_are_consistent() 24 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/models/reading_comprehension/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/models/reading_comprehension/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/models/reading_comprehension/naqanet_test.py: -------------------------------------------------------------------------------- 1 | #pylint: disable=unused-import 2 | from flaky import flaky 3 | 4 | from allennlp.common.testing import ModelTestCase 5 | 6 | 7 | class NumericallyAugmentedQaNetTest(ModelTestCase): 8 | def setUp(self): 9 | super().setUp() 10 | print(self.FIXTURES_ROOT) 11 | self.set_up_model(self.FIXTURES_ROOT / "naqanet" / "experiment.json", 12 | self.FIXTURES_ROOT / "data" / "drop.json") 13 | 14 | @flaky(max_runs=3, min_passes=1) 15 | def test_model_can_train_save_and_load(self): 16 | self.ensure_model_can_train_save_and_load(self.param_file) 17 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/models/semantic_parsing/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/models/semantic_parsing/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/models/semantic_parsing/nlvr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/models/semantic_parsing/nlvr/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/models/semantic_parsing/nlvr/nlvr_direct_semantic_parser_test.py: -------------------------------------------------------------------------------- 1 | from allennlp.common.testing import ModelTestCase 2 | 3 | 4 | class NlvrDirectSemanticParserTest(ModelTestCase): 5 | def setUp(self): 6 | super(NlvrDirectSemanticParserTest, self).setUp() 7 | self.set_up_model(self.FIXTURES_ROOT / "semantic_parsing" / 8 | "nlvr_direct_semantic_parser" / "experiment.json", 9 | self.FIXTURES_ROOT / "data" / "nlvr" / "sample_processed_data.jsonl") 10 | 11 | def test_model_can_train_save_and_load(self): 12 | self.ensure_model_can_train_save_and_load(self.param_file) 13 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/models/semantic_parsing/quarel/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/models/semantic_parsing/quarel/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/models/semantic_parsing/wikitables/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/models/semantic_parsing/wikitables/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/modules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/modules/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/modules/attention/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/modules/attention/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/modules/masked_layer_norm_test.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=invalid-name,no-self-use 2 | import numpy as np 3 | import torch 4 | 5 | from allennlp.common.testing import AllenNlpTestCase 6 | from allennlp.modules.masked_layer_norm import MaskedLayerNorm 7 | 8 | class TestMaskedLayerNorm(AllenNlpTestCase): 9 | def test_masked_layer_norm(self): 10 | x_n = np.random.rand(2, 3, 7) 11 | mask_n = np.array([[1, 1, 0], [1, 1, 1]]) 12 | 13 | x = torch.from_numpy(x_n).float() 14 | mask = torch.from_numpy(mask_n) 15 | 16 | layer_norm = MaskedLayerNorm(7, gamma0=0.2) 17 | normed_x = layer_norm(x, mask) 18 | 19 | N = 7 * 5 20 | mean = (x_n * np.expand_dims(mask_n, axis=-1)).sum() / N 21 | std = np.sqrt( 22 | (((x_n - mean) * np.expand_dims(mask_n, axis=-1)) ** 2).sum() / N + 1e-6 23 | ) 24 | expected = 0.2 * (x_n - mean) / (std + 1e-6) 25 | 26 | assert np.allclose(normed_x.data.numpy(), expected) 27 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/modules/matrix_attention/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/modules/matrix_attention/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/modules/seq2seq_encoders/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/modules/seq2seq_encoders/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/modules/seq2vec_encoders/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/modules/seq2vec_encoders/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/modules/similarity_functions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/modules/similarity_functions/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/modules/span_extractors/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/modules/span_extractors/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/modules/text_field_embedders/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/modules/text_field_embedders/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/modules/token_embedders/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/modules/token_embedders/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/modules/token_embedders/bidirectional_language_model_token_embedder_test.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=no-self-use,invalid-name 2 | from .language_model_token_embedder_test import TestLanguageModelTokenEmbedder 3 | 4 | 5 | class TestBidirectionalLanguageModelTokenEmbedder(TestLanguageModelTokenEmbedder): 6 | def setUp(self): 7 | super().setUp() 8 | self.set_up_model(self.FIXTURES_ROOT / 'language_model' / 9 | 'bidirectional_lm_characters_token_embedder.jsonnet', 10 | self.FIXTURES_ROOT / 'data' / 'conll2003.txt') 11 | 12 | class TestBidirectionalLanguageModelTokenEmbedderWithoutBosEos(TestLanguageModelTokenEmbedder): 13 | def setUp(self): 14 | super().setUp() 15 | self.set_up_model(self.FIXTURES_ROOT / 'language_model' / 16 | 'bidirectional_lm_characters_token_embedder_without_bos_eos.jsonnet', 17 | self.FIXTURES_ROOT / 'data' / 'conll2003.txt') 18 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/nn/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/nn/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/predictors/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/predictors/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/predictors/predictor_test.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=no-self-use,invalid-name 2 | from allennlp.common.testing import AllenNlpTestCase 3 | from allennlp.models.archival import load_archive 4 | from allennlp.predictors import Predictor 5 | 6 | class TestPredictor(AllenNlpTestCase): 7 | def test_from_archive_does_not_consume_params(self): 8 | archive = load_archive(self.FIXTURES_ROOT / 'bidaf' / 'serialization' / 'model.tar.gz') 9 | Predictor.from_archive(archive, 'machine-comprehension') 10 | 11 | # If it consumes the params, this will raise an exception 12 | Predictor.from_archive(archive, 'machine-comprehension') 13 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/semparse/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/semparse/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/semparse/contexts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/semparse/contexts/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/semparse/domain_languages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/semparse/domain_languages/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/semparse/executors/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/semparse/executors/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/semparse/type_declarations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/semparse/type_declarations/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/semparse/util_test.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=no-self-use,invalid-name 2 | from allennlp.common.testing import AllenNlpTestCase 3 | from allennlp.semparse import util 4 | 5 | 6 | class TestSemparseUtil(AllenNlpTestCase): 7 | def test_lisp_to_nested_expression(self): 8 | logical_form = "((reverse fb:row.row.year) (fb:row.row.league fb:cell.usl_a_league))" 9 | expression = util.lisp_to_nested_expression(logical_form) 10 | assert expression == [['reverse', 'fb:row.row.year'], ['fb:row.row.league', 'fb:cell.usl_a_league']] 11 | logical_form = "(count (and (division 1) (tier (!= null))))" 12 | expression = util.lisp_to_nested_expression(logical_form) 13 | assert expression == ['count', ['and', ['division', '1'], ['tier', ['!=', 'null']]]] 14 | -------------------------------------------------------------------------------- /allennlp/allennlp/tests/semparse/worlds/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/semparse/worlds/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/service/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/service/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/state_machines/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/state_machines/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/state_machines/states/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/state_machines/states/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/state_machines/trainers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/state_machines/trainers/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/state_machines/transition_functions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/state_machines/transition_functions/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/tools/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/tools/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/training/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/training/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/training/learning_rate_schedulers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/training/learning_rate_schedulers/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/training/metrics/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/training/metrics/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/training/momentum_schedulers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/training/momentum_schedulers/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/tutorials/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/tutorials/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/tutorials/tagger/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tests/tutorials/tagger/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tests/tutorials/tagger/basic_allennlp_test.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from allennlp.common.testing import AllenNlpTestCase 4 | 5 | 6 | @pytest.mark.skip("makes test-install fail (and also takes 30 seconds)") 7 | class TestBasicAllenNlp(AllenNlpTestCase): 8 | @classmethod 9 | def test_run_as_script(cls): 10 | # Just ensure the tutorial runs without throwing an exception. 11 | import tutorials.tagger.basic_allennlp # pylint: disable=unused-variable 12 | -------------------------------------------------------------------------------- /allennlp/allennlp/tools/EVALB/Makefile: -------------------------------------------------------------------------------- 1 | all: clean evalb 2 | 3 | clean: 4 | rm -f evalb 5 | 6 | evalb: evalb.c 7 | gcc -Wall -g -o evalb evalb.c 8 | -------------------------------------------------------------------------------- /allennlp/allennlp/tools/EVALB/tgrep_proc.prl: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl 2 | 3 | while(<>) 4 | { 5 | if(m/TOP/) #skip lines which are blank 6 | { 7 | print; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /allennlp/allennlp/tools/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/allennlp/tools/__init__.py -------------------------------------------------------------------------------- /allennlp/allennlp/tools/inspect_cache.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from allennlp.common.file_utils import CACHE_DIRECTORY 4 | from allennlp.common.file_utils import filename_to_url 5 | 6 | 7 | def main(): 8 | print(f"Looking for datasets in {CACHE_DIRECTORY}...") 9 | if not os.path.exists(CACHE_DIRECTORY): 10 | print('Directory does not exist.') 11 | print('No cached datasets found.') 12 | 13 | cached_files = os.listdir(CACHE_DIRECTORY) 14 | 15 | if not cached_files: 16 | print('Directory is empty.') 17 | print('No cached datasets found.') 18 | 19 | for filename in cached_files: 20 | if not filename.endswith("json"): 21 | url, etag = filename_to_url(filename) 22 | print('Filename: %s' % filename) 23 | print('Url: %s' % url) 24 | print('ETag: %s' % etag) 25 | print() 26 | 27 | 28 | if __name__ == '__main__': 29 | main() 30 | -------------------------------------------------------------------------------- /allennlp/allennlp/training/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.training.no_op_trainer import NoOpTrainer 2 | from allennlp.training.trainer import Trainer 3 | from allennlp.training.trainer_base import TrainerBase 4 | -------------------------------------------------------------------------------- /allennlp/allennlp/training/metrics/perplexity.py: -------------------------------------------------------------------------------- 1 | from overrides import overrides 2 | import torch 3 | 4 | from allennlp.training.metrics.average import Average 5 | from allennlp.training.metrics.metric import Metric 6 | 7 | 8 | @Metric.register("perplexity") 9 | class Perplexity(Average): 10 | """ 11 | Perplexity is a common metric used for evaluating how well a language model 12 | predicts a sample. 13 | 14 | Notes 15 | ----- 16 | Assumes negative log likelihood loss of each batch (base e). Provides the 17 | average perplexity of the batches. 18 | """ 19 | 20 | @overrides 21 | def get_metric(self, reset: bool = False) -> float: 22 | """ 23 | Returns 24 | ------- 25 | The accumulated perplexity. 26 | """ 27 | average_loss = super().get_metric(reset) 28 | if average_loss == 0: 29 | return 0. 30 | 31 | # Exponentiate the loss to compute perplexity 32 | return float(torch.exp(average_loss)) 33 | -------------------------------------------------------------------------------- /allennlp/allennlp/training/momentum_schedulers/__init__.py: -------------------------------------------------------------------------------- 1 | from allennlp.training.momentum_schedulers.momentum_scheduler import MomentumScheduler 2 | from allennlp.training.momentum_schedulers.inverted_triangular import InvertedTriangular 3 | -------------------------------------------------------------------------------- /allennlp/allennlp/training/momentum_schedulers/momentum_scheduler.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | from allennlp.common.params import Params 4 | from allennlp.common.registrable import Registrable 5 | from allennlp.training.scheduler import Scheduler 6 | 7 | 8 | class MomentumScheduler(Scheduler, Registrable): 9 | 10 | def __init__(self, 11 | optimizer: torch.optim.Optimizer, 12 | last_epoch: int = -1) -> None: 13 | super().__init__(optimizer, "momentum", last_epoch) 14 | 15 | def get_values(self) -> None: 16 | raise NotImplementedError 17 | 18 | # Requires custom from_params so we can pass the optimizer. 19 | @classmethod 20 | def from_params(cls, optimizer: torch.optim.Optimizer, params: Params): # type: ignore 21 | # pylint: disable=arguments-differ 22 | scheduler_type = params.pop_choice("type", MomentumScheduler.list_available()) 23 | scheduler = MomentumScheduler.by_name(scheduler_type)(optimizer, **params.as_dict()) 24 | return scheduler 25 | -------------------------------------------------------------------------------- /allennlp/allennlp/version.py: -------------------------------------------------------------------------------- 1 | _MAJOR = "0" 2 | _MINOR = "8" 3 | _REVISION = "4-unreleased" 4 | 5 | VERSION_SHORT = "{0}.{1}".format(_MAJOR, _MINOR) 6 | VERSION = "{0}.{1}.{2}".format(_MAJOR, _MINOR, _REVISION) 7 | -------------------------------------------------------------------------------- /allennlp/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | precision: 0 3 | round: down 4 | status: 5 | patch: 6 | default: 7 | target: 90 8 | project: 9 | default: 10 | threshold: 1% 11 | changes: false 12 | comment: false 13 | ignore: 14 | - "allennlp/tests" 15 | - "allennlp/tools/squad_eval.py" 16 | - "allennlp/tools/wikitables_evaluator.py" 17 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.commands.configure.rst: -------------------------------------------------------------------------------- 1 | allennlp.commands.configure 2 | =========================== 3 | 4 | .. automodule:: allennlp.commands.configure 5 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.commands.dry_run.rst: -------------------------------------------------------------------------------- 1 | allennlp.commands.dry_run 2 | ============================ 3 | 4 | .. automodule:: allennlp.commands.dry_run 5 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.commands.elmo.rst: -------------------------------------------------------------------------------- 1 | allennlp.commands.elmo 2 | ========================== 3 | 4 | .. automodule:: allennlp.commands.elmo 5 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.commands.evaluate.rst: -------------------------------------------------------------------------------- 1 | allennlp.commands.evaluate 2 | ========================== 3 | 4 | .. automodule:: allennlp.commands.evaluate 5 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.commands.find_learning_rate.rst: -------------------------------------------------------------------------------- 1 | allennlp.commands.find_learning_rate 2 | ==================================== 3 | 4 | .. automodule:: allennlp.commands.find_learning_rate 5 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.commands.fine_tune.rst: -------------------------------------------------------------------------------- 1 | allennlp.commands.fine_tune 2 | =========================== 3 | 4 | .. automodule:: allennlp.commands.fine_tune 5 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.commands.make_vocab.rst: -------------------------------------------------------------------------------- 1 | allennlp.commands.make_vocab 2 | ============================ 3 | 4 | .. automodule:: allennlp.commands.make_vocab 5 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.commands.predict.rst: -------------------------------------------------------------------------------- 1 | allennlp.commands.predict 2 | ========================== 3 | 4 | .. automodule:: allennlp.commands.predict 5 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.commands.print_results.rst: -------------------------------------------------------------------------------- 1 | allennlp.commands.print_results 2 | =============================== 3 | 4 | .. automodule:: allennlp.commands.print_results 5 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.commands.subcommand.rst: -------------------------------------------------------------------------------- 1 | allennlp.commands.subcommand 2 | ============================ 3 | 4 | .. automodule:: allennlp.commands.subcommand 5 | :members: 6 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.commands.test_install.rst: -------------------------------------------------------------------------------- 1 | allennlp.commands.test_install 2 | ============================== 3 | 4 | .. automodule:: allennlp.commands.test_install 5 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.commands.train.rst: -------------------------------------------------------------------------------- 1 | allennlp.commands.train 2 | ======================= 3 | 4 | .. automodule:: allennlp.commands.train 5 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.common.checks.rst: -------------------------------------------------------------------------------- 1 | allennlp.common.checks 2 | =============================== 3 | 4 | .. automodule:: allennlp.common.checks 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.common.configuration.rst: -------------------------------------------------------------------------------- 1 | allennlp.common.configuration 2 | =============================== 3 | 4 | .. automodule:: allennlp.common.configuration 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.common.file_utils.rst: -------------------------------------------------------------------------------- 1 | allennlp.common.file_utils 2 | =============================== 3 | 4 | .. automodule:: allennlp.common.file_utils 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.common.from_params.rst: -------------------------------------------------------------------------------- 1 | allennlp.common.from_params 2 | =============================== 3 | 4 | .. automodule:: allennlp.common.from_params 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.common.params.rst: -------------------------------------------------------------------------------- 1 | allennlp.common.params 2 | =============================== 3 | 4 | .. automodule:: allennlp.common.params 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.common.registrable.rst: -------------------------------------------------------------------------------- 1 | allennlp.common.registrable 2 | =============================== 3 | 4 | .. automodule:: allennlp.common.registrable 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.common.rst: -------------------------------------------------------------------------------- 1 | allennlp.common 2 | ======================= 3 | 4 | These submodules contain common functionality 5 | that's used by datasets, models, trainers, and so on. 6 | 7 | .. toctree:: 8 | 9 | allennlp.common.checks 10 | allennlp.common.configuration 11 | allennlp.common.file_utils 12 | allennlp.common.from_params 13 | allennlp.common.params 14 | allennlp.common.registrable 15 | allennlp.common.tee_logger 16 | allennlp.common.testing 17 | allennlp.common.tqdm 18 | allennlp.common.util 19 | 20 | .. automodule:: allennlp.common 21 | :members: 22 | :undoc-members: 23 | :show-inheritance: 24 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.common.tee_logger.rst: -------------------------------------------------------------------------------- 1 | allennlp.common.tee_logger 2 | =============================== 3 | 4 | .. automodule:: allennlp.common.tee_logger 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.common.testing.rst: -------------------------------------------------------------------------------- 1 | allennlp.common.testing 2 | =============================== 3 | 4 | .. automodule:: allennlp.common.testing 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.common.testing.test_case 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.common.testing.model_test_case 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.common.tqdm.rst: -------------------------------------------------------------------------------- 1 | allennlp.common.checks 2 | =============================== 3 | 4 | .. automodule:: allennlp.common.tqdm 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.common.util.rst: -------------------------------------------------------------------------------- 1 | allennlp.common.util 2 | =============================== 3 | 4 | .. automodule:: allennlp.common.util 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset 2 | ===================== 3 | 4 | .. automodule:: allennlp.data.dataset 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.babi.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.babi 2 | ================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.babi 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.ccgbank.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.ccgbank 2 | ==================================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.ccgbank 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.conll2000.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.conll2000 2 | ======================================= 3 | 4 | .. automodule:: allennlp.data.dataset_readers.conll2000 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.conll2003.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.conll2003 2 | =============================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.conll2003 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.copynet_seq2seq.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.copynet_seq2seq 2 | ============================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.copynet_seq2seq 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.coreference_resolution.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.coreference_resolution 2 | ==================================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.coreference_resolution.conll 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.data.dataset_readers.coreference_resolution.winobias 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.dataset_reader.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.dataset_reader 2 | ============================================ 3 | 4 | .. automodule:: allennlp.data.dataset_readers.dataset_reader 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.dataset_utils.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.dataset_utils 2 | =========================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.dataset_utils.ontonotes 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.data.dataset_readers.dataset_utils.span_utils 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.data.dataset_readers.dataset_utils.text2sql_utils 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.event2mind.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.event2mind 2 | ======================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.event2mind 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.interleaving_dataset_reader.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.interleaving_dataset_reader 2 | ========================================================= 3 | 4 | .. automodule:: allennlp.data.dataset_readers.interleaving_dataset_reader 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.language_modeling.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.language_modeling 2 | =============================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.language_modeling 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.multiprocess_dataset_reader.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.multiprocess_dataset_reader 2 | =========================================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.multiprocess_dataset_reader 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.ontonotes_ner.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.ontonotes_ner 2 | =========================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.ontonotes_ner 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.penn_tree_bank.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.penn_tree_bank 2 | ==================================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.penn_tree_bank 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.quora_paraphrase.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.quora_paraphrase 2 | ===================================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.quora_paraphrase 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.semantic_dependency_parsing.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.semantic_dependency_parsing 2 | ========================================================= 3 | 4 | .. automodule:: allennlp.data.dataset_readers.semantic_dependency_parsing 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.semantic_parsing.wikitables.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.semantic_parsing.wikitables 2 | ========================================================= 3 | 4 | .. automodule:: allennlp.data.dataset_readers.semantic_parsing.wikitables 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.data.dataset_readers.semantic_parsing.wikitables.wikitables 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.data.dataset_readers.semantic_parsing.wikitables.util 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.semantic_role_labeling.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.semantic_role_labeling 2 | ==================================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.semantic_role_labeling 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.seq2seq.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.seq2seq 2 | ============================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.seq2seq 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.sequence_tagging.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.sequence_tagging 2 | ============================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.sequence_tagging 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.simple_language_modeling.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.simple_language_modeling 2 | ====================================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.simple_language_modeling 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.snli.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.snli 2 | ================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.snli 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.stanford_sentiment_tree_bank.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.stanford_sentiment_tree_bank 2 | ========================================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.stanford_sentiment_tree_bank 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.text_classification_json.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.text_classification_json 2 | ====================================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.text_classification_json 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.dataset_readers.universal_dependencies.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.dataset_readers.universal_dependencies 2 | ===================================================== 3 | 4 | .. automodule:: allennlp.data.dataset_readers.universal_dependencies 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.instance.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.instance 2 | ====================== 3 | 4 | .. automodule:: allennlp.data.instance 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.rst: -------------------------------------------------------------------------------- 1 | allennlp.data 2 | ===================== 3 | 4 | These submodules contain various functionality for working with data. 5 | 6 | .. toctree:: 7 | 8 | allennlp.data.dataset 9 | allennlp.data.dataset_readers 10 | allennlp.data.fields 11 | allennlp.data.instance 12 | allennlp.data.iterators 13 | allennlp.data.token_indexers 14 | allennlp.data.tokenizers 15 | allennlp.data.vocabulary 16 | 17 | .. automodule:: allennlp.data 18 | :members: 19 | :undoc-members: 20 | :show-inheritance: 21 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.data.vocabulary.rst: -------------------------------------------------------------------------------- 1 | allennlp.data.vocabulary 2 | ======================== 3 | 4 | .. automodule:: allennlp.data.vocabulary 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.archival.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.archival 2 | ========================================= 3 | 4 | .. automodule:: allennlp.models.archival 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.basic_classifier.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.basic_classifier 2 | ================================ 3 | 4 | .. automodule:: allennlp.models.basic_classifier 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.bert_for_classification.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.bert_for_classification 2 | ======================================= 3 | 4 | .. automodule:: allennlp.models.bert_for_classification 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.biaffine_dependency_parser.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.biaffine_dependency_parser 2 | ========================================== 3 | 4 | .. automodule:: allennlp.models.biaffine_dependency_parser 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.biattentive_classification_network.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.biattentive_classification_network 2 | ================================================== 3 | 4 | .. automodule:: allennlp.models.biattentive_classification_network 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.bimpm.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.bimpm 2 | ======================== 3 | 4 | .. automodule:: allennlp.models.bimpm 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.constituency_parser.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.constituency_parser 2 | =================================== 3 | 4 | .. automodule:: allennlp.models.constituency_parser 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.coreference_resolution.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.coreference_resolution 2 | ====================================== 3 | 4 | .. automodule:: allennlp.models.coreference_resolution 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.models.coreference_resolution.coref 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.crf_tagger.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.crf_tagger 2 | ========================================= 3 | 4 | .. automodule:: allennlp.models.crf_tagger 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.decomposable_attention.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.decomposable_attention 2 | ========================================= 3 | 4 | .. automodule:: allennlp.models.decomposable_attention 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.encoder_decoders.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.encoder_decoders 2 | ================================ 3 | 4 | .. automodule:: allennlp.models.encoder_decoders 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.models.encoder_decoders.simple_seq2seq 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.models.encoder_decoders.copynet_seq2seq 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.ensemble.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.ensemble 2 | ========================================= 3 | 4 | .. automodule:: allennlp.models.ensemble 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.esim.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.esim 2 | ==================== 3 | 4 | .. automodule:: allennlp.models.esim 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.event2mind.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.event2mind 2 | ========================== 3 | 4 | .. automodule:: allennlp.models.event2mind 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.graph_parser.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.graph_parser 2 | ============================ 3 | 4 | .. automodule:: allennlp.models.graph_parser 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.language_model.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.language_model 2 | ============================== 3 | 4 | .. automodule:: allennlp.models.language_model 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.model.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.model 2 | ========================================= 3 | 4 | .. automodule:: allennlp.models.model 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.rst: -------------------------------------------------------------------------------- 1 | allennlp.models 2 | ======================= 3 | 4 | .. automodule:: allennlp.models 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. toctree:: 10 | 11 | allennlp.models.model 12 | allennlp.models.archival 13 | allennlp.models.bert_for_classification 14 | allennlp.models.biaffine_dependency_parser 15 | allennlp.models.biattentive_classification_network 16 | allennlp.models.bimpm 17 | allennlp.models.basic_classifier 18 | allennlp.models.constituency_parser 19 | allennlp.models.coreference_resolution 20 | allennlp.models.crf_tagger 21 | allennlp.models.decomposable_attention 22 | allennlp.models.encoder_decoders 23 | allennlp.models.ensemble 24 | allennlp.models.esim 25 | allennlp.models.event2mind 26 | allennlp.models.graph_parser 27 | allennlp.models.reading_comprehension 28 | allennlp.models.semantic_parsing 29 | allennlp.models.semantic_role_labeler 30 | allennlp.models.language_model 31 | allennlp.models.simple_tagger 32 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.semantic_parsing.atis.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.semantic_parsing.atis 2 | =========================================== 3 | 4 | .. automodule:: allennlp.models.semantic_parsing.atis 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.models.semantic_parsing.atis.atis_semantic_parser 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.semantic_parsing.nlvr.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.semantic_parsing.nlvr 2 | ===================================== 3 | 4 | .. automodule:: allennlp.models.semantic_parsing.nlvr 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.models.semantic_parsing.nlvr.nlvr_semantic_parser 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.models.semantic_parsing.nlvr.nlvr_coverage_semantic_parser 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | 19 | .. automodule:: allennlp.models.semantic_parsing.nlvr.nlvr_direct_semantic_parser 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.semantic_parsing.quarel.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.semantic_parsing.quarel 2 | ======================================= 3 | 4 | .. automodule:: allennlp.models.semantic_parsing.quarel 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.models.semantic_parsing.quarel.quarel_semantic_parser 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.semantic_parsing.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.semantic_parsing 2 | ================================ 3 | 4 | .. automodule:: allennlp.models.semantic_parsing 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.models.semantic_parsing.text2sql_parser 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. toctree:: 15 | 16 | allennlp.models.semantic_parsing.nlvr 17 | allennlp.models.semantic_parsing.wikitables 18 | allennlp.models.semantic_parsing.atis 19 | allennlp.models.semantic_parsing.quarel 20 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.semantic_parsing.wikitables.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.semantic_parsing.wikitables 2 | =========================================== 3 | 4 | .. automodule:: allennlp.models.semantic_parsing.wikitables 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.models.semantic_parsing.wikitables.wikitables_semantic_parser 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.models.semantic_parsing.wikitables.wikitables_mml_semantic_parser 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | 19 | .. automodule:: allennlp.models.semantic_parsing.wikitables.wikitables_erm_semantic_parser 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.semantic_role_labeler.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.semantic_role_labeler 2 | ========================================= 3 | 4 | .. automodule:: allennlp.models.semantic_role_labeler 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.models.simple_tagger.rst: -------------------------------------------------------------------------------- 1 | allennlp.models.simple_tagger 2 | ========================================= 3 | 4 | .. automodule:: allennlp.models.simple_tagger 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.attention.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.attention 2 | ========================================= 3 | 4 | .. automodule:: allennlp.modules.attention 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.modules.attention.attention 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.modules.attention.bilinear_attention 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | 19 | .. automodule:: allennlp.modules.attention.cosine_attention 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | 24 | .. automodule:: allennlp.modules.attention.dot_product_attention 25 | :members: 26 | :undoc-members: 27 | :show-inheritance: 28 | 29 | .. automodule:: allennlp.modules.attention.legacy_attention 30 | :members: 31 | :undoc-members: 32 | :show-inheritance: 33 | 34 | .. automodule:: allennlp.modules.attention.linear_attention 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.augmented_lstm.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.augmented_lstm 2 | ========================================= 3 | 4 | .. automodule:: allennlp.modules.augmented_lstm 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.bimpm_matching.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.bimpm_matching 2 | ========================================= 3 | 4 | .. automodule:: allennlp.modules.bimpm_matching 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.conditional_random_field.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.conditional_random_field 2 | ========================================= 3 | 4 | .. automodule:: allennlp.modules.conditional_random_field 5 | :members: 6 | :show-inheritance: 7 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.elmo.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.elmo 2 | ================================== 3 | 4 | .. automodule:: allennlp.modules.elmo 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.elmo_lstm.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.elmo_lstm 2 | ================================== 3 | 4 | .. automodule:: allennlp.modules.elmo_lstm 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.feedforward.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.feedforward 2 | ========================================= 3 | 4 | .. automodule:: allennlp.modules.feedforward 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.highway.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.highway 2 | ========================================= 3 | 4 | .. automodule:: allennlp.modules.highway 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.input_variational_dropout.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.input_variational_dropout 2 | ========================================== 3 | 4 | .. automodule:: allennlp.modules.input_variational_dropout 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.layer_norm.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.layer_norm 2 | ========================================= 3 | 4 | .. automodule:: allennlp.modules.layer_norm 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.lstm_cell_with_projection.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.lstm_cell_with_projection 2 | ========================================== 3 | 4 | .. automodule:: allennlp.modules.lstm_cell_with_projection 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.masked_layer_norm.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.masked_layer_norm 2 | ========================================= 3 | 4 | .. automodule:: allennlp.modules.masked_layer_norm 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.maxout.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.maxout 2 | ======================= 3 | 4 | .. automodule:: allennlp.modules.maxout 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.openai_transformer.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.openai_transformer 2 | =================================== 3 | 4 | .. automodule:: allennlp.modules.openai_transformer 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.pruner.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.pruner 2 | ======================= 3 | 4 | .. automodule:: allennlp.modules.pruner 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.residual_with_layer_dropout.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.residual_with_layer_dropout 2 | ============================================ 3 | 4 | .. automodule:: allennlp.modules.residual_with_layer_dropout 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.sampled_softmax_loss.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.sampled_softmax_loss 2 | ===================================== 3 | 4 | .. automodule:: allennlp.modules.sampled_softmax_loss 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.scalar_mix.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.scalar_mix 2 | ========================================= 3 | 4 | .. automodule:: allennlp.modules.scalar_mix 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.span_extractors.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.span_extractors 2 | ================================ 3 | 4 | .. automodule:: allennlp.modules.span_extractors 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.modules.span_extractors.span_extractor 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.modules.span_extractors.endpoint_span_extractor 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | 19 | .. automodule:: allennlp.modules.span_extractors.self_attentive_span_extractor 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | 24 | .. automodule:: allennlp.modules.span_extractors.bidirectional_endpoint_span_extractor 25 | :members: 26 | :undoc-members: 27 | :show-inheritance: 28 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.stacked_alternating_lstm.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.stacked_alternating_lstm 2 | ========================================= 3 | 4 | .. automodule:: allennlp.modules.stacked_alternating_lstm 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.stacked_bidirectional_lstm.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.stacked_bidirectional_lstm 2 | =========================================== 3 | 4 | .. automodule:: allennlp.modules.stacked_bidirectional_lstm 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.text_field_embedders.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.text_field_embedders 2 | ============================================= 3 | 4 | .. automodule:: allennlp.modules.text_field_embedders 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | * :ref:`TextFieldEmbedder` 10 | * :ref:`BasicTextFieldEmbedder` 11 | 12 | .. _text-field-embedder: 13 | .. automodule:: allennlp.modules.text_field_embedders.text_field_embedder 14 | :members: 15 | :undoc-members: 16 | :show-inheritance: 17 | 18 | .. _basic-text-field-embedder: 19 | .. automodule:: allennlp.modules.text_field_embedders.basic_text_field_embedder 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | 24 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.modules.time_distributed.rst: -------------------------------------------------------------------------------- 1 | allennlp.modules.time_distributed 2 | ========================================= 3 | 4 | .. automodule:: allennlp.modules.time_distributed 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.nn.activations.rst: -------------------------------------------------------------------------------- 1 | allennlp.nn.activations 2 | ========================================= 3 | 4 | .. automodule:: allennlp.nn.activations 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.nn.beam_search.rst: -------------------------------------------------------------------------------- 1 | allennlp.nn.beam_search 2 | ========================================= 3 | 4 | .. automodule:: allennlp.nn.beam_search 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.nn.chu_liu_edmonds.rst: -------------------------------------------------------------------------------- 1 | allennlp.nn.chu_liu_edmonds 2 | =========================== 3 | 4 | .. automodule:: allennlp.nn.chu_liu_edmonds 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.nn.initializers.rst: -------------------------------------------------------------------------------- 1 | allennlp.nn.initializers 2 | ========================================= 3 | 4 | .. automodule:: allennlp.nn.initializers 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.nn.regularizers.rst: -------------------------------------------------------------------------------- 1 | allennlp.nn.regularizers 2 | ====================================== 3 | 4 | .. automodule:: allennlp.nn.regularizers 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.nn.regularizers.regularizer 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.nn.regularizers.regularizers 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | 19 | .. automodule:: allennlp.nn.regularizers.regularizer_applicator 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | 24 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.nn.rst: -------------------------------------------------------------------------------- 1 | allennlp.nn 2 | =========== 3 | 4 | These submodules contain utilities and helpers 5 | for working with PyTorch neural networks. 6 | 7 | .. toctree:: 8 | 9 | allennlp.nn.activations 10 | allennlp.nn.chu_liu_edmonds 11 | allennlp.nn.initializers 12 | allennlp.nn.regularizers 13 | allennlp.nn.util 14 | allennlp.nn.beam_search 15 | 16 | 17 | .. automodule:: allennlp.nn 18 | :members: 19 | :undoc-members: 20 | :show-inheritance: 21 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.nn.util.rst: -------------------------------------------------------------------------------- 1 | allennlp.nn.util 2 | ========================================= 3 | 4 | .. automodule:: allennlp.nn.util 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.pretrained.rst: -------------------------------------------------------------------------------- 1 | allennlp.pretrained 2 | =================== 3 | 4 | Pretrained models available in AllenNLP. 5 | 6 | .. automodule:: allennlp.pretrained 7 | :members: 8 | :undoc-members: 9 | :show-inheritance: 10 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.semparse.executors.rst: -------------------------------------------------------------------------------- 1 | allennlp.semparse.executors 2 | =========================== 3 | 4 | .. automodule:: allennlp.semparse.executors 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.semparse.executors.wikitables_sempre_executor 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.semparse.executors.sql_executor 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.semparse.rst: -------------------------------------------------------------------------------- 1 | allennlp.semparse 2 | ================= 3 | 4 | .. automodule:: allennlp.semparse 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.semparse.action_space_walker 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. toctree:: 15 | 16 | allennlp.semparse.contexts 17 | allennlp.semparse.executors 18 | allennlp.semparse.type_declarations 19 | allennlp.semparse.worlds 20 | allennlp.semparse.executors 21 | allennlp.semparse.domain_languages 22 | allennlp.semparse.util 23 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.semparse.type_declarations.rst: -------------------------------------------------------------------------------- 1 | allennlp.semparse.type_declarations 2 | ======================================== 3 | 4 | .. automodule:: allennlp.semparse.type_declarations 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.semparse.type_declarations.type_declaration 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.semparse.type_declarations.wikitables_lambda_dcs 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | 19 | .. automodule:: allennlp.semparse.type_declarations.quarel_type_declaration 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.semparse.util.rst: -------------------------------------------------------------------------------- 1 | allennlp.semparse.util 2 | =========================== 3 | 4 | .. automodule:: allennlp.semparse.util 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.semparse.worlds.rst: -------------------------------------------------------------------------------- 1 | allennlp.semparse.worlds 2 | ============================= 3 | 4 | .. automodule:: allennlp.semparse.worlds 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.semparse.worlds.world 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.semparse.worlds.wikitables_world 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | 19 | .. automodule:: allennlp.semparse.worlds.atis_world 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | 24 | .. automodule:: allennlp.semparse.worlds.text2sql_world 25 | :members: 26 | :undoc-members: 27 | :show-inheritance: 28 | 29 | .. automodule:: allennlp.semparse.worlds.quarel_world 30 | :members: 31 | :undoc-members: 32 | :show-inheritance: 33 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.service.config_explorer.rst: -------------------------------------------------------------------------------- 1 | allennlp.service.config_explorer 2 | ================================= 3 | 4 | .. automodule:: allennlp.service.config_explorer 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.service.rst: -------------------------------------------------------------------------------- 1 | allennlp.service 2 | ======================== 3 | 4 | These submodules contain a server 5 | and ``Predictor`` wrappers for serving AllenNLP models 6 | via a REST API or similar. 7 | 8 | .. toctree:: 9 | 10 | allennlp.service.server_simple 11 | allennlp.service.config_explorer 12 | 13 | .. automodule:: allennlp.service 14 | :members: 15 | :undoc-members: 16 | :show-inheritance: 17 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.service.server_simple.rst: -------------------------------------------------------------------------------- 1 | allennlp.service.server_simple 2 | ================================= 3 | 4 | .. automodule:: allennlp.service.server_simple 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.state_machines.rst: -------------------------------------------------------------------------------- 1 | allennlp.state_machines 2 | ======================= 3 | 4 | .. automodule:: allennlp.state_machines 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.state_machines.beam_search 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.state_machines.constrained_beam_search 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | 19 | .. automodule:: allennlp.state_machines.util 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | 24 | .. toctree:: 25 | 26 | allennlp.state_machines.states 27 | allennlp.state_machines.trainers 28 | allennlp.state_machines.transition_functions 29 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.state_machines.trainers.rst: -------------------------------------------------------------------------------- 1 | allennlp.state_machines.trainers 2 | ================================ 3 | 4 | .. automodule:: allennlp.state_machines.trainers 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.state_machines.trainers.decoder_trainer 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.state_machines.trainers.maximum_marginal_likelihood 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | 19 | .. automodule:: allennlp.state_machines.trainers.expected_risk_minimization 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.tools.rst: -------------------------------------------------------------------------------- 1 | allennlp.tools 2 | ============== 3 | 4 | Modules containing official evaluators of various 5 | tasks for which we build models. 6 | 7 | .. automodule:: allennlp.tools 8 | :members: 9 | :undoc-members: 10 | :show-inheritance: 11 | 12 | .. automodule:: allennlp.tools.drop_eval 13 | :members: 14 | :undoc-members: 15 | :show-inheritance: 16 | 17 | .. automodule:: allennlp.tools.squad_eval 18 | :members: 19 | :undoc-members: 20 | :show-inheritance: 21 | 22 | .. automodule:: allennlp.tools.wikitables_evaluator 23 | :members: 24 | :undoc-members: 25 | :show-inheritance: 26 | 27 | .. automodule:: allennlp.tools.archive_surgery 28 | :members: 29 | :undoc-members: 30 | :show-inheritance: 31 | 32 | .. automodule:: allennlp.tools.create_elmo_embeddings_from_vocab 33 | :members: 34 | :undoc-members: 35 | :show-inheritance: 36 | 37 | .. automodule:: allennlp.tools.inspect_cache 38 | :members: 39 | :undoc-members: 40 | :show-inheritance: 41 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.training.checkpointer.rst: -------------------------------------------------------------------------------- 1 | allennlp.training.checkpointer 2 | ====================================== 3 | 4 | .. automodule:: allennlp.training.checkpointer 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.training.learning_rate_schedulers.rst: -------------------------------------------------------------------------------- 1 | allennlp.training.learning_rate_schedulers 2 | ========================================== 3 | 4 | .. automodule:: allennlp.training.learning_rate_schedulers 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.training.learning_rate_schedulers.learning_rate_scheduler 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.training.learning_rate_schedulers.cosine 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | 19 | .. automodule:: allennlp.training.learning_rate_schedulers.noam 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | 24 | .. automodule:: allennlp.training.learning_rate_schedulers.slanted_triangular 25 | :members: 26 | :undoc-members: 27 | :show-inheritance: 28 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.training.metric_tracker.rst: -------------------------------------------------------------------------------- 1 | allennlp.training.metric_tracker 2 | ====================================== 3 | 4 | .. automodule:: allennlp.training.metric_tracker 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.training.momentum_schedulers.rst: -------------------------------------------------------------------------------- 1 | allennlp.training.momentum_schedulers 2 | ========================================== 3 | 4 | .. automodule:: allennlp.training.momentum_schedulers 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | 9 | .. automodule:: allennlp.training.momentum_schedulers.momentum_scheduler 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | 14 | .. automodule:: allennlp.training.momentum_schedulers.inverted_triangular 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.training.moving_average.rst: -------------------------------------------------------------------------------- 1 | allennlp.training.moving_average 2 | ====================================== 3 | 4 | .. automodule:: allennlp.training.moving_average 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.training.no_op_trainer.rst: -------------------------------------------------------------------------------- 1 | allennlp.training.no_op_trainer 2 | ====================================== 3 | 4 | .. automodule:: allennlp.training.no_op_trainer 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.training.optimizers.rst: -------------------------------------------------------------------------------- 1 | allennlp.training.optimizers 2 | ====================================== 3 | 4 | .. automodule:: allennlp.training.optimizers 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.training.rst: -------------------------------------------------------------------------------- 1 | allennlp.training 2 | ========================= 3 | 4 | These submodules contain utilities and functions 5 | for training AllenNLP models. 6 | 7 | .. toctree:: 8 | 9 | allennlp.training.checkpointer 10 | allennlp.training.scheduler 11 | allennlp.training.learning_rate_schedulers 12 | allennlp.training.momentum_schedulers 13 | allennlp.training.metric_tracker 14 | allennlp.training.metrics 15 | allennlp.training.moving_average 16 | allennlp.training.no_op_trainer 17 | allennlp.training.optimizers 18 | allennlp.training.tensorboard_writer 19 | allennlp.training.trainer 20 | allennlp.training.trainer_base 21 | allennlp.training.util 22 | 23 | .. automodule:: allennlp.training 24 | :members: 25 | :undoc-members: 26 | :show-inheritance: 27 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.training.scheduler.rst: -------------------------------------------------------------------------------- 1 | allennlp.training.scheduler 2 | ========================================== 3 | 4 | .. automodule:: allennlp.training.scheduler 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.training.tensorboard_writer.rst: -------------------------------------------------------------------------------- 1 | allennlp.training.tensorboard_writer 2 | ====================================== 3 | 4 | .. automodule:: allennlp.training.tensorboard_writer 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.training.trainer.rst: -------------------------------------------------------------------------------- 1 | allennlp.training.trainer 2 | ====================================== 3 | 4 | .. automodule:: allennlp.training.trainer 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.training.trainer_base.rst: -------------------------------------------------------------------------------- 1 | allennlp.training.trainer_base 2 | ====================================== 3 | 4 | .. automodule:: allennlp.training.trainer_base 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/api/allennlp.training.util.rst: -------------------------------------------------------------------------------- 1 | allennlp.training.util 2 | ====================================== 3 | 4 | .. automodule:: allennlp.training.util 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /allennlp/doc/static/allennlp-logo-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/doc/static/allennlp-logo-dark.png -------------------------------------------------------------------------------- /allennlp/doc/static/custom.css: -------------------------------------------------------------------------------- 1 | .toggle .header { 2 | display: block; 3 | clear: both; 4 | } 5 | 6 | .toggle .header:after { 7 | content: " ▼"; 8 | } 9 | 10 | .toggle .header.open:after { 11 | content: " ▲"; 12 | } 13 | 14 | .wy-nav-content a.internal code span.pre { 15 | color: blue; 16 | text-decoration: underline; 17 | } 18 | 19 | /* Ensures that the logo scales properly */ 20 | .wy-side-nav-search a { 21 | display: block; 22 | } -------------------------------------------------------------------------------- /allennlp/doc/templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | 3 | {% set css_files = css_files + ["_static/custom.css"] %} 4 | 5 | {% block footer %} 6 | 16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /allennlp/scripts/build_demo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | from subprocess import run 5 | 6 | value = os.environ.get('BUILD_DEMO', 'false') 7 | if value.lower() == "true": 8 | run('npm install', shell=True, check=True, cwd='demo') 9 | run('npm run build', shell=True, check=True, cwd='demo') 10 | print('Demo built') 11 | else: 12 | print("BUILD_DEMO is '%s'. Not building demo." % value) 13 | -------------------------------------------------------------------------------- /allennlp/scripts/cache_models.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | 5 | value = os.environ.get('CACHE_MODELS', 'false') 6 | if value.lower() == "true": 7 | import sys 8 | sys.path.insert(0, os.path.dirname(os.path.abspath(os.path.join(__file__, os.pardir)))) 9 | from allennlp.commands.serve import DEFAULT_MODELS 10 | from allennlp.common.file_utils import cached_path 11 | models = DEFAULT_MODELS.items() 12 | print("CACHE_MODELS is '%s'. Downloading %i models." % (value, len(models))) 13 | for i, (model, url) in enumerate(models): 14 | print("Downloading '%s' model from %s" % (model, url)) 15 | print("Saved at %s" % cached_path(url)) 16 | else: 17 | print("CACHE_MODELS is '%s'. Not caching models." % value) 18 | -------------------------------------------------------------------------------- /allennlp/scripts/mypy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Run type checking over the python code. 3 | 4 | ./scripts/verify.py --checks mypy 5 | -------------------------------------------------------------------------------- /allennlp/scripts/nlvr/sed_commands.txt: -------------------------------------------------------------------------------- 1 | s/<:>/<,>/g 2 | s//>/g 3 | s//>/g 4 | s//>/g 5 | s//>/g 6 | s//>/g 7 | s//>/g 8 | s//>/g 9 | s//>/g 10 | s///g 11 | s///g 12 | s///g 13 | s///g 14 | s///g 15 | s/[[:<:]]int[[:>:]]/e/g 16 | s/[[:<:]]bool[[:>:]]/t/g 17 | s/Color/c/g 18 | s/Shape/s/g 19 | s/Set\[Box\]/b/g 20 | s/Set\[Object\]/o/g 21 | -------------------------------------------------------------------------------- /allennlp/scripts/pylint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Run our linter over the python code. 3 | 4 | ./scripts/verify.py --checks pylint 5 | -------------------------------------------------------------------------------- /allennlp/setup.cfg: -------------------------------------------------------------------------------- 1 | [aliases] 2 | test=pytest -------------------------------------------------------------------------------- /allennlp/tutorials/getting_started/predicting_paper_venues/best_paper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/getting_started/predicting_paper_venues/best_paper.png -------------------------------------------------------------------------------- /allennlp/tutorials/getting_started/predicting_paper_venues/best_paper_pie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/getting_started/predicting_paper_venues/best_paper_pie.png -------------------------------------------------------------------------------- /allennlp/tutorials/getting_started/semantic_parsing_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/getting_started/semantic_parsing_example.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/configurator_images/configurator.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/configurator_images/configurator.1.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/configurator_images/configurator.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/configurator_images/configurator.2.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/configurator_images/configurator.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/configurator_images/configurator.3.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/configurator_images/configurator.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/configurator_images/configurator.4.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/configurator_images/configurator.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/configurator_images/configurator.5.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/debugging_images/attach_to_local_process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/debugging_images/attach_to_local_process.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/debugging_images/attach_to_process_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/debugging_images/attach_to_process_1.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/debugging_images/attach_to_process_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/debugging_images/attach_to_process_3.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/debugging_images/breakpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/debugging_images/breakpoint.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/debugging_images/debug_debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/debugging_images/debug_debug.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/debugging_images/inspect_variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/debugging_images/inspect_variable.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/debugging_images/vscode_breakpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/debugging_images/vscode_breakpoint.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/debugging_images/vscode_call_stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/debugging_images/vscode_call_stack.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/debugging_images/vscode_debug_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/debugging_images/vscode_debug_icon.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/debugging_images/vscode_debugging_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/debugging_images/vscode_debugging_profile.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/debugging_images/vscode_start_debugging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/debugging_images/vscode_start_debugging.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/debugging_images/vscode_watched_variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/debugging_images/vscode_watched_variable.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/visualization_images/action_detail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/visualization_images/action_detail.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/visualization_images/action_detail_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/visualization_images/action_detail_2.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/visualization_images/bidaf_attention_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/visualization_images/bidaf_attention_demo.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/visualization_images/linking_scores.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/visualization_images/linking_scores.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/visualization_images/predicted_actions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/visualization_images/predicted_actions.png -------------------------------------------------------------------------------- /allennlp/tutorials/how_to/visualization_images/wikitables_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/how_to/visualization_images/wikitables_overview.png -------------------------------------------------------------------------------- /allennlp/tutorials/tagger/simple_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/allennlp/tutorials/tagger/simple_demo.png -------------------------------------------------------------------------------- /allennlp/tutorials/tagger/training.txt: -------------------------------------------------------------------------------- 1 | The###DET dog###NN ate###V the###DET apple###NN 2 | Everybody###NN read###V that###DET book###NN 3 | -------------------------------------------------------------------------------- /allennlp/tutorials/tagger/validation.txt: -------------------------------------------------------------------------------- 1 | The###DET dog###NN read###V the###DET apple###NN 2 | Everybody###NN ate###V that###DET book###NN 3 | -------------------------------------------------------------------------------- /ner/code/constraints.yml: -------------------------------------------------------------------------------- 1 | - [['B-org'], ['NNP']] 2 | - [['B-tim'], ['NNP','CD','JJ']] 3 | - [['B-geo'], ['NNP']] 4 | - [['B-gpe'], ['JJ','NNS','NNP']] 5 | - [['B-per'], ['NNP']] 6 | - [['I-per'], ['NNP']] 7 | - [['I-org'], ['NNP']] 8 | - [['I-geo'], ['NNP','NNPS']] 9 | - [['I-tim'], ['CD','NNP','NN','IN']] 10 | - [['B-eve'], ['NNP']] 11 | - [['I-eve'], ['NNP']] 12 | - [['B-art'], ['NNP','NNPS','JJ','NNS']] 13 | - [['I-art'], ['NNP']] 14 | - [['I-gpe'], ['NNP']] 15 | - [['B-nat'], ['NNP']] 16 | - [['I-nat'], ['NNP']] 17 | 18 | 19 | -------------------------------------------------------------------------------- /ner/code/penalty.py: -------------------------------------------------------------------------------- 1 | from abc import abstractmethod 2 | import six 3 | import abc 4 | 5 | @six.add_metaclass(abc.ABCMeta) 6 | class BasePenalty(): 7 | """ 8 | This is an abstract class for any constraint 9 | """ 10 | 11 | def __init__(self): 12 | super(BasePenalty,self).__init__() 13 | 14 | @abstractmethod 15 | def num_constraints(self): 16 | pass 17 | 18 | @abstractmethod 19 | def get_penalty(self,task1_scores,task2_scores, mask, indicator): 20 | pass 21 | 22 | -------------------------------------------------------------------------------- /ner/code/settings.py: -------------------------------------------------------------------------------- 1 | cuda = 0 2 | def set_settings(params): 3 | global cuda 4 | cuda = params['cuda_device'] != -1 5 | -------------------------------------------------------------------------------- /ner/code/time_taken.csv: -------------------------------------------------------------------------------- 1 | ts-400,sid-1,../configs/replicate/ner-pos-bs8-cw1-gan_supen.template_ifa1_ifb1_ddlr0.01_decay0_dlra1.jsonnet,104.50213599205017 2 | -------------------------------------------------------------------------------- /srl/code/settings.py: -------------------------------------------------------------------------------- 1 | cuda = 0 2 | def set_settings(params): 3 | global cuda 4 | cuda = params['cuda_device'] != -1 -------------------------------------------------------------------------------- /srl/configs/replicate_results/.constr_all_adadelta.template_wd0_dwd0_ifb10_lrd0_ddlr0.01_p1_rs42_gn3.5.jsonnet.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dair-iitd/dl-with-constraints/1d591354869fde8cfb8dede991d0445649ce391c/srl/configs/replicate_results/.constr_all_adadelta.template_wd0_dwd0_ifb10_lrd0_ddlr0.01_p1_rs42_gn3.5.jsonnet.swp -------------------------------------------------------------------------------- /typenet/src/penalty.py: -------------------------------------------------------------------------------- 1 | from abc import abstractmethod 2 | import six 3 | import abc 4 | 5 | @six.add_metaclass(abc.ABCMeta) 6 | class BasePenalty(): 7 | """ 8 | This is an abstract class for any constraint 9 | """ 10 | 11 | def __init__(self): 12 | super(BasePenalty,self).__init__() 13 | 14 | @abstractmethod 15 | def num_constraints(self): 16 | pass 17 | 18 | @abstractmethod 19 | def get_penalty(self,scores,indicator): 20 | pass 21 | 22 | --------------------------------------------------------------------------------