MCPcopy Index your code
hub / github.com/Toloka/crowd-kit

github.com/Toloka/crowd-kit @v1.4.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.4.2 ↗ · + Follow
441 symbols 1,608 edges 81 files 188 documented · 43%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Crowd-Kit: Computational Quality Control for Crowdsourcing

Crowd-Kit

PyPI Version GitHub Tests Codecov Documentation Paper

Crowd-Kit is a powerful Python library that implements commonly-used aggregation methods for crowdsourced annotation and offers the relevant metrics and datasets. We strive to implement functionality that simplifies working with crowdsourced data.

Currently, Crowd-Kit contains:

  • implementations of commonly-used aggregation methods for categorical, pairwise, textual, and segmentation responses;
  • metrics of uncertainty, consistency, and agreement with aggregate;
  • loaders for popular crowdsourced datasets.

Also, the learning subpackage contains PyTorch implementations of deep learning from crowds methods and advanced aggregation algorithms.

Installing

To install Crowd-Kit, run the following command: pip install crowd-kit. If you also want to use the learning subpackage, type pip install crowd-kit[learning].

If you are interested in contributing to Crowd-Kit, use uv to manage the dependencies:

uv venv
uv pip install -e '.[dev,docs,learning]'
uv tool run pre-commit install

We use pytest for testing and a variety of linters, including pre-commit, Black, isort, Flake8, pyupgrade, and nbQA, to simplify code maintenance.

Getting Started

This example shows how to use Crowd-Kit for categorical aggregation using the classical Dawid-Skene algorithm.

First, let us do all the necessary imports.

from crowdkit.aggregation import DawidSkene
from crowdkit.datasets import load_dataset

import pandas as pd

Then, you need to read your annotations into Pandas DataFrame with columns task, worker, label. Alternatively, you can download an example dataset:

df = pd.read_csv('results.csv')  # should contain columns: task, worker, label
# df, ground_truth = load_dataset('relevance-2')  # or download an example dataset

Then, you can aggregate the workers' responses using the fit_predict method from the scikit-learn library:

aggregated_labels = DawidSkene(n_iter=100).fit_predict(df)

More usage examples

Implemented Aggregation Methods

Below is the list of currently implemented methods, including the already available (✅) and in progress (🟡).

Categorical Responses

Method Status
Majority Vote
One-coin Dawid-Skene
Dawid-Skene
Gold Majority Vote
M-MSR
Wawa
Zero-Based Skill
GLAD
KOS
MACE

Multi-Label Responses

Method Status
Binary Relevance

Textual Responses

Method Status
RASA
HRRASA
ROVER

Image Segmentation

Method Status
Segmentation MV
Segmentation RASA
Segmentation EM

Pairwise Comparisons

Method Status
Bradley-Terry
Noisy Bradley-Terry

[!TIP] Consider using the more modern Evalica library to aggregate pairwise comparisons.

Learning from Crowds

Method Status
CrowdLayer
CoNAL

Citation

@article{CrowdKit,
  author    = {Ustalov, Dmitry and Pavlichenko, Nikita and Tseitlin, Boris},
  title     = {{Learning from Crowds with Crowd-Kit}},
  year      = {2024},
  journal   = {Journal of Open Source Software},
  volume    = {9},
  number    = {96},
  pages     = {6227},
  publisher = {The Open Journal},
  doi       = {10.21105/joss.06227},
  issn      = {2475-9066},
  eprint    = {2109.08584},
  eprinttype = {arxiv},
  eprintclass = {cs.HC},
  language  = {english},
}

Support and Contributions

Please use GitHub Issues to seek support and submit feature requests. We accept contributions to Crowd-Kit via GitHub as according to our guidelines in CONTRIBUTING.md.

License

© Crowd-Kit team authors, 2020–2025. Licensed under the Apache License, Version 2.0. See LICENSE file for more details.

Core symbols most depended-on inside this repo

fit
called by 24
crowdkit/aggregation/texts/rover.py
fit_predict
called by 23
crowdkit/aggregation/texts/rover.py
get_accuracy
called by 15
crowdkit/aggregation/utils.py
named_series_attrib
called by 15
crowdkit/aggregation/utils.py
uncertainty
called by 12
crowdkit/metrics/data/_classification.py
fit
called by 12
crowdkit/aggregation/classification/dawid_skene.py
_load_dataset
called by 11
crowdkit/datasets/_loaders.py
entropy_threshold
called by 5
crowdkit/postprocessing/entropy_threshold.py

Shape

Function 225
Method 179
Class 35
Route 2

Languages

Python100%

Modules by API surface

tests/aggregation/test_ds_aggregation.py33 symbols
crowdkit/aggregation/classification/glad.py17 symbols
crowdkit/aggregation/embeddings/hrrasa.py16 symbols
crowdkit/aggregation/classification/dawid_skene.py16 symbols
tests/aggregation/test_bt_aggregation.py15 symbols
crowdkit/datasets/_loaders.py15 symbols
crowdkit/aggregation/base/__init__.py15 symbols
crowdkit/aggregation/utils.py13 symbols
crowdkit/aggregation/classification/mace.py13 symbols
tests/metrics/test_metrics.py12 symbols
tests/conftest.py12 symbols
tests/aggregation/test_classification_aggregation_edge_cases.py12 symbols

For agents

$ claude mcp add crowd-kit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact