Extension:ORES/zh

This page is a translated version of the page Extension:ORES and the translation is 44% complete.
Other languages:
Bahasa Indonesia • ‎English • ‎Türkçe • ‎中文 • ‎日本語
MediaWiki擴充功能手冊
OOjs UI icon advanced.svg
ORES
发布状态: 稳定版
ORES extension screenshot.png
描述 This extension integrates data from the ORES project into the RecentChanges view.
作者 Kunal Mehta, Amir Sarabadani, Adam Roses Wight
数据庫更改
ores_classification
ores_model
许可协议 GNU通用公眾授權條款3.0或更新版本
下载
  • $wgOresBaseUrl
  • $wgOresFrontendBaseUrl
  • $wgOresCacheVersion
  • $wgOresAggregatedModels
  • $wgOresWikiId
  • $wgOresEnabledNamespaces
  • $wgOresRevisionsPerBatch
  • $wgOresExcludeBots
  • $wgOresFiltersThresholds
  • $wgOresModelClasses
  • $wgOresUiEnabled
  • $wgOresModels
翻譯ORES擴充功能如在translatewiki.net可用
检查使用和版本矩阵。
Vagrant角色 ores
问题 尚未完成的工作 · 回報錯誤

The ORES extension integrates data from an ORES service into the RecentChanges view.

Currently, the ORES backend service is only set up for Wikimedia wikis, and significant work would be required to set it up for third-party MediaWiki installations.

截图

 
Changes that "need review" and may be damaging are highlighted in Special:RecentChanges.
 
A "needs review" flag is added to the Special:RecentChanges legend.

安装

  • 下载文件,并将其放置在您extensions/文件夹中的ORES目录内。
  • 将下列代码放置在您的LocalSettings.php的底部:
    wfLoadExtension( 'ORES' );
    
  •   完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。

You need to run CheckModelVersions.php maintenance script once it's deployed (and after that you can run PopulateDatabase.php too)

配置变量

Here's the config variables and their default values and a little description about them.

// URL of the service
$wgOresBaseUrl = 'https://ores.wikimedia.org/';
// Either to exclude edits made by bot to score
$wgOresExcludeBots = true;
// Models to score
$wgOresModels = [
    'damaging' => [ 'enabled' => true ],
    'goodfaith' => [ 'enabled' => true ],
    'reverted' => [ 'enabled' => true ],
    'wp10' => [ 'enabled' => true ],
];
// Thresholds of different sensitivies in ORES
$wgOresDamagingThresholds = [ 'soft' => 0.7, 'hard' => 0.5 ];
// Namespaces the ORES should score. Empty array means all namespaces.
// If not empty, it will only works on the given namespaces.
// Determine namespaces like [ 0 => true, 120 => true ].
$wgOresEnabledNamespaces = [];
// Database id for ORES service. If not determined, it'll use database name.
// You can choose 'testwiki' that ORES service sends last two digits of rev_id flipped.
// For example: https://ores.wikimedia.org/v1/scores/testwiki/damaging/12345
$wgOresWikiId = null;

ORES服务响应

ORES extension is merely more than an interface to the ORES service. The service returns a probability score of edits being damaging like this (API v1):

{
  "724030089": {
    "damaging": {
      "prediction": false,
      "probability": {
        "false": 0.8917716518085119,
        "true": 0.10822834819148802
      }
    }
  }
}

It means this edit (diff=724030089) is 10% likely to have caused damage. Note that 90% likely doesn't mean 9 out of ten cases will be vandalism. Choosing thresholds should be done via analysing recall (percentage of vandalism it can catch) or false positive rate. In ORES the "soft" threshold is when recall is 75% (meaning it will include 75% of all damaging edits) and the "hard" threshold is when recall is 90%. You can get the thresholds from model info (an example).

数据库架构

ORES extension introduces two new tables: ores_model and ores_classification. See the full database schema description.

扩展流程

Scores

Once an edit is made the extension triggers a job to hit the service and store the results in the ores_classification. It means it will not include scores for edits made before the deployment. In order to fill the database you can run the maintenance script PopulateDatabase.php. It will hits the service and keeps the score for the last 5,000 edits. You can run it several times if needed.

Once a model gets updated to a newer version CheckModelVersions.php maintenance script needs to be ran to update the ores_model table which will cause to scores stored in ores_classification become deprecated. You can clean these obsolete scores by running PurgeScoreCache.php maintenance script.

介面

The extension won't show anything when deployed but it will add itself as a beta feature (扩展:测试功能 is a dependency of this extension) and once it's enabled by the user it will use hooks in ChangesList (RecentChanges, Watchlist, and RelatedChanges) in both old and enhanced mode and highlights when score exceeds the given threshold.