Skip to content

zjukg/OntoZSL

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 

Repository files navigation

OntoZSL

Code and Data for the paper: "OntoZSL: Ontology-enhanced Zero-shot Learning". In this work, we propose to utilize ontology and generative adversarial network to deal with the zero-shot learning problems in image classification and KG completion.

Dataset Description

IMGC

Dataset # Classes (Total/Seen/Unseen) # Ontology Schema (Triples/Concepts/Properties)
AwA 50/40/10 1,256/180/12
ImNet-A 80/28/52 563/227/19
ImNet-O 35/10/25 222/115/8

KGC

Dataset # Relations (Total/Train/Val/Test) # Ontology Schema (Triples/Concepts/Properties)
NELL-ZS 139/10/32 3,055/1,186/4
Wikidata-ZS 469/20/48 10,399/3,491/8

Requirements

  • python 3.5
  • PyTorch >= 1.0.0

Dataset Preparation

Word Embeddings

You need to download pretrained Glove word embedding dictionary, uncompress it and put all files to the folder data/glove/.

AwA2

Download public image features and dataset split for AwA2, uncompress it and put the files in AWA2 folder to our folder data/AwA2/.

ImageNet (ImNet-A, ImNet-O)

Download the image features and the word embeddings of ImageNet classes as well as their splits from here and put them to the folder data/ImageNet/.

NELL-ZS & Wikidata-ZS

You can download these two datasets from here and put them to the corresponding data folder.

OntoZSL Training

The first thing you need to do is to train the text-aware ontology encoder using the code in the folder code/OntoEncoder, you can get more details at code/OntoEncoder/README.md.

Secondly, with well-trained ontology embedding, you can take it as the input of generative model, see the codes in the folders code/IMGC and code/KGC. The running commands are listed in the corresponding README.md files.

Note: you can skip the first step if you just want to use the ontology embedding we learned, the files are provided in the corresponding directories.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%