Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/TimDettmers/ConvE
Browse files Browse the repository at this point in the history
  • Loading branch information
TimDettmers committed Mar 24, 2018
2 parents 789dad7 + 988944e commit 9c26d8a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ This repo supports Linux and Python installation via Anaconda.

1. Install [PyTorch](https://github.com/pytorch/pytorch) using [Anaconda](https://www.continuum.io/downloads)
2. Install the requirements `pip install -r requirements`
3. Run the preprocessing script for WN18RR, FB15k-237, YAGO3-10, UMLS, Kinship, and Nations: `sh preprocess.sh`
3. You can now run the model
3. Download the default English model used by [spaCy](https://github.com/explosion/spaCy), which is installed in the previous step `python -m spacy download en`
4. Run the preprocessing script for WN18RR, FB15k-237, YAGO3-10, UMLS, Kinship, and Nations: `sh preprocess.sh`
5. You can now run the model

## Running a model

Expand Down Expand Up @@ -130,7 +131,11 @@ There are some quirks of this framework.

It has been noted that [#6](/../../issues/6) WN18RR does contain 212 entities in the test set that do not appear in the training set. About 6.7% of the test set is affected. This means that most models will find it impossible to make any reasonable predictions for these entities. This will make WN18RR appear more difficult than it really is, but it should not affect the usefulness of the dataset. If all researchers compared to the same datasets the scores will still be comparable.

### Citation
## Logs

Some log files of the original research are included in the repo (logs.tar.gz). These log files are mostly unstructured in names and might be created from checkpoints so that it is difficult to comprehend them. Nevertheless, it might help to replicate the results or study the behavior of the training under certain conditions and thus I included them here.

## Citation

If you found this codebase or our work useful please cite us:
```
Expand Down
Binary file added logs.tar.gz
Binary file not shown.
3 changes: 1 addition & 2 deletions reverse_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ def check_for_reversible_relations(rel_to_tuple, threshold=0.80):
if i % 1000 == 0: print(i)
if rel in rel2reversal_rel:
rel2 = rel2reversal_rel[rel]
if (e2, e1) in rel2tuples[rel]: ranks.append(1)
elif (e2, e1) in rel2tuples[rel2]: ranks.append(1)
if (e2, e1) in rel2tuples[rel2]: ranks.append(1)
elif (e1, e2) in rel2tuples[rel2]: ranks.append(1)
else:
#ranks.append(rdm.randint(1, num_entities+1))
Expand Down

0 comments on commit 9c26d8a

Please sign in to comment.