Giter Site home page Giter Site logo

pycrfsuite's Introduction

pyCRFsuite

This is a python wrapper for crfsuite, a fast implementation of Conditional Random Fields

Authors

Installation

Currently the package is set-up only for in-place installation. It requires the crfsuite library to be installed: see http://www.chokkan.org/software/crfsuite/

Once this is installed, simply type make in the head directory.

Testing

There are a few basic test scripts in the head directory. test.py will read a small dataset from example_files, then run a basic training and tagging operation. crfsuite_test.sh runs the same operation using the command-line frontend provided by crfsuite. To compare the results of the training and tagging, run compare_output.sh. This will print all the places where the tagging results differ.

TODO

This is still a very incomplete wrapper. Search TODO within src/crfsuite.pyx to see some issues that need to be addressed.

Issues

There are a few 'features' in crfsuite that make efficient python wrapping difficult.

  • Model File Output: as currently written, crfsuite writes the result of a training directly to a binary file. The library is not configured to allow writing the model to memory. This means that a python wrapper must write the model to disk, then read the model into memory before performing any tagging operation. It would be better if the model could be saved directly to a CRFsuite model structure, though when dealing with the very large datasets for which crfsuite is designed, it's clear why the author made the choice he did.
  • Memory mapping: as currently written, crfsuite data is not stored in contiguous arrays. This means that there is no way to map a crfsuite data structure to a numpy array, and any input to crfsuite will need to be copied in memory. Addressing this would require significant upstream changes: the crfsuite_item_t structure would have to use an array of floats and an array of ints rather than an array of attribute structures.

pycrfsuite's People

Contributors

jakevdp avatar kmike avatar tpeng avatar

Watchers

 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.