Code Monkey home page Code Monkey logo

murphy's Introduction

murphy

This is a library for structured prediction. It was primarily developed by Taylor Berg-Kirkpatrick. Other contributors include John DeNero, Aria Haghighi, Dan Klein, Jonathan Kummerfeld, and Adam Pauls.

To use the library, download it one of these ways, and include it in your code as described below:

This library was initially released as supplementary material for the experiments described in:

An Empirical Analysis of Optimization for Max-Margin NLP, Jonathan K. Kummerfeld, Taylor Berg-Kirkpatrick and Dan Klein, EMNLP 2015

Using the library

You will need to implement the following:

  • Code that creates a LossAugmentedLearner, e.g. PrimalSubgradientSVMLearner, and calls train. This is your main interface to the learning code. At creation you set parameters such as the learning rate and regularization, and when you call train you provide the data, initial weights, and number of iterations.
  • A class that extends LossAugmentedLinearModel. This is the interface through which the learning code calls your inference procedure. Given an instance, your code will find the best structure (b) under your model with loss-augmentation relative to the gold (g). You will return an UpdateBundle that includes the loss of b relative to g, and the features active in b and g.
  • [if using sparse updates] Modifications to your inference procedure to use getCount on a LazyAdaGradResult to get weights. This handles the delayed updates (see the paper above for further informtation).

Then include this code on your classpath, compile, and you're ready to go!

For an exmple, see the files in the example directory. Note, the classification it does is trivial, but it shows how you put the pieces together. You can build and run the example with build_and_run_example.sh (assuming you have javac, java, and standard command line tools - find, echo, mkdir).

Options

The library comes with three versions of the structured predicition code:

  • structpred, the basic implementation
  • floatstructpred, a variant that uses floats instead of doubles to save space and time
  • lazystructpred, a variant that allows for sparse updates

Note that the dual methods (NSlackSVMLearner) are only implemented for the basic version.

murphy's People

Contributors

dhgarrette avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.