Skip to content

AurelieMerlo/time_extract

 
 

Repository files navigation

Time Extract

A python lib to extract time entities from text

Metadat extraction

Usage

Le script utilise une fonction avec 2 paramètres :

  • text to analyse
  • a metadata
python SEM.py message metadata

Example:

python SEM.py 'je voudrais partir lundi' 'date'

Installation

Since it's complex to have a valid environment to run treetagger + python. We provide a valid Dockerfile and some scripts to ease the tool usage.

  1. Install docker https://docs.docker.com/engine/installation/
  2. run bin/build_dev.sh

Launch nlp env

bin/dev.sh

Run webserver

bin/dev_server.sh

It listen on port 8080. Wait for POST calls on /api/v1/metadata and wait for 2 args:

  • 'message' : the text to analyse
  • 'name' : the name of the metadata (either date or duration)

There's an authentication mechanism that is reading the 'Http-Auth' header en check that it contains the same thing as in https://github.com/blackbirdco/time_extract/blob/master/secrets/config.yml

Testing

bin/test.sh

About

A python lib to extract time entities from text

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 78.3%
  • Shell 19.0%
  • Ruby 2.7%