Editing Wikiq
From CommunityData
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
[https://code.communitydata.cc/mediawiki_dump_tools.git Wikiq] is our tool for building tabular datasets from raw mediawiki edit data. Mediawiki outputs xml dump files, but these files are not so easy to work with, particularly because they contain the full text of every revision to every page. This makes it quite computationally expensive to process large wikis and leads to other technical problems. Wikiq efficiently processes mediawiki xml dumps to produce much smaller datasets that only contain variables that will be useful in our research. [[User:Groceryheist|Nate]] is working this summer on improvements to wikiq. Let him know if you have any requests!. | [https://code.communitydata.cc/mediawiki_dump_tools.git Wikiq] is our tool for building tabular datasets from raw mediawiki edit data. Mediawiki outputs xml dump files, but these files are not so easy to work with, particularly because they contain the full text of every revision to every page. This makes it quite computationally expensive to process large wikis and leads to other technical problems. Wikiq efficiently processes mediawiki xml dumps to produce much smaller datasets that only contain variables that will be useful in our research. [[User:Groceryheist|Nate]] is working this summer on improvements to wikiq. Let him know if you have any requests!. | ||
== ! New | == ! New Wikiq in 2018 == | ||
If you want the new wikiq, with improved persistence measures, use <code> wikiq_new </code>. | |||
There will be some breaking changes to wikiq in summer 2018. Currently, the stable version of the new wikiq is called <code>wikiq_new</code> on hyak. At some point we will switch to calling the old version <code>wikiq_old</code> and the new version will be <code> wikiq </code>. | |||
See Also: [[ | See Also: [[Dataset_And_Tools_Release_2018]] | ||
== Setting up Wikiq == | == Setting up Wikiq == | ||
Wikiq is a python3 program with dependencies. To run on Hyak, for now, you will need to install the dependencies using | Wikiq is a python3 program with dependencies. To run on Hyak, for now, you will need to install the dependencies using | ||
<code> pip install --user mwxml pandas git+https://github.com/mediawiki-utilities/python-mwpersistence.git mediawiki-utilities pymysql </code> | <code> pip install --user mwxml pandas git+https://github.com/mediawiki-utilities/python-mwpersistence.git mediawiki-utilities pymysql </code> | ||
== Command Line Arguments == | == Command Line Arguments == | ||
Line 16: | Line 18: | ||
<code>--url-encode</code> : *Recommended* pass this in to url-encode text fields (page titles, editor names). This is used to safely handle text which might contain unicode characters that conflict with other parsing systems. You will probably want to url-decode these columns when you read them. | <code>--url-encode</code> : *Recommended* pass this in to url-encode text fields (page titles, editor names). This is used to safely handle text which might contain unicode characters that conflict with other parsing systems. You will probably want to url-decode these columns when you read them. | ||
<code>--persistence</code> : Compute persistent word revisions, a useful measure of contribution quality, for each edit. This is somewhat costly, and slow, to compute | <code>--persistence</code> : Compute persistent word revisions, a useful measure of contribution quality, for each edit. This is somewhat costly, and slow, to compute. | ||
<code>--collapse-user</code> : Operate only on the final revision made by user a user within all sequences of consecutive edits made by a user. This can be useful for addressing issues with text persistence measures. | <code>--collapse-user</code> : Operate only on the final revision made by user a user within all sequences of consecutive edits made by a user. This can be useful for addressing issues with text persistence measures. | ||
<code>--help</code> : Get help using Wikiq. | <code>--help</code> : Get help using Wikiq. | ||
== Codebook == | == Codebook == | ||
The current version of wikiq provides one row for each edit (unless --collapse-user is passed, in which case each row corresponds to consecutive edits by the same editor) | The current version of wikiq provides one row for each edit (unless --collapse-user is passed, in which case each row corresponds to consecutive edits by the same editor): | ||
anon articleid collapsed_revs date_time deleted editor editor_id minor namespace revert reverteds revid sha1 text_chars title token_revs tokens_added tokens_removed tokens_window | anon articleid collapsed_revs date_time deleted editor editor_id minor namespace revert reverteds revid sha1 text_chars title token_revs tokens_added tokens_removed tokens_window | ||
Line 64: | Line 45: | ||
<code>minor</code> : Whether the edit is minor | <code>minor</code> : Whether the edit is minor | ||
<code>namespace</code> : | <code>namespace</code> : Id of the namespace. (see https://www.mediawiki.org/wiki/Manual:Namespace#Built-in_namespaces) | ||
<code>revert</code> : The edit identity reverts one or more other edits. | <code>revert</code> : The edit identity reverts one or more other edits. | ||
Line 76: | Line 57: | ||
<code>text_chars</code> : Length of the article in characters following the revision | <code>text_chars</code> : Length of the article in characters following the revision | ||
The following variables refer to persistent word revisions (PWR) and are only provided when wikiq is called with the <code>--persistence</code> argument: | The following variables refer to persistent word revisions (PWR) and are only provided when wikiq is called with the <code>--persistence</code> argument: | ||
<code> | <code>token revs</code> : The number of "token revisions" contributed by the edit. This is the key PWR variable. | ||
<code> | <code>tokens added</code> : The number of tokens added by the edit. | ||
<code> | <code>tokens removed</code>: The number of tokens removed by the edit. | ||
<code> | <code>tokens window</code> : The maximum revisions examined in computing token revisions. | ||
Line 92: | Line 72: | ||
<code>collapsed_revs</code> : The number of consecutive revisions the editor made that have been collapsed into the row. | <code>collapsed_revs</code> : The number of consecutive revisions the editor made that have been collapsed into the row. | ||