TorchicTab Heuristic
TorchicTab is a semantic table annotation system that automatically understands the content of a table and assigns semantic tags to its elements with high accuracy. It was originally developed for the SemTab challenge. You can find more about the full system in our dedicated article and paper.
This repository contains TorchicTab-Heuristic, the TorchicTab subsystem that annotates tables, using the Wikidata knowledge graph as a reference knowledge base. TorchicTab-Heuristic produces annotations for the following semantic annotation tasks:
- The Cell Entity Annotation (CEA) task associates a table cell with an entity.
- The Column Type Annotation (CTA) task assigns a semantic type to a column.
- The Column Property Annotation (CPA) task discovers a semantic relation contained in the RDF graph that best represents the relation between two columns.
- The Topic Detection (TD) task identifies the topic of a table that lacks a subject column and assigns a class.
Installation
TorchicTab-Heuristic requires a Python 3.9, 3.10 or 3.11 version. In case of conflicts, create a new virtual environment. For example, if you use conda, run:
conda create -n torchictab_env python=3.11
conda activate torchictab_env
Simple installation:
pip install torchic_tab_heuristic
Optional:
TorchicTab also allows the creation of an Elasticsearch index which contains all Wikidata entity-labels pairs. This allows for enhanced lookup tecnhiques leveraging powerful Elasticsearch functionalities, such as fuzzy querying. To use TorchicTab-Heuristic with Elasticsearch:
-
Download a Wikidata RDF dump from Zenodo
-
Install Elasticsearch. Recommended version: Elasticsearch 8
-
Process
config.pyfile to configure index name and RDF dump adress. -
Run elasticsearch server:
cd elasticsearch-X.X.X ./bin/elasticsearch
-
Create the elasticsearch index:
python elasticsearch/create_index.py
Usage
Example usage of TorchicTab-Heuristic with Wikidata:
Without Elasticsearch
python examples/sta_demo.py -i "examples/tables/cities.csv"
With Elasticsearch
python examples/sta_demo.py -i "examples/tables/cities.csv" -e
Cite
Thank you for reading! To cite our resource:
@InProceedings{dasoulas2023torchictab,
author = {Dasoulas, Ioannis and Yang, Duo and Duan, Xuemin and Dimou, Anastasia},
journal = {CEUR Workshop Proceedings},
publisher = {CEUR Workshop Proceedings},
title = {TorchicTab: Semantic Table Annotation with Wikidata and Language Models},
year = {2023-11-02},
}
Metadata
Release files for torchic-tab-heuristic 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| torchic_tab_heuristic-0.1.2.tar.gz | 31.8 kB | Without provenance | Details for torchic_tab_heuristic-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| torchic_tab_heuristic-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for torchic_tab_heuristic-0.1.2-py3-none-any.whl |
Total release size: 69.1 kB
Release files / torchic_tab_heuristic-0.1.2.tar.gz
| Download URL | torchic_tab_heuristic-0.1.2.tar.gz |
|---|---|
| Size | 31.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7c0fdb86115996336f80b875fb639dff722f82eed796152b5faddf5706b2fe3f
|
|
BLAKE2b-256 checksum How to use checksums |
ac56bfc0ed5b655b49a01c9bba00480da1c55cfa43b4730a82303b2982c3b7e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / torchic_tab_heuristic-0.1.2-py3-none-any.whl
| Download URL | torchic_tab_heuristic-0.1.2-py3-none-any.whl |
|---|---|
| Size | 37.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
43d14b6ab0204d485455752839120e9a2985d055b5f577943e259fe426711a47
|
|
BLAKE2b-256 checksum How to use checksums |
8c78c95d6a2cfb3c27efbd1dfd188ef29684b811d8710ea270212506d9be59d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Security for torchic-tab-heuristic 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.