Machine learning models/Production/Swedish Wikipedia article quality


Model card
This page is an on-wiki machine learning model card.
A diagram of a neural network
A model card is a document about a machine learning model that seeks to answer basic questions about the model.
Model Information Hub
Model creator(s)Aaron Halfaker (User:EpochFail) and Amir Sarabadani
Model owner(s)WMF Machine Learning Team (ml@wikimediafoundation.org)
Model interfaceOres homepage
CodeORES Github, ORES training data, and ORES model binaries
Uses PIINo
In production?Yes
Which projects?Swedish Wikipedia
This model uses data about a revision to predict the likelihood that the article is of a certain quality level.


Motivation

edit

This model card describes a model for predicting the quality of Wikipedia articles. It uses structural features extracted from the article to label Wikipedia articles with a probability score for each article quality class.

Wikipedia articles range in quality from rich, well-illustrated, fully-referenced articles that fully cover their topic and are easy to read to single sentence stubs that define the topic of the article but do not offer much more information. It is very useful to be able to reliably distinguish between these extremes and the various stages of quality along this spectrum. Wikipedia editors have developed rich rubrics for how to evaluate the quality of Wikipedia articles and are constantly assessing article quality to assist in coordinating work on the wikis. Editors use these quality scores to evaluate and prioritize their work. Researchers use these quality scores to understand content dynamics. Developers use these quality scores as filters when building recommender systems or other tools.

Wikipedia is always changing, which makes it time-consuming (and largely impossible) for editors to keep these quality assessments complete and up-to-date. An automatic quality model can help fill these gaps by evaluating the quality for articles that are unassessed or have changed substantially since they were last assessed. In doing so, it can provide researchers and tool developers with more consistent data and even potentially help editors identify articles that would benefit from a human assessment.

Users and uses

edit
Use this model for
  • high-level analyses of article quality trends
  • filtering / ranking articles in tools – e.g. only show low-quality articles in a recommender system
  • identifying potential ways to improve articles – e.g. using the lowest-value feature from the model as a recommendation
Don't use this model for
  • projects outside of Swedish Wikipedia
  • namespaces outside of 0, disambiguation pages, and redirects
  • directly comparing article quality across language editions – the scores are for a given project so e.g., an article that received a 0.5 score on English Wikipedia would get a much higher score if it had been on Simple English Wikipedia instead (because high-quality articles on English Wikipedia generally have more content than high-quality articles on Simple English Wikipedia)
Current uses

This model is a part of ORES, and generally accessible via API. It is used for high-level analysis of Wikipedia, platform research, and other on-wiki tasks.

Example API call:
https://ores.wikimedia.org/v3/scores/svwiki/1234/articlequality

Ethical considerations, caveats, and recommendations

edit
  • The source data for this model is several years old — data drift may skew current outputs relative to the training data.
  • The model does not currently take into account the quality of the specific writing, so a long article with many fake words would register as high quality. It does take into account structure though, so a long article would be penalized if it did not have many sections or was poorly referenced.
  • Different wikis have different labeling schemes — do not use this model in conjunction with other models to conduct an interwiki analysis.

Model

edit

Performance

edit

Test data confusion matrix:

Label n ~u ~b ~r ~s
u 498 371 15 106 6
b 497 87 222 106 82
r 499 176 23 289 11
s 466 1 54 15 396

Test data sample rates:

u b r s
sample 0.254 0.254 0.255 0.238
population 0.019 0.06 0.042 0.879

Test data performance:

Statistic u b r s
match_rate 0.191 0.086 0.173 0.755
filter_rate 0.809 0.914 0.827 0.245
recall 0.745 0.447 0.579 0.85
precision 0.074 0.312 0.14 0.989
f1 0.135 0.367 0.226 0.914
accuracy 0.818 0.908 0.833 0.86
fpr 0.181 0.063 0.155 0.066
roc_auc 0.874 0.761 0.826 0.959
pr_auc 0.105 0.404 0.174 0.992

Implementation

edit
Model architecture
{
    "type": "GradientBoosting",
    "params": {
        "loss": "deviance",
        "init": null,
        "ccp_alpha": 0.0,
        "verbose": 0,
        "min_impurity_split": null,
        "center": true,
        "multilabel": false,
        "n_iter_no_change": null,
        "min_samples_split": 2,
        "validation_fraction": 0.1,
        "subsample": 1.0,
        "min_samples_leaf": 1,
        "random_state": null,
        "max_features": "log2",
        "label_weights": null,
        "warm_start": false,
        "min_weight_fraction_leaf": 0.0,
        "labels": [
            "u",
            "b",
            "r",
            "s"
        ],
        "population_rates": null,
        "tol": 0.0001,
        "criterion": "friedman_mse",
        "min_impurity_decrease": 0.0,
        "presort": "deprecated",
        "n_estimators": 500,
        "learning_rate": 0.01,
        "max_depth": 3,
        "max_leaf_nodes": null,
        "scale": true
    }
}
Output schema
{
    "title": "Scikit learn-based classifier score with probability",
    "properties": {
        "probability": {
            "description": "A mapping of probabilities onto each of the potential output labels",
            "properties": {
                "u": {
                    "type": "number"
                },
                "s": {
                    "type": "number"
                },
                "b": {
                    "type": "number"
                },
                "r": {
                    "type": "number"
                }
            },
            "type": "object"
        },
        "prediction": {
            "description": "The most likely label predicted by the estimator",
            "type": "string"
        }
    },
    "type": "object"
}
Example input and output
Input:
https://ores.wikimedia.org/v3/scores/svwiki/1234/articlequality

Output:

{
    "svwiki": {
        "models": {
            "articlequality": {
                "version": "0.8.0"
            }
        },
        "scores": {
            "1234": {
                "articlequality": {
                    "score": {
                        "prediction": "s",
                        "probability": {
                            "b": 0.009658583330794227,
                            "r": 0.005079205879615088,
                            "s": 0.9790932720055064,
                            "u": 0.006168938784084233
                        }
                    }
                }
            }
        }
    }
}

Data

edit
Data pipeline
Labels were collected from on-wiki judgements of article quality, and then joined with revision features to create a source dataset.
Training data
Train data was automatically split off from test data using functionality from the revscoring repository.
Test data
Test data was automatically and randomly split off from train data using functionality from the revscoring repository and held out during the training process. The model then makes a prediction on that data, which is compared to the underlying ground truth to calculate performance statistics.

Licenses

edit

Citation

edit

Cite this model card as:

@misc{
  Triedman_Bazira_2023_Swedish_Wikipedia_article_quality,
  title={ Swedish Wikipedia article quality model card },
  author={ Triedman, Harold and Bazira, Kevin },
  year={ 2023 },
  url={ https://meta.wikimedia.org/wiki/Machine_learning_models/Production/Swedish_Wikipedia_article_quality }
}