off-load 0.3.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.
- off_load-0.3.0/LICENSE +9 -0
- off_load-0.3.0/PKG-INFO +108 -0
- off_load-0.3.0/README.md +88 -0
- off_load-0.3.0/off_load/__init__.py +2 -0
- off_load-0.3.0/off_load/loader.py +2242 -0
- off_load-0.3.0/off_load/preproc.py +175 -0
- off_load-0.3.0/off_load.egg-info/PKG-INFO +108 -0
- off_load-0.3.0/off_load.egg-info/SOURCES.txt +11 -0
- off_load-0.3.0/off_load.egg-info/dependency_links.txt +1 -0
- off_load-0.3.0/off_load.egg-info/requires.txt +5 -0
- off_load-0.3.0/off_load.egg-info/top_level.txt +1 -0
- off_load-0.3.0/pyproject.toml +29 -0
- off_load-0.3.0/setup.cfg +4 -0
off_load-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © 2021 Stefan Pernes <stefan@pernes.net>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
off_load-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: off-load
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Loaders for 43 hate speech and offensive language datasets in 18 languages, as lists of {'text', 'label'}
|
|
5
|
+
Author: Stefan Pernes
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/neospe/dataload
|
|
8
|
+
Keywords: hate speech,offensive language,content moderation,datasets
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
11
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
|
12
|
+
Requires-Python: >=3.11
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: pandas
|
|
16
|
+
Requires-Dist: openpyxl
|
|
17
|
+
Provides-Extra: datalake
|
|
18
|
+
Requires-Dist: pymongo; extra == "datalake"
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# off-load
|
|
23
|
+
|
|
24
|
+
Loaders for 43 hate speech and offensive language data sets in 18 languages. Each returns a list of `{'text': ..., 'label': ...}`; `off_load.preproc` maps the label names to classes. Formerly `dataload`.
|
|
25
|
+
|
|
26
|
+
## functions
|
|
27
|
+
|
|
28
|
+
| Code | Dataset Name | Languages |
|
|
29
|
+
|------------------|------------------------------------------------|----------------|
|
|
30
|
+
| `conan` | CONAN | en/fr/it |
|
|
31
|
+
| `mlma_hate` | MLMA_hate_speech | ar/en/fr |
|
|
32
|
+
| `largescale_hate` | largescale-hatespeech | en/tr |
|
|
33
|
+
| `hateval2019` | hateval2019 | en/es |
|
|
34
|
+
| `hasoc2020` | hasoc-2020 | de/en/hi |
|
|
35
|
+
| `en_hate1` | hate-speech-and-offensive-language | en |
|
|
36
|
+
| `en_hate2` | NAACL_SRW_2016 | en |
|
|
37
|
+
| `en_hate3` | hate-speech-dataset | en |
|
|
38
|
+
| `en_hate4` | hatespeechtwitter | en |
|
|
39
|
+
| `en_delft` | delft/data/sequenceLabelling/toxic | en |
|
|
40
|
+
| `en_offense19` | OffensEval 2019 (SemEval 2019 - Task 6) | en |
|
|
41
|
+
| `en_offense20` | OffensEval 2020 | en |
|
|
42
|
+
| `en_olid` | OLID | en |
|
|
43
|
+
| `en_hatexplain` | HateXplain | en |
|
|
44
|
+
| `en_malignant` | MalignantCommentClassification | en |
|
|
45
|
+
| `en_cad` | ContextualAbuseDataset | en |
|
|
46
|
+
| `en_threat1` | hexis-english-threats | en |
|
|
47
|
+
| `en_spam1` | smsspamcollection | en |
|
|
48
|
+
| `de_germeval` | loader for various versions of the tab-separated germeval format. also: haspeede 2020 (it) | de/it |
|
|
49
|
+
| `de_germeval2021` | germeval 2021 | de |
|
|
50
|
+
| `es_hate1` | haternet | es |
|
|
51
|
+
| `es_hate2` | violentometro-online | es |
|
|
52
|
+
| `it_hate1` | Italian Hate Speech Corpus (IHSC) | it |
|
|
53
|
+
| `ru_hate1` | russian-inappropriate-messages | ru |
|
|
54
|
+
| `ru_hate2` | Russian Language Toxic Comments | ru |
|
|
55
|
+
| `ru_hate3` | RuEthnoHate | ru |
|
|
56
|
+
| `fr_hate1` | help_dicrah | fr |
|
|
57
|
+
| `ar_hate1` | Aljazeera Deleted Comments | ar |
|
|
58
|
+
| `ar_hate2` | Corpus_of_offensive_language_in_Arabic | ar |
|
|
59
|
+
| `pt_hate1` | OffComBR | pt |
|
|
60
|
+
| `pt_hate2` | Portuguese-Hate-Speech-Dataset | pt |
|
|
61
|
+
| `pt_hate3` | ToLD-Br | pt |
|
|
62
|
+
| `tr_troff` | troff | tr |
|
|
63
|
+
| `ko_hatescore` | hatescore-korean-hate-speech | ko |
|
|
64
|
+
| `hi_constraint` | Constraint_AAAI2021 | hi |
|
|
65
|
+
| `el_offense20` | greek offenseval 2020 | el |
|
|
66
|
+
| `id_hate1` | id-hatespeech-detection | id |
|
|
67
|
+
| `id_hate2` | id-multi-label-hate-speech-and-abusive-language-detection | id |
|
|
68
|
+
| `mr_mahahate` | L3Cube-MahaHate | mr |
|
|
69
|
+
| `pl_poleval19` | PolEval_2019 | pl |
|
|
70
|
+
| `vi_vihsd` | vihsd | vi |
|
|
71
|
+
| `da_dkhate` | dkhate | da |
|
|
72
|
+
| `nl_dalc` | DALC | nl |
|
|
73
|
+
| `wordlist` | loader for wordlists | - |
|
|
74
|
+
| `augmentations` | loader for dataset-specific augmentations | - |
|
|
75
|
+
| `relabel` | loader for re-labeled data | - |
|
|
76
|
+
| `debias_madlibs` | loads eval_datasets from _unintended-ml-bias-analysis_ | - |
|
|
77
|
+
| `twint` | loads the output of twint scraper | - |
|
|
78
|
+
|
|
79
|
+
## install
|
|
80
|
+
|
|
81
|
+
`pip install off-load`, then `import off_load`
|
|
82
|
+
|
|
83
|
+
for loading from a MongoDB/gridFS data lake (see [datalake](https://github.com/neospe/datalake)):
|
|
84
|
+
|
|
85
|
+
`pip install "off-load[datalake]"`
|
|
86
|
+
|
|
87
|
+
Used by [autofit2](https://github.com/neospe/autofit2) for its moderation configs: `pip install "autofit2[dataload]"`.
|
|
88
|
+
|
|
89
|
+
## usage
|
|
90
|
+
|
|
91
|
+
By default, data sets are read from the local file system, below `data/` in the working directory. The default paths follow the layout of the original repositories, e.g.:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
git clone https://github.com/t-davidson/hate-speech-and-offensive-language data/en/hate-speech-and-offensive-language
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
from off_load.loader import en_hate1
|
|
99
|
+
data = en_hate1() # [{'text': ..., 'label': ...}, ...]
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Other locations can be passed with `files=[...]`. If `DATALAKE_ADDR` is set (e.g. `127.0.0.1:27017`), data sets are loaded from gridFS instead.
|
|
103
|
+
|
|
104
|
+
## good to know
|
|
105
|
+
|
|
106
|
+
- `off-load` (as `dataload`) is built into [augment](https://github.com/neospe/augment), [bpemb](https://github.com/neospe/bpemb), and [autofit](https://github.com/neospe/autofit) as well as [autofit2](https://github.com/neospe/autofit2).
|
|
107
|
+
- The paper _Antypas & Camacho-Collados - Robust Hate Speech Detection in Social Media: A Cross-Dataset Empirical Evaluation_ [[arxiv link](https://arxiv.org/abs/2307.01680)] backs up some of our re-labelings and selective use of certain data sets in order to improve data aggregation.
|
|
108
|
+
|
off_load-0.3.0/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
|
|
2
|
+
# off-load
|
|
3
|
+
|
|
4
|
+
Loaders for 43 hate speech and offensive language data sets in 18 languages. Each returns a list of `{'text': ..., 'label': ...}`; `off_load.preproc` maps the label names to classes. Formerly `dataload`.
|
|
5
|
+
|
|
6
|
+
## functions
|
|
7
|
+
|
|
8
|
+
| Code | Dataset Name | Languages |
|
|
9
|
+
|------------------|------------------------------------------------|----------------|
|
|
10
|
+
| `conan` | CONAN | en/fr/it |
|
|
11
|
+
| `mlma_hate` | MLMA_hate_speech | ar/en/fr |
|
|
12
|
+
| `largescale_hate` | largescale-hatespeech | en/tr |
|
|
13
|
+
| `hateval2019` | hateval2019 | en/es |
|
|
14
|
+
| `hasoc2020` | hasoc-2020 | de/en/hi |
|
|
15
|
+
| `en_hate1` | hate-speech-and-offensive-language | en |
|
|
16
|
+
| `en_hate2` | NAACL_SRW_2016 | en |
|
|
17
|
+
| `en_hate3` | hate-speech-dataset | en |
|
|
18
|
+
| `en_hate4` | hatespeechtwitter | en |
|
|
19
|
+
| `en_delft` | delft/data/sequenceLabelling/toxic | en |
|
|
20
|
+
| `en_offense19` | OffensEval 2019 (SemEval 2019 - Task 6) | en |
|
|
21
|
+
| `en_offense20` | OffensEval 2020 | en |
|
|
22
|
+
| `en_olid` | OLID | en |
|
|
23
|
+
| `en_hatexplain` | HateXplain | en |
|
|
24
|
+
| `en_malignant` | MalignantCommentClassification | en |
|
|
25
|
+
| `en_cad` | ContextualAbuseDataset | en |
|
|
26
|
+
| `en_threat1` | hexis-english-threats | en |
|
|
27
|
+
| `en_spam1` | smsspamcollection | en |
|
|
28
|
+
| `de_germeval` | loader for various versions of the tab-separated germeval format. also: haspeede 2020 (it) | de/it |
|
|
29
|
+
| `de_germeval2021` | germeval 2021 | de |
|
|
30
|
+
| `es_hate1` | haternet | es |
|
|
31
|
+
| `es_hate2` | violentometro-online | es |
|
|
32
|
+
| `it_hate1` | Italian Hate Speech Corpus (IHSC) | it |
|
|
33
|
+
| `ru_hate1` | russian-inappropriate-messages | ru |
|
|
34
|
+
| `ru_hate2` | Russian Language Toxic Comments | ru |
|
|
35
|
+
| `ru_hate3` | RuEthnoHate | ru |
|
|
36
|
+
| `fr_hate1` | help_dicrah | fr |
|
|
37
|
+
| `ar_hate1` | Aljazeera Deleted Comments | ar |
|
|
38
|
+
| `ar_hate2` | Corpus_of_offensive_language_in_Arabic | ar |
|
|
39
|
+
| `pt_hate1` | OffComBR | pt |
|
|
40
|
+
| `pt_hate2` | Portuguese-Hate-Speech-Dataset | pt |
|
|
41
|
+
| `pt_hate3` | ToLD-Br | pt |
|
|
42
|
+
| `tr_troff` | troff | tr |
|
|
43
|
+
| `ko_hatescore` | hatescore-korean-hate-speech | ko |
|
|
44
|
+
| `hi_constraint` | Constraint_AAAI2021 | hi |
|
|
45
|
+
| `el_offense20` | greek offenseval 2020 | el |
|
|
46
|
+
| `id_hate1` | id-hatespeech-detection | id |
|
|
47
|
+
| `id_hate2` | id-multi-label-hate-speech-and-abusive-language-detection | id |
|
|
48
|
+
| `mr_mahahate` | L3Cube-MahaHate | mr |
|
|
49
|
+
| `pl_poleval19` | PolEval_2019 | pl |
|
|
50
|
+
| `vi_vihsd` | vihsd | vi |
|
|
51
|
+
| `da_dkhate` | dkhate | da |
|
|
52
|
+
| `nl_dalc` | DALC | nl |
|
|
53
|
+
| `wordlist` | loader for wordlists | - |
|
|
54
|
+
| `augmentations` | loader for dataset-specific augmentations | - |
|
|
55
|
+
| `relabel` | loader for re-labeled data | - |
|
|
56
|
+
| `debias_madlibs` | loads eval_datasets from _unintended-ml-bias-analysis_ | - |
|
|
57
|
+
| `twint` | loads the output of twint scraper | - |
|
|
58
|
+
|
|
59
|
+
## install
|
|
60
|
+
|
|
61
|
+
`pip install off-load`, then `import off_load`
|
|
62
|
+
|
|
63
|
+
for loading from a MongoDB/gridFS data lake (see [datalake](https://github.com/neospe/datalake)):
|
|
64
|
+
|
|
65
|
+
`pip install "off-load[datalake]"`
|
|
66
|
+
|
|
67
|
+
Used by [autofit2](https://github.com/neospe/autofit2) for its moderation configs: `pip install "autofit2[dataload]"`.
|
|
68
|
+
|
|
69
|
+
## usage
|
|
70
|
+
|
|
71
|
+
By default, data sets are read from the local file system, below `data/` in the working directory. The default paths follow the layout of the original repositories, e.g.:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
git clone https://github.com/t-davidson/hate-speech-and-offensive-language data/en/hate-speech-and-offensive-language
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
from off_load.loader import en_hate1
|
|
79
|
+
data = en_hate1() # [{'text': ..., 'label': ...}, ...]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Other locations can be passed with `files=[...]`. If `DATALAKE_ADDR` is set (e.g. `127.0.0.1:27017`), data sets are loaded from gridFS instead.
|
|
83
|
+
|
|
84
|
+
## good to know
|
|
85
|
+
|
|
86
|
+
- `off-load` (as `dataload`) is built into [augment](https://github.com/neospe/augment), [bpemb](https://github.com/neospe/bpemb), and [autofit](https://github.com/neospe/autofit) as well as [autofit2](https://github.com/neospe/autofit2).
|
|
87
|
+
- The paper _Antypas & Camacho-Collados - Robust Hate Speech Detection in Social Media: A Cross-Dataset Empirical Evaluation_ [[arxiv link](https://arxiv.org/abs/2307.01680)] backs up some of our re-labelings and selective use of certain data sets in order to improve data aggregation.
|
|
88
|
+
|