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
- Create an account at wiba.dev to get your API token
- Install the package:
pip install wiba - Initialize the client with your token
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wiba-0.1.1.tar.gz.
File metadata
- Download URL: wiba-0.1.1.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
981c06c2c6f956ec6459e37c63d650abe65a80e1adae57d73c345d2d537e648c
|
|
| MD5 |
6af9652e7734c4c9f2e1be8e76fbeb4a
|
|
| BLAKE2b-256 |
dca4d147d98d6497d6006217faa932186a98d0e910451506ee3c5ccd8cb8fc25
|
File details
Details for the file wiba-0.1.1-py3-none-any.whl.
File metadata
- Download URL: wiba-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
161f6a7a5f082e0934139eb2ca64110d920e8265d97c57296de2c5d01b006198
|
|
| MD5 |
9366da5103e233486b60774c2b910cad
|
|
| BLAKE2b-256 |
76e8bbb0cfd8f61f8b7e4569004af581180fff479b44e491017f4fce6039f665
|