Coder Social home page Coder Social logo

pydecode's Introduction

PyDecode is a dynamic programming toolkit developed for research in natural langauge processing. Its aim is to be simple enough for fast prototyping, but efficient enough for research use.

_images/parsing_9_0.png



Features

  • Simple specifications. Dynamic programming algorithms specified through pseudo-code.

    # Viterbi algorithm.
    ...
    c.init(items[0, :])
    for i in range(1, n):
        for t in range(len(tags)):
            c.set(items[i, t],
                  items[i-1, :],
                  labels=labels[i, t, :])
    graph = c.finish()
    
  • Efficient implementation. Core code in C++, python interfaces through numpy.

    # Compute path.
    label_weights = numpy.random.random(graph.label_size)
    weights = pydecode.transform_label_array(graph, label_weights)
    path = pydecode.best_path(graph, weights)
    
  • High-level algorithms. Includes a set of widely-used algorithms.

    # Inside probabilities.
    inside = pydecode.inside(graph, weights, kind=pydecode.LogProb)
    
    # (Max)-marginals.
    marginals = pydecode.marginals(graph, weights)
    
    # Pruning
    mask = marginals > threshold
    pruned_graph = pydecode.filter(graph, mask)
    
  • Integration with machine learning toolkits. Train structured models.

    # Train a discriminative tagger.
    perceptron_tagger = StructuredPerceptron(tagger)
    perceptron_tagger.fit(X, Y)
    Y_test = perceptron_tagger.predict(X_test)
    
  • Visualization tools. IPython integrated tools for debugging and teaching.

    pydecode.draw(graph, paths=paths)
    

_images/hmm.png

pydecode's People

Contributors

on2valhalla avatar srush avatar yinwen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pydecode's Issues

Error in documentation

Hello,

There is an error in the first tutorial : http://pydecode.readthedocs.org/en/latest/notebooks/Fibonacci.html
The content of the inside variable is false (just above "But since we have this structure in memory") :
array([ 0., 1., 2., 4., 7., 12., 20., 33., 54., 88.])

It should be :
array([ 0., 1., 1., 2., 3., 5., 8., 13., 21., 34.])

Executing the code in IPython gives the right value, so the saved output may be the one of a former code.

kind regards,

setup.py forces use of cython

the logic in the setup script seems to force the use of cython by requiring a cython import: build_ext outside of the normal logic.

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.