File size: 30,845 Bytes
813cd99 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "23a02d5a",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>acl.id</th>\n",
" <th>X1</th>\n",
" <th>text</th>\n",
" <th>label</th>\n",
" <th>type</th>\n",
" <th>target</th>\n",
" <th>level</th>\n",
" <th>split</th>\n",
" <th>round.base</th>\n",
" <th>annotator</th>\n",
" <th>round</th>\n",
" <th>acl.id.matched</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>acl1</td>\n",
" <td>1</td>\n",
" <td>dalits are lowlives</td>\n",
" <td>hate</td>\n",
" <td>notgiven</td>\n",
" <td>notgiven</td>\n",
" <td>original</td>\n",
" <td>train</td>\n",
" <td>1</td>\n",
" <td>GNZuCtwed3</td>\n",
" <td>1</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>acl10</td>\n",
" <td>2</td>\n",
" <td>gay people are a burden to our society</td>\n",
" <td>hate</td>\n",
" <td>notgiven</td>\n",
" <td>notgiven</td>\n",
" <td>original</td>\n",
" <td>train</td>\n",
" <td>1</td>\n",
" <td>GNZuCtwed3</td>\n",
" <td>1</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>acl100</td>\n",
" <td>3</td>\n",
" <td>Arabs are not welcome</td>\n",
" <td>hate</td>\n",
" <td>notgiven</td>\n",
" <td>notgiven</td>\n",
" <td>original</td>\n",
" <td>train</td>\n",
" <td>1</td>\n",
" <td>vDe7GN0NrL</td>\n",
" <td>1</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>acl1000</td>\n",
" <td>4</td>\n",
" <td>I'm not saying we should actually eliminate he...</td>\n",
" <td>hate</td>\n",
" <td>notgiven</td>\n",
" <td>notgiven</td>\n",
" <td>original</td>\n",
" <td>train</td>\n",
" <td>1</td>\n",
" <td>oemYWm1Tjg</td>\n",
" <td>1</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>acl10000</td>\n",
" <td>5</td>\n",
" <td>bananas are for black people</td>\n",
" <td>hate</td>\n",
" <td>notgiven</td>\n",
" <td>notgiven</td>\n",
" <td>original</td>\n",
" <td>test</td>\n",
" <td>1</td>\n",
" <td>QiOKkCi7F8</td>\n",
" <td>1</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>117100</th>\n",
" <td>acl9974</td>\n",
" <td>41228</td>\n",
" <td>Indian culture is so backwards</td>\n",
" <td>hate</td>\n",
" <td>notgiven</td>\n",
" <td>notgiven</td>\n",
" <td>original</td>\n",
" <td>test</td>\n",
" <td>1</td>\n",
" <td>GNZuCtwed3</td>\n",
" <td>1</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>118100</th>\n",
" <td>acl11574</td>\n",
" <td>1752</td>\n",
" <td>Women don't want equality, they just want to b...</td>\n",
" <td>hate</td>\n",
" <td>derogation</td>\n",
" <td>wom</td>\n",
" <td>original</td>\n",
" <td>train</td>\n",
" <td>2</td>\n",
" <td>CAgNlUizNm</td>\n",
" <td>2a</td>\n",
" <td>acl11575</td>\n",
" </tr>\n",
" <tr>\n",
" <th>119100</th>\n",
" <td>acl13446</td>\n",
" <td>3832</td>\n",
" <td>fuck covid</td>\n",
" <td>nothate</td>\n",
" <td>none</td>\n",
" <td>none</td>\n",
" <td>original</td>\n",
" <td>train</td>\n",
" <td>2</td>\n",
" <td>CAgNlUizNm</td>\n",
" <td>2a</td>\n",
" <td>acl13447</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1205</th>\n",
" <td>acl13457</td>\n",
" <td>3844</td>\n",
" <td>This computer is garbage</td>\n",
" <td>nothate</td>\n",
" <td>none</td>\n",
" <td>none</td>\n",
" <td>original</td>\n",
" <td>train</td>\n",
" <td>2</td>\n",
" <td>eLGzdD8Tvb</td>\n",
" <td>2a</td>\n",
" <td>acl13458</td>\n",
" </tr>\n",
" <tr>\n",
" <th>121100</th>\n",
" <td>acl32095</td>\n",
" <td>24553</td>\n",
" <td>The only good Muslim is a dead one</td>\n",
" <td>hate</td>\n",
" <td>threatening</td>\n",
" <td>mus</td>\n",
" <td>original</td>\n",
" <td>train</td>\n",
" <td>4</td>\n",
" <td>IBsVsBliwX</td>\n",
" <td>4a</td>\n",
" <td>acl32096</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>41144 rows × 12 columns</p>\n",
"</div>"
],
"text/plain": [
" acl.id X1 text \\\n",
"1 acl1 1 dalits are lowlives \n",
"2 acl10 2 gay people are a burden to our society \n",
"3 acl100 3 Arabs are not welcome \n",
"4 acl1000 4 I'm not saying we should actually eliminate he... \n",
"5 acl10000 5 bananas are for black people \n",
"... ... ... ... \n",
"117100 acl9974 41228 Indian culture is so backwards \n",
"118100 acl11574 1752 Women don't want equality, they just want to b... \n",
"119100 acl13446 3832 fuck covid \n",
"1205 acl13457 3844 This computer is garbage \n",
"121100 acl32095 24553 The only good Muslim is a dead one \n",
"\n",
" label type target level split round.base \\\n",
"1 hate notgiven notgiven original train 1 \n",
"2 hate notgiven notgiven original train 1 \n",
"3 hate notgiven notgiven original train 1 \n",
"4 hate notgiven notgiven original train 1 \n",
"5 hate notgiven notgiven original test 1 \n",
"... ... ... ... ... ... ... \n",
"117100 hate notgiven notgiven original test 1 \n",
"118100 hate derogation wom original train 2 \n",
"119100 nothate none none original train 2 \n",
"1205 nothate none none original train 2 \n",
"121100 hate threatening mus original train 4 \n",
"\n",
" annotator round acl.id.matched \n",
"1 GNZuCtwed3 1 NaN \n",
"2 GNZuCtwed3 1 NaN \n",
"3 vDe7GN0NrL 1 NaN \n",
"4 oemYWm1Tjg 1 NaN \n",
"5 QiOKkCi7F8 1 NaN \n",
"... ... ... ... \n",
"117100 GNZuCtwed3 1 NaN \n",
"118100 CAgNlUizNm 2a acl11575 \n",
"119100 CAgNlUizNm 2a acl13447 \n",
"1205 eLGzdD8Tvb 2a acl13458 \n",
"121100 IBsVsBliwX 4a acl32096 \n",
"\n",
"[41144 rows x 12 columns]"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"\n",
"url = \"https://github.com/bvidgen/Dynamically-Generated-Hate-Speech-Dataset/raw/main/Dynamically%20Generated%20Hate%20Dataset%20v0.2.3.csv\"\n",
"df = pd.read_csv(url, index_col=[0])\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "da71ad26",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>text</th>\n",
" <th>type</th>\n",
" <th>label</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>36829</th>\n",
" <td>women are just thots</td>\n",
" <td>notgiven</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26232</th>\n",
" <td>They will if they keep coming to voat. The thi...</td>\n",
" <td>derogation</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>133</th>\n",
" <td>I don't have a problem with lesbians, but I do...</td>\n",
" <td>notgiven</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5145</th>\n",
" <td>muslims grow abroad and should stay there</td>\n",
" <td>derogation</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34928</th>\n",
" <td>This country is a lot worse now, there are too...</td>\n",
" <td>notgiven</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11884</th>\n",
" <td>There are not enough fucking racists these day...</td>\n",
" <td>derogation</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>33797</th>\n",
" <td>Mike Pence had to swear in Kyrsten Sinema, the...</td>\n",
" <td>derogation</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>39112</th>\n",
" <td>The disabled should be sterilized</td>\n",
" <td>notgiven</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10691</th>\n",
" <td>No blacks welcome at my party</td>\n",
" <td>notgiven</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20979</th>\n",
" <td>Get rid of the gays</td>\n",
" <td>notgiven</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>36957</th>\n",
" <td>disabled people are not bad, they're just infe...</td>\n",
" <td>notgiven</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7328</th>\n",
" <td>Is anyone else getting really bored? I heard s...</td>\n",
" <td>derogation</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8007</th>\n",
" <td>i love making chicks angry</td>\n",
" <td>animosity</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3806</th>\n",
" <td>I have no money and there are no fucking jobs,...</td>\n",
" <td>animosity</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7175</th>\n",
" <td>Im DONE! This is over, ropeheads dont belong a...</td>\n",
" <td>derogation</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5725</th>\n",
" <td>Dear baby boomers, think twice before you pass...</td>\n",
" <td>notgiven</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24537</th>\n",
" <td>These attacks will only end when Whites stand ...</td>\n",
" <td>derogation</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1300</th>\n",
" <td>Can you smell these dirty muzzies? It's a brut...</td>\n",
" <td>derogation</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>35023</th>\n",
" <td>No matter how much they tell us the opposite, ...</td>\n",
" <td>notgiven</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16933</th>\n",
" <td>Oy vey, da poysakyewshun! It's anudda shoah. I...</td>\n",
" <td>derogation</td>\n",
" <td>hate</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" text type label\n",
"36829 women are just thots notgiven hate\n",
"26232 They will if they keep coming to voat. The thi... derogation hate\n",
"133 I don't have a problem with lesbians, but I do... notgiven hate\n",
"5145 muslims grow abroad and should stay there derogation hate\n",
"34928 This country is a lot worse now, there are too... notgiven hate\n",
"11884 There are not enough fucking racists these day... derogation hate\n",
"33797 Mike Pence had to swear in Kyrsten Sinema, the... derogation hate\n",
"39112 The disabled should be sterilized notgiven hate\n",
"10691 No blacks welcome at my party notgiven hate\n",
"20979 Get rid of the gays notgiven hate\n",
"36957 disabled people are not bad, they're just infe... notgiven hate\n",
"7328 Is anyone else getting really bored? I heard s... derogation hate\n",
"8007 i love making chicks angry animosity hate\n",
"3806 I have no money and there are no fucking jobs,... animosity hate\n",
"7175 Im DONE! This is over, ropeheads dont belong a... derogation hate\n",
"5725 Dear baby boomers, think twice before you pass... notgiven hate\n",
"24537 These attacks will only end when Whites stand ... derogation hate\n",
"1300 Can you smell these dirty muzzies? It's a brut... derogation hate\n",
"35023 No matter how much they tell us the opposite, ... notgiven hate\n",
"16933 Oy vey, da poysakyewshun! It's anudda shoah. I... derogation hate"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.loc[df.type != \"none\"].sample(20)[[\"text\", \"type\", \"label\"]]"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "a195bff3",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"none 18969\n",
"derogation 9907\n",
"notgiven 7110\n",
"animosity 3439\n",
"dehumanization 906\n",
"threatening 606\n",
"support 207\n",
"Name: type, dtype: int64"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.type.value_counts()"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "897a1bd5",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array(['Who here wants to bet that she is JEWISH FUNDED?',\n",
" \"Believe me! Not all black men slatternly - I've met a few that were actually clean\",\n",
" \"She's a cunt. I despise her - she's taking the total piss and her dumbass followers will copy her and think it's fine to go to multiple supermarkets in a week. Do a fucking big shop Lynds and spend the rest of the time at home in your god damn ugly house. Germaphobe - what a joke!\",\n",
" \"I believe using the name jungle japping japs doesn't function as a slur, don't you agree?\",\n",
" 'well to be honest if we go buy the situation i mentioned in france we might not know the full effects for 20-40 years and seeing the outcomes of their kids raised in canada',\n",
" \"I despise all this 'anti-woke' narrative, at the same time, insisting that I am recognised as a woman is not woke, it's just my birthright, and I don't want it taken away and given to trans\",\n",
" 'it was an ugly black woman replacing a white man. This movie will fail and idiot consumertubers will take the bait and release review videos calling it trash.',\n",
" \"I'm sorry but black girls develop faster than other girls (obviously not intellectually), because that's just what is in their genes naturally!\",\n",
" 'Sadly this means that UK immigration is now free to grant an unlimited amount of work permits to non whites. With emphasis on those who “speak English”. Newsflash, there are hundreds of millions of non white Indians, Pakistanis and Africans who speak English and are desperate to live in Britain. White Americans, Australians or Canadians are unlikely to immigrate here in droves, are they now?',\n",
" 'Blacks are so fragile and whiny. Everything is a threat to THEIR race. Nobody is 100% any race you dipshits. Your dumbass is already mixed so STFU.'],\n",
" dtype=object)"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.loc[df.type == \"animosity\"].sample(10).text.values"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "b4e7c439",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>acl.id</th>\n",
" <th>X1</th>\n",
" <th>text</th>\n",
" <th>label</th>\n",
" <th>type</th>\n",
" <th>target</th>\n",
" <th>level</th>\n",
" <th>split</th>\n",
" <th>round.base</th>\n",
" <th>annotator</th>\n",
" <th>round</th>\n",
" <th>acl.id.matched</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1437</th>\n",
" <td>acl11290</td>\n",
" <td>1437</td>\n",
" <td>people who think hermies should be eliminated ...</td>\n",
" <td>hate</td>\n",
" <td>threatening</td>\n",
" <td>gendermin</td>\n",
" <td>original</td>\n",
" <td>train</td>\n",
" <td>2</td>\n",
" <td>TrRF46JWfP</td>\n",
" <td>2a</td>\n",
" <td>acl20647</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1443</th>\n",
" <td>acl11296</td>\n",
" <td>1443</td>\n",
" <td>anyone want to join me in sorting out the tran...</td>\n",
" <td>hate</td>\n",
" <td>threatening</td>\n",
" <td>gendermin</td>\n",
" <td>original</td>\n",
" <td>train</td>\n",
" <td>2</td>\n",
" <td>TrRF46JWfP</td>\n",
" <td>2a</td>\n",
" <td>acl20390</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1465</th>\n",
" <td>acl11315</td>\n",
" <td>1465</td>\n",
" <td>I don't agree with scapegoating but you have t...</td>\n",
" <td>hate</td>\n",
" <td>threatening</td>\n",
" <td>gendermin</td>\n",
" <td>original</td>\n",
" <td>train</td>\n",
" <td>2</td>\n",
" <td>TrRF46JWfP</td>\n",
" <td>2a</td>\n",
" <td>acl11316</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1469</th>\n",
" <td>acl11319</td>\n",
" <td>1469</td>\n",
" <td>I wish someone would just exterminate those he...</td>\n",
" <td>hate</td>\n",
" <td>threatening</td>\n",
" <td>gendermin</td>\n",
" <td>original</td>\n",
" <td>train</td>\n",
" <td>2</td>\n",
" <td>TrRF46JWfP</td>\n",
" <td>2a</td>\n",
" <td>acl11320</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1495</th>\n",
" <td>acl11342</td>\n",
" <td>1495</td>\n",
" <td>Traaaans should be wiped off</td>\n",
" <td>hate</td>\n",
" <td>threatening</td>\n",
" <td>trans</td>\n",
" <td>original</td>\n",
" <td>train</td>\n",
" <td>2</td>\n",
" <td>TrRF46JWfP</td>\n",
" <td>2a</td>\n",
" <td>acl11343</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34490</th>\n",
" <td>acl41038</td>\n",
" <td>34490</td>\n",
" <td>I proudly beat gays in the gay wars of 2007</td>\n",
" <td>hate</td>\n",
" <td>threatening</td>\n",
" <td>gay</td>\n",
" <td>perturbation</td>\n",
" <td>dev</td>\n",
" <td>4</td>\n",
" <td>IBsVsBliwX</td>\n",
" <td>4b</td>\n",
" <td>acl37574</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34495</th>\n",
" <td>acl41042</td>\n",
" <td>34495</td>\n",
" <td>Covid vaccine? It's 100% sure that it's made b...</td>\n",
" <td>hate</td>\n",
" <td>threatening</td>\n",
" <td>bla, jew</td>\n",
" <td>original</td>\n",
" <td>dev</td>\n",
" <td>4</td>\n",
" <td>iO6vHa6qJm</td>\n",
" <td>4a</td>\n",
" <td>acl31366</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34554</th>\n",
" <td>acl41096</td>\n",
" <td>34554</td>\n",
" <td>I hope her Daddy'll beat H.E.R., until her fac...</td>\n",
" <td>hate</td>\n",
" <td>threatening</td>\n",
" <td>wom</td>\n",
" <td>perturbation</td>\n",
" <td>dev</td>\n",
" <td>4</td>\n",
" <td>iO6vHa6qJm</td>\n",
" <td>4b</td>\n",
" <td>acl34774</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34556</th>\n",
" <td>acl41098</td>\n",
" <td>34556</td>\n",
" <td>yo, what heppen to the idea of lynching that n...</td>\n",
" <td>hate</td>\n",
" <td>threatening</td>\n",
" <td>bla</td>\n",
" <td>perturbation</td>\n",
" <td>dev</td>\n",
" <td>4</td>\n",
" <td>iO6vHa6qJm</td>\n",
" <td>4b</td>\n",
" <td>acl41004</td>\n",
" </tr>\n",
" <tr>\n",
" <th>121100</th>\n",
" <td>acl32095</td>\n",
" <td>24553</td>\n",
" <td>The only good Muslim is a dead one</td>\n",
" <td>hate</td>\n",
" <td>threatening</td>\n",
" <td>mus</td>\n",
" <td>original</td>\n",
" <td>train</td>\n",
" <td>4</td>\n",
" <td>IBsVsBliwX</td>\n",
" <td>4a</td>\n",
" <td>acl32096</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>606 rows × 12 columns</p>\n",
"</div>"
],
"text/plain": [
" acl.id X1 text \\\n",
"1437 acl11290 1437 people who think hermies should be eliminated ... \n",
"1443 acl11296 1443 anyone want to join me in sorting out the tran... \n",
"1465 acl11315 1465 I don't agree with scapegoating but you have t... \n",
"1469 acl11319 1469 I wish someone would just exterminate those he... \n",
"1495 acl11342 1495 Traaaans should be wiped off \n",
"... ... ... ... \n",
"34490 acl41038 34490 I proudly beat gays in the gay wars of 2007 \n",
"34495 acl41042 34495 Covid vaccine? It's 100% sure that it's made b... \n",
"34554 acl41096 34554 I hope her Daddy'll beat H.E.R., until her fac... \n",
"34556 acl41098 34556 yo, what heppen to the idea of lynching that n... \n",
"121100 acl32095 24553 The only good Muslim is a dead one \n",
"\n",
" label type target level split round.base \\\n",
"1437 hate threatening gendermin original train 2 \n",
"1443 hate threatening gendermin original train 2 \n",
"1465 hate threatening gendermin original train 2 \n",
"1469 hate threatening gendermin original train 2 \n",
"1495 hate threatening trans original train 2 \n",
"... ... ... ... ... ... ... \n",
"34490 hate threatening gay perturbation dev 4 \n",
"34495 hate threatening bla, jew original dev 4 \n",
"34554 hate threatening wom perturbation dev 4 \n",
"34556 hate threatening bla perturbation dev 4 \n",
"121100 hate threatening mus original train 4 \n",
"\n",
" annotator round acl.id.matched \n",
"1437 TrRF46JWfP 2a acl20647 \n",
"1443 TrRF46JWfP 2a acl20390 \n",
"1465 TrRF46JWfP 2a acl11316 \n",
"1469 TrRF46JWfP 2a acl11320 \n",
"1495 TrRF46JWfP 2a acl11343 \n",
"... ... ... ... \n",
"34490 IBsVsBliwX 4b acl37574 \n",
"34495 iO6vHa6qJm 4a acl31366 \n",
"34554 iO6vHa6qJm 4b acl34774 \n",
"34556 iO6vHa6qJm 4b acl41004 \n",
"121100 IBsVsBliwX 4a acl32096 \n",
"\n",
"[606 rows x 12 columns]"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"targets = [\"threatening\"]\n",
"clean_df = df.loc[df.type.isin(targets)][[\"text\", \"label\"]]\n",
"clean_df.label = 1\n",
"clean_df.to_csv(\"../../data/processed/Dynamically-Generated-Hate-Speech-Dataset_p.csv\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "sexism_detection",
"language": "python",
"name": "sexism_detection"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.15"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|