-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP: added docs until encoders * Further create docs * Fixed upgrade to series and column name for concat * Adapt NotImplementedError * Fix failing tests * Add meta to qgramsblocker * Finalized docs,linting,type problems * Add architecture logo cleanup som deps * Add missing picture * Free ubuntu disk space * Remove failing flag and missing import
- Loading branch information
Showing
47 changed files
with
2,322 additions
and
1,210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,90 @@ | ||
<p align="center"> | ||
<img src="https://github.com/dobraczka/klinker/raw/main/docs/assets/logo.png" alt="klinker logo", width=200/> | ||
<h2 align="center"> strawman</h2> | ||
</p> | ||
<h2 align="center"> klinker</h2> | ||
|
||
<p align="center"> | ||
<a href="https://github.com/dobraczka/klinker/actions/workflows/main.yml"><img alt="Actions Status" src="https://github.com/dobraczka/klinker/actions/workflows/main.yml/badge.svg?branch=main"></a> | ||
<a href='https://strawman.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/klinker/badge/?version=latest' alt='Documentation Status' /></a> | ||
<a href="https://codecov.io/gh/dobraczka/klinker"><img src="https://codecov.io/gh/dobraczka/klinker/branch/main/graph/badge.svg"/></a> | ||
<a href="https://pypi.org/project/klinker"/><img alt="Stable python versions" src="https://img.shields.io/pypi/pyversions/klinker"></a> | ||
<a href='https://klinker.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/klinker/badge/?version=latest' alt='Documentation Status' /></a> | ||
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a> | ||
</p> | ||
|
||
<p align="center"> | ||
<img src="https://github.com/dobraczka/klinker/raw/main/docs/assets/KlinkerArchitectureNoLogo.png" alt="klinker overview", width=200/> | ||
</p> | ||
|
||
Installation | ||
============ | ||
Clone the repo and change into the directory: | ||
|
||
```bash | ||
git clone https://github.com/dobraczka/klinker.git | ||
cd klinker | ||
``` | ||
|
||
For usage with GPU create a [micromamba](https://mamba.readthedocs.io/en/latest/micromamba-installation.html) environment: | ||
|
||
```bash | ||
micromamba env create -n klinker-conda --file=klinker-conda.yaml | ||
``` | ||
|
||
Activate it and install the remaining dependencies: | ||
``` | ||
mamba activate klinker-conda | ||
pip install -e . | ||
``` | ||
|
||
Alternatively if you don't intend to utilize a GPU you can install it in a virtual environment: | ||
``` | ||
python -m venv klinker-env | ||
source klinker-env/bin/activate | ||
pip install -e .[all] | ||
``` | ||
|
||
or via [poetry](https://python-poetry.org/docs/): | ||
``` | ||
poetry install | ||
``` | ||
|
||
Usage | ||
===== | ||
Load a dataset: | ||
```python | ||
from sylloge import MovieGraphBenchmark | ||
from klinker.data import KlinkerDataset | ||
|
||
ds = KlinkerDataset.from_sylloge(MovieGraphBenchmark(graph_pair="tmdb-tvdb")) | ||
``` | ||
|
||
Create blocks and write to parquet: | ||
|
||
```python | ||
from klinker.blockers import SimpleRelationalTokenBlocker | ||
|
||
blocker = SimpleRelationalTokenBlocker() | ||
blocks = blocker.assign(left=ds.left, right=ds.right, left_rel=ds.left_rel, right_rel=ds.right_rel) | ||
blocks.to_parquet("tmdb-tvdb-tokenblocked") | ||
``` | ||
|
||
Read blocks from parquet and evaluate: | ||
```python | ||
from klinker import KlinkerBlockManager | ||
from klinker.eval_metrics import Evaluation | ||
|
||
kbm = KlinkerBlockManager.read_parqet("tmdb-tvdb-tokenblocked") | ||
ev = Evaluation.from_dataset(blocks=kbm, dataset=ds) | ||
``` | ||
|
||
Reproduce Experiments | ||
===================== | ||
|
||
The `experiment.py` has commands for datasets and blockers. You can use `python experiment.py --help` to show the available commands. Subcommands can also offer help e.g. `python experiment.py gcn-blocker --help`. | ||
|
||
You have to use a dataset command before a blocker command. | ||
|
||
For example if you used micromamba for installation: | ||
```bash | ||
micromamba run -n klinker-conda python experiment.py movie-graph-benchmark-dataset --graph-pair "tmdb-tvdb" relational-token-blocker | ||
``` | ||
|
||
This would be similar to the steps described in the above usage section. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.