Skip to main content

A set of python modules for applying knowledge graph embedding on tabular data

Project description

Vectograph

Vectograph is an open-source software library for applying knowledge graph embedding approaches on tabular data. To this end, Vectograph enables users to converts tabular data into RDF knowledge graph and apply KGE approaches.

Installation

Installation from source

1) git clone https://github.com/dice-group/Vectograph.git
2) conda create -n temp python=3.6.2 # Or be sure that your have Python => 3.6.
3) conda activate temp
4) python ontolearn/setup.py install
# After you receive this Finished processing dependencies for OntoPy==0.0.1
5) python -c "import vectograph"

Installation via pip

pip install vectograph

Usage

import pandas as pd
from sklearn.pipeline import Pipeline
from vectograph.transformers import ApplyKGE, KGCreator

path_of_folder = '/.../data_files/'
tabular_csv_data_name = 'example'  
df = pd.read_csv(path_of_folder + tabular_csv_data_name + '.csv', index_col=0, low_memory=False)
####################################
#### Data Preprocessing ####
####################################
kg_path = path_of_folder + tabular_csv_data_name
pipe = Pipeline([('createkg', KGCreator(path=kg_path)),
                 ('embeddings', ApplyKGE(params={'kge': 'Conve',  # Distmult,Complex,Tucker,Hyper, Conve
                                                 'embedding_dim': 10,
                                                 'batch_size': 256,
                                                 'num_epochs': 10}))])

model = pipe.fit_transform(X=df.select_dtypes(include='category'))
print(model)

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

vectograph-0.0.2.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vectograph-0.0.2-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file vectograph-0.0.2.tar.gz.

File metadata

  • Download URL: vectograph-0.0.2.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.0.post20200616 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10

File hashes

Hashes for vectograph-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a3aad22c1800219a0ce25e82fd44e9aac3a89586f65f6da2f58a5ddc60620eee
MD5 dcafbd27f055dabc3759c2b65ed5eef4
BLAKE2b-256 95f02d508dea86a01201124942f11777c93c1316f41c114767b1105a3d2ceb88

See more details on using hashes here.

File details

Details for the file vectograph-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: vectograph-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.0.post20200616 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10

File hashes

Hashes for vectograph-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d2d608616a24940285a4a08e1e0158fab0d1a10db8596462eecf6c8b409024d9
MD5 1ae6a87007f65e935e063bf7b9950a4f
BLAKE2b-256 c5175dbc2e6f5b1acda0df1d6faed70b3fb384c3a936513b70f26a4f88f955d3

See more details on using hashes here.

Supported by

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