Skip to main content

WIBA: What Is Being Argued? A Comprehensive Approach to Argument Mining

Project description

WIBA: What Is Being Argued?

WIBA is a comprehensive argument mining toolkit that helps you detect, analyze, and understand arguments in text. It provides a simple yet powerful interface to identify argumentative content, extract topics, analyze stance, and discover arguments in longer texts.

Installation

pip install wiba

Quick Start

from wiba import WIBA

# Initialize with your API token
analyzer = WIBA(api_token="your_api_token_here")

# Example text
text = "Climate change is real because global temperatures are rising."

# Detect if it's an argument
result = analyzer.detect(text)
print(f"Argument detected: {result.argument_prediction}")
print(f"Confidence: {result.confidence_score}")

Features

  • Argument Detection: Identify whether a text contains an argument
  • Topic Extraction: Extract the main topic being argued about
  • Stance Analysis: Determine the stance towards a specific topic
  • Argument Discovery: Find argumentative segments in longer texts
  • Batch Processing: Efficiently process multiple texts
  • DataFrame Support: Native pandas DataFrame integration

Documentation

For detailed documentation and examples, visit wiba.dev.

Getting Started

  1. Create an account at wiba.dev to get your API token
  2. Install the package: pip install wiba
  3. Initialize the client with your token
  4. Start analyzing arguments!

Example Usage

Detect Arguments

# Single text
result = analyzer.detect("Climate change is real because temperatures are rising.")
print(result.argument_prediction)  # "Argument" or "NoArgument"
print(result.confidence_score)     # Confidence score between 0 and 1

# Multiple texts
texts = [
    "Climate change is real because temperatures are rising.",
    "This is just a simple statement without any argument."
]
results = analyzer.detect(texts)
for r in results:
    print(f"Text: {r.text}")
    print(f"Prediction: {r.argument_prediction}")

Extract Topics

result = analyzer.extract("Climate change is a serious issue because it affects our environment.")
print(result.topics)  # List of extracted topics

Analyze Stance

text = "We must take action on climate change because the evidence is overwhelming."
topic = "climate change"
result = analyzer.stance(text, topic)
print(f"Stance: {result.stance}")  # "Favor", "Against", or "NoArgument"

Discover Arguments

text = """Climate change is a serious issue. Global temperatures are rising at an 
unprecedented rate. This is causing extreme weather events. However, some argue 
that natural climate cycles are responsible."""

results_df = analyzer.discover_arguments(
    text,
    window_size=2,  # Number of sentences per window
    step_size=1     # Number of sentences to move window
)
print(results_df[['text_segment', 'argument_prediction', 'argument_confidence']])

Citation

If you use WIBA in your research, please cite:

@misc{irani2024wibaarguedcomprehensiveapproach,
      title={WIBA: What Is Being Argued? A Comprehensive Approach to Argument Mining}, 
      author={Arman Irani and Ju Yeon Park and Kevin Esterling and Michalis Faloutsos},
      year={2024},
      eprint={2405.00828},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2405.00828}, 
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wiba-0.1.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wiba-0.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file wiba-0.1.0.tar.gz.

File metadata

  • Download URL: wiba-0.1.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for wiba-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e0cda5e6654418e9c3079b80675e862c80bae4783fe6e5df4d8eb8b20fa211d1
MD5 b15521254cf7a2f1fd0bfb8e0979dfa4
BLAKE2b-256 1db9e5ba6d42a513166c0d6076866717b18fe5c0c8c2656741da76f6b6ebd9a0

See more details on using hashes here.

File details

Details for the file wiba-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wiba-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for wiba-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b36a45f7611203289d0e30ee1be930a94a33927573e6175737a419358f5ec7e
MD5 9851bc73a2d63ce38de957c89ca25fb3
BLAKE2b-256 a52b37f26df0de9e234f0a73cac2554b26e468eedd9709c70602ee212cff9003

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page