Giter VIP home page Giter VIP logo

node2vec-arxiv's Introduction

node2vec-arxiv

Documentation Status

Experiment using node2vec on arXiv papers metadata.

Installation

Prerequisites

  • Python โ‰ฅ 3.6

Provision a Virtual Environment

Create and activate a virtual environment (conda)

conda create --name py36_node2vec-arxiv python=3.6
source activate py36_node2vec-arxiv

If pip is configured in your conda environment, install dependencies from within the project root directory

pip install -r requirements.txt

Get ArXiv dataset

The dataset used in this repository should be downloaded from Kaggle

Create a folder data from within the project root directory. Place the downloaded file arxivData.json in the data folder.

Running the code

Now that the environment is setup and the dataset is available, you can run the code using the following command:

python main.py 

This will by default use the arxivData.json file as input and generate in the same data folder the following embedding files:

  • kg_node2vec_embed.emb: the embedding file with as first column the node id followed by the vector dimensions
  • kg_node2vec_label.tsv: a mapping of node id to node label

To simplify the visualisation we output as well embeddings and labels compliant with tensorflow projector tool. Note that we filter only to Author nodes for the purpose of the blog post.

  • kg_node2vec_tf_proj.tsv: an embedding file compliant with tensorflow project format (vectors without label nor id)
  • kg_node2vec_label.tsv: an label file compliant with tensorflow project format

Visualising the embeddings

Use Tensorflow projector to visualise the embeddings. You can load the data (embedding and label).

node2vec-arxiv's People

Contributors

pyvandenbussche avatar

Watchers

 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.