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

  • Comprehensive Analysis: Full argument analysis in one call - detection, extraction, topic, stance, and argument type
  • 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"

Comprehensive Analysis (New in v0.2.0)

# Get full analysis in one call
text = "Climate change requires immediate action to prevent catastrophic environmental damage."
result = analyzer.comprehensive(text)

print(f"Is Argument: {result.is_argument}")      # True/False
print(f"Confidence: {result.confidence}")         # 0.0-1.0
print(f"Claims: {result.claims}")                 # List of claims
print(f"Premises: {result.premises}")             # List of premises
print(f"Topic (fine): {result.topic_fine}")       # Specific topic
print(f"Topic (broad): {result.topic_broad}")     # Broad policy area
print(f"Stance (fine): {result.stance_fine}")     # Favor/Against/NoArgument
print(f"Stance (broad): {result.stance_broad}")   # Favor/Against/NoArgument
print(f"Argument Type: {result.argument_type}")   # Deductive/Inductive/etc.
print(f"Argument Scheme: {result.argument_scheme}")

# Batch processing
texts = ["Text 1...", "Text 2..."]
results = analyzer.comprehensive(texts)

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.2.0.tar.gz (14.7 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.2.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for wiba-0.2.0.tar.gz
Algorithm Hash digest
SHA256 931cd1a0fbacbeb12da42e3ae4c2ad62fd87ce3f0bb677fe8d86bb36f237fbdb
MD5 d462dc165ce16339e01bfb1fb8398e5d
BLAKE2b-256 6c111a1bfcb744035b9c16fa87852d39ecd8784e170b8557f09ab895d2afb433

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wiba-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.3 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f01d8e514242be5e201df55bc710bc382c42e4e70c46f59592f7391cc831d68
MD5 901f35c3848ea57d0b6b30da984060ab
BLAKE2b-256 17e5251934bec1c8a62e250cc0051e61b1e49001e23373594631442eb0dc2a7c

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