资源算法allennlp_sempar

allennlp_sempar

2020-04-08 | |  27 |   0 |   0

AllenNLP for semantic parsing

This repository contains the data, configuration files, and scripts needed to reproduce the following results on the ATIS, GEO, and JOBS semantic parsing datasets, using the AllenNLP framework:

ModelATISGEOJOBS
S2S + attention79.968.971.4
S2S + attention + ELMo83.375.777.9
S2S + attention + OpenAI GPT83.376.883.6
S2S + attention + BERT (Base)83.575.782.9
S2S + attention + BERT (Large)83.073.280.7

Make sure you have AllenNLP installed first!

Training models

To train a model:

make train# ... follow the prompts to specify the path to your model config# (e.g. experiments/atis/seq2seq.json) and serialization directory.

Prediction and Evaluation

After training, to generate predictions:

allennlp predict --output-file [FILENAME] --predictor simple_seq2seq 
[SERIALIZED_MODEL] [INPUT_JSONL]

For example, to generate predictions on ATIS for a model that has been serialized to /tmp/models/atis/seq2seq/run_001:

allennlp predict --output-file predictions/atis/seq2seq.jsonl 
--predictor simple_seq2seq 
--include-package nlpete.data.dataset_readers 
--include-package nlpete.models 
--include-package nlpete.training.metrics 
/tmp/models/atis/seq2seq/run_001/model.tar.gz data/atis/atis_test.jsonl

I have already included the predictions in the "predictions" folder for those who simply want to verify the results. Once the predictions have been generated, the accuracy of the model can be calculated against the gold outputs on the test set by following the code in results.ipynb.


上一篇:kaldi-lattice-word-index

下一篇:allennlp-feedstock

用户评价
全部评价

热门资源

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • shih-styletransfer

    shih-styletransfer Code from Style Transfer ...