inspirehep/inspire-magpie

Name: inspire-magpie

Owner: inspirehep

Description: Wrapper around magpie for InspireHEP

Created: 2016-04-04 15:12:27.0

Updated: 2017-11-17 17:30:36.0

Pushed: 2016-05-26 17:32:20.0

Homepage:

Size: 320233

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Inspire-Magpie

A wrapper around magpie for Inspire that provides trained models and functions to learn from the High Energy Physics corpus.

Installation

t clone https://github.com/inspirehep/inspire-magpie.git
 inspire-magpie
p install .

Dependencies

Usage

There exists a UI and REST API based on Flask that you can run with:

thon wsgi.py

Access the UI on http://localhost:5051 and the REST interface under http://localhost:5051/api.

REST Example
rl -i -X POST -H 'Content-Type: application/json' -d '{"corpus": "keywords", "positive": ["lhc"]}' http://localhost:5051/api/word2vec

For the training, you can use two functions that the API provides: train() and batch_train(). The latter performs out-of-core training, but both of them take the same parameters:

om inspire_magpie.api import batch_train
tch_train('/path/to/the/training/set', test_dir='if/you/have/a/test/set', nn='cnn', nb_epochs=5, batch_size=64, persist=True, no_of_labels=10000, verbose=1)

Other configuration variables might be found in the config file.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.