Giter Site home page Giter Site logo

huazai1992 / heer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gentlezhu/heer

0.0 1.0 0.0 253 KB

Easing Embedding Learning by Comprehensive Transcription of Heterogeneous Information Networks(KDD'18)

Python 80.61% Shell 11.39% Makefile 0.27% C++ 6.29% C 1.44%

heer's Introduction

HEER: Easing Embedding Learning by Comprehensive Transcription of Heterogeneous Information Networks

Source code and data for KDD'18 paper Easing Embedding Learning by Comprehensive Transcription of Heterogeneous Information Networks.

KDD promotional video Click Here!

Dependencies

Data

We use two publicly available real-world HIN datasets: DBLP and YAGO. We provide processed data links to reproduce our results.

  • DBLP (Tang et al., 2008): DBLP is a bibliographical network in the computer science domain. There are five types of nodes in the network: author, paper, key term, venue, and year. The edge types include authorship (aut.), term usage (term), publishing venue(ven.), and publishing year (year) of a paper, and the reference relationship from a paper to another (ref.). [download] [pretrained LINE embeddings]
  • YAGO (Suchanek et al., 2007): YAGO is a large-scale knowledge graph derived from Wikipedia, WordNet, and GeoNames. There are seven types of nodes in the network: person, location, organization, piece of work, prize, position, and event. A total of 24 edge types exist in the network, with five being directed and others being undirected. [download] [pretrained LINE embeddings]

Preparation

You will need to download zipped data and pretrained embedding via above links.

$ make

Please place unzipped pretrained embeddings under folder intermediate_data/ and network files under input_data/.

Train HEER

The hyperparameters for HEER are network name and epoch number. Regarding our proposed edge reconstruction task, the $network is formatted as "$data-name"_ko_"$ko-rate", e.g. yago_ko_0.4. You can find both DBLP and YAGO datasets with knock out rate from 0.1 to 0.9 in above link.

Example Usage

$ ./src/run.sh $network $epoch

Default Run & Parameters

Run HEER training on the YAGO dataset for 61 epochs, knock out rate is 0.4. We set the default model dump timer as 6, so you will have 10 models.

$ ./src/run.sh yago_ko_0.4 61

Evaluation

Similar with training, here we show how to evaluate HEER on the YAGO dataset, knock out rate is 0.4. Micro-MRR, Macro-MRR and MRR for each specific edge type can be found in evaluation result files under output/.

$ ./src/eval.sh yago_ko_0.4 61

Play with Your Own Data

We also provide tools to generate train and test data from any HINs. You can find detailed instructions under preprocessing/. In short, you need to prepare a formatted edge list and a data-specific config file. Then pre-train LINE embedding via pretrain/. Take yago.config for example,

[[0, 1], [0, 2], [0, 2], [0, 1], [0, 3], [0, 4], [4, 4], [0, 4], [0, 4], [0, 1], [0, 4], [0, 0], [0, 0], [0, 1], [0, 5], [0, 0], [2, 4], [0, 2], [0, 0], [6, 4], [0, 1], [0, 4], [0, 0], [4, 4]]
['PE', 'WO', 'AS', 'PR', 'AD', 'PO', 'EV']
['<created>:u', '<isAffiliatedTo>:u', '<playsFor>:u', '<actedIn>:u', '<hasWonPrize>:u', '<diedIn>:u', '<isPartOf>:d', '<isCitizenOf>:u', '<wasBornIn>:u', '<wroteMusicFor>:u', '<livesIn>:u', '<hasChild>:d', '<isMarriedTo>:u', '<directed>:u', '<holdsPosition>:u', '<influences>:d', '<isLocatedIn>:u', '<graduatedFrom>:u', '<isConnectedTo>:u', '<happenedIn>:u', '<edited>:u', '<isPoliticianOf>:u', '<isAdvisedBy>:d', '<hasCapital>:d']
[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1]

The first line describes left and right node types of a specific edge types, in which you need to index them in the node type list. The second line is the node type list. The third and fourth line describes edge types and directions. For example, <created>:u means created is an un-directed relation. Moreover, the first 0 in the fourth line indicates it is un-directed as well.

You can create your own train and evaluation file using command below, please refer preprocessing/ for more details:

$ python ./preprocessing/ko_hin.py --input-hin-file your-data --data-set-name preferred-network-name --path-output output-path --ko-rate 0.x

heer's People

Contributors

fangguo1 avatar ysyushi avatar unique24 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.