Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Procrustes alignment #32

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9804369
custom srcipts added
AlbertKhomich Oct 23, 2024
6e6fd5d
Resolved merge conflict in limes_config_extractor.py
AlbertKhomich Oct 23, 2024
7818df7
custom scripts were added
AlbertKhomich Nov 6, 2024
0216192
improve class extractor
AlbertKhomich Nov 13, 2024
3a775f4
Add: Add pipeline.sh
sshivam95 Nov 26, 2024
9d1223b
Update pipeline.sh
sshivam95 Nov 26, 2024
0ab0223
AML has been added; scripts update
AlbertKhomich Nov 27, 2024
3728b90
Add init file
sshivam95 Nov 29, 2024
648b8db
Update .gitignore
sshivam95 Nov 29, 2024
71b79b5
Add comments in pipeline
sshivam95 Nov 29, 2024
07404da
Pipeline: installing AML, creating alignment, creating links with limes
AlbertKhomich Nov 29, 2024
bd82f4d
extract classes, merge linking
AlbertKhomich Dec 2, 2024
074d1d4
Modify pipeline
sshivam95 Dec 2, 2024
0b8e2d0
Updated sh and alignment
Duygubirol Dec 2, 2024
70813d6
resolve merging conflict
Duygubirol Dec 2, 2024
0444fa0
Save changes to pipeline.sh
AlbertKhomich Dec 3, 2024
fdd1571
Resolved merge conflicts in .gitignore and pipeline.sh
AlbertKhomich Dec 3, 2024
b3853e7
creating alignments, generating sameAs links
sshivam95 Dec 2, 2024
0ad5223
minor updates
AlbertKhomich Dec 3, 2024
20818ba
extractor for dbpedia has been added
AlbertKhomich Dec 3, 2024
977f975
Update limes_config_extractor.py
sshivam95 Dec 3, 2024
1685028
Update limes_config_extractor.py
sshivam95 Dec 3, 2024
fb7292b
Update limes_config_extractor.py
sshivam95 Dec 3, 2024
2717595
expand prefix list
AlbertKhomich Dec 3, 2024
8535c69
Update .gitignore
sshivam95 Dec 3, 2024
3b5bf9b
Merge branch 'pipeline' of https://github.com/dice-group/WHALE into p…
sshivam95 Dec 3, 2024
5185b06
Update .gitignore
sshivam95 Dec 3, 2024
8595d44
Remove .json files
sshivam95 Dec 3, 2024
dc0fab9
Update .gitignore
sshivam95 Dec 3, 2024
925c427
Add linked prediction evaluation from dice embeddings
sshivam95 Dec 3, 2024
f67bb86
Change input path
sshivam95 Dec 3, 2024
681039e
Update pipeline
sshivam95 Dec 3, 2024
8f5c075
extractor, merge alignment, pipeline improvements
AlbertKhomich Dec 4, 2024
dafc16b
Merge branch 'pipeline' of https://github.com/dice-group/WHALE into a…
AlbertKhomich Dec 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
cache/
WDC_scripts/linking_scripts/AML/AML_v3.2/data
WDC_scripts/linking_scripts/AML/AML_v3.2/logs

# Translations
*.mo
Expand Down Expand Up @@ -175,4 +178,13 @@ knowledge_graph.nt
wikidata_classes_by_language.csv
wikidata_classes.nt
*.xml
*.nt
*.nt
*.nq
*.sh
!WDC_scripts/linking_scripts/limes/extract_configs_with_props_use_limes.sh

WDC_scripts/linking_scripts/limes/datasets/
Test_dataset/
*.json
checkpoints/
Experiments/
36 changes: 36 additions & 0 deletions Alignment/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Procrustes Alignment Module

## Overview

This module implements Procrustes alignment, a mathematical method for aligning embeddings from two knowledge graphs into a shared vector space. By aligning embeddings, entities and relations from different datasets can be directly compared, improving tasks such as link prediction and knowledge graph integration. The module supports alignment dictionaries from tools like LIMES or manually curated datasets, ensuring scalability and interpretability.


## Key Features

**Dynamic Loading of Embeddings and Mappings:** Automatically identifies and loads embeddings, entities, and relations from dataset folders.
**Flexible Alignment Dictionaries:** Accepts both pre-aligned dictionaries or LIMES-generated sameAs links for entity alignment.
**Bidirectional Procrustes Alignment:** Forward direction: Aligns Dataset A to Dataset B. Reverse direction: Aligns Dataset B to Dataset A.
**Integration of Non-Aligned Entities:** Processes non-aligned embeddings and integrates them into the aligned space.
**Unified Embedding Representation:** Combines aligned and non-aligned embeddings into a single representation for downstream tasks.
**Output Models:** Saves aligned embeddings and trained models, ready for tasks like link prediction, clustering, and graph completion.


## Applications

**Cross-Knowledge Graph Tasks:** Facilitates link prediction and other tasks requiring compatibility across datasets.
**Knowledge Graph Integration:** Aligns embeddings to merge multiple knowledge graphs seamlessly.
**Scalable and Explainable AI:** Maintains interpretability while being computationally efficient for large-scale datasets.


## Inputs

**Embedding Folder:**
- Directory containing subfolders for the two datasets.
- Each dataset subfolder must include:
- model.pt: Trained model file with embeddings.
- entity_to_idx.p: Entity-to-index mapping file.
- relation_to_idx.p: Relation-to-index mapping file.

**Alignment Dictionaries:**
- Pre-Aligned Dictionary: A file (e.g., .nt, .ttl, .txt) containing known alignments between entities in the two datasets.
- LIMES Alignment Dictionary: A file generated by LIMES that provides sameAs links for alignment.
Loading