Alternative scorer for the CoNLL-2011/2012 shared tasks on coreference resolution.
Project description
Scorch¹
This is an alternative implementation of the coreference scorer for the CoNLL-2011/2012 shared tasks on coreference resolution.
It aims to be more straightforward than the reference implementation, while maintaining as much compatibility with it as possible.
The implementations of the various scores are as close as possible from the formulas used by Pradhan et al. (2014), with the edge cases for BLANC taken from Recasens and Hovy (2011).
1. Scorer for coreference chains.
Usage
scorch gold.json sys.json out.txt
Install
From the cheeseshop
python3 -m pip install --user scorch
Or directly from git
python3 -m pip install --user git+https://github.com/LoicGrobol/scorch.git
Formats
Single document
The input files should be JSON files with a "type"
key at top-level
- If
"type"
is"graph"
, then top-level should have at top-level- A
"mentions"
key containing a list of all mention identifiers - A
"links"
key containing a list of pairs of corefering mention identifiers
- A
- If
"type"
is"clusters"
, then top-level should have a"clusters"
key containing a mapping from clusters ids to cluster contents (as lists of mention identifiers).
Of course the system and gold files should use the same set of mention identifiers for the mentions they have in common.
For convenience, the conll.py
converts CoNLL-2012 files to this format.
Multiple documents
If the inputs are directories, files with the same base name (excluding extension) as those present in the sys directory are expected to be present in the gold directory, with exactly one gold file for each sys file. In that case, the output scores will be the micro-average of the individual files scores, ie their arithmetic means weighted by the relative numbers of
- Gold mentions for Recall
- System mentions for Precision
- The sum of the previous two for F₁
This is different from the reference interpretation where
- MUC weighting ignores mentions in singleton entities
- This should not make any difference for the CoNLL-2012 dataset, since singleton entities are not annotated.
- For datasets with singletons, the shortcomings of MUC are well known, so this score shouldn't matter much
- BLANC is calculated by micro-averaging coreference and non-coreference separately, using
the number of links as weights instead of the number of mentions.
- This is roughly equivalent to weighting coreference scores per document by their number of non-singleton clusters and non-coreference scores by the square of their number of mentions. This give disproportionate importance to large documents, which is not desirable in heterogenous corpora
The CoNLL average score is the arithmetic mean of the global MUC, B³ and CEAFₑ F₁ scores.
Sources
- Scoring Coreference Partitions of Predicted Mentions: A Reference Implementation. Sameer Pradhan, Xiaoqiang Luo, Marta Recasens, Eduard Hovy, Vincent Ng and Michael Strube. Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics, Baltimore, MD, June 2014. (pdf)
- BLANC: Implementing the Rand Index for Coreference Evaluation. Marta Recasens and Eduard Hovy In: Natural Language Engineering 17 (4). Cambridge University Press, 2011. (pdf)
- An Extension of BLANC to System Mentions. Xiaoqiang Luo, Sameer Pradhan, Marta Recasens and Eduard Hovy. Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics, Baltimore, MD, June 2014. (pdf)
- The version of the Kuhn-Munkres algorithm used for the CEAF scores uses
scipy.optimize.linear_sum_assignment
, with$-ϕ_n$
as cost function.
License
Unless otherwise specified (see below), the following licence (the so-called “MIT License”) applies to all the files in this repository. See also LICENSE.md.
Copyright 2018 Loïc Grobol <loic.grobol@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License exceptions
-
The reference scorer testcases located in
tests/fixtures/conll/
are distributed under the Creative Commons Attribution ShareAlike 4.0 International License- Copyright © 2011- Sameer Pradhan pradhan <at> cemantix.org
- Authors
- Emili Sapena, Universitat Politècnica de Catalunya, http://www.lsi.upc.edu/~esapena, esapena <at> lsi.upc.edu
- Sameer Pradhan, http://cemantix.org, pradhan <at> cemantix.org
- Sebastian Martschat, sebastian.martschat <at> h-its.org
- Xiaoqiang Luo, xql <at> google.com
- Origin http://conll.github.io/reference-coreference-scorers
These files are taken verbatim from the 8.0.1 of the official CoNLL scorer at https://github.com/conll/reference-coreference-scorers/releases
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file scorch-0.2.0.tar.gz
.
File metadata
- Download URL: scorch-0.2.0.tar.gz
- Upload date:
- Size: 17.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9846e4a78ada585bc0458b0dc7fc7b3c156f7fa407e1d0625151efe8a38b8031 |
|
MD5 | 8d65a9d2175cc2162271c96a1205bb30 |
|
BLAKE2b-256 | 1cd3fa59d58648a0217db0e0d6655a94150d05446210ac758facef4cef2e3daa |
File details
Details for the file scorch-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: scorch-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d450229a5e8a2219a27ed30e19c922a5bb125f1714ca2887469bb46e0715800 |
|
MD5 | dcabca620361e20a6cb98c6ffe18a663 |
|
BLAKE2b-256 | d5b0a651d91d0278a373fd6e7c5ee1300025a2ea4214fb3c3830352912f309ab |