Timexy 🕙 📅
A spaCy custom component that extracts and normalizes dates and other temporal expressions.
Features
- :boom: Extract dates and durations for various languages. See here a list of currently supported languages
- :boom: Normalize dates to timestamps or normalize dates and durations to the TimeML TIMEX3 standard
Supported Languages
- 🇩🇪 German
- :uk: English
- 🇫🇷 French
Installation
pip install timexy
Usage
After installation, simply integrate the timexy component in any of your spaCy pipelines to extract and normalize dates and other temporal expressions:
import spacy
from timexy import Timexy
nlp = spacy.load("en_core_web_sm")
# Optionally add config if varying from default values
config = {
"kb_id_type": "timex3", # possible values: 'timex3'(default), 'timestamp'
"label": "timexy", # default: 'time'
"overwrite": False # default: False
}
nlp.add_pipe("timexy", config=config)
doc = nlp("Today is the 10.10.2010. I was in Paris for six years.")
for e in doc.ents:
print(f"{e.text}\t{e.label_}\t{e.kb_id_}")
>>> 10.10.2010 timexy TIMEX3 type="DATE" value="2010-10-10T00:00:00"
>>> six years timexy TIMEX3 type="DURATION" value="P6Y"
Contributing
Please refer to the contributing guidelines here.
Metadata
Release files for timexy 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| timexy-0.1.3.tar.gz | 9.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| timexy-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.2 kB
Release files / timexy-0.1.3.tar.gz
| Download URL | timexy-0.1.3.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20e8c39933575e932656f71f6be22244e96ddac2151b15a2331e38152b122205
|
|
BLAKE2b-256 checksum How to use checksums |
23335fa6362eda8cf7bcdb2115dd47ee5b03653adfb651b35fb7e73ed3dd4393
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.9.10 Linux/5.11.0-1028-azure
|
Release files / timexy-0.1.3-py3-none-any.whl
| Download URL | timexy-0.1.3-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4dff67f37c6ea09e501d0f21345a187e4212c7edb8664a5a5c09ca50cfec181
|
|
BLAKE2b-256 checksum How to use checksums |
db84a2b9b85a67bb0821152bbb543bd508c11cbd7cb46a2be08fc672ad566a8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.9.10 Linux/5.11.0-1028-azure
|