Skip to content

Find the perfect author for your resarch paper, using Graph neural networks

Notifications You must be signed in to change notification settings

viraj-s15/GraphCollabInsight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Co-author prediction

Status


A graph neural network which uses a neo4j database for link prediction

📝 Table of Contents

🧐 About

A graph neural network which predicts upto n number of co-authors, one particular author would want to work with. This model has been leveraged in the form of a notebook, python script and a flask api, all of which will be explained in their respective sections ahead. The data was extracted fro a neo4j dump and converted to a custom deep graph db for training.

🏁 Getting Started

Prerequisites

Before cloning the project, I highly recommend using a virtual environment, since the scale of this project was not very large, I have used pip. If this project has a larger scale or is to be worked on by others, I would recommned conda instead.

First create a python env and install all the dependencies

python3 -m venv venv
# activate env
source venv/bin/activate
pip install -r requirements.txt

🔧 Running the Code

Once the dependencies have been installed, I highly recommend using JupyterLab for running the notebooks. The purpose of each notebook will be explained in the section below.

🎈 Usage

All the information about the code has been included in the notebooks, some commens have also been included in places where I seemed necessary

  • notebooks/data_visualisation.ipynb : consists of all the relevant to visualise data and find outliers using a visual means
  • notebooks/dgl_data_creation.ipynb: This notebook takes the data in the csv format and converts it to a DGL data which can loaded into the dataloader directly
  • notebooks/inference.ipynb:The code used for inference of the model, the saved model is loaded and then used
  • notebooks/model_dgl_data.ipynb: Taking in the dgl data and creating a GraphSage model, training the neural network and saving it for inference
  • notebooks/model_training.ipynb: An alternate script to train the csv data using pytorch geometric
  • notebooks/tabular_data_creation.ipynb:Connects to the local neo4j database and converts to useful csv data

scripts/inference.py: A python inference script which can be imported as a module into other scripts scripts/model_definition.py: The model definition from which the GraphSage model can be imported during deployment api/main.py: Consists of the flask api for this model. It returns 5(can be chanegd) author ids along with a score

🚀 Deployment

A flask api which can be deployed extremely easily

Directions to run the api locally

cd api
python main.py

Example api call:

http://localhost:5000/get_possible_coauthors?author_id=authorID_5ef6f_df325_13aa7_cd11f_72bec

⛏️ Built Using

  • Python3 - Language
  • Pytorch - Deep Learning framework
  • DGL - Graph Neural Networks Ecosystem
  • Flask - Api creation

✍️ Authors

About

Find the perfect author for your resarch paper, using Graph neural networks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published