Skip to content

Instantly share code, notes, and snippets.

View Ladsgroup's full-sized avatar

Amir Sarabadani Ladsgroup

View GitHub Profile
# MIT license
import pywikibot
import re
site = pywikibot.Site('en')
page = pywikibot.Page(site, 'Wikipedia:CHECKWIKI/WPC_104_dump')
ok = True
chars = '-\\/'
for case in page.get().split('\n'):
if not case.startswith('*') or '[[' not in case:
continue
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Fix quantities in wikidata. See T142087
The following parameters are supported:
&params;
-property like P31
@Ladsgroup
Ladsgroup / ores.js
Created October 29, 2016 20:31
A simple ScoredRevision alternate
// MIT license
// Author: Amir Sarabadani <[email protected]>
mw.config.set( 'ORESHighlighter', {
0.075: '#ffe099',
0.37: '#ffbe99',
0.90: '#f4908a'
});
( function ( mw, $ ) {
'use strict';
if ( !$('.mw-changeslist').length && !$('mw-contributions-list').length ) {
@Ladsgroup
Ladsgroup / SpecialEntityUsageTest.php
Created October 10, 2016 20:48
Special Entity usage test
<?php
namespace Wikibase\Client\Tests\Specials;
use FakeResultWrapper;
use RequestContext;
use SpecialPageFactory;
use SpecialPageTestBase;
use Title;
use Wikibase\Client\Specials\SpecialEntityUsage;
@Ladsgroup
Ladsgroup / populate_wp10.py
Created September 16, 2016 12:58
Populate wp10 tables
"""
Populate wp10 table based on the generated dump file
See T106278 and T135684
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
@Ladsgroup
Ladsgroup / test_flow.php
Created August 12, 2016 20:56
PHP test for __get()
<?php
class A {
public $d;
public function __get( $attribute ) {
throw new Exception( "Accessing non-existent parameter: $attribute" );
}
}
$a = new A();
ores:
scoring_system: local_single_thread
wsgi:
application_root: ""
url_prefix: ""
data_paths:
nltk: /srv/ores/config/submodules/wheels/nltk/
# Score cache options
score_caches:
@Ladsgroup
Ladsgroup / enwiki.md
Created May 23, 2016 12:21
PR-AUC reports

Model tuning report

  • Revscoring version: 1.2.6
  • Features: editquality.feature_lists.enwiki.damaging
  • Date: 2016-05-22T10:53:50.651577
  • Observations: 19739
  • Labels: [false, true]
  • Scoring: average_precision
  • Folds: 5

Top scoring configurations

delete from workset_task
using workset_task as wt
join workset on workset.id = wt.workset_id left outer join label on label.task_id = wt.task_id
WHERE
workset_task.workset_id = wt.workset_id AND
workset_task.task_id = wt.task_id AND
label.data is NULL
AND workset.expires < NOW();
feature.revision.user.has_advanced_rights 1.0490093950737576e-06
feature.revision.page.is_draftspace 2.4621092177386807e-05
feature.english.badwords.revision.diff.match_prop_delta_decrease 4.367555356801528e-05
feature.english.badwords.revision.diff.match_delta_decrease 8.270019856970701e-05
feature.english.informals.revision.diff.match_delta_decrease 0.00020848518531816815
feature.english.informals.revision.diff.match_prop_delta_decrease 0.00043629651036459154
feature.wikitext.revision.diff.uppercase_word_delta_decrease 0.0011955337824679502
feature.english.informals.revision.diff.match_delta_increase 0.0015854950858275522
feature.wikitext.revision.diff.uppercase_word_delta_increase 0.0016891927516089244
feature.wikitext.revision.diff.uppercase_word_prop_delta_decrease 0.0018079822750063184