资源算法allennlp-as-a-library-example

allennlp-as-a-library-example

2019-12-25 | |  35 |   0 |   0

A simple example for how to build your own model using AllenNLP as a dependency.  An explanation of all of the code in this repository is given in the part 1 and part 2 of the AllenNLP tutorial.

There are two main pieces of code you need to write in order to make a new model: aDatasetReader and a Model.  In this repository, we constructed a DatasetReader for reading academic papers formatted as a JSON lines file (you can see an example of the data intests/fixtures/s2_papers.jsonl).  We then constructed a model to classify the papers given some label (which we specified as the paper's venue in theDatasetReader).  Finally, we added a script to use AllenNLP's training commands from a third-party repository, and an experiment configuration for running a real model on real data.

To train this model, after setting up your development environment by runningpip install -r requirements.txt, you run:

allennlp train experiments/venue_classifier.json -s /tmp/your_output_dir_here --include-package my_library

This example was written by the AllenNLP team.  You can see a similar example repository written by others here.


上一篇:allennlp-demo

下一篇:allennlp-website

用户评价
全部评价

热门资源

  • 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 ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...