wiba 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of wiba might be problematic. Click here for more details.
- wiba-0.1.0/LICENSE +21 -0
- wiba-0.1.0/MANIFEST.in +3 -0
- wiba-0.1.0/PKG-INFO +157 -0
- wiba-0.1.0/README.md +118 -0
- wiba-0.1.0/pyproject.toml +6 -0
- wiba-0.1.0/setup.cfg +4 -0
- wiba-0.1.0/setup.py +41 -0
- wiba-0.1.0/wiba/__init__.py +909 -0
- wiba-0.1.0/wiba.egg-info/PKG-INFO +157 -0
- wiba-0.1.0/wiba.egg-info/SOURCES.txt +11 -0
- wiba-0.1.0/wiba.egg-info/dependency_links.txt +1 -0
- wiba-0.1.0/wiba.egg-info/requires.txt +5 -0
- wiba-0.1.0/wiba.egg-info/top_level.txt +1 -0
wiba-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Arman Akbarian
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
wiba-0.1.0/MANIFEST.in
ADDED
wiba-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: wiba
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: WIBA: What Is Being Argued? A Comprehensive Approach to Argument Mining
|
|
5
|
+
Home-page: https://github.com/Armaniii/WIBA
|
|
6
|
+
Author: Arman Irani
|
|
7
|
+
Author-email: airan002@ucr.edu
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/Armaniii/WIBA/issues
|
|
9
|
+
Project-URL: Documentation, https://wiba.dev
|
|
10
|
+
Project-URL: Source Code, https://github.com/Armaniii/WIBA
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
|
21
|
+
Requires-Python: >=3.8
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: requests>=2.25.0
|
|
25
|
+
Requires-Dist: pandas>=1.2.0
|
|
26
|
+
Requires-Dist: numpy>=1.19.0
|
|
27
|
+
Requires-Dist: tqdm>=4.50.0
|
|
28
|
+
Requires-Dist: structlog>=21.1.0
|
|
29
|
+
Dynamic: author
|
|
30
|
+
Dynamic: author-email
|
|
31
|
+
Dynamic: classifier
|
|
32
|
+
Dynamic: description
|
|
33
|
+
Dynamic: description-content-type
|
|
34
|
+
Dynamic: home-page
|
|
35
|
+
Dynamic: project-url
|
|
36
|
+
Dynamic: requires-dist
|
|
37
|
+
Dynamic: requires-python
|
|
38
|
+
Dynamic: summary
|
|
39
|
+
|
|
40
|
+
# WIBA: What Is Being Argued?
|
|
41
|
+
|
|
42
|
+
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.
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install wiba
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Quick Start
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from wiba import WIBA
|
|
54
|
+
|
|
55
|
+
# Initialize with your API token
|
|
56
|
+
analyzer = WIBA(api_token="your_api_token_here")
|
|
57
|
+
|
|
58
|
+
# Example text
|
|
59
|
+
text = "Climate change is real because global temperatures are rising."
|
|
60
|
+
|
|
61
|
+
# Detect if it's an argument
|
|
62
|
+
result = analyzer.detect(text)
|
|
63
|
+
print(f"Argument detected: {result.argument_prediction}")
|
|
64
|
+
print(f"Confidence: {result.confidence_score}")
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Features
|
|
68
|
+
|
|
69
|
+
- **Argument Detection**: Identify whether a text contains an argument
|
|
70
|
+
- **Topic Extraction**: Extract the main topic being argued about
|
|
71
|
+
- **Stance Analysis**: Determine the stance towards a specific topic
|
|
72
|
+
- **Argument Discovery**: Find argumentative segments in longer texts
|
|
73
|
+
- **Batch Processing**: Efficiently process multiple texts
|
|
74
|
+
- **DataFrame Support**: Native pandas DataFrame integration
|
|
75
|
+
|
|
76
|
+
## Documentation
|
|
77
|
+
|
|
78
|
+
For detailed documentation and examples, visit [wiba.dev](https://wiba.dev).
|
|
79
|
+
|
|
80
|
+
## Getting Started
|
|
81
|
+
|
|
82
|
+
1. Create an account at [wiba.dev](https://wiba.dev) to get your API token
|
|
83
|
+
2. Install the package: `pip install wiba`
|
|
84
|
+
3. Initialize the client with your token
|
|
85
|
+
4. Start analyzing arguments!
|
|
86
|
+
|
|
87
|
+
## Example Usage
|
|
88
|
+
|
|
89
|
+
### Detect Arguments
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
# Single text
|
|
93
|
+
result = analyzer.detect("Climate change is real because temperatures are rising.")
|
|
94
|
+
print(result.argument_prediction) # "Argument" or "NoArgument"
|
|
95
|
+
print(result.confidence_score) # Confidence score between 0 and 1
|
|
96
|
+
|
|
97
|
+
# Multiple texts
|
|
98
|
+
texts = [
|
|
99
|
+
"Climate change is real because temperatures are rising.",
|
|
100
|
+
"This is just a simple statement without any argument."
|
|
101
|
+
]
|
|
102
|
+
results = analyzer.detect(texts)
|
|
103
|
+
for r in results:
|
|
104
|
+
print(f"Text: {r.text}")
|
|
105
|
+
print(f"Prediction: {r.argument_prediction}")
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Extract Topics
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
result = analyzer.extract("Climate change is a serious issue because it affects our environment.")
|
|
112
|
+
print(result.topics) # List of extracted topics
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Analyze Stance
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
text = "We must take action on climate change because the evidence is overwhelming."
|
|
119
|
+
topic = "climate change"
|
|
120
|
+
result = analyzer.stance(text, topic)
|
|
121
|
+
print(f"Stance: {result.stance}") # "Favor", "Against", or "NoArgument"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Discover Arguments
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
text = """Climate change is a serious issue. Global temperatures are rising at an
|
|
128
|
+
unprecedented rate. This is causing extreme weather events. However, some argue
|
|
129
|
+
that natural climate cycles are responsible."""
|
|
130
|
+
|
|
131
|
+
results_df = analyzer.discover_arguments(
|
|
132
|
+
text,
|
|
133
|
+
window_size=2, # Number of sentences per window
|
|
134
|
+
step_size=1 # Number of sentences to move window
|
|
135
|
+
)
|
|
136
|
+
print(results_df[['text_segment', 'argument_prediction', 'argument_confidence']])
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Citation
|
|
140
|
+
|
|
141
|
+
If you use WIBA in your research, please cite:
|
|
142
|
+
|
|
143
|
+
```bibtex
|
|
144
|
+
@misc{irani2024wibaarguedcomprehensiveapproach,
|
|
145
|
+
title={WIBA: What Is Being Argued? A Comprehensive Approach to Argument Mining},
|
|
146
|
+
author={Arman Irani and Ju Yeon Park and Kevin Esterling and Michalis Faloutsos},
|
|
147
|
+
year={2024},
|
|
148
|
+
eprint={2405.00828},
|
|
149
|
+
archivePrefix={arXiv},
|
|
150
|
+
primaryClass={cs.CL},
|
|
151
|
+
url={https://arxiv.org/abs/2405.00828},
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## License
|
|
156
|
+
|
|
157
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
wiba-0.1.0/README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# WIBA: What Is Being Argued?
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install wiba
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from wiba import WIBA
|
|
15
|
+
|
|
16
|
+
# Initialize with your API token
|
|
17
|
+
analyzer = WIBA(api_token="your_api_token_here")
|
|
18
|
+
|
|
19
|
+
# Example text
|
|
20
|
+
text = "Climate change is real because global temperatures are rising."
|
|
21
|
+
|
|
22
|
+
# Detect if it's an argument
|
|
23
|
+
result = analyzer.detect(text)
|
|
24
|
+
print(f"Argument detected: {result.argument_prediction}")
|
|
25
|
+
print(f"Confidence: {result.confidence_score}")
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Features
|
|
29
|
+
|
|
30
|
+
- **Argument Detection**: Identify whether a text contains an argument
|
|
31
|
+
- **Topic Extraction**: Extract the main topic being argued about
|
|
32
|
+
- **Stance Analysis**: Determine the stance towards a specific topic
|
|
33
|
+
- **Argument Discovery**: Find argumentative segments in longer texts
|
|
34
|
+
- **Batch Processing**: Efficiently process multiple texts
|
|
35
|
+
- **DataFrame Support**: Native pandas DataFrame integration
|
|
36
|
+
|
|
37
|
+
## Documentation
|
|
38
|
+
|
|
39
|
+
For detailed documentation and examples, visit [wiba.dev](https://wiba.dev).
|
|
40
|
+
|
|
41
|
+
## Getting Started
|
|
42
|
+
|
|
43
|
+
1. Create an account at [wiba.dev](https://wiba.dev) to get your API token
|
|
44
|
+
2. Install the package: `pip install wiba`
|
|
45
|
+
3. Initialize the client with your token
|
|
46
|
+
4. Start analyzing arguments!
|
|
47
|
+
|
|
48
|
+
## Example Usage
|
|
49
|
+
|
|
50
|
+
### Detect Arguments
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
# Single text
|
|
54
|
+
result = analyzer.detect("Climate change is real because temperatures are rising.")
|
|
55
|
+
print(result.argument_prediction) # "Argument" or "NoArgument"
|
|
56
|
+
print(result.confidence_score) # Confidence score between 0 and 1
|
|
57
|
+
|
|
58
|
+
# Multiple texts
|
|
59
|
+
texts = [
|
|
60
|
+
"Climate change is real because temperatures are rising.",
|
|
61
|
+
"This is just a simple statement without any argument."
|
|
62
|
+
]
|
|
63
|
+
results = analyzer.detect(texts)
|
|
64
|
+
for r in results:
|
|
65
|
+
print(f"Text: {r.text}")
|
|
66
|
+
print(f"Prediction: {r.argument_prediction}")
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Extract Topics
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
result = analyzer.extract("Climate change is a serious issue because it affects our environment.")
|
|
73
|
+
print(result.topics) # List of extracted topics
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Analyze Stance
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
text = "We must take action on climate change because the evidence is overwhelming."
|
|
80
|
+
topic = "climate change"
|
|
81
|
+
result = analyzer.stance(text, topic)
|
|
82
|
+
print(f"Stance: {result.stance}") # "Favor", "Against", or "NoArgument"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Discover Arguments
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
text = """Climate change is a serious issue. Global temperatures are rising at an
|
|
89
|
+
unprecedented rate. This is causing extreme weather events. However, some argue
|
|
90
|
+
that natural climate cycles are responsible."""
|
|
91
|
+
|
|
92
|
+
results_df = analyzer.discover_arguments(
|
|
93
|
+
text,
|
|
94
|
+
window_size=2, # Number of sentences per window
|
|
95
|
+
step_size=1 # Number of sentences to move window
|
|
96
|
+
)
|
|
97
|
+
print(results_df[['text_segment', 'argument_prediction', 'argument_confidence']])
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Citation
|
|
101
|
+
|
|
102
|
+
If you use WIBA in your research, please cite:
|
|
103
|
+
|
|
104
|
+
```bibtex
|
|
105
|
+
@misc{irani2024wibaarguedcomprehensiveapproach,
|
|
106
|
+
title={WIBA: What Is Being Argued? A Comprehensive Approach to Argument Mining},
|
|
107
|
+
author={Arman Irani and Ju Yeon Park and Kevin Esterling and Michalis Faloutsos},
|
|
108
|
+
year={2024},
|
|
109
|
+
eprint={2405.00828},
|
|
110
|
+
archivePrefix={arXiv},
|
|
111
|
+
primaryClass={cs.CL},
|
|
112
|
+
url={https://arxiv.org/abs/2405.00828},
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## License
|
|
117
|
+
|
|
118
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
wiba-0.1.0/setup.cfg
ADDED
wiba-0.1.0/setup.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
with open("README.md", "r", encoding="utf-8") as fh:
|
|
4
|
+
long_description = fh.read()
|
|
5
|
+
|
|
6
|
+
setup(
|
|
7
|
+
name="wiba",
|
|
8
|
+
version="0.1.0",
|
|
9
|
+
author="Arman Irani",
|
|
10
|
+
author_email="airan002@ucr.edu",
|
|
11
|
+
description="WIBA: What Is Being Argued? A Comprehensive Approach to Argument Mining",
|
|
12
|
+
long_description=long_description,
|
|
13
|
+
long_description_content_type="text/markdown",
|
|
14
|
+
url="https://github.com/Armaniii/WIBA",
|
|
15
|
+
packages=find_packages(),
|
|
16
|
+
classifiers=[
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Science/Research",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.8",
|
|
23
|
+
"Programming Language :: Python :: 3.9",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
26
|
+
"Topic :: Text Processing :: Linguistic",
|
|
27
|
+
],
|
|
28
|
+
python_requires=">=3.8",
|
|
29
|
+
install_requires=[
|
|
30
|
+
"requests>=2.25.0",
|
|
31
|
+
"pandas>=1.2.0",
|
|
32
|
+
"numpy>=1.19.0",
|
|
33
|
+
"tqdm>=4.50.0",
|
|
34
|
+
"structlog>=21.1.0",
|
|
35
|
+
],
|
|
36
|
+
project_urls={
|
|
37
|
+
"Bug Tracker": "https://github.com/Armaniii/WIBA/issues",
|
|
38
|
+
"Documentation": "https://wiba.dev",
|
|
39
|
+
"Source Code": "https://github.com/Armaniii/WIBA",
|
|
40
|
+
},
|
|
41
|
+
)
|