https://github.com/zenwor/article_gnn
Predict the number of article reads using graph neural networks.
https://github.com/zenwor/article_gnn
bash bert conda dl graph-neural-networks llm machine-learning ml mlp python pytorch regression
Last synced: 4 months ago
JSON representation
Predict the number of article reads using graph neural networks.
- Host: GitHub
- URL: https://github.com/zenwor/article_gnn
- Owner: zenwor
- Created: 2024-11-26T04:56:50.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-11-30T04:10:29.000Z (11 months ago)
- Last Synced: 2025-05-09T23:18:34.961Z (6 months ago)
- Topics: bash, bert, conda, dl, graph-neural-networks, llm, machine-learning, ml, mlp, python, pytorch, regression
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
π 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},
}