Skip to main content

MAMKit

Tests Documentation PyPI

A comprehensive toolkit for multimodal argument mining.

Multimodal argument mining (MAM) studies arguments in speech. A model reads the transcript of a sentence, its audio, or both, and classifies the sentence or the relation between two sentences.

The corpora that MAMKit ships are political debates with aligned transcripts and recordings. MAMKit runs the models of the MAMKit paper on four corpora under one configuration system, one training loop, and one set of metrics. Every experiment of the paper is a registered task. Reproducing a result is therefore running one key, and comparing two models is a change of key.

MAMKit is built on Cinnamon. Corpora, split strategies, featurizers, models, and metrics are components with registered configurations. A task names each of them by key.

Documentation · Tutorial · Contributing

Installation

MAMKit requires Python 3.10 or later.

pip install mamkit

Audio tasks also need FFmpeg on the system path, for example through sudo apt install ffmpeg or brew install ffmpeg.

The cmn-run command, which runs registered tasks interactively, needs the cli extra of Cinnamon:

pip install "cinnamon-core[cli]"

Quickstart

A task is one experiment from start to finish: a corpus, a split strategy, a featurizer per modality, a model, its metrics, and a list of seeds. The script below runs the toy task, which trains a text BiLSTM on a synthetic corpus in seconds on a CPU.

from pathlib import Path

import mamkit
from cinnamon.registry import Registry
from mamkit.configurations.keys import TOY_TASK

Registry.build(directory=Path(mamkit.__file__).parent)

task = Registry.from_key(TOY_TASK, save_path="results", seeds=[0, 1])
results = task.run()
print(results["test"]["f1"])
{'per_seed_mean': [1.0, 1.0], 'per_seed_std': [0.0, 0.0], 'mean': 1.0, 'std': 0.0}

For each seed and split, the task refits its featurizers, builds a fresh model, trains with early stopping on the validation loss, and scores the best checkpoint. Features from a pretrained model or MFCCs are computed once per input and shared by every seed and split. per_seed_mean and per_seed_std summarize the splits of each seed, and mean and std summarize the per-seed means. The same results land in results/results.json, beside the checkpoints. The toy corpus marks each label with a cue word, so a perfect score only shows that the run holds together.

An experiment of the paper is a key with the name task in the mamkit namespace. Its tags name the corpus, the task, the input mode, the model family, and the source of the configuration:

from cinnamon.registry import RegistrationKey

key = RegistrationKey(
    name="task",
    tags={"ukdebates", "asd", "text-only", "bilstm", "mancini-et-al-2022"},
    namespace="mamkit",
)
results = Registry.from_key(key).run()

On first use, the task downloads UKDebates and the GloVe vectors into the working directory. It writes its results under results/ukdebates/asd/text-only/bilstm/mancini-et-al-2022. cmn-run -dir mamkit, from a clone of the repository, offers every registered task from the command line.

Tasks

Tag Task Corpora
asd Argumentative sentence detection UKDebates, MM-USED
acc Argumentative component classification, claim or premise MM-USED
arc Argumentative relation classification, support, attack, or neither M-Arg
afc Argumentative fallacy classification, over six fallacy categories MM-USED-fallacy
afd Argumentative fallacy detection MM-USED-fallacy

Each task runs in one of three input modes, text-only, audio-only, or text-audio, and the mode is a tag of its key.

Models

Model Text encoding Audio encoding Fusion Tags
BiLSTM GloVe and BiLSTM MFCCs, or a pretrained audio model, and BiLSTM Concatenation bilstm, bilstm-mfcc, bilstm-transformer
Transformer BERT or RoBERTa Pretrained audio model and BiLSTM Concatenation transformer, mmtransformer
Audio Transformer None Pretrained audio model and Transformer encoder None transformer-encoder
CSA BERT token embeddings Pretrained audio model Self-attention over the concatenated sequences csa
Ensemble BERT token embeddings Pretrained audio model and Transformer encoder Learned average of the two class distributions ensemble
MulTA BERT token embeddings Pretrained audio model Cross-modal attention in both directions multa

The pretrained audio model is wav2vec 2.0 by default. The HuBERT and WavLM variants of a task carry a tag such as audio.model_card=facebook/hubert-base-ls960. The models page describes each family.

Corpora

Corpus Source Tasks Size Splits
UKDebates Lippi and Torroni, 2016 ASD 386 sentences from the 2015 UK Prime Ministerial debate Folds of Mancini et al. (2022)
M-Arg Mestre et al., ArgMining 2021 ARC 4,104 sentence pairs from the 2020 US presidential debates, of which 2,443 have an agreement confidence of at least 85% Folds of Mancini et al. (2022), on the 85% subset
MM-USED Mancini et al., ArgMining 2022 ASD, ACC 23,505 sentences from 39 US presidential debates aired from 1960 to 2016 Fixed training, validation, and test sets
MM-USED-fallacy Mancini et al., EACL 2024 AFC, AFD 1,278 fallacious snippets from the same debates Leave one dialogue out, from Mancini et al. (2024)

The alignment of MM-USED and MM-USED-fallacy was refined after their publication, so their sample counts differ from the original papers. Each corpus is downloaded on first use. MM-USED and MM-USED-fallacy download the debate recordings only for a task that reads audio.

Metrics

Corpus Score
UKDebates F1 of the claim class
M-Arg F1 of the support and attack classes, averaged
MM-USED Macro F1
MM-USED-fallacy Macro F1

The leaderboard reports the results of the MAMKit paper.

Contact

Questions about a component or a result are best raised as an issue. For anything else, write to Eleonora Mancini or Federico Ruggeri.

Citation

If you use MAMKit in your research, please cite the following paper:

@inproceedings{mancini-etal-2024-mamkit,
    title = "{MAMK}it: A Comprehensive Multimodal Argument Mining Toolkit",
    author = "Mancini, Eleonora  and
      Ruggeri, Federico  and
      Colamonaco, Stefano  and
      Zecca, Andrea  and
      Marro, Samuele  and
      Torroni, Paolo",
    editor = "Ajjour, Yamen  and
      Bar-Haim, Roy  and
      El Baff, Roxanne  and
      Liu, Zhexiong  and
      Skitalinskaya, Gabriella",
    booktitle = "Proceedings of the 11th Workshop on Argument Mining (ArgMining 2024)",
    month = aug,
    year = "2024",
    address = "Bangkok, Thailand",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2024.argmining-1.7",
    doi = "10.18653/v1/2024.argmining-1.7",
    pages = "69--82",
}

Acknowledgement

This work was partially supported by project FAIR: Future Artificial Intelligence Research (European Commission NextGeneration EU programme, PNRR-M4C2-Investimento 1.3, PE00000013-"FAIR" - Spoke 8).

Metadata

Release files for mamkit 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mamkit 0.2.0
File Size Uploaded Provenance Actions
mamkit-0.2.0.tar.gz 80.5 kB With provenance Details for mamkit-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mamkit 0.2.0
File Interpreter ABI Platform Actions
mamkit-0.2.0-py3-none-any.whl Python 3 none any Details for mamkit-0.2.0-py3-none-any.whl

Total release size: 147.4 kB

Release files / mamkit-0.2.0.tar.gz

Download URL mamkit-0.2.0.tar.gz
Size 80.5 kB
Tags Source
SHA-256 checksum
How to use checksums
11b663c065df38fc85cce3a83a538cb6fb22104ae0f62ce84a10037d5823ef73
BLAKE2b-256 checksum
How to use checksums
8b43cf535a5db7766c88281c8cf61f6f101845359d7598a26ca18bb581ecc658
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Release files / mamkit-0.2.0-py3-none-any.whl

Download URL mamkit-0.2.0-py3-none-any.whl
Size 67.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53a3ef5d549131e597e451f0df40e2c53a577a49602a1011f7bb6c0edbe98867
BLAKE2b-256 checksum
How to use checksums
314a8b19e9ed1ad6f4b103836bd423043d92b966c976b8eab015f1f2c15ea0f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Security for mamkit 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mamkit-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page