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
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
vectograph-0.0.2-py3-none-any.whl
(20.8 kB
view hashes)
Close
Hashes for vectograph-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2d608616a24940285a4a08e1e0158fab0d1a10db8596462eecf6c8b409024d9 |
|
MD5 | 1ae6a87007f65e935e063bf7b9950a4f |
|
BLAKE2b-256 | c5175dbc2e6f5b1acda0df1d6faed70b3fb384c3a936513b70f26a4f88f955d3 |