<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Reference Matching on Crossref</title><link>https://www.crossref.org/categories/reference-matching/</link><description>Recent content in Reference Matching on Crossref</description><generator>Hugo 0.139.4</generator><language>en-us</language><managingEditor>support@crossref.org (Crossref/Cazinc/Benoît Benedetti)</managingEditor><webMaster>support@crossref.org (Crossref/Cazinc/Benoît Benedetti)</webMaster><lastBuildDate>Mon, 08 Jul 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://www.crossref.org/categories/reference-matching/" rel="self" type="application/rss+xml"/><item><title>What if I told you that bibliographic references can be structured?</title><link>https://www.crossref.org/blog/what-if-i-told-you-that-bibliographic-references-can-be-structured/</link><pubDate>Mon, 08 Jul 2019 00:00:00 +0000</pubDate><author>Dominika Tkaczyk</author><guid>https://www.crossref.org/blog/what-if-i-told-you-that-bibliographic-references-can-be-structured/</guid><description>&lt;p>Last year I spent several weeks studying how to automatically match unstructured references to DOIs (you can read about these experiments in &lt;a href="https://doi.org/10.64000/e6ey2-wce96" target="_blank">my previous blog posts&lt;/a>). But what about references that are not in the form of an unstructured string, but rather a structured collection of metadata fields? Are we matching them, and how? Let&amp;rsquo;s find out.&lt;/p>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;ul>
&lt;li>43% of open/limited references deposited with Crossref have no publisher-asserted DOI and no unstructured string. This means they need a matching approach suitable for structured references. &lt;em>[EDIT 6th June 2022 - all references are now open by default].&lt;/em>&lt;/li>
&lt;li>I adapted our new matching algorithms: Search-Based Matching (SBM) and Search-Based Matching with Validation (SMBV) to work with both structured and unstructured references.&lt;/li>
&lt;li>I compared three matching algorithms: Crossref&amp;rsquo;s current (legacy) algorithm, SBM and SBMV, using a dataset of 2,000 structured references randomly chosen from Crossref&amp;rsquo;s references.&lt;/li>
&lt;li>SBMV and the legacy algorithm performed almost the same. SBMV&amp;rsquo;s F1 was slightly better (0.9660 vs. 0.9593).&lt;/li>
&lt;li>Similarly as in the case of unstructured references, SBMV achieved slightly lower precision and better recall than the legacy algorithm.&lt;/li>
&lt;/ul>
&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>Those of you who often read scientific papers are probably used to bibliographic references in the form of unstructured strings, as they appear in the bibliography, for example:&lt;/p>
&lt;pre tabindex="0">&lt;code>[5] Elizabeth Lundberg, “Humanism on Gallifrey,” Science Fiction Studies, vol. 40, no. 2, p. 382, 2013.
&lt;/code>&lt;/pre>&lt;p>This form, however, is not the only way we can store the information about the referenced paper. An alternative is a structured, more machine-readable form, for example using BibTeX format:&lt;/p>
&lt;pre tabindex="0">&lt;code>@article{Elizabeth_Lundberg_2013,
year = 2013,
publisher = {{SF}-{TH}, Inc.},
volume = {40},
number = {2},
pages = {382},
author = {Elizabeth Lundberg},
title = {Humanism on Gallifrey},
journal = {Science Fiction Studies}
}
&lt;/code>&lt;/pre>&lt;p>Probably the most concise way to provide the information about the referenced document is to use its identifier, for example (🥁drum roll&amp;hellip;) the DOI:&lt;/p>
&lt;pre tabindex="0">&lt;code>&amp;lt;https://doi.org/10.5621/sciefictstud.40.2.0382&amp;gt;
&lt;/code>&lt;/pre>&lt;p>It is important to understand that these three representations (DOI, structured reference and unstructured reference) are not equivalent. The amount of information they carry varies:&lt;/p>
&lt;ul>
&lt;li>The DOI, by definition, provides the full information about the referenced document, because it identifies it without a doubt. Even though the metadata and content are not directly present in the DOI string, they can be easily and deterministically accessed. It is by far the preferred representation of the referenced document.&lt;/li>
&lt;li>The structured reference contains the metadata of the referenced object, but it doesn&amp;rsquo;t identify the referenced object without a doubt. In our example, we know that the paper was published in 2013 by Elizabeth Lundberg, but we might not know exactly which paper it is, especially if there are more than one document with the same or similar metadata.&lt;/li>
&lt;li>The unstructured reference contains the metadata field values, but without the names of the fields. This also doesn&amp;rsquo;t identify the referenced document, and even its metadata is not known without a doubt. In our example, we know that the word “Science” appears somewhere in the metadata, but we don&amp;rsquo;t know for sure whether it is a part of the title, journal title, or maybe the author&amp;rsquo;s (very cool) name.&lt;/li>
&lt;/ul>
&lt;p>The diagram presents the relationships between all these three forms:&lt;/p>
&lt;figure>&lt;img src="https://www.crossref.org/images/blog/structured_matching_reference_forms.png"
alt="reference forms" width="800px">
&lt;/figure>
&lt;br/>
&lt;p>The arrows show actions that Crossref has to perform to transform one form to another.&lt;/p>
&lt;p>Green transformations are in general easy and can be done without introducing any errors. The reason is that green arrows go from more information to less information. We all know how easy it is to forget important stuff!&lt;/p>
&lt;p>Green transformations are typically performed when the publication is being created. At the beginning the author can access the DOI of the referenced document, because they know exactly which document it is. Then, they can extract the bibliographic metadata (the structured form) of the document based on the DOI, for example by following the DOI to the document&amp;rsquo;s webpage or retrieving the metadata from &lt;a href="https://github.com/CrossRef/rest-api-doc" target="_blank">Crossref&amp;rsquo;s REST API&lt;/a>. Finally, the structured form can be formatted into an unstructured string using, for example, the &lt;a href="https://en.wikipedia.org/wiki/CiteProc" target="_blank">CiteProc&lt;/a> tool.&lt;/p>
&lt;p>We&amp;rsquo;ve also automated it further and these two green transformation (getting the document&amp;rsquo;s metadata based on the DOI and formatting it into a string) can be done in one go using &lt;a href="https://www.crossref.org/labs/citation-formatting-service/">Crossref&amp;rsquo;s content negotiation&lt;/a>.&lt;/p>
&lt;p>Red transformations are often done in systems that store bibliographic metadata (like our own metadata collection), often at a large scale. In these systems, we typically want to have DOIs (or other unique identifiers) of the referenced documents, but in practise we often have only structured and/or unstructured form. To fix this, we match references. Some systems also perform reference parsing (thankfully, we discovered &lt;a href="https://www.crossref.org/labs/resolving-citations-we-dont-need-no-stinkin-parser/">we do not need to do this in our case&lt;/a>).&lt;/p>
&lt;p>In general, red transformations are difficult, because we have to go from less information to more information, effectively recreating the information that has been lost during paper writing. This requires a bit of reasoning, educated guessing, and juggling probabilities. Data errors, noise, and sparsity make the situation even more dire. As a result, we do not expect any matching or parsing algorithm to be always correct. Instead, we perform evaluations (like in this blog post) to capture how well they perform on average.&lt;/p>
&lt;p>My &lt;a href="https://doi.org/10.64000/e6ey2-wce96" target="_blank">previous blog post&lt;/a> focused on matching unstructured references to DOIs (long red &amp;ldquo;matching&amp;rdquo; arrow). In this one, I analyse how well we can match structured references to DOIs (short red &amp;ldquo;matching&amp;rdquo; arrow).&lt;/p>
&lt;h2 id="references-in-crossref">References in Crossref&lt;/h2>
&lt;p>You might be asking yourself how important it is to have the matching algorithm working for both structured and unstructured references. Let&amp;rsquo;s look more closely at the references our matching algorithm has to deal with.&lt;/p>
&lt;p>29% of open/limited references deposited with Crossref already have the DOI provided by the publisher member. At Crossref, when we come across those references, we start dancing on a rainbow to the tunes of &lt;a href="https://en.wikipedia.org/wiki/Linkin_Park" target="_blank">Linkin Park&lt;/a>, while the references holding their DOIs sprinkle from the sky. Some of us sing along. We live for those moments, so if you care about us, please provide as many DOIs in your references as possible!&lt;/p>
&lt;p>You might be wondering how we are sure these publisher-provided DOIs are correct. The short answer is that we are not. After all, the publisher might have used an automated matcher to insert the DOIs before depositing the metadata. Nevertheless, our current workflow assumes these publisher-provided DOIs are correct and we simply accept them as they are.&lt;/p>
&lt;p>Unfortunately, the remaining 71% of references are deposited without a DOI. Those are the references we try to match ourselves.&lt;/p>
&lt;p>Here is the distribution of all the open/limited references:&lt;/p>
&lt;figure>&lt;img src="https://www.crossref.org/images/blog/structured_matching_reference_distribution.png"
alt="reference distibution" width="600px">
&lt;/figure>
&lt;p>17% of the references are deposited with no DOI and both structured and unstructured form. 11% have no DOI and only an unstructured form, and 43% have no DOI and only a structured form. These 43% cannot be directly processed by the unstructured matching algorithm.&lt;/p>
&lt;p>This distribution clearly shows that we need a matching algorithm able to process both structured and unstructured references. If our algorithm worked only with one type, we would miss a large percentage of the input references, and the quality of our citation metadata would be questionable.&lt;/p>
&lt;h2 id="the-analysis">The analysis&lt;/h2>
&lt;p>Let&amp;rsquo;s get to the point. I evaluated and compared three matching algorithms, focusing on the structured references.&lt;/p>
&lt;p>The first algorithm is one of the legacy algorithms currently used in Crossref. It uses fuzzy querying in a relational database to find the best matching DOI for the given structured reference. It can be accessed through a &lt;a href="https://support.crossref.org/hc/en-us/articles/214880143-OpenURL%23openurl2" target="_blank">Crossref OpenURL&lt;/a> query.&lt;/p>
&lt;p>The second algorithm is an adaptation of the Search-Based Matching (SBM) algorithm for structured references. In this algorithm, we concatenate all metadata fields of the reference and use it to search in the Crossref&amp;rsquo;s REST API. The first hit is returned as the target DOI if its relevance score exceeds the predefined threshold.&lt;/p>
&lt;p>The third algorithm is an adaptation of the Search-Based Matching with Validation (SBMV) for structured references. Similarly as in the case of SBM, we also concatenate all metadata fields of the input reference and use it to search in the &lt;a href="https://github.com/CrossRef/rest-api-doc" target="_blank">Crossref&amp;rsquo;s REST API&lt;/a>. Next, a number of top hits are considered as candidates and their similarity score with the input reference is calculated. The candidate with the highest similarity score is returned as the target DOI if its score exceeds the predefined threshold. The similarity score is based on fuzzy comparison of the metadata field values between the candidate and the input reference.&lt;/p>
&lt;p>I compared these three algorithms on a test set composed of 2,000 structured bibliographic references randomly chosen from Crossref&amp;rsquo;s metadata. For each reference, I manually checked the output of all matching algorithms, and in some cases performed additional manual searching. This resulted in the true target DOI (or null) assigned to each reference.&lt;/p>
&lt;p>The metrics are the same as in the previous evaluations: precision, recall and F1 calculated over the set of input references.&lt;/p>
&lt;p>The thresholds for SBM and SBMV algorithms were chosen on a separate validation dataset. The validation dataset also contains 2,000 structured references with manually-verified target DOIs.&lt;/p>
&lt;h2 id="the-results">The results&lt;/h2>
&lt;p>The plot shows the results of the evaluation of all three algorithms:&lt;/p>
&lt;figure>&lt;img src="https://www.crossref.org/images/blog/structured_matching_results.png"
alt="structured matching evaluation results" width="600px">
&lt;/figure>
&lt;br/>
&lt;p>The vertical black lines on top of the bars represent the confidence intervals.&lt;/p>
&lt;p>As we can see, SBMV and the legacy approach achieved very similar results. SBMV slightly outperforms the legacy approach in F1: 0.9660 vs. 0.9593.&lt;/p>
&lt;p>SBMV is slightly worse that the legacy approach in precision (0.9831 vs. 0.9929) and better in recall (0.9495 vs. 0.9280).&lt;/p>
&lt;p>The SBM algorithm performs the worst, especially in precision. Why is there such a huge difference between SBM and SBMV? The algorithms differ in the post-processing validation stage. SBM relies on the ability of the search engine to select the best target DOI, while SBMV re-scores a number of candidates obtained from the search engine using custom similarity. The results here suggest that in the case of structured references, the right target DOI is usually somewhere close to the top of the search results, but often it is not in the first position. One of the reasons might be missing titles in 76% of the structured references, which can confuse the search engine.&lt;/p>
&lt;p>Let&amp;rsquo;s look more closely at a few interesting cases in our test set:&lt;/p>
&lt;pre tabindex="0">&lt;code>first-page = 1000
article-title = Sequence capture using PCR-generated probes: a cost-effective method of targeted high-throughput sequencing for nonmodel organisms
volume = 14
author = Peñalba
year = 2014
journal-title = Molecular Ecology Resources
&lt;/code>&lt;/pre>&lt;p>The reference above was successfully matched by SBMV to &lt;a href="https://doi.org/10.1111/1755-0998.12249" target="_blank">https://doi.org/10.1111/1755-0998.12249&lt;/a>, even though the document&amp;rsquo;s volume and pages are missing from Crossref&amp;rsquo;s metadata.&lt;/p>
&lt;pre tabindex="0">&lt;code>issue = 2
first-page = 101
volume = 6
author = Abraham
year = 1987
journal-title = Promoter: An Automated Promotion Evaluation System
&lt;/code>&lt;/pre>&lt;p>Here the structure incorrectly labels article title as journal title. Despite this, the reference was correctly matched by our brave SBMV to &lt;a href="https://doi.org/10.1287/mksc.6.2.101" target="_blank">https://doi.org/10.1287/mksc.6.2.101&lt;/a>.&lt;/p>
&lt;pre tabindex="0">&lt;code>author = Marshall Day C.
volume = 39
first-page = 572
year = 1949
journal-title = India. J. A. D. A.
&lt;/code>&lt;/pre>&lt;p>Above we have most likely a parsing error. A part of the article title appears in the journal name, and the main journal name is abbreviated. ‘I see what you did there, my old friend Parsing Algorithm! Only a minor obstacle!&amp;rsquo; said SBMV, and matched the reference to &lt;a href="https://doi.org/10.14219/jada.archive.1949.0114" target="_blank">https://doi.org/10.14219/jada.archive.1949.0114&lt;/a>.&lt;/p>
&lt;pre tabindex="0">&lt;code>volume = 5
year = 2015
article-title = A retrospective analysis of the effect of discussion in teleconference and face-to-face scientific peer-review panels
journal-title = BMJ Open
&lt;/code>&lt;/pre>&lt;p>Here the the page number and author are not in the structure, but our invincible SBMV jumped over the holes left by the missing metadata and gracefully grabbed the right DOI &lt;a href="https://doi.org/10.1136/bmjopen-2015-009138" target="_blank">https://doi.org/10.1136/bmjopen-2015-009138&lt;/a>.&lt;/p>
&lt;pre tabindex="0">&lt;code>issue = 2
first-page = 533
volume = 30
author = Uthman BM
year = 1989
journal-title = Epilepsia
&lt;/code>&lt;/pre>&lt;p>In this case we have a mismatch in the page number (“533” vs. “S33”). But did SBMV give up and burst into tears? I think we already know the answer! Of course, it conquered the nasty typo with the sword made of fuzzy comparisons (yes, it&amp;rsquo;s a thing!) and brought us back the correct DOI &lt;a href="https://doi.org/10.1111/j.1528-1157.1989.tb05823.x" target="_blank">https://doi.org/10.1111/j.1528-1157.1989.tb05823.x&lt;/a>.&lt;/p>
&lt;h2 id="structured-vs-unstructured">Structured vs. unstructured&lt;/h2>
&lt;p>How does matching structured references compare to matching unstructured references?&lt;/p>
&lt;p>The general trends are the same. For both structured and unstructured references, SBMV outperforms the legacy approach in F1, achieving worse precision and better recall. This tells us that our legacy algorithms are more strict and as a result they miss some links.&lt;/p>
&lt;p>Structured reference matching seems easier than unstructured reference matching. The reason is that when we have the structure, we can compare the input reference to the candidate field by field, which is more precise than using the unstructured string.&lt;/p>
&lt;p>Structured matching, however, in practise brings new challenges. One big problem is data sparsity. 15% of structured references without DOIs have fewer than four metadata fields. This is not always enough to identify the DOI. Also, 76% of the structured references without DOIs do not contain the article title, which poses a problem for candidate selection using the search engine.&lt;/p>
&lt;h2 id="whats-next">What&amp;rsquo;s next?&lt;/h2>
&lt;p>So far, I have focused on evaluating SBMV for unstructured and structured references separately. 17% of the open/limited references at Crossref, however, have both unstructured and structured form. In those cases, it might be beneficial to use the information from both forms. I plan to perform some experiments on this soon.&lt;/p>
&lt;p>The data and code for this evaluation can be found at &lt;a href="https://github.com/CrossRef/reference-matching-evaluation" target="_blank">https://github.com/CrossRef/reference-matching-evaluation&lt;/a>. The Java version of SBMV (for both structured and unstructured references) can be found at &lt;a href="https://gitlab.com/crossref/search-based-reference-matcher" target="_blank">https://gitlab.com/crossref/search-based-reference-matcher&lt;/a>.&lt;/p></description></item><item><title>Reference matching: for real this time</title><link>https://www.crossref.org/blog/reference-matching-for-real-this-time/</link><pubDate>Tue, 18 Dec 2018 00:00:00 +0000</pubDate><author>Dominika Tkaczyk</author><guid>https://www.crossref.org/blog/reference-matching-for-real-this-time/</guid><description>&lt;p>In my previous blog post, &lt;a href="https://doi.org/10.64000/pdm9z-20m09" target="_blank">Matchmaker, matchmaker, make me a match&lt;/a>, I compared four approaches for reference matching. The comparison was done using a dataset composed of automatically-generated reference strings. Now it&amp;rsquo;s time for the matching algorithms to face the real enemy: the &lt;strong>unstructured reference strings&lt;/strong> deposited with Crossref by some members. Are the matching algorithms ready for this challenge? Which algorithm will prove worthy of becoming the guardian of the mighty citation network? Buckle up and enjoy our second matching battle!&lt;/p>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;ul>
&lt;li>I evaluated and compared four reference matching approaches: the legacy approach based on reference parsing, and three variants of search-based matching.&lt;/li>
&lt;li>The dataset comprises 2,000 unstructured reference strings from the Crossref metadata.&lt;/li>
&lt;li>The metrics are &lt;a href="https://en.wikipedia.org/wiki/Precision_and_recall" target="_blank">precision and recall&lt;/a> calculated over the citation links. I also use &lt;a href="https://en.wikipedia.org/wiki/F1_score" target="_blank">F1&lt;/a> as a standard single-number metric that combines precision and recall, weighing them equally.&lt;/li>
&lt;li>The best variant of &lt;strong>search-based matching outperforms the legacy approach in F1 (96.3% vs. 92.5%)&lt;/strong>, with the precision worse by only 0.9% (98.09% vs. 98.95%), and the recall better by 8.9% (94.56% vs. 86.85%).&lt;/li>
&lt;li>Common causes of SBMV&amp;rsquo;s errors are: incomplete/erroneous metadata of the target documents, and noise in the reference strings.&lt;/li>
&lt;li>The results reported here generalize to the subset of references in Crossref that are deposited without the target DOI and are present in the form of unstructured strings.&lt;/li>
&lt;/ul>
&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>In reference matching, we try to find the DOI of the document referenced by a given input reference. The input reference can have a structured form (a collection of metadata fields) and/or an unstructured form (a string formatted in a certain citation style).&lt;/p>
&lt;p>In my &lt;a href="https://doi.org/10.64000/pdm9z-20m09" target="_blank">previous blog post&lt;/a>, I used reference strings generated automatically to compare four matching algorithms: Crossref&amp;rsquo;s legacy approach based on reference parsing and three variations of search-based matching. The best algorithm turned out to be Search-Based Matching with Validation (SBMV). SBMV uses our &lt;a href="https://search.crossref.org" target="_blank">REST API&amp;rsquo;s bibliographic search function&lt;/a> to select the candidate target documents, and a separate validation-scoring procedure to choose the final target document. The legacy approach and SBMV achieved very similar average precision, and SBMV was much better in average recall.&lt;/p>
&lt;p>This comparison had important limitations, which affect the interpretation of these results.&lt;/p>
&lt;p>First of all, the reference strings in the dataset might be too perfect. Since they were generated automatically from the Crossref metadata records, any piece of information present in the string, such as the title or the name of the author, will exactly match the information in Crossref&amp;rsquo;s metadata. In such a case, a matcher comparing the string against the record can simply apply exact matching and everything should be fine.&lt;/p>
&lt;p>In real life, however, we should expect all sorts of errors and noise in the reference strings. For example, a string might have been manually typed by a human, so it can have typos. The string might have been scraped from the PDF file, in which case it could have unusual unicode characters, &lt;a href="https://en.wikipedia.org/wiki/Typographic_ligature" target="_blank">ligatures&lt;/a> or missing and extra spaces. A string can also have typical OCR errors, if it was extracted from a scan.&lt;/p>
&lt;p>These problems are typical for messy real-life data, and our matching algorithms should be robust enough to handle them. However, when we evaluate and compare approaches using the perfect reference strings, the results won&amp;rsquo;t tell us how well the algorithms handle harder, noisy cases. After all, even if you repeatedly win chess games against your father, it doesn&amp;rsquo;t mean you will likely defeat Garry Kasparov (unless, of course, you are Garry Kasparov&amp;rsquo;s child, in which case, please pass on our regards to your dad!).&lt;/p>
&lt;p>Even though I attempted to make the data more similar to the noisy real-life data by simulating some of the possible errors (typos, missing/extra spaces) in two styles, this might not be enough. We simply don&amp;rsquo;t know the typical distribution of the errors, or even what all the possible errors are, so our data was probably still far from the real, noisy reference strings.&lt;/p>
&lt;p>The differences in the distributions are a second major issue with the previous experiment. To build the dataset, I used a random sample from Crossref metadata, so the distribution of the cited item types (journal paper, conference proceeding, book chapter, etc.) reflects the overall distribution in our collection. However, the distribution in real life might be different if, for example, journal papers are on average cited more often than conference proceedings.&lt;/p>
&lt;p>Similarly, the distribution of the citation styles is most likely different. To generate the reference strings, I used 11 styles distributed uniformly, while the real distribution most likely contains more styles and is skewed.&lt;/p>
&lt;p>All these issues can be summarized as: &lt;strong>the data used in my previous experiment is different from the data our matching algorithms have to deal with in the production system&lt;/strong>. Why is this important? Because in such a case, &lt;strong>the evaluation results do not reflect the real performance in our system&lt;/strong>, just like the child&amp;rsquo;s score on the math exam says nothing about their score on the history test. We can hope my previous results accurately showed the strengths and weaknesses of each algorithm, but the estimations could be far off.&lt;/p>
&lt;blockquote>
&lt;p>So, can we do better? Sure!&lt;/p>
&lt;/blockquote>
&lt;p>This time, instead of automatically-generated reference strings, I will use real reference strings found in the Crossref metadata. This will give us a much better picture of the matching algorithms and their real-life performance.&lt;/p>
&lt;h2 id="evaluation">Evaluation&lt;/h2>
&lt;p>This time the &lt;strong>evaluation dataset is composed of 2,000 unstructured reference strings from the Crossref metadata&lt;/strong>, along with the target true DOIs. The dataset was prepared mostly manually:&lt;/p>
&lt;ol>
&lt;li>First, I drew a random sample of 100,000 metadata records from the system.&lt;/li>
&lt;li>Second, I iterated over all sampled items, and extracted those unstructured reference strings, that do not have the DOI provided by the member.&lt;/li>
&lt;li>Next, I randomly sampled 2,000 reference strings.&lt;/li>
&lt;li>Finally, I assigned a target DOI (or null) to each reference string. This was done by verifying DOIs returned by the algorithms and/or manual searching.&lt;/li>
&lt;/ol>
&lt;p>The metrics this time are based on the citation links. A citation link points from the reference (or the document containing the reference) to the referenced (target) document.&lt;/p>
&lt;p>When we apply a matching algorithm to a set of reference strings in our collection, we get a set of citation links between our documents. I will call those citation links &lt;strong>returned links&lt;/strong>.&lt;/p>
&lt;p>On the other hand, in our collection we have real, &lt;strong>true links&lt;/strong> between the documents. In the best-case scenario, the set of true links and the set of returned links are identical. But we don&amp;rsquo;t live in a perfect world and our matching algorithms make mistakes.&lt;/p>
&lt;p>To measure how close the returned links are to the true links, I used precision, recall and F1. This time they are calculated over all citation links in the dataset. More specifically:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Precision&lt;/strong> is the fraction of the returned links that are correct. Precision answers the question: if I see a citation link A-&amp;gt;B in the output of a matcher, how certain can I be that paper A actually cites paper B?&lt;/li>
&lt;li>&lt;strong>Recall&lt;/strong> is the percentage of true links that were returned by the algorithm. Recall answers the question: if paper A cites paper B and B is in the collection, how certain can I be that the matcher&amp;rsquo;s output contains the citation link A-&amp;gt;B?&lt;/li>
&lt;li>&lt;strong>F1&lt;/strong> is the harmonic mean of precision and recall.&lt;/li>
&lt;/ul>
&lt;p>In the previous experiment, I also used precision, recall and F1, but they were calculated for each target document and then averaged. This time precision, recall and F1 are not averaged but simply calculated over all citation links. This is a more natural approach, since now the dataset comprises isolated reference strings rather than target documents, and in practice each target document has at most one incoming reference.&lt;/p>
&lt;p>I tested the same four approaches as before:&lt;/p>
&lt;ul>
&lt;li>the &lt;strong>legacy approach&lt;/strong>, based on reference parsing&lt;/li>
&lt;li>&lt;strong>SBM with a simple threshold&lt;/strong>, which searches for the reference string in the search engine and returns the first hit, if its relevance score exceeds the predefined threshold&lt;/li>
&lt;li>&lt;strong>SBM with a normalized threshold&lt;/strong>, which searches for the reference string in the search engine and returns the first hit, if its relevance score divided by the string length exceeds the predefined threshold&lt;/li>
&lt;li>&lt;strong>SBMV&lt;/strong>, which first applies SBM with a normalized threshold to select a number of candidate items, and a separate validation procedure is used to select the final target item&lt;/li>
&lt;/ul>
&lt;p>All the thresholds are parameters which have to be set prior to the matching. The thresholds used in the experiments were chosen using a separate dataset, as the values maximizing the F1 of each algorithm.&lt;/p>
&lt;h2 id="results">Results&lt;/h2>
&lt;p>The plot shows the overall results of all tested approaches:&lt;/p>
&lt;figure>&lt;img src="https://www.crossref.org/images/blog/matching_comparison_real_data.png"
alt="overall comparison of reference matching algorithms on real dataset" width="500px">
&lt;/figure>
&lt;br />
&lt;p>The exact values are also given in the table (the best result for each metric is bolded):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>&lt;/th>
&lt;th>precision&lt;/th>
&lt;th>recall&lt;/th>
&lt;th>F1&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>legacy approach&lt;/td>
&lt;td>&lt;strong>0.9895&lt;/strong>&lt;/td>
&lt;td>0.8685&lt;/td>
&lt;td>0.9251&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>SBM (simple threshold)&lt;/td>
&lt;td>0.8686&lt;/td>
&lt;td>0.8191&lt;/td>
&lt;td>0.8431&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>SBM (normalized threshold)&lt;/td>
&lt;td>0.7712&lt;/td>
&lt;td>0.9121&lt;/td>
&lt;td>0.8358&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>SBMV&lt;/td>
&lt;td>0.9809&lt;/td>
&lt;td>&lt;strong>0.9456&lt;/strong>&lt;/td>
&lt;td>&lt;strong>0.9629&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>As we can see, the legacy approach is the best in precision, slightly outperforming SBMV. In recall, SBMV is clearly the best, which also decided about its victory over the legacy approach in F1.&lt;/p>
&lt;p>How do these results compare to the results from my previous blog post? The overall trends (the legacy approach slightly outperforms SBMV in precision, and SBMV outperforms the legacy approach in recall and F1) are the same. The most important differences are: 1) on the real dataset SBM without validation is worse than the legacy approach, and 2) this time the algorithms achieved much higher recall. These differences are most likely related to the difference in data distributions explained before.&lt;/p>
&lt;h3 id="sbmvs-strengths-and-weaknesses">SBMV&amp;rsquo;s strengths and weaknesses&lt;/h3>
&lt;p>Let&amp;rsquo;s look at a few example cases where SBMV successfully returned the correct DOI, while the legacy approach failed.&lt;/p>
&lt;pre tabindex="0">&lt;code>Lundqvist D, Flykt A, Ohman A: The Karolinska Directed Emotional Faces - KDEF, CD ROM from Department of Clinical Neuroscience, Psychology section, Karolinska Institutet. 1998
&lt;/code>&lt;/pre>&lt;p>matched to &lt;a href="https://doi.org/10.1037/t27732-000" target="_blank">https://doi.org/10.1037/t27732-000&lt;/a>&lt;/p>
&lt;p>The target item is a dataset, which means unusual metadata fields and an unusual reference string.&lt;/p>
&lt;pre tabindex="0">&lt;code>Schminck, A. , ‘The Beginnings and Origins of the “Macedonian” Dynasty’ in J. Burke and R. Scott , eds., Byzantine Macedonia: Identity, Image and History (Melbourne, 2000), 61–8.
&lt;/code>&lt;/pre>&lt;p>matched to &lt;a href="https://doi.org/10.1163/9789004344730_006" target="_blank">https://doi.org/10.1163/9789004344730_006&lt;/a>&lt;/p>
&lt;p>This is an example of a book chapter. The reference string contains special quotes and dash characters.&lt;/p>
&lt;pre tabindex="0">&lt;code>R. Schneider,On the Aleksandrov-Fenchel inequality, inDiscrete Geometry and Convexity (J. E. Goodman, E. Lutwak, J. Malkevitch and R. Pollack, eds.), Annals of the New York Academy of Sciences440 (1985), 132–141.
&lt;/code>&lt;/pre>&lt;p>matched to &lt;a href="https://doi.org/10.1111/j.1749-6632.1985.tb14547.x" target="_blank">https://doi.org/10.1111/j.1749-6632.1985.tb14547.x&lt;/a>&lt;/p>
&lt;p>In this case, spaces are missing in the reference string, which might be problematic for the parsing.&lt;/p>
&lt;pre tabindex="0">&lt;code>R. B. Husar andE. M. Sparrow, Int. J. Heat Mass Transfer11, 1206 (1968).
&lt;/code>&lt;/pre>&lt;p>matched to &lt;a href="https://doi.org/10.1016/0017-9310%2868%2990036-7" target="_blank">https://doi.org/10.1016/0017-9310(68)90036-7&lt;/a>&lt;/p>
&lt;p>This is another example of a reference string with missing spaces.&lt;/p>
&lt;pre tabindex="0">&lt;code>F. Cappello, A. Geist, W. Gropp, S. Kale, B. Kramer, and M. Snir. Toward exascale resilience: 2014 update. Supercomputing frontiers and innovations, 1(1), 2014.
&lt;/code>&lt;/pre>&lt;p>matched to &lt;a href="https://doi.org/10.14529/jsfi140101" target="_blank">https://doi.org/10.14529/jsfi140101&lt;/a>&lt;/p>
&lt;p>In this case authors are missing in the Crossref metadata.&lt;/p>
&lt;pre tabindex="0">&lt;code>Li KZ, Shen XT, Li HJ, Zhang SY, Feng T, Zhang LL. Ablation of the Carbon/carbon Composite Nozzle-throats in a Small Solid Rocket Motor[J]. Carbon, 2011, 49: 1 208–1 215
&lt;/code>&lt;/pre>&lt;p>matched to &lt;a href="https://doi.org/10.1016/j.carbon.2010.11.037" target="_blank">https://doi.org/10.1016/j.carbon.2010.11.037&lt;/a>&lt;/p>
&lt;p>Here we have unexpected spaces inside page numbers.&lt;/p>
&lt;pre tabindex="0">&lt;code>N. Kaloper, A. Lawrence and L. Sorbo, An Ignoble Approach to Large Field Inflation, JCAP 03 (2011) 023 [ arXiv:1101.0026 ] [ INSPIRE ].
&lt;/code>&lt;/pre>&lt;p>matched to &lt;a href="https://doi.org/10.1088/1475-7516/2011/03/023" target="_blank">https://doi.org/10.1088/1475-7516/2011/03/023&lt;/a>&lt;/p>
&lt;p>In this case we have an acronym of the journal name and additional arXiv id.&lt;/p>
&lt;pre tabindex="0">&lt;code>KrönerE. ?Stress space and strain space continuum mechanics?, Phys. Stat. Sol. (b), 144 (1987) 39?44.
&lt;/code>&lt;/pre>&lt;p>matched to &lt;a href="https://doi.org/10.1002/pssb.2221440104" target="_blank">https://doi.org/10.1002/pssb.2221440104&lt;/a>&lt;/p>
&lt;p>This reference string has a missing space, a missing word in the title, and incorrectly encoded special characters.&lt;/p>
&lt;pre tabindex="0">&lt;code>Suyemoto K. L., (1998) The functions of self-mutilationClinical Psychology Review 18(5): 531–554
&lt;/code>&lt;/pre>&lt;p>matched to &lt;a href="https://doi.org/10.1016/s0272-7358%2897%2900105-0" target="_blank">https://doi.org/10.1016/s0272-7358(97)00105-0&lt;/a>&lt;/p>
&lt;p>In this case the space is missing between the title and the journal name.&lt;/p>
&lt;pre tabindex="0">&lt;code>Ono , N. 2011 Stable and fast update rules for independent vector analysis based on auxiliary function technique Proceedings of IEEE Workshop on Applications of Signal Processing to Audio and Acoustics 189 192
&lt;/code>&lt;/pre>&lt;p>matched to &lt;a href="https://doi.org/10.1109/aspaa.2011.6082320" target="_blank">https://doi.org/10.1109/aspaa.2011.6082320&lt;/a>&lt;/p>
&lt;p>The parsing can also have problems with missing punctuation, like in this case.&lt;/p>
&lt;pre tabindex="0">&lt;code>Hybertsen M.S., Witzigmann B., Alam M.A., Smith R.K. (2002) 1 113
&lt;/code>&lt;/pre>&lt;p>matched to &lt;a href="https://doi.org/10.1023/a:1020732215449" target="_blank">https://doi.org/10.1023/a:1020732215449&lt;/a>&lt;/p>
&lt;p>In this case both title and journal name are missing from the reference string.&lt;/p>
&lt;p>We can see from these examples that SBMV is fairly robust and able to deal with a small amount of noise in the metadata and reference strings.&lt;/p>
&lt;p>What about the errors SBMV made? From the perspective of citation links, we have two types of errors:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>False positives&lt;/strong>: incorrect links returned by the algorithm.&lt;/li>
&lt;li>&lt;strong>False negatives&lt;/strong>: links that should have been returned but weren&amp;rsquo;t.&lt;/li>
&lt;/ul>
&lt;p>When we apply SBMV instead of the legacy approach, the fraction of false positives within the returned links increases from 1.05% to 1.91%, and the fraction of false negatives within the true links decreases from 13.15% to 5.44%. This means with SBMV:&lt;/p>
&lt;ul>
&lt;li>1.91% of the links in the algorithm&amp;rsquo;s output are incorrect&lt;/li>
&lt;li>5.44% of the true links are not returned by the algorithm&lt;/li>
&lt;/ul>
&lt;p>We can also classify all the references in the dataset into several categories, based on the values of true and returned DOIs:&lt;/p>
&lt;figure>&lt;img src="https://www.crossref.org/images/blog/matching_references_errors.png"
alt="references errors distribution" width="800px">
&lt;/figure>
&lt;p>We have the following categories:&lt;/p>
&lt;ul>
&lt;li>References matched to correct DOIs (1129 cases, returned and true blue)&lt;/li>
&lt;li>References correctly not matched to anything (791 cases, returned and true white)&lt;/li>
&lt;li>References not matched to anything, when they should be (58 cases, returned white, true grey)&lt;/li>
&lt;li>References matched to wrong DOIs (7 cases, returned red, true yellow)&lt;/li>
&lt;li>References matched to something, when they shouldn&amp;rsquo;t be matched to anything (15 cases, returned black, true white)&lt;/li>
&lt;/ul>
&lt;p>Note that in terms of these categories, precision is equal to:&lt;/p>
&lt;figure>&lt;img src="https://www.crossref.org/images/blog/matching_precision.png"
alt="precision" width="200px">
&lt;/figure>
&lt;p>And recall is equal to:&lt;/p>
&lt;figure>&lt;img src="https://www.crossref.org/images/blog/matching_recall.png"
alt="recall" width="200px">
&lt;/figure>
&lt;p>What are the most common causes of SBMV&amp;rsquo;s errors?&lt;/p>
&lt;ul>
&lt;li>Incomplete or incorrect Crossref metadata. Even a perfect reference string formatted in the most popular citation style will not be matched, if the target record in the Crossref collection has many missing or incorrect fields.&lt;/li>
&lt;li>Similarly, missing or incorrect information in the reference string is very problematic for the matchers.&lt;/li>
&lt;li>Errors/noise in the reference string, such as:
&lt;ul>
&lt;li>HTML/XML markup not stripped from the string&lt;/li>
&lt;li>multiple references mixed in one string&lt;/li>
&lt;li>spacing issues and typos&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>In a few cases a document related to the real target was matched, such as the book instead of its chapter, or the conference proceedings paper instead of the thesis.&lt;/li>
&lt;/ul>
&lt;h2 id="limitations">Limitations&lt;/h2>
&lt;p>The most important limitation is the size of the dataset. Every item had to be verified manually, which significantly limited the possibility of creating a large set and also using a lot of independent sets.&lt;/p>
&lt;p>Finally, the numbers reported here still don&amp;rsquo;t reflect the overall precision and recall of the current links in the Crossref metadata. This is because:&lt;/p>
&lt;ol>
&lt;li>we still use the legacy approach for matching,&lt;/li>
&lt;li>some references are deposited along with the target DOIs and are not matched by Crossref, these links are not analyzed here, and&lt;/li>
&lt;li>in Crossref we have both unstructured and structured references, and in this experiment only the unstructured ones were tested.&lt;/li>
&lt;/ol>
&lt;h2 id="whats-next">What&amp;rsquo;s next?&lt;/h2>
&lt;p>The next experiment will be related to the structured references. Similarly as here, I will try to estimate the performance of the search-based matching approach and compare it to the performance of the legacy approach.&lt;/p>
&lt;p>The evaluation framework, evaluation data and experiments related to the reference matching are available in the repository &lt;a href="https://github.com/CrossRef/reference-matching-evaluation" target="_blank">https://github.com/CrossRef/reference-matching-evaluation&lt;/a>. Future experiments will be added there as well.&lt;/p>
&lt;p>&lt;a href="https://github.com/CrossRef/reference-matching-evaluation" target="_blank">https://github.com/CrossRef/reference-matching-evaluation&lt;/a> also contains the Python implementation of the SBMV algorithm. The Java implementation of SBMV is available in the repository &lt;a href="https://gitlab.com/crossref/search_based_reference_matcher" target="_blank">https://gitlab.com/crossref/search_based_reference_matcher&lt;/a>.&lt;/p></description></item><item><title>Matchmaker, matchmaker, make me a match</title><link>https://www.crossref.org/blog/matchmaker-matchmaker-make-me-a-match/</link><pubDate>Mon, 12 Nov 2018 00:00:00 +0000</pubDate><author>Dominika Tkaczyk</author><guid>https://www.crossref.org/blog/matchmaker-matchmaker-make-me-a-match/</guid><description>&lt;p>Matching (or resolving) bibliographic references to target records in the collection is a crucial algorithm in the Crossref ecosystem. Automatic reference matching lets us discover citation relations in large document collections, calculate citation counts, H-indexes, impact factors, etc. At Crossref, we currently use a matching approach based on reference string parsing. Some time ago we realized there is &lt;a href="https://www.crossref.org/labs/resolving-citations-we-dont-need-no-stinkin-parser/">a much simpler approach&lt;/a>. And now it is finally battle time: which of the two approaches is better?&lt;/p>
&lt;h3 id="tldr">TL;DR&lt;/h3>
&lt;ul>
&lt;li>I evaluated and compared four approaches to reference matching: the legacy approach based on reference parsing, and three variants of the new idea called &lt;strong>search-based matching&lt;/strong>.&lt;/li>
&lt;li>A large &lt;strong>automatically generated dataset&lt;/strong> was used for the experiments. It is composed of 7,374 metadata records from the Crossref collection, each of which was formatted automatically into reference strings using 11 citation styles.&lt;/li>
&lt;li>The main metrics used for the evaluation are &lt;a href="https://en.wikipedia.org/wiki/Precision_and_recall" target="_blank">precision and recall&lt;/a>. I also use &lt;a href="https://en.wikipedia.org/wiki/F1_score" target="_blank">F1&lt;/a> as a standard metric that combines precision and recall into a single number, weighing them equally. All values are calculated for each metadata record separately and averaged over the dataset.&lt;/li>
&lt;li>In general, search-based matching is better than the legacy approach in F1 and recall, but worse in precision.&lt;/li>
&lt;li>The best variant of &lt;strong>search-based matching outperforms the legacy approach in average F1 (84.5% vs. 52.9%)&lt;/strong>, with the average precision worse by only 0.1% (99.2% vs 99.3%), and the average recall better by 88% (79.0% vs. 42.0%).&lt;/li>
&lt;li>The best variant of search-based matching also outperforms the legacy approach in average F1 for each one of the 11 styles.&lt;/li>
&lt;li>A weak spot of the parsing-based approach is degraded/noisy reference strings, which do not appear to use any of the known citation styles.&lt;/li>
&lt;li>A weak spot of search-based approach is short reference strings, and in particular citation styles that do not include the title in the reference string.&lt;/li>
&lt;/ul>
&lt;h3 id="introduction">Introduction&lt;/h3>
&lt;p>In reference matching, on the input we have a bibliographic reference. It can have the form of an unstructured string, such as:&lt;/p>
&lt;p>&lt;em>(1) Adamo, S. H.; Cain, M. S.; Mitroff, S. R. Psychological Science 2013, 24, 2569–2574.&lt;/em>&lt;/p>
&lt;p>The input can also have the form of a structured reference, such as (BibTex format):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-JSON" data-lang="JSON">&lt;span class="line">&lt;span class="cl"> &lt;span class="err">@article&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="err">adamo2013,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="err">author&lt;/span> &lt;span class="err">=&lt;/span> &lt;span class="err">{Stephen&lt;/span> &lt;span class="err">H.&lt;/span> &lt;span class="err">Adamo&lt;/span> &lt;span class="err">and&lt;/span> &lt;span class="err">Matthew&lt;/span> &lt;span class="err">S.&lt;/span> &lt;span class="err">Cain&lt;/span> &lt;span class="err">and&lt;/span> &lt;span class="err">Stephen&lt;/span> &lt;span class="err">R.&lt;/span> &lt;span class="err">Mitroff&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="err">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="err">title&lt;/span> &lt;span class="err">=&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="err">Self-Induced&lt;/span> &lt;span class="err">Attentional&lt;/span> &lt;span class="err">Blink:&lt;/span> &lt;span class="err">A&lt;/span> &lt;span class="err">Cause&lt;/span> &lt;span class="err">of&lt;/span> &lt;span class="err">Errors&lt;/span> &lt;span class="err">in&lt;/span> &lt;span class="err">Multiple-Target&lt;/span> &lt;span class="err">Search&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="err">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="err">journal&lt;/span> &lt;span class="err">=&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="err">Psychological&lt;/span> &lt;span class="err">Science&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="err">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="err">volume&lt;/span> &lt;span class="err">=&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="err">24&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="err">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="err">number&lt;/span> &lt;span class="err">=&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="err">12&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="err">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="err">pages&lt;/span> &lt;span class="err">=&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="err">2569-2574&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="err">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="err">year&lt;/span> &lt;span class="err">=&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="err">2013&lt;/span>&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The goal of matching is to find the document, which the input reference points to.&lt;/p>
&lt;h3 id="matching-algorithms">Matching algorithms&lt;/h3>
&lt;p>Matching references is not a trivial task even for a human, not to mention the machines, which are still a bit less intelligent than us (or so they want us to believe…). A typical meta-approach to reference matching might be to score the similarity between the input reference and the candidate target documents. The document most similar to the input is then returned as the target.&lt;/p>
&lt;p>Of course, still a lot can go wrong here. We can have more than one potential target record with the same score (which one do we choose?). We can have only documents with low to medium scores (is the actual target even present in our collection?). We can also have errors in the input string (are the similarity scores robust enough?). Life&amp;rsquo;s tough!&lt;/p>
&lt;p>The main difference between various matching algorithms is in fact how the similarity is calculated. For example, one idea might be to compare the records field by field (how similar is the title/author/journal in the input reference to the title/author/journal of our candidate target record?). This is roughly how the matching works currently at Crossref.&lt;/p>
&lt;p>The main problem with this approach is that it requires a structured reference, and in practise, often all we have is a plain reference string. In such a case we need to extract the metadata fields from the reference string (this is called parsing). Parsing introduces errors, since no parser is omniscient. The errors propagate further and affect the scoring… you get the picture.&lt;/p>
&lt;p>Luckily, as &lt;a href="https://www.crossref.org/labs/resolving-citations-we-dont-need-no-stinkin-parser/">we have known for some time now&lt;/a>, this is not the only approach. Instead of comparing structured objects, we could calculate the similarity between them using their unstructured textual form. This effectively eliminates the need for parsing, since the unstructured form is either already available on the input or can be easily generated from the structured form.&lt;/p>
&lt;p>What about the similarity scores? We already know a powerful method for scoring the similarities between texts. Those are (you guessed it!) scoring algorithms used by search engines. Most of them, including &lt;a href="https://search.crossref.org" target="_blank">Crossref&amp;rsquo;s&lt;/a>, do not need a structured representation of the object, they are perfectly happy with just a plain text query.&lt;/p>
&lt;p>So all we need to do is to pass the original reference string (or some concatenation of the reference fields, if only a structured reference is available) to the search engine and let it score the similarity for us. It will also conveniently sort the results so that it is easy to find the top hit.&lt;/p>
&lt;h3 id="evaluation">Evaluation&lt;/h3>
&lt;p>So far so good. But which strategy is better? Is it better to develop an accurate parser, or just rely on the search engine? I don&amp;rsquo;t feel like guessing. Let&amp;rsquo;s try to answer this using (data) science. But first, we need to decompose our question into smaller pieces.&lt;/p>
&lt;h4 id="question-1-how-can-i-measure-the-quality-of-a-reference-matcher">Question 1. How can I measure the quality of a reference matcher?&lt;/h4>
&lt;p>Generally speaking, this can be done by checking the resulting citation links. Simply put, the better the links, the better the matching approach must have been.&lt;/p>
&lt;p>A few standard metrics can be applied here, including &lt;a href="https://en.wikipedia.org/wiki/Accuracy_and_precision" target="_blank">accuracy&lt;/a>, &lt;a href="https://en.wikipedia.org/wiki/Precision_and_recall" target="_blank">precision, recall&lt;/a> and &lt;a href="https://en.wikipedia.org/wiki/F1_score" target="_blank">F1&lt;/a>. We decided to calculate precision, recall and F1 separately for each document in the dataset, and then average those numbers over the entire dataset.&lt;/p>
&lt;p>When I say &amp;ldquo;documents&amp;rdquo;, I really mean &amp;ldquo;target documents&amp;rdquo;:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>precision&lt;/strong> for a document X tells us, what percentage of links to X in the system are correct&lt;/li>
&lt;li>&lt;strong>recall&lt;/strong> for a document X tells us, what percentage of true links to X are present in the system&lt;/li>
&lt;li>&lt;strong>F1&lt;/strong> is the harmonic mean of precision and recall&lt;/li>
&lt;/ul>
&lt;p>F1 is a single-number metric combining precision and recall. In F1 precision and recall are weighted equally. It is also possible to combine precision and recall using different weights, to place more emphasis on one of those metrics.&lt;/p>
&lt;p>We decided to look at links from the target document&amp;rsquo;s perspective, because this is what the academic world cares about (i.e. how accurate the citation counts of academic papers are).&lt;/p>
&lt;p>Calculating separate numbers for individual documents and averaging them within a dataset is the best way to have reliable confidence intervals (which makes the whole analysis look much smarter!).&lt;/p>
&lt;h4 id="question-2-which-approaches-should-be-compared">Question 2. Which approaches should be compared?&lt;/h4>
&lt;p>In total we tested four reference matching approaches.&lt;/p>
&lt;p>The first approach, called the &lt;strong>legacy approach&lt;/strong>, is the approach currently used in Crossref ecosystem. It uses a parser and matches the extracted metadata fields against the records in the collection.&lt;/p>
&lt;p>The second approach is the &lt;strong>search-based matching (SBM)&lt;/strong> with a &lt;strong>simple threshold&lt;/strong>. It queries the search engine using the reference string and returns the top hit from the results, if its relevance score exceeds the threshold.&lt;/p>
&lt;p>The third approach is the &lt;strong>search-based matching (SBM)&lt;/strong> with a &lt;strong>normalized threshold&lt;/strong>. Similarly as in the simplest SBM, in this approach we query the search engine using the reference string. In this case the first hit is returned if its normalized score (the score divided by the reference length) exceeds the threshold.&lt;/p>
&lt;p>Finally, the fourth approach is a variation of the search based matching, called &lt;strong>search-based matching with validation (SBMV)&lt;/strong>. In this algorithm we use additional validation procedure on top of SBM. First, SBM with a normalized threshold is applied and the search results with the scores exceeding the normalized threshold are selected as candidate target documents. Second, we calculate validation similarity between the input string and each of the candidates. This validation similarity is based on the presence of the candidate record&amp;rsquo;s metadata fields (year, volume, issue, pages, the last name of the first author, etc.) in the input reference string, as well as the relevance score returned by the search engine. Finally, the most similar candidate is returned as the final target document, if its validation similarity exceeds the &lt;strong>validation threshold&lt;/strong>.&lt;/p>
&lt;p>By adding the validation stage to the search-based matching we make sure that the same bibliographic numbers (year, volume, etc.) are present in both the input reference and the returned document. We also don&amp;rsquo;t simply take the first result, but rather use this validation similarity to choose from results scored similarly by the search engine.&lt;/p>
&lt;p>All the thresholds are parameters which have to be set prior to the matching. The thresholds used in these experiments were chosen using a separate dataset, as the values maximizing the F1 of each algorithm.&lt;/p>
&lt;h4 id="question-3-how-to-create-the-dataset">Question 3. How to create the dataset?&lt;/h4>
&lt;h3 id="results">Results&lt;/h3>
&lt;p>We could try to calculate our metrics for every single document in the system. Since we currently have &lt;a href="https://doi.org/10.64000/c8tcs-9vm83" target="_blank">over 100M of them&lt;/a>, this would take a while, and we already felt impatient&amp;hellip;&lt;/p>
&lt;p>A faster strategy was to use &lt;a href="https://en.wikipedia.org/wiki/Sampling_%28statistics%29" target="_blank">sampling&lt;/a> with all the tools statistics was so generous to provide. And this is exactly what we did. We used a random sample of 2500 items from our system, which is big enough to give reliable results and, as we will see later, produces quite narrow confidence intervals.&lt;/p>
&lt;p>Apart from the sample, we needed some input reference strings. We generated those automatically by formatting the metadata of the chosen items using various citation styles. (Similarly to what happens when you automatically format the bibliography section for your article. Or at least we hope you don&amp;rsquo;t produce those reference strings manually…)&lt;/p>
&lt;p>For each record in our sample, we generated 11 citation strings, using the following styles:&lt;/p>
&lt;ul>
&lt;li>Well known citation styles from various disciplines:
&lt;ul>
&lt;li>american-chemical-society (acs)&lt;/li>
&lt;li>american-institute-of-physics (aip)&lt;/li>
&lt;li>elsevier-without-titles (ewt)&lt;/li>
&lt;li>apa&lt;/li>
&lt;li>chicago-author-date&lt;/li>
&lt;li>modern-language-association (mla)&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Known styles + random noise. To simulate not-so-clean data, we randomly added noise (additional spaces, deleted spaces, typos) to the generated strings of the following styles:
&lt;ul>
&lt;li>american-institute-of-physics&lt;/li>
&lt;li>apa&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Custom degraded &amp;ldquo;styles&amp;rdquo;:
&lt;ul>
&lt;li>degraded: a simple concatenation of authors&amp;rsquo; names, title, container title, year, volume, issue and pages&lt;/li>
&lt;li>one author: a simple concatenation of the first author&amp;rsquo;s name, title, container title, year, volume, issue and pages&lt;/li>
&lt;li>title scrambled: same as degraded, but with title words randomly shuffled&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;p>Some styles include the DOI in the reference string. In such cases we stripped the DOI from the string, to make the matching problem non-trivial.&lt;/p>
&lt;p>An ideal matching algorithm will match every generated string to the record it was generated from. In practise, some of the expected matches will be missing, which will lower the recall of the tested matching approach. On the other hand, it is very probable that we will get the precision of 100%. To have the precision lower than 100%, we would have to have some unexpected matches to our sampled documents, which is unlikely. This is obviously not great, because we are missing a very important piece of information.&lt;/p>
&lt;p>What can we do to “encourage” such mismatches to our sampled documents? We could generate additional reference strings of documents that are not in our sample, but are similar to the documents in our sample. Hopefully, we will see some incorrect links from those similar strings to our sampled documents.&lt;/p>
&lt;p>For each sampled document I added up to 2 similar documents (I used, surprise surprise, our search engine to find the most similar documents). I ended up with 7,374 items in total (2,500 originally sampled and 4,874 similar items). For each item, 11 different reference strings were generated. Each reference string was then matched using the tested approaches and I could finally look at some results.&lt;/p>
&lt;h3 id="results-1">Results&lt;/h3>
&lt;p>First, let&amp;rsquo;s compare the overall results averaged over the entire dataset:&lt;/p>
&lt;img src="https://www.crossref.org/images/blog/matching_comparison_overall.png" alt="overall comparison of reference matching evaluation" width="500px" />
&lt;p>The small vertical black lines at the top of the boxes show the confidence intervals at the confidence level 95%. The table gives the exact values and the same confidence intervals. The best result for each metric is bolded.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>&lt;/th>
&lt;th>average precision&lt;/th>
&lt;th>average recall&lt;/th>
&lt;th>average F1&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>legacy approach&lt;/td>
&lt;td>&lt;strong>0.9933&lt;/strong>&lt;br />(0.9910 - 0.9956)&lt;/td>
&lt;td>0.4203&lt;br />(0.4095 - 0.4312)&lt;/td>
&lt;td>0.5289&lt;br /> (0.5164 - 0.5413)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>SBM (simple threshold)&lt;/td>
&lt;td>0.9890&lt;br />(0.9863 - 0.9917)&lt;/td>
&lt;td>0.7127&lt;br />(0.7021 - 0.7233)&lt;/td>
&lt;td>0.7866&lt;br />(0.7763 - 0.7968)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>SBM (normalized threshold)&lt;/td>
&lt;td>0.9872&lt;br />(0.9844 - 0.9901)&lt;/td>
&lt;td>&lt;strong>0.7905&lt;/strong>&lt;br />(0.7796 - 0.8015)&lt;/td>
&lt;td>0.8354&lt;br />(0.8249 - 0.8458)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>SBMV&lt;/td>
&lt;td>0.9923&lt;br />(0.9902 - 0.9945)&lt;/td>
&lt;td>0.7902&lt;br />(0.7802 - 0.8002)&lt;/td>
&lt;td>&lt;strong>0.8448&lt;/strong>&lt;br />(0.8352 - 0.8544)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The confidence intervals given in the table are the ranges, in which it is 95% likely to have the real average precision, recall and F1. For example, we are 95% sure that the real F1 for SBMV in our entire collection is within the range 0.8352 - 0.8544.&lt;/p>
&lt;p>As we can see, each metric has a different winner.&lt;/p>
&lt;p>&lt;strong>The legacy approach is the best in precision&lt;/strong>. This suggests the legacy approach is quite conservative and outputs a match only if it is very sure about it. This might also result in missing a number of true matches (false negatives).&lt;/p>
&lt;p>According to the paired Student&amp;rsquo;s t-test, the difference between the average precision of the legacy approach and the average precision of the second best SBMV is not statistically significant. This means we cannot rule out that this difference is simply the effect of the randomness in sampling, and not the sign of the true difference.&lt;/p>
&lt;p>&lt;strong>SBM with a normalized threshold is the best in recall&lt;/strong>. This suggests that it is fairly tolerant and returns a lot of matches, which might also result in returning more incorrect matches (false positives). Also in this case the difference between the winner and the second best (SBMV) is not statistically significant.&lt;/p>
&lt;p>&lt;strong>SBMV is the best in F1&lt;/strong>. This shows that this approach balances precision and recall the best, despite being only the second best in both of those metrics. According to the paired Student&amp;rsquo;s t-test, the difference between SBMV and the second best approach (SBM with a normalized threshold) is &lt;strong>statistically significant&lt;/strong>.&lt;/p>
&lt;p>&lt;strong>All variants of the search-based matching outperform the parsing-based approach in terms of F1&lt;/strong>, with statistically significant differences. This shows that in search based-matching it is possible to keep precision almost as good as in the legacy approach, and still include many more true positives.&lt;/p>
&lt;p>Let&amp;rsquo;s also look at the same results split by the citation style:&lt;/p>
&lt;img src="https://www.crossref.org/images/blog/matching_comparison_by_style.png" alt="comparison of reference matching evaluation by style" width="500px" />
&lt;p>For all styles the precision values are very high, and the legacy approach is slightly better than all variations of the search-based approach.&lt;/p>
&lt;p>In terms of recall and F1 SBM with a simple threshold is better than the legacy approach in 8 out of 11 styles. The three styles for which the legacy approach outperforms SBM with a simple threshold are styles that do not include the title in the reference strings (acs, aip and ewt). The reason for this is that the simple threshold cannot be well calibrated for shorter and longer reference strings at the same time.&lt;/p>
&lt;p>SBM with a normalized threshold and &lt;strong>SBMV is better than the legacy approach in recall and F1 for all 11 styles&lt;/strong>.&lt;/p>
&lt;p>The weak spot of the legacy approach is degraded and noisy reference strings, which do not appear to use any of the known citation styles.&lt;/p>
&lt;p>The weak spot of the search-based matching is short reference strings, and in particular citation styles that do not include the title in the string.&lt;/p>
&lt;h3 id="limitations">Limitations&lt;/h3>
&lt;p>The limitations are related mostly to the method of building the dataset.&lt;/p>
&lt;ul>
&lt;li>All the numbers reported here are estimates, since they were calculated on a sample.&lt;/li>
&lt;li>The numbers show strengths and weaknesses of each approach, but they do not reflect the real precision and recall in the system:
&lt;ul>
&lt;li>Since we included only 2 similar documents for each document in the sample, precision is most likely lower in the real data.&lt;/li>
&lt;li>We used a number of styles distributed uniformly. Of course in the real system the styles and their distribution might be different, which affects all the calculated numbers.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul></description></item><item><title>What does the sample say?</title><link>https://www.crossref.org/blog/what-does-the-sample-say/</link><pubDate>Fri, 09 Nov 2018 00:00:00 +0000</pubDate><author>Dominika Tkaczyk</author><guid>https://www.crossref.org/blog/what-does-the-sample-say/</guid><description>&lt;p>At Crossref Labs, we often come across interesting research questions and try to answer them by analyzing our data. Depending on the nature of the experiment, processing &lt;a href="https://doi.org/10.64000/c8tcs-9vm83" target="_blank">over 100M records&lt;/a> might be time-consuming or even impossible. In those dark moments we turn to sampling and statistical tools. But what can we infer from only a sample of the data?&lt;/p>
&lt;p>Imagine you are cooking soup. You just put some salt in it and now you are wondering if it is salty enough. What do you do next?&lt;/p>
&lt;ul>
&lt;li>Option #1: Since you carefully measured 1/7 of a teaspoon of salt per 0.13 litres of soup (as always), you already know the soup is fine. Everyone else better stop asking silly questions and eat their soup.&lt;/li>
&lt;li>Option #2: You stir everything carefully and taste a tablespoon. If it is not salty enough, you put more salt in the soup and repeat the tasting procedure.&lt;/li>
&lt;li>Option #3: You eat a tablespoon of soup and it tastes fine. But wait, there&amp;rsquo;s more soup in the pot, what if the sip you&amp;rsquo;ve just tasted was somehow different than the rest? You decide it&amp;rsquo;s better to eat another spoon of soup (which tastes fine). Still, a lot of soup left, who knows what that tastes like? It might be safer to eat an entire bowl of soup. Hmm, still not sure, you&amp;rsquo;ve eaten such a small fraction of the soup, who can guarantee the rest tastes the same? You have no choice but to eat another bowl, and then some more… Ooops, now you have eaten the entire pot of soup! At least you can be 100% sure now that the soup was indeed salty enough. The problem is, there is no soup left, and also, you don&amp;rsquo;t feel so good. But people are getting hungry, so you start cooking a new batch…&lt;/li>
&lt;/ul>
&lt;p>If your answer was option #3, read on. Your life is going to get easier!&lt;/p>
&lt;h3 id="tldr">TL;DR&lt;/h3>
&lt;ul>
&lt;li>Sampling and confidence intervals can be used to estimate the mean of a certain feature, or the proportion of items passing a certain test, by calculating it only for a random sample of items, instead of the entire large set of items. Note that estimating =/= guessing.&lt;/li>
&lt;li>Confidence intervals are a way of controlling the amount of uncertainty related to randomness in sampling.&lt;/li>
&lt;li>The confidence interval has a form (estimated value - something, estimated value + something). Confidence interval at the confidence level 95% is interpreted as follows: we are 95% sure that the real value that we are estimating is within our calculated confidence interval.&lt;/li>
&lt;li>The higher the confidence level (i.e. the more certain we want to be about the interval), the wider the interval has to be.&lt;/li>
&lt;li>The larger the sample, the narrower the confidence interval.&lt;/li>
&lt;li>We are never 100% sure that the value we are estimating is actually within our calculated confidence interval. By setting the confidence level high, we only make sure this is a very likely event.&lt;/li>
&lt;/ul>
&lt;h3 id="the-problem">The problem&lt;/h3>
&lt;p>Sampling and estimating drew my attention while I was working on the evaluation of the reference matching algorithms. In Crossref&amp;rsquo;s case, reference matching is the task of finding the target document DOI for the given input reference string, such as:&lt;/p>
&lt;p>&lt;em>(1) Adamo, S. H.; Cain, M. S.; Mitroff, S. R. Psychological Science 2013, 24, 2569–2574.&lt;/em>&lt;/p>
&lt;p>Accurate reference matching is very important for the scientific community. Thanks to automatic reference matching we are able to find citing relations in large document sets, calculate citation counts, H-indexes, impact factors, etc.&lt;/p>
&lt;p>For several weeks now I have been investigating &lt;a href="https://www.crossref.org/labs/resolving-citations-we-dont-need-no-stinkin-parser/">a simple reference matching algorithm based on the search engine&lt;/a>. In this algorithm, we use the input reference string as the query in the search engine, and we return the first item from the results as the target document. Luckily, at Crossref we already have &lt;a href="https://search.crossref.org" target="_blank">a good search engine&lt;/a> in place, so all the pieces are there.&lt;/p>
&lt;p>I was interested in how well this simple algorithm works, i.e. how often the correct target document is found. For example, let&amp;rsquo;s say we have a reference string in APA citation style generated for a specific record in Crossref system. How certain can I be that it will be correctly matched to the record&amp;rsquo;s DOI?&lt;/p>
&lt;p>I could calculate this directly by generating the APA reference string for every record in the system and trying to match those strings to DOIs. Since we already have &lt;a href="https://doi.org/10.64000/c8tcs-9vm83" target="_blank">over 100M records&lt;/a>, this would take a while and I was getting impatient. So instead of eating the whole pot of soup, I decided to stir and taste just a little bit of it, or, academically speaking, use &lt;a href="https://en.wikipedia.org/wiki/Sampling_%28statistics%29" target="_blank">sampling&lt;/a> and &lt;a href="https://en.wikipedia.org/wiki/Confidence_interval" target="_blank">confidence intervals&lt;/a>.&lt;/p>
&lt;p>These statistical tools are useful in situations, where we have a large set of items, and we want to know the average of a certain feature of an item in our set, or the proportion of items passing a certain test, but calculating it directly is impossible or difficult. For example, we might want to know the average height of all women living in USA, the average salary of a Java programmer in London, or the proportion of book records in the Crossref collection. The entire set we are interested in is called a &lt;strong>population&lt;/strong> and the value we are interested in is called a &lt;strong>population average&lt;/strong> or a &lt;strong>population proportion&lt;/strong>. Sampling and confidence intervals let us estimate the population average or proportion using only a sample of items, in a reliable and controlled way.&lt;/p>
&lt;h3 id="experiments">Experiments&lt;/h3>
&lt;p>In general I wanted to see, how well I can estimate the population proportion of records passing a certain test, using only a sample.&lt;/p>
&lt;p>In the following experiments, the population is 1 million metadata records from the Crossref collection. I didn&amp;rsquo;t use the entire collection as the population, because I wanted to be able to calculate the real proportion and compare it to the estimates.&lt;/p>
&lt;p>The test for a single record is: whether the APA reference string generated from said record is correctly matched to the record&amp;rsquo;s original DOI. In other words: if I generate the APA reference string from my record and use it as the query in Crossref&amp;rsquo;s search, will the record be the first element in the result list? Note that this proportion can also be interpreted as the probability that the APA reference string will be correctly matched to the target DOI.&lt;/p>
&lt;h4 id="estimating-from-a-sample">Estimating from a sample&lt;/h4>
&lt;p>I took a random sample of size 100 from my population and calculated the proportion of the records correctly matched - this is called a &lt;strong>sample proportion&lt;/strong>. In my case, the sample proportion is 0.92. This means that in my sample 92 reference strings were successfully matched to the right DOIs. Not too bad.&lt;/p>
&lt;p>I could now treat this number as the estimate and assume that 0.92 is close to the population proportion. On the other hand, this is only a sample, and a rather small one, which raises doubts. What if our 92 correct matches happen to be the only correct matches in the entire 1M population? In such a case, our estimate of 0.92 would be very far from the population proportion. This uncertainty related to sampling randomness can be captured by the confidence interval.&lt;/p>
&lt;h4 id="confidence-interval">Confidence interval&lt;/h4>
&lt;p>The confidence interval for my 100-point sample, at the confidence level 95%, is 0.8668-0.9732. This is interpreted as follows: we are 95% sure that the real population proportion is within the range 0.8668-0.9732. Note that the sample average (0.92) is exactly in the middle of this range.&lt;/p>
&lt;p>100 items is not a big sample. Let&amp;rsquo;s calculate the confidence interval for a sample 10 times larger. From a sample of size 1000 I got the estimate 0.932, and the confidence interval 0.9164-0.9476. Based on this, we can be 95% sure that the real population proportion is within the range 0.9164-0.9476.&lt;/p>
&lt;p>It seems the our interval got smaller when we increased the sample size. Let&amp;rsquo;s plot the intervals for a variety of sample sizes:&lt;/p>
&lt;img src="https://www.crossref.org/images/blog/sampling_ci_by_size.png" alt="confidence interval vs sample size" width="500px" />
&lt;p>The blue line represents the estimated proportion for samples of different sizes, and the grey vertical lines are confidence intervals. The estimated proportion varies, because for each size a different sample was drawn.&lt;/p>
&lt;p>We can see that increasing the sample size decreases the interval. This should make intuitive sense: if we have more data to estimate from, we can expect our estimate to be more reliable (i.e. closer to the population proportion).&lt;/p>
&lt;p>What about the confidence level? By setting the confidence level we specify, how certain we want to be about our confidence interval. So far I used 95%. What happens if I calculate the confidence intervals for my original sample of 100 records, but with varying confidence level?&lt;/p>
&lt;img src="https://www.crossref.org/images/blog/sampling_ci_by_cl.png" alt="confidence interval vs confidence level" width="500px" />
&lt;p>In this case the average is always the same, because only one sample was used.&lt;/p>
&lt;p>As we can see, increasing the confidence level widens the interval. In other words, the more certain we want to be about the interval containing the real population average, the wider the interval has to be.&lt;/p>
&lt;h4 id="sampling-distribution">Sampling distribution&lt;/h4>
&lt;p>So far so good, but where does this magic confidence interval actually come from? It is calculated by the theoretical analysis of the sampling distribution (not to be confused with sample distribution):&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Sample distribution&lt;/strong> is when we collect one sample of size &lt;em>k&lt;/em> and calculate a certain feature for every element in the sample. It is a distribution of &lt;em>k&lt;/em> values of the feature in one sample.&lt;/li>
&lt;li>&lt;strong>Sampling distribution&lt;/strong> is when we independently collect &lt;em>n&lt;/em> samples, each of size &lt;em>k&lt;/em>, and calculate the sample proportion for each sample. It is the distribution of &lt;em>n&lt;/em> sample proportions.&lt;/li>
&lt;/ul>
&lt;p>Imagine I collect all samples of size 100 from my population and I calculate the sample proportion for each sample. This is the sampling distribution. Now I randomly choose one number from this sampling distribution. Note that this is equivalent to what I did before: choosing one random sample of size 100 and calculating its sample proportion.&lt;/p>
&lt;p>According to &lt;a href="https://en.wikipedia.org/wiki/Central_limit_theorem" target="_blank">Central Limit Theorem&lt;/a>, sampling distribution is approximately normal with the mean equal to the population proportion. Here is the visualisation of the sampling distribution:&lt;/p>
&lt;img src="https://www.crossref.org/images/blog/sampling_sampling_distribution.png" alt="visualization of sampling distribution" width="500px" />
&lt;p>The black vertical line shows the mean of the sampling distribution. This is also the real population proportion. The grey area covers the middle 95% of the distribution mass (within 2 standard deviations from the mean).&lt;/p>
&lt;p>When we choose one sample and calculate the sample proportion, there are two possibilities:&lt;/p>
&lt;ul>
&lt;li>With 95% probability, we were lucky and the sample proportion is within the grey area. In that case, the real population proportion is not further than 2 standard deviations from our estimate.&lt;/li>
&lt;li>With 5% probability, we were unlucky and the sample proportion is outside the grey area. In that case, the real population proportion is further than 2 standard deviations from our estimate.&lt;/li>
&lt;/ul>
&lt;p>So with the confidence of 95% we can say that the real population proportion is within 2 standard deviations from our sample proportion. We can see now that these 2 standard deviations of the sampling distribution define our confidence interval at the confidence level of 95%.&lt;/p>
&lt;p>Smaller confidence level would make the grey area narrower, and the confidence interval would shrink as well. Larger confidence level makes the grey area, and the confidence interval, larger.&lt;/p>
&lt;p>To look more closely at the sampling distribution, I generated sampling distributions for all combinations of &amp;ldquo;&lt;em>n&lt;/em> samples of size &lt;em>k&lt;/em>&amp;rdquo;, where &lt;em>n&lt;/em> and &lt;em>k&lt;/em> are the elements of the set {25, 50, 100, 200, 400, 800, 1600, 3200}. This is only an approximation, since the real sampling distributions would contain many more samples.&lt;/p>
&lt;p>Here is the heatmap showing the mean of each sampling distribution (this should be approximately the same as the real population proportion):&lt;/p>
&lt;img src="https://www.crossref.org/images/blog/sampling_sampling_means.png" alt="means of sampling distributions" width="500px" />
&lt;p>We can see that there is some variability in the top left part of the heatmap, which corresponds to small sample sizes and small numbers of samples. The bottom right part of the heatmap shows much less variability. As we increase the sample size and number of samples, the mean of the sampling distribution approaches numbers around 0.933.&lt;/p>
&lt;p>Here is the heatmap showing the standard deviation for each sampling distribution:&lt;/p>
&lt;img src="https://www.crossref.org/images/blog/sampling_sampling_stdevs.png" alt="standard deviations of sampling distributions" width="500px" />
&lt;p>We can clearly see how the standard deviation decreases when we increase the sample size. This is consistent with the previous observation, that the confidence interval decreases when the sample size is increased.&lt;/p>
&lt;p>Let&amp;rsquo;s also see the histograms of all the sampling distributions:&lt;/p>
&lt;img src="https://www.crossref.org/images/blog/sampling_sampling_histograms.png" alt="histograms of sampling distributions" width="500px" />
&lt;p>Here we can see the following patterns:&lt;/p>
&lt;ul>
&lt;li>All histograms indeed seem to be centered around approximately the same number.&lt;/li>
&lt;li>The more samples we include, the more normal the sampling distribution appears. This happens because with more samples the real sampling distribution is better approximated.&lt;/li>
&lt;li>The larger the sample size, the narrower the sampling distribution (i.e. smaller standard deviation).&lt;/li>
&lt;/ul>
&lt;h4 id="the-estimation-vs-the-real-value">The estimation vs. the real value&lt;/h4>
&lt;p>Let&amp;rsquo;s go back to my original question. What is the proportion of reference strings in APA style, that are successfully matched to the original DOIs of the records they were generated from? So far we observed the following:&lt;/p>
&lt;ul>
&lt;li>A small sample of 100 gave the estimate 0.92 (confidence interval 0.8668-0.9732)&lt;/li>
&lt;li>A larger samples of 1000 gave the estimate 0.932 (confidence interval 0.9164-0.9476)&lt;/li>
&lt;li>The means of sampling distributions seem to slowly approach 0.933&lt;/li>
&lt;/ul>
&lt;p>So what is the real population proportion in my case? It is 0.933005. As we can see, the estimations were fairly close, and the intervals indeed contain the real value.&lt;/p>
&lt;p>Now I can also calculate the confidence interval for each sample in my sampling distributions, and then the fraction of the intervals that contain the real population proportion (I expect these numbers to be close to the confidence level 95%). Here is the heatmap:&lt;/p>
&lt;img src="https://www.crossref.org/images/blog/sampling_sampling_fractions.png" alt="fractions of samples containing the real proportion in confidence interval" width="500px" />
&lt;p>We can see that for larger sample sizes indeed the fractions are high. The fraction is not always above 95%, as we would expect, especially for smaller sample sizes. One of the reasons is that when we calculate the confidence interval, we approximate the standard deviation of the population with the standard deviation of the sample. This is not always a reliable estimate, especially for small samples. This suggests that sample sizes of at least 1000-2000 should be used.&lt;/p>
&lt;h3 id="be-careful">Be careful&lt;/h3>
&lt;p>Some important things to remember:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Aggregate functions&lt;/strong>. As mentioned before, apart from estimating the proportion, a similar procedure can be applied for estimating the average of a certain numeric feature.&lt;/li>
&lt;li>&lt;strong>(Lack of) certainty&lt;/strong>. Remember that the confidence level &amp;lt; 1. This means that we are never sure that our confidence interval contains the true population proportion. If for any reason you need to be 100% sure, just process the entire dataset.&lt;/li>
&lt;li>&lt;strong>Randomness&lt;/strong>, a.k.a. “stirring before tasting”. The sample has to be chosen randomly. Beware of assuming that the dataset is shuffled and taking the first 1000 rows!&lt;/li>
&lt;li>&lt;strong>Sample size&lt;/strong>. We know already that the larger the sample, the better. As a rule of thumb, using sample sizes &amp;lt; 30 makes the estimates, including the interval, rather unreliable.&lt;/li>
&lt;li>&lt;strong>Skewness&lt;/strong>. In general, the more skewed the original feature distribution, the larger sample we need. In case of the proportion, the sample should contain at least 5 data points of each value of the feature (passes/doesn&amp;rsquo;t pass the test).&lt;/li>
&lt;li>&lt;strong>Generalization&lt;/strong>. The sample average/proportion can be used as an estimate for the population average/proportion, but only the population it was drawn from. This means that if we applied any filters before sampling (which is equivalent to sampling from a subset passing the filter), we can reason only about the filtered subset of the data.&lt;/li>
&lt;li>&lt;strong>Reproducibility&lt;/strong>. This is more of an engineering concern. In short, all the analyses we do should be reproducible. In the context of sampling it means, at the very least, that we should record the samples we use.&lt;/li>
&lt;/ul></description></item></channel></rss>