Skip to main content

unit tests code quality Code Climate maintainability PyPI version

Deep Argument Analysis (deepa2)

This project provides deepa2, which

  • 🥚 takes NLP data (e.g. NLI, argument mining) as ingredients;
  • 🎂 bakes DeepA2 datatsets conforming to the Deep Argument Analysis Framework;
  • 🍰 serves DeepA2 data as text2text datasets suitable for training language models.

There's a public collection of 🎂 DeepA2 datatsets baked with deepa2 at the HF hub.

The Documentation describes usage options and gives background info on the Deep Argument Analysis Framework.

Quickstart

Integrating deepa2 into Your Training Pipeline

  1. Install deepa2 into your ML project's virtual environment, e.g.:
source my-projects-venv/bin/activate 
python --version  # should be ^3.7
python -m pip install deepa2
  1. Add deepa2 preprocessor to your training pipeline. Your training script may look like, for example:
#!/bin/bash

# configure and activate environment
...

# download deepa2 datasets and 
# prepare for text2text training
deepa2 serve \
    --path some-deepa2-dataset \    # <<< 🎂
    --export_format csv \
    --export_path t2t \             # >>> 🍰

# run default training script, 
# e.g., with 🤗 Transformers
python .../run_summarization.py \
    --train_file t2t/train.csv \    # <<< 🍰
    --text_column "text" \
    --summary_column "target" \
    --...

# clean-up
rm -r t2t
  1. That's it.

Create DeepA2 datasets with deepa2 from existing NLP data

Install poetry.

Clone the repository:

git clone https://github.com/debatelab/deepa2-datasets.git

Install this package from within the repo's root folder:

poetry install

Bake a DeepA2 dataset, e.g.:

poetry run deepa2 bake \\
  --name esnli \\                   # <<< 🥚
  --debug-size 100 \\
  --export-path ./data/processed    # >>> 🎂  

Contribute a DeepA2Builder for another Dataset

We welcome contributions to this repository, especially scripts that port existing datasets to the DeepA2 Framework. Within this repo, a code module that transforms data into the DeepA2 format contains

  1. a Builder class that describes how DeepA2 examples will be constructed and that implements the abstract builder.Builder interface (such as, e.g., builder.entailmentbank_builder.EnBankBuilder);
  2. a DataLoader which provides a method for loading the raw data as a 🤗 Dataset object (such as, for example, builder.entailmentbank_builder.EnBankLoader) -- you may use deepa2.DataLoader as is in case the data is available in a way compatible with 🤗 Dataset;
  3. dataclasses which describe the features of the raw data and the preprocessed data, and which extend the dummy classes deepa2.RawExample and deepa2.PreprocessedExample;
  4. a collection of unit tests that check the concrete Builder's methods (such as, e.g., tests/test_enbank.py);
  5. a documentation of the pipeline (as for example in docs/esnli.md).

Consider suggesting to collaboratively construct such a pipeline by opening a new issue.

Citation

This repository builds on and extends the DeepA2 Framework originally presented in:

@article{betz2021deepa2,
      title={DeepA2: A Modular Framework for Deep Argument Analysis with Pretrained Neural Text2Text Language Models}, 
      author={Gregor Betz and Kyle Richardson},
      year={2021},
      eprint={2110.01509},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Release files for deepa2 0.1.16

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

Source distribution (sdist)

Source distribution for deepa2 0.1.16
File Size Uploaded
deepa2-0.1.16.tar.gz 43.8 kB Details

Built distribution (wheel)

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

Total release size: 94.9 kB

Release files / deepa2-0.1.16.tar.gz

Download URL deepa2-0.1.16.tar.gz
Size 43.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c4cd593d9a46aca53d54e1233111332c96c67be36a85e9fb8c4614eb72647f87
BLAKE2b-256 checksum
How to use checksums
1361d6608c8ec0510c4450bbe8a9ccda99cb03d345b6ee89bf0032fb238e6ba9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.8.5 Darwin/19.6.0

Release files / deepa2-0.1.16-py3-none-any.whl

Download URL deepa2-0.1.16-py3-none-any.whl
Size 51.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a6121686b7fa0a38b986d9cb7a8105efb539171cf99369b2bcf978818f477df
BLAKE2b-256 checksum
How to use checksums
9508c10c174abec933356015b0c72008bd2256c3aba5f9c53fa41149d0e4be0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.8.5 Darwin/19.6.0

Release history Release notifications | RSS feed

This release

0.1.16 This release

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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