optimisingbeyondaccuracy

Keras-based neural recommender system trained on the MIND dataset, using attention mechanisms and differentiable loss regularisation to balance accuracy, diversity, and novelty.

https://github.com/johannesvc/optimisingbeyondaccuracy

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.8%) to scientific vocabulary

Keywords

attention-mechanism deep-learning keras mind-dataset neural-networks news-recommendation nlp recommender-system transformers
Last synced: 6 months ago · JSON representation ·

Repository

Keras-based neural recommender system trained on the MIND dataset, using attention mechanisms and differentiable loss regularisation to balance accuracy, diversity, and novelty.

Basic Info
  • Host: GitHub
  • Owner: JohannesVC
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage: https://johannes.vc
  • Size: 3.68 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Topics
attention-mechanism deep-learning keras mind-dataset neural-networks news-recommendation nlp recommender-system transformers
Created 11 months ago · Last pushed 10 months ago
Metadata Files
Readme License Citation

README.md

Optimising Beyond Accuracy

Tuning for Diversity and Novelty in Attention-based News Recommenders

This project implements and evaluates neural recommendation systems for news, with a focus on beyond-accuracy metrics such as diversity and novelty. Using the MIND dataset, it compares traditional and attention-based models, incorporating pre-trained language models (GloVe and BERT), and applies custom regularisation layers to encourage diverse and novel recommendations.

Key Features

  • Custom-built bi-encoder architectures
  • Integration of GloVe and fine-tuned BERT embeddings
  • Training pipeline with hard-negative sampling
  • Regularisation for Intra-List Diversity and Novelty
  • Evaluation on both accuracy and beyond-accuracy metrics
  • Statistical validation with t-tests and visualisations

Evaluation Metrics

| Type | Metrics | |-------------------|--------------------------------------| | Accuracy | AUC, MRR, nDCG@5, nDCG@10 | | Beyond-Accuracy | ILD, Surprisal, EPC, coverage |

Installation Instructions

1. Clone the repository

bash git clone https://github.com/johannesvc/OptimisingBeyondAccuracy.git cd OptimisingBeyondAccuracy

2. Install the requirements

bash pip install -r requirements.txt

3. Download the dataset

Download the MIND-small and/or MIND-large datasets from msnews.github.io, and place them in the .data/ directory.

4. Recreate Embedding Layers

To ensure reproducibility:

  • Use the embeddings.ipynb to:
    • Build the GloVe lookup matrix
    • Fine-tune the BERT embeddings (bert-base-uncased) on titles
  • Save the results to .npy format in the .data/ directory

Run Notebooks

All models are run from notebooks. Simply follow the steps and press run.

Results and Evaluation

After training, results (metrics and hyperparameters) are saved to results.json. Evaluation scripts are provided in the evaluation.ipynb notebook. These include:

  • Accuracy vs diversity trade-offs
  • Metric comparisons across model types
  • All plots used in the main report

Project Structure

bash . ├── baselines.ipynb # Main baselines script ├── bi-bert.ipynb # Documented training script using GloVe embeddings ├── bi-glove.ipynb # Documented training script using BERT embeddings ├── bi-encoder.ipynb # Main training script for hyperparameter tuning ├── CB.ipynb # Content-based filtering baseline script ├── EDA.ipynb # Exporatory Data Analysis and plotting ├── embeddings.ipynb # Fine-tuning BERT + saving embeddings ├── evaluation.ipynb # Evaluation scripts and plotting ├── README.md # This file ├── model.png # Diagram of model ├── recs │ ├── bi_encoder.py # Main training script │ ├── data_loader.py # Preprocessing and sequence generation │ ├── __init__.py │ ├── metrics.py # Evaluation and plotting │ ├── subclasses.py # Model architectures and custom layers │ └── utils.py # Utils for logging ├── requirements.txt └── results.json # Output results for all models


License

MIT License.


Citation

If you reference or build upon this work, please cite it using the following:

bibtex @software{Van_Cauwenberghe_Optimising_Beyond_Accuracy_2025, author = {Van Cauwenberghe, Johannes}, doi = {10.5281/zenodo.15322092}, license = {MIT}, month = apr, title = {{Optimising Beyond Accuracy: Tuning for Diversity and Novelty in Attention-based News Recommenders}}, url = {https://github.com/JohannesVC/OptimisingBeyondAccuracy}, version = {1.0}, year = {2025} }


Acknowledgements

  • MIND dataset by Microsoft Research
  • GloVe embeddings by Stanford NLP
  • BERT models via HuggingFace
  • Inspired by Microsoft Recommenders and Transformers4Rec (Nvidia)

Owner

  • Login: JohannesVC
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this work, please cite it as below."
title: "Optimising Beyond Accuracy: Tuning for Diversity and Novelty in Attention-based News Recommenders"
authors:
  - family-names: "Van Cauwenberghe"
    given-names: "Johannes"
    affiliation: "University of London"
version: "1.0"
doi: 10.5281/zenodo.15322092
date-released: 2025-04-13
url: "https://github.com/JohannesVC/OptimisingBeyondAccuracy"
license: MIT

GitHub Events

Total
  • Release event: 1
  • Public event: 1
  • Push event: 2
  • Create event: 1
Last Year
  • Release event: 1
  • Public event: 1
  • Push event: 2
  • Create event: 1

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 8
  • Total Committers: 1
  • Avg Commits per committer: 8.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 8
  • Committers: 1
  • Avg Commits per committer: 8.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
johannes j****c@h****m 8

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

requirements.txt pypi
  • colorcet ==3.1.0
  • huggingface-hub ==0.27.1
  • kagglehub ==0.3.4
  • keras ==3.8.0
  • keras-hub ==0.17.0
  • keras-tuner ==1.4.7
  • matplotlib ==3.9.1
  • nltk ==3.9.1
  • numpy ==1.26.4
  • nvidia-cuda-runtime-cu12 ==12.6.77
  • nvidia-tensorrt ==99.0.0
  • pandas ==1.5.3
  • scikit-learn ==1.6.1
  • seaborn *
  • tensorboard ==2.17.1