Skip to main content

Time Extractor NLP project - locate dates and times in text documents

Project description

The project was developed by Digamma.ai. The goal of the project is to develop a library to find and extract time/date information from textual documents.

Why Should I Use This?

The main goal is to identify texts fragments that are related to time/date/period (exact date, time of day, day of the week, months, seasons, time intervals, etc.) and make structural forms from them. We tried to detect a variety of textual representations and handle things like recurring times (e.g. “every Wednesday”).

Installation

$ pip install pytimeextractor

You can also download or checkout the latest code and install from the source:

$ python setup.py install

Usage

To use it, simply do:

>>> from pytimeextractor import ExtractionService
>>> text = "from winter to summer"
>>> ExtractionService.extract(text)

A PySettings can be applied to specify some additional extraction options, like setting local user date/time, time-zone offset, filtering extraction rules and finding latest dates.

PySettingsBuilder is used for constructing PySettings instance when you need to set configuration options other than the default. PySettingsBuilder is best used by creating it, and then invoking its various configuration methods, and finally calling build method.

>>> from pytimeextractor import PySettingsBuilder
>>> settings = (PySettingsBuilder()
...          .addRulesGroup('DateGroup')
...          .excludeRules("relativeDateRule")
...          .addUserDate("2017-10-23T18:40:40.931Z")
...          .addTimeZoneOffset("2")
...          .includeOnlyLatestDates(True)
...          .build()
...         )
>>> ExtractionService.extract(text, settings)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytimeextractor-0.1.4.tar.gz (3.0 MB view details)

Uploaded Source

File details

Details for the file pytimeextractor-0.1.4.tar.gz.

File metadata

File hashes

Hashes for pytimeextractor-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d6d40ff9ceed7ebc14f3f7cc7eff4da91cbc57b29ebc917fdaedd7e477f99312
MD5 43fc91861a08204727de364e145a43cc
BLAKE2b-256 abc51e38e843855ba686e3070611e601bb3638357ff8c51e12c3e6228d91cb29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page