Skip to content

Commit

Permalink
Refact
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis-Mozart committed Mar 25, 2024
1 parent 8d8fd9a commit d1abfdf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Decal Embeddings: Embeddings Knowledge Graph in Clifford Algebras

Knowledge graph embedding has shown to be succesfull when using divisional algebras ($\mathbb{R}$, $\mathbb{C}$, $\mathbb{Q}$, etc..) as these space are useful to model complex relations and pattern in a KG dataset. However, it exists no universal space to perform the embedding for all datasets as the space is congruent to the existing knowledge. Therefore, it can be difficult to decide, given a KG dataset in which space we will compute the embeddings. One existing approach **[(Keci)](https://link.springer.com/chapter/10.1007/978-3-031-43418-1_34)** already tackle this problem by performing the embedding in a Clifford Algebra $Cl_{p,q}(\mathbb{R})$. This approach already generalize over baselines such as DistMult, ComplEx etc... but cannot generalize over approaches based on dual numbers. To tackle this, we developped our approach DeCaL which performs the embeddings into a degenerate Clifford Algebra $Cl_{p,q,r}(\mathbb{R})$. These spaces, allows generalizing over approaches based on dual numbers (which cannot be modelled using $Cl_{p,q}$) and capturing patterns that emanate from the absence of higher-order interactions between real and complex parts of entity embeddings.
Knowledge graph embedding has shown to be succesfull when using divisional algebras ($\mathbb{R}$, $\mathbb{C}$, $\mathbb{Q}$, etc..) as these space are useful to model complex relations and pattern in a KG dataset. However, it exists no universal space to perform the embedding for all datasets as the space is congruent to the existing knowledge. Therefore, it can be difficult to decide, given a KG dataset in which space we will compute the embeddings.

One existing approach **[(Keci)](https://link.springer.com/chapter/10.1007/978-3-031-43418-1_34)** already tackle this problem by performing the embedding in a Clifford Algebra $Cl_{p,q}(\mathbb{R})$. This approach already generalize over baselines such as DistMult, ComplEx etc... but cannot generalize over approaches based on dual numbers. To tackle this, we developped our approach DeCaL which performs the embeddings into a degenerate Clifford Algebra $Cl_{p,q,r}(\mathbb{R})$. These spaces, allows generalizing over approaches based on dual numbers (which cannot be modelled using $Cl_{p,q}$) and capturing patterns that emanate from the absence of higher-order interactions between real and complex parts of entity embeddings.

For the discovery of the extra parameter p,q and r we proposed four algorithms:

Expand Down Expand Up @@ -31,7 +33,7 @@ wget https://files.dice-research.org/datasets/dice-embeddings/KGs.zip --no-check

# How to use this repo?
First install all the necessary packages: pip install -r requirements.txt
# Example of how to run the scripts

### Run the LES algorithm:
```bash
python run_Decal_LES.py --kg UMLS
Expand All @@ -46,5 +48,5 @@ python run_Decal_GS.py --kg UMLS
```
### Run the DeCal with desired values of p,q,r:
```bash
python main.py --path_dataset_folder ../decal-embeddings/KGs/FB15k-237 --p 1 --q 1 --r 5
python main.py --dataset_dir ../decal-embeddings/KGs/FB15k-237 --p 1 --q 1 --r 5
```

0 comments on commit d1abfdf

Please sign in to comment.