{"id":15014199,"url":"https://github.com/paulrinckens/timexy","last_synced_at":"2025-04-12T06:06:05.043Z","repository":{"id":42224463,"uuid":"460607013","full_name":"paulrinckens/timexy","owner":"paulrinckens","description":"A spaCy custom component that extracts and normalizes temporal expressions","archived":false,"fork":false,"pushed_at":"2023-02-13T23:00:14.000Z","size":20,"stargazers_count":54,"open_issues_count":3,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T06:05:56.172Z","etag":null,"topics":["date-parser","datetime","natural-language-processing","nlp","python","spacy","spacy-extension","timeml","timex3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paulrinckens.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-17T21:02:36.000Z","updated_at":"2025-02-11T15:55:49.000Z","dependencies_parsed_at":"2022-09-22T02:42:18.457Z","dependency_job_id":null,"html_url":"https://github.com/paulrinckens/timexy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulrinckens%2Ftimexy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulrinckens%2Ftimexy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulrinckens%2Ftimexy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulrinckens%2Ftimexy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulrinckens","download_url":"https://codeload.github.com/paulrinckens/timexy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525144,"owners_count":21118618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["date-parser","datetime","natural-language-processing","nlp","python","spacy","spacy-extension","timeml","timex3"],"created_at":"2024-09-24T19:45:18.967Z","updated_at":"2025-04-12T06:06:05.020Z","avatar_url":"https://github.com/paulrinckens.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⏳ Timexy\n\n\u003ca href=\"https://pypi.org/project/timexy\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/timexy?color=%2334D058\u0026label=pypi%20package\" alt=\"Package version\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://app.codecov.io/gh/paulrinckens/timexy\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/codecov/c/gh/paulrinckens/timexy\" alt=\"Codecov\"\u003e\n\u003c/a\u003e\n\n\nA [spaCy](https://spacy.io/) [custom component](https://spacy.io/usage/processing-pipelines#custom-components) that extracts and normalizes dates and other temporal expressions.\n\n## Features\n- :boom: Extract dates and durations for various languages. See [here](#supported-languages) a list of currently supported languages\n- :boom: Normalize dates to timestamps or normalize dates and durations to the [TimeML TIMEX3 standard](https://timeml.github.io/site/publications/timeMLdocs/timeml_1.2.1.html)\n\n## Supported Languages\n- 🇩🇪 German\n- :uk: English\n- 🇫🇷 French\n\n## Installation\n````\npip install timexy\n````\n## Usage\nAfter installation, simply integrate the timexy component in any of your spaCy pipelines to extract and normalize dates and other temporal expressions:\n\n```py\nimport spacy\nfrom timexy import Timexy\n\nnlp = spacy.load(\"en_core_web_sm\")\n\n# Optionally add config if varying from default values\nconfig = {\n    \"kb_id_type\": \"timex3\",  # possible values: 'timex3'(default), 'timestamp'\n    \"label\": \"timexy\",       # default: 'timexy'\n    \"overwrite\": False       # default: False\n}\nnlp.add_pipe(\"timexy\", config=config, before=\"ner\")\n\ndoc = nlp(\"Today is the 10.10.2010. I was in Paris for six years.\")\nfor e in doc.ents:\n    print(f\"{e.text}\\t{e.label_}\\t{e.kb_id_}\")    \n```\n\n```bash\n\u003e\u003e\u003e 10.10.2010    timexy    TIMEX3 type=\"DATE\" value=\"2010-10-10T00:00:00\"\n\u003e\u003e\u003e six years     timexy    TIMEX3 type=\"DURATION\" value=\"P6Y\"\n```\n\n### Normalization of temporal expressions\nTimexy allows the normalization of all temporal expressions to\n- TimeML Timex3 standard\n- timestamp\n\nThe normalization is configured with the `kb_id_type` config parameter:\n```python\nconfig = {\n    \"kb_id_type\": \"timex3\",  # possible values: 'timex3'(default), 'timestamp'\n    \"label\": \"timexy\",       # default: 'timexy'\n    \"overwrite\": False       # default: False\n}\nnlp.add_pipe(\"timexy\", config=config, before=\"ner\")\n```\n\n\u003e **_NOTE:_** Normalizing temporal expressions that are not concrete dates to timestamp is not viable. Therefore, all non-date temporal expressions are always normalized to timex3 regardless of the `kb_id_type` config.\n\n## Contributing\nPlease refer to the contributing guidelines [here](https://github.com/paulrinckens/timexy/blob/main/CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulrinckens%2Ftimexy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulrinckens%2Ftimexy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulrinckens%2Ftimexy/lists"}