Page MenuHomePhabricator

Compile a list of articles with "similar" references and hand-categorize use cases
Open, Needs TriagePublic

Assigned To
None
Authored By
awight
Jun 11 2024, 1:23 PM
Referenced Files
F56162222: image.png
Jul 2 2024, 7:16 AM
F56162143: image.png
Jul 2 2024, 7:16 AM
F56162115: image.png
Jul 2 2024, 7:16 AM
F56162026: image.png
Jul 2 2024, 7:16 AM
F56162267: image.png
Jul 2 2024, 7:16 AM
F56161899: image.png
Jul 2 2024, 7:16 AM

Description

We want to understand why similar refs (currently defined by us as "differing by less than 10 characters in length, and with a Levenshtein edit distance less than 10% of the longer text") exist. The German Wikipedia users are also curious to have a list of articles they can clean up in which we've detected such similarities. One hypothesis is that these are going to mostly be small but meaningful differences, for example two different page numbers in the same book.

Cannot commit to doing this regularly, it's just a one-off thing at the moment.

  • Select a handful of wikis to process, which have varied template-ref usage patterns. Include dewiki.
    • dewiki (12% of pages include similar refs)
    • enwiki (12%)
    • jawiki (16%)
    • cawiki (7%)
  • Go through scraper output and produce a list of all articles with similar refs.
    • Columns: article title, URL to the page, count of similar refs, count of identical refs
    • Example query: gunzip -c < dewiki-20240501-page-summary.ndjson.gz | jq -c "select(.similar_ref_count > 0) | [.title, .ref_count, .similar_ref_count, .identical_ref_count]" > ~/dewiki-20240501-similars.ndjson
  • Choose a limited sample of these pages which we will look at manually.
    • Initial sample of 10 articles per wiki (40 total) was chosen by using shuf on the results of the command above.
  • Hand-code each page from our sample, letting the data define our categories. For example, "two different page numbers in same book", "accidental typo in otherwise identical refs", "accidental whitespace change", "Different issues of a magazine or another change which would not fit our extends feature"...
    • Open the article in read mode, copy the URL to the sample sheet.
    • Select and copy the entire footnote block
    • Paste the reflist into a scratch spreadsheet worksheet so that each item is on its own line.
    • Sort the column A-Z
  • Package the output in a form that's easy to share with the German Wikipedia community and publish. Reflect on how "extends" could be applied in various cases, its strengths and weaknesses.

Summary of findings

Disclaimer: this was a small sampling of N=40 articles taken from 4 wikis, 10 per wiki. We can't draw any definite conclusions, but there was some consistency in the patterns across wikis.

Summary spreadsheet: https://docs.google.com/spreadsheets/d/1uWD6ojZP6uXGlgYtB6TX02NXKN_KpeD4wfYPObY1IpU/edit

Is there evidence for the "book referencing" use case?

  • Yes, in half of the sampled articles there was at least one pair of references which refer to the same book, only differing by a page or volume number.
  • Only one or two sampled articles on each wiki leaned heavily on book references, in most cases these were a small minority of the refs.

Were there any challenges in how "extends" would apply to these book referencing cases?

  • When the book is already mentioned in a Bibliography section, it wouldn't make sense to pull the book out and turn it into a list-defined reference. One possibility is to create a parent reference which points to the bibliography book:

image.png (362×171 px, 12 KB)

  • Nesting some references but not others breaks the visual equivalence between sources, even though 1 vs. 2 references coming from a source doesn't deserve such strong semantics.
  • Multi-column layout and very long (eg. 40) lists of indented subreferences both turn the layout into a narrow vertical strip.
  • In another extreme example, almost all references in the article are from two encyclopedic sources, which could make it harder to see the "parent" context:

image.png (799×228 px, 107 KB)

  • On all wikis other than German wikipedia, it seems much more common to use templates like {{sfn}} especially when referencing different pages of a book.

What were the other use cases which were detected as "similar" references?

  • The case of "different URL" was roughly twice as prevalent as book references. This is a use case in which the source could be grouped but each subreference points to a different Internet resource so the links will have to be inside of each subref. For example, there might be different years of a census or different episodes of a TV show. The title of the entire resource often changes for every subreference:

image.png (577×95 px, 34 KB)

This is an awkward fit for "extends" because the grouped resource might not have a natural name, and the subreferences still require separate metadata such as access date:
image.png (485×86 px, 13 KB)

Another example:
image.png (408×213 px, 37 KB)

  • Sometimes there's a single author eg. journalist and newspaper which resemble a single "source" in the sense that we want to consolidate, but the articles don't fit well into a single group, since they're usually considered independent units:

image.png (404×108 px, 24 KB)

  • We saw only a handful of "should have been identical", which were all caused by slightly different ways of typing the same reference. FWIW, these are usually easy to see if the references are shown in an alphabetically-sorted list.

Event Timeline

awight removed awight as the assignee of this task.Jul 2 2024, 7:16 AM
awight updated the task description. (Show Details)
awight moved this task from Doing to UX/PM Review on the WMDE-TechWish-Sprint-2024-06-26 board.

Question from @WMDE-Fisch which should be investigated:

Would be interesting if these [book referencing] examples use "the" cite book template.

Would be interesting if these [book referencing] examples use "the" cite book template.

The answer was that dewiki is the exception and in our sample bare refs are created. But on other wikis the book referencing is normally done using templates like {{sfn}} (or templates with even more magic included).

Would be interesting if these [book referencing] examples use "the" cite book template.

The answer was that dewiki is the exception and in our sample bare refs are created. But on other wikis the book referencing is normally done using templates like {{sfn}} (or templates with even more magic included).

Interesting, I was under the impression that dewiki also usually used {{Cite book}} to format references, but you say that's not the case? And for enwiki, I was under the impression that most (if not all) parent references where {{sfn}}-templates point to, also contain {{Cite book}}, eg:

<ref>{{cite book |last=Shulman |first=Seth |title=The Telephone Gambit: Chasing Alexander Bell's Secret |location=New York |publisher=Norton & Company |date=2008 |page=[https://archive.org/details/telephonegambitc00shul/page/49 49] |isbn=978-0-393-06206-9 |url=https://archive.org/details/telephonegambitc00shul/page/49 }}</ref>

and

{{sfn|Shulman|2008|p=46}}

Is that different from your understanding of the situation?

Wrt to @WMDE-Fisch 's question - could you then not 'count' how many of the similar references contain {{Cite book}} vs journal, news, or other templates? I would love to see the division, and then potentially take a sample of 10 examples each of similar refs that:

  • contain {{Cite book}}
  • contain any other template that is present in at least 10% of similar refs
  • contain no templates whatsoever

That might really help me understand the space more deeply, formulate assumptions on the potential for sub-references to be adopted for each prevalent case, and craft some example materials to validate those assumptions.

Interesting, I was under the impression that dewiki also usually used {{Cite book}} to format references, but you say that's not the case?

I would want to answer that with better quantitative data, so going to the full scraper results I see that refs_with_solely_transclusion_count is 28% of refs on dewiki (4305823 / 15115887), vs. for example 48% on enwiki (39916823 / 82865130). Looking at transclusions_inside_refs in the detailed summary shows that the {{Literatur}} template was detected in 789215 refs or 5% of all refs. This is dwarfed by {{Internetquelle}} which is used 3.5x as often, just to compare. So yeah I think the conclusion is that {{Literatur}} is not extremely common. I also double-checked against another tool since we have a known problem with top-level templates in dumps at the moment, but the external tool reports even fewer, at 490029 transclusions.

And for enwiki, I was under the impression that most (if not all) parent references where {{sfn}}-templates point to, also contain {{Cite book}}

Reading through the template docs, what you say matches except for two points:

  • There are a large number of templates which can format the main source, not just {{Cite book}}. They're calling this family "Citation Style 1", for example {{cite web}} etc.. Also, there are many ways of referencing the work which can link to it using different anchor IDs. For example, {{sfn}}, {{Harv}} and {{rp}}, and the anchor ID can also be passed either explicitly or using alternative schemes such as harvid: {{sfn|ref={{harvid|Monty Python and Philosophy|2006}}}}.
  • The other big difference was probably just a typo in your example, but {{cite book}} would not be inside of a <ref> tag in the use case we're talking about, instead it will be in a Bibliography section on its own line of normal article text.

I actually understood Fisch's question in a different way, just to mention it. I thought he was asking if the "subrefs" were using {{Cite book}}. My mistake! But it does factor into your next question too, which I'll get to separately :-)

Wrt to @WMDE-Fisch 's question - could you then not 'count' how many of the similar references contain {{Cite book}} vs journal, news, or other templates? I would love to see the division, and then potentially take a sample of 10 examples each of similar refs that:

Finding the overall statistics would be best accomplished by adding to the scraper module which finds similar refs, then doing some analysis of the contents of these refs in our next scraper run. I think there was also an improvement to Parsoid which will let us get more information from refs with top-level templates such as {{cite book}}.

But let's get a quick sample by looking at the similar refs identified in this task. It won't be particularly representative but does illustrate some patterns:

<ref>Edita [[SARPE]] ''Gran Enciclopedia de la Música Clásica, vol. I, pàg. 55'' ({{ISBN|84-7291-226-4}})</ref>
<ref>Edita [[SARPE]] ''Gran Enciclopedia de la Música Clásica, vol. I, pàg. 40'' ({{ISBN|84-7291-226-4}})</ref>
<ref> Edita [[SARPE]], Gran Enciclopedia de la Música Clásica, vol. III, pàg. 1165. (ISBN|84-7291-226-4)</ref>
<ref>{{format ref}} http://www.mabtech.com/Main/Page.asp?PageId=16 {{Webarchive|url=https://web.archive.org/web/20120220020151/http://www.mabtech.com/Main/Page.asp?PageId=16 |date=2012-02-20}}</ref>
<ref>{{format ref}} http://www.mabtech.com/Main/Page.asp?PageId=33 {{Webarchive|url=https://web.archive.org/web/20120519022812/http://www.mabtech.com/Main/Page.asp?PageId=33 |date=2012-05-19}}</ref>
{{sfn|Condado Madera|2002|p=35}}
{{sfn|Condado Madera|2002|p=36}}
<ref name="GEM">{{GEM|4|180|Cova, Comtat de la}}</ref>
<ref>{{GEM|4|182|Cova, sa}}</ref>
{{sfn|Martí i Salas|2017|p=56}}
{{sfn|Martí i Salas|2017|p=68}}
{{sfn|Martí i Salas|2017|p=72}}
...
<ref>{{Ref-web|url=https://familysearch.org/pal:/MM9.3.1/TH-266-12122-137523-99?cc=1542666&wc=M6WV-BM9:101520103,101722201|títol=Hungary Funeral Notices, 1840-1990; pal:/MM9.3.1/TH-266-12122-137523-99 — FamilySearch.org|obra=[[FamilySearch]]|consulta=14 December 2014|arxiuurl=https://web.archive.org/web/20160304091651/https://familysearch.org/pal:/MM9.3.1/TH-266-12122-137523-99?cc=1542666&wc=M6WV-BM9:101520103,101722201|arxiudata=4 March 2016}}</ref>
<ref>{{Ref-web|url=https://familysearch.org/pal:/MM9.3.1/TH-266-12122-133677-0?cc=1542666&wc=M6WV-BM9:101520103,101722201|títol=Hungary Funeral Notices, 1840-1990; pal:/MM9.3.1/TH-266-12122-133677-0 — FamilySearch.org|obra=[[FamilySearch]]|consulta=14 December 2014|arxiuurl=https://web.archive.org/web/20160304104345/https://familysearch.org/pal:/MM9.3.1/TH-266-12122-133677-0?cc=1542666&wc=M6WV-BM9:101520103,101722201|arxiudata=4 March 2016}}</ref>
<ref>{{Ref-web|url=https://familysearch.org/pal:/MM9.3.1/TH-267-11097-127369-82?cc=1542666&wc=M6WV-PTL:101520601,101622301|títol=Hungary Funeral Notices, 1840-1990; pal:/MM9.3.1/TH-267-11097-127369-82 — FamilySearch.org|obra=[[FamilySearch]]|consulta=14 December 2014|arxiuurl=https://web.archive.org/web/20160303230949/https://familysearch.org/pal:/MM9.3.1/TH-267-11097-127369-82?cc=1542666&wc=M6WV-PTL:101520601,101622301|arxiudata=3 March 2016}}</ref>
<ref>{{Ref-web|url=https://familysearch.org/pal:/MM9.3.1/TH-267-11097-128186-85?cc=1542666&wc=M6WV-PTL:101520601,101622301|títol=Hungary Funeral Notices, 1840-1990; pal:/MM9.3.1/TH-267-11097-128186-85 — FamilySearch.org|obra=[[FamilySearch]]|consulta=14 December 2014|arxiuurl=https://web.archive.org/web/20160307215634/https://familysearch.org/pal:/MM9.3.1/TH-267-11097-128186-85?cc=1542666&wc=M6WV-PTL:101520601,101622301|arxiudata=7 March 2016}}</ref>
<ref>{{Ref-llibre|url= http://quran.com/24|capítol=Surat An-Nur|títol=Qu'ran}}</ref>
<ref>{{Ref-llibre |url= http://quran.com/66/1-6 |títol=Qur'an |capítol=Surat At-Tahrim}}</ref>
<ref>{{ref-web|títol= Todos os brasileiros - 1974| url= http://www1.folha.uol.com.br/folha/especial/2006/copa/todos_os_brasileiros-1974.shtml | consulta= 2017-12-16 |data=9 desembre 2005 | editor=FolhaOnline |llengua= portuguès}}</ref>
<ref>{{ref-web|títol= Todos os brasileiros - 1978| url= http://www1.folha.uol.com.br/folha/especial/2006/copa/todos_os_brasileiros-1978.shtml | consulta= 2017-12-16 |data=9 desembre 2005 | editor=FolhaOnline |llengua= portuguès}}</ref>
<ref>{{cite web|url=http://www.tv.com/without-a-trace/show/7449/episode.html?tag=list_header;paginator;1&season=1 |title=''Without a Trace Season 1 Episode Guide'' |publisher=tv.com |accessdate=9. Juni 2010}}</ref>
<ref>{{cite web|url=http://www.tv.com/without-a-trace/show/7449/episode.html?tag=list_header;paginator;2&season=2 |title=''Without a Trace Season 2 Episode Guide'' |publisher=tv.com |accessdate=9. Juni 2010}}</ref>
<ref>{{cite web|url=http://www.tv.com/without-a-trace/show/7449/episode.html?tag=list_header;paginator;3&season=3 |title=''Without a Trace Season 3 Episode Guide'' |publisher=tv.com |accessdate=9. Juni 2010}}</ref>
...
<ref name="Statistik2005">{{Orte TG 2000}}</ref>
<ref name="Statistik2012">{{Orte TG 2010}}</ref>
<ref>Gemeinde Weichselbaum: [http://www.gemeinde-weichselbaum.at/cms/index.php?view=article&id=60%3Agemeindeprofil&option=com_content&Itemid=23 ''Gemeindeprofil''] (abgerufen am 29. Oktober 2014)</ref>
<ref>Gemeinde Weichselbaum: [http://www.gemeinde-weichselbaum.at/cms/index.php?view=article&id=86%3Aortsteile&option=com_content&Itemid=23 ''Ortsteile''] (abgerufen am 29. Oktober 2014)</ref>
<ref name="Geschichte">Gemeinde Weichselbaum: {{Webarchiv|url=http://www.gemeinde-weichselbaum.at/cms/index.php?option=com_content&view=article&id=5&Itemid=5 |wayback=20150221234735 |text=''Geschichte'' |archiv-bot=2019-05-10 20:42:01 InternetArchiveBot }} (abgerufen am 29. Oktober 2014)</ref>
...
<ref>Zit. nach Tropper (Hrsg.): ''Kirche im Gau.'' 1995, S. 57 f. (Dok. 7). Wiedergegeben auch bei Schernthaner: ''Andreas Rohracher.'' 1994, S. 55, Anm. 190.</ref>
<ref>Tropper (Hrsg.): ''Kirche im Gau.'' 1995, Dokument 21 (am 30. August 1940) sowie 32 (am 28. Juni 1941).</ref>
<ref>Tropper (Hrsg.): ''Kirche im Gau.'' 1995, S. 170 f. (Dok. 44: Brief vom 16. April 1942). – Manche Historiker sprechen hier von einem „Protest“ Rohrachers; das ist aber angesichts seiner Formulierungen, die – genau genommen – nur die Mittel und Wege infrage stellten, nicht aber die Ziele – übertrieben.</ref>
<ref name="NRHP_5">vgl. Broomer/Friedberg, S. 5.</ref>
<ref name="NRHP_6">vgl. Broomer/Friedberg, S. 6.</ref>
<ref name="NRHP_7">vgl. Broomer/Friedberg, S. 7.</ref>
<ref>Dan Goldstein: ''The Rough Guide to English Football – A Fan’s Handbook 2000–2001''. Rough Guides, London 2000, S. 430.</ref>
<ref>Dan Goldstein: ''The Rough Guide to English Football – A Fan’s Handbook 2000–2001''. Rough Guides, London 2000, S. 82.</ref>
<ref>Dan Goldstein: ''The Rough Guide to English Football – A Fan’s Handbook 2000–2001''. Rough Guides, London 2000, S. 215, 435.</ref>

and

<ref>''London Calling – Die Hauptstadt des Fußballs.'' (= 11 Freunde Spezial). März 2016, S. 99.</ref>
<ref>''London Calling – Die Hauptstadt des Fußballs.'' (= 11 Freunde Spezial). März 2016, S. 67.</ref>
<ref>{{Internetquelle |url=http://www.gdk-research.de/de/obj19401985.html |titel=Jagdbeute — Die Großen Deutsche Kunstausstellungen 1937 – 1944/45 |abruf=2021-12-06}}</ref>
<ref>{{Internetquelle |url=http://www.gdk-research.de/de/obj19402286.html |titel=Hühnerhof — Die Großen Deutsche Kunstausstellungen 1937 – 1944/45 |abruf=2021-12-06}}</ref>
<ref>{{Internetquelle |url=http://www.gdk-research.de/de/obj19405171.html |titel=Wintertag am Niederrhein — Die Großen Deutsche Kunstausstellungen 1937 – 1944/45 |abruf=2021-12-06}}</ref>
...
<ref>Stefan Neumann: ''Loriot und die Hochkomik.'' 2011, S.&nbsp;251.</ref>
<ref>Dieter Lobenbrett: ''Loriot.'' 2012, S.&nbsp;121. Stefan Neumann: ''Loriot und die Hochkomik.'' 2011, S.&nbsp;243.</ref>
<ref name="firstsound">Carl J. Mora: „Mexican Cinema: Reflections of a Society, 1896–2004.“ McFarland & Co Inc, Jefferson N.C. 2005. Seite 33.</ref>
<ref name="santa">Carl J. Mora: „Mexican Cinema: Reflections of a Society, 1896–2004.“ McFarland & Co Inc, Jefferson N.C. 2005. Seite 34.</ref>
<ref name="PRS2010">{{Cite web|url=http://www.perthroyalshow.com.au/Libraries/Beer/2010-Beer-Results.pdf|publisher=Royal Agricultural Society of Western Australia|title=2010 Perth Royal Beer Show|year=2010|access-date=5 June 2013|archive-url=https://web.archive.org/web/20130421123912/http://www.perthroyalshow.com.au/Libraries/Beer/2010-Beer-Results.pdf|archive-date=21 April 2013|url-status=dead}}</ref>
<ref name="PRS2011">{{Cite web|url=http://www.perthroyalshow.com.au/best-in-show/competition-results_2011.aspx|publisher=Royal Agricultural Society of Western Australia|title=2011 Perth Royal Beer Show|year=2011|access-date=5 June 2013|archive-date=8 September 2013|archive-url=https://web.archive.org/web/20130908091928/http://www.perthroyalshow.com.au/best-in-show/competition-results_2011.aspx|url-status=dead}}</ref>
<ref name="PRS2012">{{Cite web|url=http://www.perthroyalshow.com.au/best-in-show/Competition-Results.aspx|publisher=Royal Agricultural Society of Western Australia|title=2012 Perth Royal Beer Show|year=2012|access-date=5 June 2013|archive-date=19 April 2013|archive-url=https://web.archive.org/web/20130419002208/http://www.perthroyalshow.com.au/best-in-show/Competition-Results.aspx|url-status=dead}}</ref>
...
<ref>{{Cite web |title=Open Government Guide Alabama - Reporters Committee |url=https://www.rcfp.org/open-government-guide/alabama/ |access-date=2023-03-05 |website=The Reporters Committee for Freedom of the Press |language=en-US}}</ref>
<ref>{{Cite web |title=Open Government Guide Alaska - Reporters Committee |url=https://www.rcfp.org/open-government-guide/alaska/ |access-date=2023-03-05 |website=The Reporters Committee for Freedom of the Press |language=en-US}}</ref>
<ref>{{Cite web |title=Open Government Guide Arizona - Reporters Committee |url=https://www.rcfp.org/open-government-guide/arizona/ |access-date=2023-03-05 |website=The Reporters Committee for Freedom of the Press |language=en-US}}</ref>
...
<ref>{{cite web|url=http://eresources.nlb.gov.sg/infopedia/articles/SIP_93_2005-01-26.html|title=Sang Nila Utama – Infopedia|first=National Library Board|last=Singapore|website=Eresources.nlb.gov.sg|access-date=2016-08-28}}</ref>
<ref>{{cite web|url=http://eresources.nlb.gov.sg/infopedia/articles/SIP_1540_2009-07-06.html|title=Iskandar Shah – Infopedia|first=National Library Board|last=Singapore|website=Eresources.nlb.gov.sg|access-date=2016-08-28}}</ref>
<ref>{{cite web|url=http://eresources.nlb.gov.sg/infopedia/articles/SIP_1097_2006-07-28.html|title=Yusof bin Ishak – Infopedia|first=National Library Board|last=Singapore|website=Eresources.nlb.gov.sg|access-date=2016-08-28}}</ref>
...

I was under the impression that dewiki also usually used {{Cite book}}

dewiki uses {{Literatur}}. I'm afraid it's hard to tell what the distribution is between refs that actually use {{Literatur}} vs. manually crafted refs that do the same either with more specialized citation templates or without any. See https://de.wikipedia.org/wiki/Kategorie:Vorlage:Zitation and the sub-categories. There are a few hundred of such templates.

{{Literatur}} alone is used on about half a million pages. That's approx. 16% of all dewiki articles.

A good test I know is to keep clicking "random article" and manually count a random sample.

  • dewiki articles in my sample that actually use {{Literatur}}: 6
  • Articles with refs that could totally be converted to use {{Literatur}}, but do everything manually instead: 12 (extreme example, and another one)
  • Articles with more specialized citation templates: 1 (example)