Coder Social home page Coder Social logo

pyduckling's Introduction

pyduckling - a native python interface to the haskell version of duckling

Duckling by wit.ai/Facebook (https://github.com/facebookincubator/duckling) is one of the best libraries to find and parse time expressions.

This package contains a native python wrapper to use duckling directly from within python. It basically provides a wrapper for the Haskell FFI (Foreign Function Interface).

Note: This code is experimental. Contributions are welcome, but I cannot guarantee to integrate stuff quickly. But please feel free to use it as an inspiration for your own work.

Usage

The wrapper currently only supports the Time dimension, but should be easily extendable to other extensions (see DucklingFFI.hs). I only tested it within Docker containers. There the process is as follows:

  • in the project root build the image docker build -t pyduckling .

  • start a shell in the container docker run -it pyduckling bash

  • start python

  • run:

from datetime import datetime
from pyduckling import parse_time

now = int(1000 * datetime.timestamp(datetime.utcnow()))

parse_time('next week', 'EN', now)
parse_time('nächsten Montag', 'DE', now)

pyduckling's People

Contributors

sebastianmika avatar

Watchers

Jackie Ju avatar James Cloos avatar

Forkers

spiderchow

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.