Skip to content

zenwor/article_gnn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Article GNN - Predicting the Number of Article Reads

Article GNN is a project implementing Graph Neural Networks, for the purpose of predicting the number of reads an article is going to get.

ℹ️ General Information

This project aims to understand the effect of locality graphs could create.

Graph generation is very simple in itself - articles of the same domain (source) are connected to each other, forming the connected components. This creates an isolated environment for each domain, and no communication is happening amongst the articles.

Leveraging these connected components, GNNs learn that the environment also matters, aside from the content. This leads to the obvious point - even if two different sources published the article with exactly the same content, we don't expect the same number of reads, simply because of the popularity and timing of the article publishing.

The architecture is relatively simple: GNN block, followed by an MLP block.
GNN block consists of several Graph Attention Network (GAT) layers, whilst the MLP consists of several Fully Connected Layers.

Testing is performed by adding a single article into the graph, and then evaluating the precision of the inferred value, compared to the ground truth value present within the dataset.

πŸš€ Quick Start

git clone https://github.com/LukaNedimovic/article_gnn.git cd article_gnn source ./setup.sh

πŸ“ Project Structure

article_gnn β”œβ”€β”€ data β”‚Β Β  β”œβ”€β”€ make_graph.py # Graph generation script β”‚Β Β  └── preprocess.py # Preprocess the dataset β”œβ”€β”€ model β”‚Β Β  β”œβ”€β”€ gnn.py # Core GNN block implementation β”‚Β Β  β”œβ”€β”€ mlp.py # Core MLP block implementation β”‚Β Β  └── model.py # Combining GNN -> MLP into general model β”œβ”€β”€ requirements.txt β”œβ”€β”€ setup.sh # Use this to set up the project! β”œβ”€β”€ train β”‚Β Β  β”œβ”€β”€ train.py # Main code used for training the model β”‚Β Β  └── train.sh # Run training, as described in `train.py` └── utils β”œβ”€β”€ argparser.py # Parse cmdline arguments β”œβ”€β”€ merge.py # Utility file, used to merge CSVs together β”œβ”€β”€ merge.sh # Run CSV merging └── path.py # Utility file, expand environment variables within the path

πŸ” References

This model leverages the Graph Attention Networks, as described in the original paper "Graph Attention Networks" (VeličkoviΔ‡ et al.):
@article{ velickovic2018graph, title="{Graph Attention Networks}", author={Veli{\v{c}}kovi{\'{c}}, Petar and Cucurull, Guillem and Casanova, Arantxa and Romero, Adriana and Li{\`{o}}, Pietro and Bengio, Yoshua}, journal={International Conference on Learning Representations}, year={2018}, url={https://openreview.net/forum?id=rJXMpikCZ}, note={accepted as poster}, }

About

πŸ“° Predict the Number of Article Reads using Graph Neural Networks

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors