File size: 227,210 Bytes
158829b |
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 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 |
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "fake-news-classifier",
"provenance": [],
"collapsed_sections": [
"0b6d7Y4Y5C21",
"QJ23voyoViq1",
"F4RMi9W4aOiD",
"aoKj7P7PmDCc",
"x48sYX_gALT1"
]
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "eBpjBBZc6IvA"
},
"source": [
"**Fake News Classifier**: Text classification model to detect fake news articles!\n",
"\n",
"**Dataset**: [Kaggle Fake and real news dataset](https://www.kaggle.com/datasets/clmentbisaillon/fake-and-real-news-dataset)"
]
},
{
"cell_type": "code",
"source": [
"# !pip install --upgrade git+https://github.com/fastai/fastai.git # from github"
],
"metadata": {
"id": "E90i018KyJH3"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"import os\n",
"import csv\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"import fastai\n",
"from fastai.text.all import *\n",
"from fastai.imports import *\n",
"\n",
"from google.colab import files\n",
"from sklearn.metrics import roc_curve, auc"
],
"metadata": {
"id": "DXa0wSdOVGgn"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"fastai.__version__"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"id": "MvTJ4LhuVaVK",
"outputId": "d017101f-3f98-4183-d9b8-eb40d28efef7"
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'2.5.6'"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "string"
}
},
"metadata": {},
"execution_count": 3
}
]
},
{
"cell_type": "markdown",
"source": [
"# Upload dataset"
],
"metadata": {
"id": "0b6d7Y4Y5C21"
}
},
{
"cell_type": "code",
"source": [
"os.makedirs('data', exist_ok=True)\n",
"\n",
"os.chdir('data') # change directory to data\n",
"files.upload()\n",
"os.chdir('/content') # change directory "
],
"metadata": {
"colab": {
"resources": {
"http://localhost:8080/nbextensions/google.colab/files.js": {
"data": "Ly8gQ29weXJpZ2h0IDIwMTcgR29vZ2xlIExMQwovLwovLyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLy8geW91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iAgfQoKICAvLyBBbGwgZG9uZS4KICB5aWVsZCB7CiAgICByZXNwb25zZTogewogICAgICBhY3Rpb246ICdjb21wbGV0ZScsCiAgICB9CiAgfTsKfQoKc2NvcGUuZ29vZ2xlID0gc2NvcGUuZ29vZ2xlIHx8IHt9OwpzY29wZS5nb29nbGUuY29sYWIgPSBzY29wZS5nb29nbGUuY29sYWIgfHwge307CnNjb3BlLmdvb2dsZS5jb2xhYi5fZmlsZXMgPSB7CiAgX3VwbG9hZEZpbGVzLAogIF91cGxvYWRGaWxlc0NvbnRpbnVlLAp9Owp9KShzZWxmKTsK",
"ok": true,
"headers": [
[
"content-type",
"application/javascript"
]
],
"status": 200,
"status_text": ""
}
},
"base_uri": "https://localhost:8080/",
"height": 107
},
"id": "zzx_iQhA5g9v",
"outputId": "97c31f52-c198-4e0b-ffad-5d90d009646f"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
" <input type=\"file\" id=\"files-31c2fcb3-cb30-466b-a999-eabf5c9139e0\" name=\"files[]\" multiple disabled\n",
" style=\"border:none\" />\n",
" <output id=\"result-31c2fcb3-cb30-466b-a999-eabf5c9139e0\">\n",
" Upload widget is only available when the cell has been executed in the\n",
" current browser session. Please rerun this cell to enable.\n",
" </output>\n",
" <script src=\"/nbextensions/google.colab/files.js\"></script> "
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"Saving True.csv to True.csv\n",
"Saving Fake.csv to Fake.csv\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"# Dataset"
],
"metadata": {
"id": "QJ23voyoViq1"
}
},
{
"cell_type": "code",
"source": [
"def read_csv(file):\n",
" return pd.read_csv(file, encoding='UTF-8', low_memory=False)\n",
"\n",
"DATASET_DIRECTORY = 'data'\n",
"true_df = read_csv(f'{DATASET_DIRECTORY}/True.csv')\n",
"fake_df = read_csv(f'{DATASET_DIRECTORY}/Fake.csv')"
],
"metadata": {
"id": "pqerLEAHVkRO"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"true_df.head()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 511
},
"id": "D2aEk8wqWmFY",
"outputId": "3a8909db-46c9-41e7-a32a-7c34cc0b1df5"
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" title \\\n",
"0 As U.S. budget fight looms, Republicans flip their fiscal script \n",
"1 U.S. military to accept transgender recruits on Monday: Pentagon \n",
"2 Senior U.S. Republican senator: 'Let Mr. Mueller do his job' \n",
"3 FBI Russia probe helped by Australian diplomat tip-off: NYT \n",
"4 Trump wants Postal Service to charge 'much more' for Amazon shipments \n",
"\n",
" text \\\n",
"0 WASHINGTON (Reuters) - The head of a conservative Republican faction in the U.S. Congress, who voted this month for a huge expansion of the national debt to pay for tax cuts, called himself a “fiscal conservative” on Sunday and urged budget restraint in 2018. In keeping with a sharp pivot under way among Republicans, U.S. Representative Mark Meadows, speaking on CBS’ “Face the Nation,” drew a hard line on federal spending, which lawmakers are bracing to do battle over in January. When they return from the holidays on Wednesday, lawmakers will begin trying to pass a federal budget in a figh... \n",
"1 WASHINGTON (Reuters) - Transgender people will be allowed for the first time to enlist in the U.S. military starting on Monday as ordered by federal courts, the Pentagon said on Friday, after President Donald Trump’s administration decided not to appeal rulings that blocked his transgender ban. Two federal appeals courts, one in Washington and one in Virginia, last week rejected the administration’s request to put on hold orders by lower court judges requiring the military to begin accepting transgender recruits on Jan. 1. A Justice Department official said the administration will not chal... \n",
"2 WASHINGTON (Reuters) - The special counsel investigation of links between Russia and President Trump’s 2016 election campaign should continue without interference in 2018, despite calls from some Trump administration allies and Republican lawmakers to shut it down, a prominent Republican senator said on Sunday. Lindsey Graham, who serves on the Senate armed forces and judiciary committees, said Department of Justice Special Counsel Robert Mueller needs to carry on with his Russia investigation without political interference. “This investigation will go forward. It will be an investigation ... \n",
"3 WASHINGTON (Reuters) - Trump campaign adviser George Papadopoulos told an Australian diplomat in May 2016 that Russia had political dirt on Democratic presidential candidate Hillary Clinton, the New York Times reported on Saturday. The conversation between Papadopoulos and the diplomat, Alexander Downer, in London was a driving factor behind the FBI’s decision to open a counter-intelligence investigation of Moscow’s contacts with the Trump campaign, the Times reported. Two months after the meeting, Australian officials passed the information that came from Papadopoulos to their American co... \n",
"4 SEATTLE/WASHINGTON (Reuters) - President Donald Trump called on the U.S. Postal Service on Friday to charge “much more” to ship packages for Amazon (AMZN.O), picking another fight with an online retail giant he has criticized in the past. “Why is the United States Post Office, which is losing many billions of dollars a year, while charging Amazon and others so little to deliver their packages, making Amazon richer and the Post Office dumber and poorer? Should be charging MUCH MORE!” Trump wrote on Twitter. The president’s tweet drew fresh attention to the fragile finances of the Posta... \n",
"\n",
" subject date \n",
"0 politicsNews December 31, 2017 \n",
"1 politicsNews December 29, 2017 \n",
"2 politicsNews December 31, 2017 \n",
"3 politicsNews December 30, 2017 \n",
"4 politicsNews December 29, 2017 "
],
"text/html": [
"\n",
" <div id=\"df-85072a99-1a22-4b9c-a4df-e1eef73c369c\">\n",
" <div class=\"colab-df-container\">\n",
" <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>title</th>\n",
" <th>text</th>\n",
" <th>subject</th>\n",
" <th>date</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>As U.S. budget fight looms, Republicans flip their fiscal script</td>\n",
" <td>WASHINGTON (Reuters) - The head of a conservative Republican faction in the U.S. Congress, who voted this month for a huge expansion of the national debt to pay for tax cuts, called himself a “fiscal conservative” on Sunday and urged budget restraint in 2018. In keeping with a sharp pivot under way among Republicans, U.S. Representative Mark Meadows, speaking on CBS’ “Face the Nation,” drew a hard line on federal spending, which lawmakers are bracing to do battle over in January. When they return from the holidays on Wednesday, lawmakers will begin trying to pass a federal budget in a figh...</td>\n",
" <td>politicsNews</td>\n",
" <td>December 31, 2017</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>U.S. military to accept transgender recruits on Monday: Pentagon</td>\n",
" <td>WASHINGTON (Reuters) - Transgender people will be allowed for the first time to enlist in the U.S. military starting on Monday as ordered by federal courts, the Pentagon said on Friday, after President Donald Trump’s administration decided not to appeal rulings that blocked his transgender ban. Two federal appeals courts, one in Washington and one in Virginia, last week rejected the administration’s request to put on hold orders by lower court judges requiring the military to begin accepting transgender recruits on Jan. 1. A Justice Department official said the administration will not chal...</td>\n",
" <td>politicsNews</td>\n",
" <td>December 29, 2017</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Senior U.S. Republican senator: 'Let Mr. Mueller do his job'</td>\n",
" <td>WASHINGTON (Reuters) - The special counsel investigation of links between Russia and President Trump’s 2016 election campaign should continue without interference in 2018, despite calls from some Trump administration allies and Republican lawmakers to shut it down, a prominent Republican senator said on Sunday. Lindsey Graham, who serves on the Senate armed forces and judiciary committees, said Department of Justice Special Counsel Robert Mueller needs to carry on with his Russia investigation without political interference. “This investigation will go forward. It will be an investigation ...</td>\n",
" <td>politicsNews</td>\n",
" <td>December 31, 2017</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>FBI Russia probe helped by Australian diplomat tip-off: NYT</td>\n",
" <td>WASHINGTON (Reuters) - Trump campaign adviser George Papadopoulos told an Australian diplomat in May 2016 that Russia had political dirt on Democratic presidential candidate Hillary Clinton, the New York Times reported on Saturday. The conversation between Papadopoulos and the diplomat, Alexander Downer, in London was a driving factor behind the FBI’s decision to open a counter-intelligence investigation of Moscow’s contacts with the Trump campaign, the Times reported. Two months after the meeting, Australian officials passed the information that came from Papadopoulos to their American co...</td>\n",
" <td>politicsNews</td>\n",
" <td>December 30, 2017</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Trump wants Postal Service to charge 'much more' for Amazon shipments</td>\n",
" <td>SEATTLE/WASHINGTON (Reuters) - President Donald Trump called on the U.S. Postal Service on Friday to charge “much more” to ship packages for Amazon (AMZN.O), picking another fight with an online retail giant he has criticized in the past. “Why is the United States Post Office, which is losing many billions of dollars a year, while charging Amazon and others so little to deliver their packages, making Amazon richer and the Post Office dumber and poorer? Should be charging MUCH MORE!” Trump wrote on Twitter. The president’s tweet drew fresh attention to the fragile finances of the Posta...</td>\n",
" <td>politicsNews</td>\n",
" <td>December 29, 2017</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-85072a99-1a22-4b9c-a4df-e1eef73c369c')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
" \n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
" <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
" </svg>\n",
" </button>\n",
" \n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" flex-wrap:wrap;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-85072a99-1a22-4b9c-a4df-e1eef73c369c button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-85072a99-1a22-4b9c-a4df-e1eef73c369c');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
" </div>\n",
" "
]
},
"metadata": {},
"execution_count": 5
}
]
},
{
"cell_type": "code",
"source": [
"# add is_fake column\n",
"true_df['is_fake'] = 0;"
],
"metadata": {
"id": "aUNnvfVWYZaq"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"fake_df.head()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 511
},
"id": "e-L6MevjYtyS",
"outputId": "4648e5f1-465c-4b7f-f826-c98bae45395a"
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" title \\\n",
"0 Donald Trump Sends Out Embarrassing New Year’s Eve Message; This is Disturbing \n",
"1 Drunk Bragging Trump Staffer Started Russian Collusion Investigation \n",
"2 Sheriff David Clarke Becomes An Internet Joke For Threatening To Poke People ‘In The Eye’ \n",
"3 Trump Is So Obsessed He Even Has Obama’s Name Coded Into His Website (IMAGES) \n",
"4 Pope Francis Just Called Out Donald Trump During His Christmas Speech \n",
"\n",
" text \\\n",
"0 Donald Trump just couldn t wish all Americans a Happy New Year and leave it at that. Instead, he had to give a shout out to his enemies, haters and the very dishonest fake news media. The former reality show star had just one job to do and he couldn t do it. As our Country rapidly grows stronger and smarter, I want to wish all of my friends, supporters, enemies, haters, and even the very dishonest Fake News Media, a Happy and Healthy New Year, President Angry Pants tweeted. 2018 will be a great year for America! As our Country rapidly grows stronger and smarter, I want to wish all of m... \n",
"1 House Intelligence Committee Chairman Devin Nunes is going to have a bad day. He s been under the assumption, like many of us, that the Christopher Steele-dossier was what prompted the Russia investigation so he s been lashing out at the Department of Justice and the FBI in order to protect Trump. As it happens, the dossier is not what started the investigation, according to documents obtained by the New York Times.Former Trump campaign adviser George Papadopoulos was drunk in a wine bar when he revealed knowledge of Russian opposition research on Hillary Clinton.On top of that, Papadopoul... \n",
"2 On Friday, it was revealed that former Milwaukee Sheriff David Clarke, who was being considered for Homeland Security Secretary in Donald Trump s administration, has an email scandal of his own.In January, there was a brief run-in on a plane between Clarke and fellow passenger Dan Black, who he later had detained by the police for no reason whatsoever, except that maybe his feelings were hurt. Clarke messaged the police to stop Black after he deplaned, and now, a search warrant has been executed by the FBI to see the exchanges.Clarke is calling it fake news even though copies of the search... \n",
"3 On Christmas day, Donald Trump announced that he would be back to work the following day, but he is golfing for the fourth day in a row. The former reality show star blasted former President Barack Obama for playing golf and now Trump is on track to outpace the number of golf games his predecessor played.Updated my tracker of Trump s appearances at Trump properties.71 rounds of golf including today s. At this pace, he ll pass Obama s first-term total by July 24 next year. https://t.co/Fg7VacxRtJ pic.twitter.com/5gEMcjQTbH Philip Bump (@pbump) December 29, 2017 That makes what a Washingt... \n",
"4 Pope Francis used his annual Christmas Day message to rebuke Donald Trump without even mentioning his name. The Pope delivered his message just days after members of the United Nations condemned Trump s move to recognize Jerusalem as the capital of Israel. The Pontiff prayed on Monday for the peaceful coexistence of two states within mutually agreed and internationally recognized borders. We see Jesus in the children of the Middle East who continue to suffer because of growing tensions between Israelis and Palestinians, Francis said. On this festive day, let us ask the Lord for peace fo... \n",
"\n",
" subject date \n",
"0 News December 31, 2017 \n",
"1 News December 31, 2017 \n",
"2 News December 30, 2017 \n",
"3 News December 29, 2017 \n",
"4 News December 25, 2017 "
],
"text/html": [
"\n",
" <div id=\"df-a593ab06-d375-428e-888c-c265e2883487\">\n",
" <div class=\"colab-df-container\">\n",
" <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>title</th>\n",
" <th>text</th>\n",
" <th>subject</th>\n",
" <th>date</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Donald Trump Sends Out Embarrassing New Year’s Eve Message; This is Disturbing</td>\n",
" <td>Donald Trump just couldn t wish all Americans a Happy New Year and leave it at that. Instead, he had to give a shout out to his enemies, haters and the very dishonest fake news media. The former reality show star had just one job to do and he couldn t do it. As our Country rapidly grows stronger and smarter, I want to wish all of my friends, supporters, enemies, haters, and even the very dishonest Fake News Media, a Happy and Healthy New Year, President Angry Pants tweeted. 2018 will be a great year for America! As our Country rapidly grows stronger and smarter, I want to wish all of m...</td>\n",
" <td>News</td>\n",
" <td>December 31, 2017</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Drunk Bragging Trump Staffer Started Russian Collusion Investigation</td>\n",
" <td>House Intelligence Committee Chairman Devin Nunes is going to have a bad day. He s been under the assumption, like many of us, that the Christopher Steele-dossier was what prompted the Russia investigation so he s been lashing out at the Department of Justice and the FBI in order to protect Trump. As it happens, the dossier is not what started the investigation, according to documents obtained by the New York Times.Former Trump campaign adviser George Papadopoulos was drunk in a wine bar when he revealed knowledge of Russian opposition research on Hillary Clinton.On top of that, Papadopoul...</td>\n",
" <td>News</td>\n",
" <td>December 31, 2017</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Sheriff David Clarke Becomes An Internet Joke For Threatening To Poke People ‘In The Eye’</td>\n",
" <td>On Friday, it was revealed that former Milwaukee Sheriff David Clarke, who was being considered for Homeland Security Secretary in Donald Trump s administration, has an email scandal of his own.In January, there was a brief run-in on a plane between Clarke and fellow passenger Dan Black, who he later had detained by the police for no reason whatsoever, except that maybe his feelings were hurt. Clarke messaged the police to stop Black after he deplaned, and now, a search warrant has been executed by the FBI to see the exchanges.Clarke is calling it fake news even though copies of the search...</td>\n",
" <td>News</td>\n",
" <td>December 30, 2017</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Trump Is So Obsessed He Even Has Obama’s Name Coded Into His Website (IMAGES)</td>\n",
" <td>On Christmas day, Donald Trump announced that he would be back to work the following day, but he is golfing for the fourth day in a row. The former reality show star blasted former President Barack Obama for playing golf and now Trump is on track to outpace the number of golf games his predecessor played.Updated my tracker of Trump s appearances at Trump properties.71 rounds of golf including today s. At this pace, he ll pass Obama s first-term total by July 24 next year. https://t.co/Fg7VacxRtJ pic.twitter.com/5gEMcjQTbH Philip Bump (@pbump) December 29, 2017 That makes what a Washingt...</td>\n",
" <td>News</td>\n",
" <td>December 29, 2017</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Pope Francis Just Called Out Donald Trump During His Christmas Speech</td>\n",
" <td>Pope Francis used his annual Christmas Day message to rebuke Donald Trump without even mentioning his name. The Pope delivered his message just days after members of the United Nations condemned Trump s move to recognize Jerusalem as the capital of Israel. The Pontiff prayed on Monday for the peaceful coexistence of two states within mutually agreed and internationally recognized borders. We see Jesus in the children of the Middle East who continue to suffer because of growing tensions between Israelis and Palestinians, Francis said. On this festive day, let us ask the Lord for peace fo...</td>\n",
" <td>News</td>\n",
" <td>December 25, 2017</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-a593ab06-d375-428e-888c-c265e2883487')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
" \n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
" <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
" </svg>\n",
" </button>\n",
" \n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" flex-wrap:wrap;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-a593ab06-d375-428e-888c-c265e2883487 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-a593ab06-d375-428e-888c-c265e2883487');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
" </div>\n",
" "
]
},
"metadata": {},
"execution_count": 7
}
]
},
{
"cell_type": "code",
"source": [
"# add is_fake column\n",
"fake_df['is_fake'] = 1"
],
"metadata": {
"id": "asxxr5buYuvv"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"train_df = pd.concat([true_df, fake_df], axis=0) # concat fake_df and true_df\n",
"train_df['text'] = train_df['title'] + \" \\n \" + train_df['text'] # concat title and text\n",
"train_df.drop(['title', 'subject', 'date'], axis=1)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 815
},
"id": "kG7bVsU4ZCSs",
"outputId": "8d83cd3b-3ef7-4c94-d815-e523c0b313d6"
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" text \\\n",
"0 As U.S. budget fight looms, Republicans flip their fiscal script \\n WASHINGTON (Reuters) - The head of a conservative Republican faction in the U.S. Congress, who voted this month for a huge expansion of the national debt to pay for tax cuts, called himself a “fiscal conservative” on Sunday and urged budget restraint in 2018. In keeping with a sharp pivot under way among Republicans, U.S. Representative Mark Meadows, speaking on CBS’ “Face the Nation,” drew a hard line on federal spending, which lawmakers are bracing to do battle over in January. When they return from the holidays on Wedne... \n",
"1 U.S. military to accept transgender recruits on Monday: Pentagon \\n WASHINGTON (Reuters) - Transgender people will be allowed for the first time to enlist in the U.S. military starting on Monday as ordered by federal courts, the Pentagon said on Friday, after President Donald Trump’s administration decided not to appeal rulings that blocked his transgender ban. Two federal appeals courts, one in Washington and one in Virginia, last week rejected the administration’s request to put on hold orders by lower court judges requiring the military to begin accepting transgender recruits on Jan. 1.... \n",
"2 Senior U.S. Republican senator: 'Let Mr. Mueller do his job' \\n WASHINGTON (Reuters) - The special counsel investigation of links between Russia and President Trump’s 2016 election campaign should continue without interference in 2018, despite calls from some Trump administration allies and Republican lawmakers to shut it down, a prominent Republican senator said on Sunday. Lindsey Graham, who serves on the Senate armed forces and judiciary committees, said Department of Justice Special Counsel Robert Mueller needs to carry on with his Russia investigation without political interference. “... \n",
"3 FBI Russia probe helped by Australian diplomat tip-off: NYT \\n WASHINGTON (Reuters) - Trump campaign adviser George Papadopoulos told an Australian diplomat in May 2016 that Russia had political dirt on Democratic presidential candidate Hillary Clinton, the New York Times reported on Saturday. The conversation between Papadopoulos and the diplomat, Alexander Downer, in London was a driving factor behind the FBI’s decision to open a counter-intelligence investigation of Moscow’s contacts with the Trump campaign, the Times reported. Two months after the meeting, Australian officials passed t... \n",
"4 Trump wants Postal Service to charge 'much more' for Amazon shipments \\n SEATTLE/WASHINGTON (Reuters) - President Donald Trump called on the U.S. Postal Service on Friday to charge “much more” to ship packages for Amazon (AMZN.O), picking another fight with an online retail giant he has criticized in the past. “Why is the United States Post Office, which is losing many billions of dollars a year, while charging Amazon and others so little to deliver their packages, making Amazon richer and the Post Office dumber and poorer? Should be charging MUCH MORE!” Trump wrote on Twitter. The pr... \n",
"... ... \n",
"23476 McPain: John McCain Furious That Iran Treated US Sailors Well \\n 21st Century Wire says As 21WIRE reported earlier this week, the unlikely mishap of two US Naval vessels straying into Iranian waters just hours before the President s State of the Union speech, followed by the usual parade of arch-neocons coming on TV in real time to declare the incident as an act of aggression by Iran against the United States is no mere coincidence.24 hours after the incident, the Iranians returned all 11 US sailors, unharmed and in good spirits. The only remaining casualty from this event was an i... \n",
"23477 JUSTICE? Yahoo Settles E-mail Privacy Class-action: $4M for Lawyers, $0 for Users \\n 21st Century Wire says It s a familiar theme. Whenever there is a dispute or a change of law, and two tribes go to war, there is normally only one real winner after the tribulation the lawyers. Ars TechnicaIn late 2013, Yahoo was hit with six lawsuits over its practice of using automated scans of e-mail to produce targeted ads. The cases, which were consolidated in federal court, all argued that the privacy rights of non-Yahoo users, who did not consent to Yahoo s interception and scanning of their email... \n",
"23478 Sunnistan: US and Allied ‘Safe Zone’ Plan to Take Territorial Booty in Northern Syria \\n Patrick Henningsen 21st Century WireRemember when the Obama Administration told the world how it hoped to identify 5,000 reliable non-jihadist moderate rebels hanging out in Turkey and Jordan, who might want to fight for Washington in Syria? After all the drama over its infamous train and equip program to create their own Arab army in Syria, they want to give it another try.This week, Pentagon officials announced their new plan to train up to 7,000 more moderate fighters, but this time the proje... \n",
"23479 How to Blow $700 Million: Al Jazeera America Finally Calls it Quits \\n 21st Century Wire says Al Jazeera America will go down in history as one of the biggest failures in broadcast media history.Ever since the US and its allies began plotting to overthrow Libya and Syria, Al Jazeera has deteriorated from a promising international news network in 2003 into what it has become in 2016 a full-blown agit prop media shop for the US State Department and the Pentagon. In fact, US Military Central Command (CENTCOM) for the Middle East region is located in Qatar s capital of Doha, conveniently l... \n",
"23480 10 U.S. Navy Sailors Held by Iranian Military – Signs of a Neocon Political Stunt \\n 21st Century Wire says As 21WIRE predicted in its new year s look ahead, we have a new hostage crisis underway.Today, Iranian military forces report that two small riverine U.S. Navy boats were seized in Iranian waters, and are currently being held on Iran s Farsi Island in the Persian Gulf. A total of 10 U.S. Navy personnel, nine men and one woman, have been detained by Iranian authorities. NAVY STRAYED: U.S. Navy patrol boat in the Persian Gulf (Image Source: USNI)According to the Pentagon, the initial... \n",
"\n",
" is_fake \n",
"0 0 \n",
"1 0 \n",
"2 0 \n",
"3 0 \n",
"4 0 \n",
"... ... \n",
"23476 1 \n",
"23477 1 \n",
"23478 1 \n",
"23479 1 \n",
"23480 1 \n",
"\n",
"[44898 rows x 2 columns]"
],
"text/html": [
"\n",
" <div id=\"df-824ee744-d4ab-4512-ac2e-2fa4119096e4\">\n",
" <div class=\"colab-df-container\">\n",
" <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>is_fake</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>As U.S. budget fight looms, Republicans flip their fiscal script \\n WASHINGTON (Reuters) - The head of a conservative Republican faction in the U.S. Congress, who voted this month for a huge expansion of the national debt to pay for tax cuts, called himself a “fiscal conservative” on Sunday and urged budget restraint in 2018. In keeping with a sharp pivot under way among Republicans, U.S. Representative Mark Meadows, speaking on CBS’ “Face the Nation,” drew a hard line on federal spending, which lawmakers are bracing to do battle over in January. When they return from the holidays on Wedne...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>U.S. military to accept transgender recruits on Monday: Pentagon \\n WASHINGTON (Reuters) - Transgender people will be allowed for the first time to enlist in the U.S. military starting on Monday as ordered by federal courts, the Pentagon said on Friday, after President Donald Trump’s administration decided not to appeal rulings that blocked his transgender ban. Two federal appeals courts, one in Washington and one in Virginia, last week rejected the administration’s request to put on hold orders by lower court judges requiring the military to begin accepting transgender recruits on Jan. 1....</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Senior U.S. Republican senator: 'Let Mr. Mueller do his job' \\n WASHINGTON (Reuters) - The special counsel investigation of links between Russia and President Trump’s 2016 election campaign should continue without interference in 2018, despite calls from some Trump administration allies and Republican lawmakers to shut it down, a prominent Republican senator said on Sunday. Lindsey Graham, who serves on the Senate armed forces and judiciary committees, said Department of Justice Special Counsel Robert Mueller needs to carry on with his Russia investigation without political interference. “...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>FBI Russia probe helped by Australian diplomat tip-off: NYT \\n WASHINGTON (Reuters) - Trump campaign adviser George Papadopoulos told an Australian diplomat in May 2016 that Russia had political dirt on Democratic presidential candidate Hillary Clinton, the New York Times reported on Saturday. The conversation between Papadopoulos and the diplomat, Alexander Downer, in London was a driving factor behind the FBI’s decision to open a counter-intelligence investigation of Moscow’s contacts with the Trump campaign, the Times reported. Two months after the meeting, Australian officials passed t...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Trump wants Postal Service to charge 'much more' for Amazon shipments \\n SEATTLE/WASHINGTON (Reuters) - President Donald Trump called on the U.S. Postal Service on Friday to charge “much more” to ship packages for Amazon (AMZN.O), picking another fight with an online retail giant he has criticized in the past. “Why is the United States Post Office, which is losing many billions of dollars a year, while charging Amazon and others so little to deliver their packages, making Amazon richer and the Post Office dumber and poorer? Should be charging MUCH MORE!” Trump wrote on Twitter. The pr...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23476</th>\n",
" <td>McPain: John McCain Furious That Iran Treated US Sailors Well \\n 21st Century Wire says As 21WIRE reported earlier this week, the unlikely mishap of two US Naval vessels straying into Iranian waters just hours before the President s State of the Union speech, followed by the usual parade of arch-neocons coming on TV in real time to declare the incident as an act of aggression by Iran against the United States is no mere coincidence.24 hours after the incident, the Iranians returned all 11 US sailors, unharmed and in good spirits. The only remaining casualty from this event was an i...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23477</th>\n",
" <td>JUSTICE? Yahoo Settles E-mail Privacy Class-action: $4M for Lawyers, $0 for Users \\n 21st Century Wire says It s a familiar theme. Whenever there is a dispute or a change of law, and two tribes go to war, there is normally only one real winner after the tribulation the lawyers. Ars TechnicaIn late 2013, Yahoo was hit with six lawsuits over its practice of using automated scans of e-mail to produce targeted ads. The cases, which were consolidated in federal court, all argued that the privacy rights of non-Yahoo users, who did not consent to Yahoo s interception and scanning of their email...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23478</th>\n",
" <td>Sunnistan: US and Allied ‘Safe Zone’ Plan to Take Territorial Booty in Northern Syria \\n Patrick Henningsen 21st Century WireRemember when the Obama Administration told the world how it hoped to identify 5,000 reliable non-jihadist moderate rebels hanging out in Turkey and Jordan, who might want to fight for Washington in Syria? After all the drama over its infamous train and equip program to create their own Arab army in Syria, they want to give it another try.This week, Pentagon officials announced their new plan to train up to 7,000 more moderate fighters, but this time the proje...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23479</th>\n",
" <td>How to Blow $700 Million: Al Jazeera America Finally Calls it Quits \\n 21st Century Wire says Al Jazeera America will go down in history as one of the biggest failures in broadcast media history.Ever since the US and its allies began plotting to overthrow Libya and Syria, Al Jazeera has deteriorated from a promising international news network in 2003 into what it has become in 2016 a full-blown agit prop media shop for the US State Department and the Pentagon. In fact, US Military Central Command (CENTCOM) for the Middle East region is located in Qatar s capital of Doha, conveniently l...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23480</th>\n",
" <td>10 U.S. Navy Sailors Held by Iranian Military – Signs of a Neocon Political Stunt \\n 21st Century Wire says As 21WIRE predicted in its new year s look ahead, we have a new hostage crisis underway.Today, Iranian military forces report that two small riverine U.S. Navy boats were seized in Iranian waters, and are currently being held on Iran s Farsi Island in the Persian Gulf. A total of 10 U.S. Navy personnel, nine men and one woman, have been detained by Iranian authorities. NAVY STRAYED: U.S. Navy patrol boat in the Persian Gulf (Image Source: USNI)According to the Pentagon, the initial...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>44898 rows × 2 columns</p>\n",
"</div>\n",
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-824ee744-d4ab-4512-ac2e-2fa4119096e4')\"\n",
" title=\"Convert this dataframe to an interactive table.\"\n",
" style=\"display:none;\">\n",
" \n",
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
" width=\"24px\">\n",
" <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
" <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
" </svg>\n",
" </button>\n",
" \n",
" <style>\n",
" .colab-df-container {\n",
" display:flex;\n",
" flex-wrap:wrap;\n",
" gap: 12px;\n",
" }\n",
"\n",
" .colab-df-convert {\n",
" background-color: #E8F0FE;\n",
" border: none;\n",
" border-radius: 50%;\n",
" cursor: pointer;\n",
" display: none;\n",
" fill: #1967D2;\n",
" height: 32px;\n",
" padding: 0 0 0 0;\n",
" width: 32px;\n",
" }\n",
"\n",
" .colab-df-convert:hover {\n",
" background-color: #E2EBFA;\n",
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
" fill: #174EA6;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert {\n",
" background-color: #3B4455;\n",
" fill: #D2E3FC;\n",
" }\n",
"\n",
" [theme=dark] .colab-df-convert:hover {\n",
" background-color: #434B5C;\n",
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
" fill: #FFFFFF;\n",
" }\n",
" </style>\n",
"\n",
" <script>\n",
" const buttonEl =\n",
" document.querySelector('#df-824ee744-d4ab-4512-ac2e-2fa4119096e4 button.colab-df-convert');\n",
" buttonEl.style.display =\n",
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
"\n",
" async function convertToInteractive(key) {\n",
" const element = document.querySelector('#df-824ee744-d4ab-4512-ac2e-2fa4119096e4');\n",
" const dataTable =\n",
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
" [key], {});\n",
" if (!dataTable) return;\n",
"\n",
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
" + ' to learn more about interactive tables.';\n",
" element.innerHTML = '';\n",
" dataTable['output_type'] = 'display_data';\n",
" await google.colab.output.renderOutput(dataTable, element);\n",
" const docLink = document.createElement('div');\n",
" docLink.innerHTML = docLinkHtml;\n",
" element.appendChild(docLink);\n",
" }\n",
" </script>\n",
" </div>\n",
" </div>\n",
" "
]
},
"metadata": {},
"execution_count": 9
}
]
},
{
"cell_type": "markdown",
"source": [
"# Dataloaders (Language Model)"
],
"metadata": {
"id": "F4RMi9W4aOiD"
}
},
{
"cell_type": "code",
"source": [
"!pip install sentencepiece"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "ECWgLnkWkA6-",
"outputId": "2bcd2cd0-bcd1-4660-ab06-716dec8167c3"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Collecting sentencepiece\n",
" Downloading sentencepiece-0.1.96-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)\n",
"\u001b[?25l\r\u001b[K |▎ | 10 kB 20.8 MB/s eta 0:00:01\r\u001b[K |▌ | 20 kB 11.6 MB/s eta 0:00:01\r\u001b[K |▉ | 30 kB 9.4 MB/s eta 0:00:01\r\u001b[K |█ | 40 kB 4.4 MB/s eta 0:00:01\r\u001b[K |█▍ | 51 kB 4.3 MB/s eta 0:00:01\r\u001b[K |█▋ | 61 kB 5.2 MB/s eta 0:00:01\r\u001b[K |██ | 71 kB 5.3 MB/s eta 0:00:01\r\u001b[K |██▏ | 81 kB 5.4 MB/s eta 0:00:01\r\u001b[K |██▍ | 92 kB 6.0 MB/s eta 0:00:01\r\u001b[K |██▊ | 102 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███ | 112 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███▎ | 122 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███▌ | 133 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███▉ | 143 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████ | 153 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████▎ | 163 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████▋ | 174 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████▉ | 184 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████▏ | 194 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████▍ | 204 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████▊ | 215 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████ | 225 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████▏ | 235 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████▌ | 245 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████▊ | 256 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████ | 266 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████▎ | 276 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████▋ | 286 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████▉ | 296 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████ | 307 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████▍ | 317 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████▋ | 327 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████ | 337 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████▏ | 348 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████▌ | 358 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████▊ | 368 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████ | 378 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████▎ | 389 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████▌ | 399 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████▉ | 409 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████ | 419 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████▍ | 430 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████▋ | 440 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████▉ | 450 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████▏ | 460 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████▍ | 471 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████▊ | 481 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████ | 491 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████▎ | 501 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████▌ | 512 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████▊ | 522 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████ | 532 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████▎ | 542 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████▋ | 552 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████▉ | 563 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████▏ | 573 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████▍ | 583 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████▋ | 593 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████ | 604 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████▏ | 614 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████▌ | 624 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████▊ | 634 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████████ | 645 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████████▎ | 655 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████████▌ | 665 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████████▉ | 675 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████████ | 686 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████████▍ | 696 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████████▋ | 706 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████ | 716 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████▏ | 727 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████▍ | 737 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████▊ | 747 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████████ | 757 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████████▎ | 768 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████████▌ | 778 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████████▉ | 788 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████████████ | 798 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████████████▎ | 808 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████████████▋ | 819 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████████████▉ | 829 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████████████▏ | 839 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████████████▍ | 849 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████████████▊ | 860 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████████ | 870 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████████▏ | 880 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████████▌ | 890 kB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████████▊ | 901 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████████████ | 911 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████████████▎ | 921 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████████████▋ | 931 kB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████████████▉ | 942 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████████████████ | 952 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████████████████▍ | 962 kB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████████████████▋ | 972 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████████████████ | 983 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████████████████▏ | 993 kB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████████████████▌ | 1.0 MB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████████████████▊ | 1.0 MB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████████████ | 1.0 MB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████████████▎ | 1.0 MB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████████████▌ | 1.0 MB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████████████▉ | 1.1 MB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████████████████ | 1.1 MB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████████████████▍ | 1.1 MB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████████████████▋ | 1.1 MB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████████████████▉ | 1.1 MB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████████████████████▏ | 1.1 MB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████████████████████▍ | 1.1 MB 5.1 MB/s eta 0:00:01\r\u001b[K |█████████████████████████████▊ | 1.1 MB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████████████████████ | 1.1 MB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████████████████████▎ | 1.1 MB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████████████████████▌ | 1.2 MB 5.1 MB/s eta 0:00:01\r\u001b[K |██████████████████████████████▊ | 1.2 MB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████████████████ | 1.2 MB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████████████████▎| 1.2 MB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████████████████▋| 1.2 MB 5.1 MB/s eta 0:00:01\r\u001b[K |███████████████████████████████▉| 1.2 MB 5.1 MB/s eta 0:00:01\r\u001b[K |████████████████████████████████| 1.2 MB 5.1 MB/s \n",
"\u001b[?25hInstalling collected packages: sentencepiece\n",
"Successfully installed sentencepiece-0.1.96\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"def get_dls(bs, is_lm=False, seq_len=72, vocab=None):\n",
" set_seed(42, reproducible=True)\n",
" if is_lm:\n",
" dls = DataBlock(\n",
" blocks=(TextBlock.from_df('text', is_lm=is_lm, tok=SentencePieceTokenizer())),\n",
" get_x=ColReader('text'),\n",
" splitter=RandomSplitter(0.1)\n",
" ).dataloaders(train_df, bs=bs, seq_len=seq_len)\n",
" elif not is_lm and vocab:\n",
" dls = DataBlock(\n",
" blocks=(TextBlock.from_df('text', vocab=vocab, is_lm=is_lm, tok=SentencePieceTokenizer()), CategoryBlock),\n",
" get_x=ColReader('text'),\n",
" get_y=ColReader('is_fake'),\n",
" splitter=TrainTestSplitter(stratify=train_df['is_fake'])\n",
" ).dataloaders(train_df, bs=bs, seq_len=seq_len)\n",
" \n",
" return dls"
],
"metadata": {
"id": "eCpjs4dYk7P8"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"dls_lm = get_dls(bs=64, is_lm=True, seq_len=80)"
],
"metadata": {
"id": "eyztNuegj5UF",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 17
},
"outputId": "8273b637-afc4-40a1-97c3-ebd5d6c9e36d"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
""
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
""
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"source": [
"dls_lm.show_batch(max_n=2)"
],
"metadata": {
"id": "JPLb8J6kllvA",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 407
},
"outputId": "a90f7621-0915-452a-973c-e4f367f6909b"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>text</th>\n",
" <th>text_</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>▁xxbos ▁xxup ▁u . s . ▁citizen ▁facing ▁subversion ▁charges ▁in ▁xxmaj ▁zimbabwe ▁released ▁from ▁jail ▁xxup ▁harare ▁( reuters ) ▁ - ▁a ▁xxup ▁u . s . ▁citizen ▁accused ▁of ▁attempting ▁to ▁subvert ▁xxmaj ▁president ▁xxmaj ▁robert ▁xxmaj ▁mugabe ▁s ▁government ▁was ▁released ▁from ▁xxmaj ▁zimbabwe ▁s ▁maximum ▁security ▁jail ▁on ▁xxmaj ▁friday , ▁a ▁day ▁after ▁the ▁xxmaj ▁high ▁xxmaj ▁court ▁ordered ▁her ▁to ▁be ▁freed ▁on ▁bail , ▁xxmaj ▁ reuters ▁witnesses ▁said . ▁xxmaj ▁judge</td>\n",
" <td>▁xxup ▁u . s . ▁citizen ▁facing ▁subversion ▁charges ▁in ▁xxmaj ▁zimbabwe ▁released ▁from ▁jail ▁xxup ▁harare ▁( reuters ) ▁ - ▁a ▁xxup ▁u . s . ▁citizen ▁accused ▁of ▁attempting ▁to ▁subvert ▁xxmaj ▁president ▁xxmaj ▁robert ▁xxmaj ▁mugabe ▁s ▁government ▁was ▁released ▁from ▁xxmaj ▁zimbabwe ▁s ▁maximum ▁security ▁jail ▁on ▁xxmaj ▁friday , ▁a ▁day ▁after ▁the ▁xxmaj ▁high ▁xxmaj ▁court ▁ordered ▁her ▁to ▁be ▁freed ▁on ▁bail , ▁xxmaj ▁ reuters ▁witnesses ▁said . ▁xxmaj ▁judge ▁xxmaj</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>▁tensions ▁running ▁high ▁and ▁matters ▁of ▁racial ▁justice ▁becoming ▁an ▁ever ▁more ▁partisan ▁subject , ▁xxmaj ▁trump ▁entered ▁the ▁2016 ▁primary ▁election ▁fully ▁exploiting ▁that ▁tension . ▁xxmaj ▁his ▁rallies ▁have ▁nearly ▁turned ▁into ▁all ▁out ▁race ▁battles , ▁his ▁racist ▁rhetoric ▁is ▁up ▁front ▁and ▁he ▁is ▁unapologetic ▁about ▁that . ▁xxmaj ▁in ▁the ▁segment , ▁xxmaj ▁maddow ▁points ▁towards ▁one ▁of ▁his ▁recent ▁statements ▁involving ▁the ▁judge ▁who ▁ruled ▁against ▁him ▁in ▁a ▁lawsuit ▁over ▁one ▁of ▁xxmaj</td>\n",
" <td>▁running ▁high ▁and ▁matters ▁of ▁racial ▁justice ▁becoming ▁an ▁ever ▁more ▁partisan ▁subject , ▁xxmaj ▁trump ▁entered ▁the ▁2016 ▁primary ▁election ▁fully ▁exploiting ▁that ▁tension . ▁xxmaj ▁his ▁rallies ▁have ▁nearly ▁turned ▁into ▁all ▁out ▁race ▁battles , ▁his ▁racist ▁rhetoric ▁is ▁up ▁front ▁and ▁he ▁is ▁unapologetic ▁about ▁that . ▁xxmaj ▁in ▁the ▁segment , ▁xxmaj ▁maddow ▁points ▁towards ▁one ▁of ▁his ▁recent ▁statements ▁involving ▁the ▁judge ▁who ▁ruled ▁against ▁him ▁in ▁a ▁lawsuit ▁over ▁one ▁of ▁xxmaj ▁trump</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
]
},
"metadata": {}
}
]
},
{
"cell_type": "markdown",
"source": [
"# Interpretation Utilies"
],
"metadata": {
"id": "OhdnwJ3T3dHl"
}
},
{
"cell_type": "code",
"source": [
"def get_classification_interpretation(learn):\n",
" return ClassificationInterpretation.from_learner(learn)\n",
"\n",
"def plot_top_losses(interp, k=9, nrows=3):\n",
" interp.plot_top_losses(k, nrows=nrows)\n",
"\n",
"def plot_confusion_matrix(interp, figsize=(12, 12), dpi=60):\n",
" interp.plot_confusion_matrix(figsize=figsize, dpi=dpi)\n",
"\n",
"def print_classification_report(interp):\n",
" interp.print_classification_report()"
],
"metadata": {
"id": "rjsHShpP3hF2"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"# Fine-Tuning the Language Model"
],
"metadata": {
"id": "aoKj7P7PmDCc"
}
},
{
"cell_type": "code",
"source": [
"learn = language_model_learner(\n",
" dls_lm, AWD_LSTM, drop_mult=0.3, \n",
" metrics=[accuracy, Perplexity()]).to_fp16()"
],
"metadata": {
"id": "VuUTad1Kl_SZ",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 37
},
"outputId": "be4ea411-6c13-4142-a425-460845086a29"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
" <div>\n",
" <progress value='105070592' class='' max='105067061' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
" 100.00% [105070592/105067061 00:01<00:00]\n",
" </div>\n",
" "
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"source": [
"learn.lr_find()"
],
"metadata": {
"id": "_aJ8FMDHqZ8t",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 300
},
"outputId": "c45380f5-1e5f-47f7-dc1d-03a767ac8958"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
""
]
},
"metadata": {}
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"SuggestedLRs(valley=0.013182567432522774)"
]
},
"metadata": {},
"execution_count": 17
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
],
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEKCAYAAAAIO8L1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dd3yV9f3+8dc7e4eQCQkQNgSQYUREQVzgQLRa97dqf86qtdqlnVq139a21tZRLd/WVa17T3AwnGhAQPYeCSMhgQTITj6/P3LUGE9CAjm5T5Lr+XicR865z32fc+UQcuW+P/cw5xwiIiJNhXgdQEREgpMKQkRE/FJBiIiIXyoIERHxSwUhIiJ+qSBERMSvMK8DtKeUlBSXnZ3tdQwRkU5j4cKFu5xzqf6e61IFkZ2dTV5entcxREQ6DTPb3Nxz2sQkIiJ+qSBERMQvFYSIiPjVpcYgRESaU1NTQ35+PpWVlV5H8URUVBRZWVmEh4e3ehkVhIh0C/n5+cTHx5OdnY2ZeR2nQznnKC4uJj8/n/79+7d6OW1iEpFuobKykuTk5G5XDgBmRnJycpvXnlQQ0uk551hXuJfPNpVQXl3rdRwJYt2xHL50MN+7NjFJp7Vw825eXbKN91YVsqWkHIAQgyHp8Yzt24NxfZMY1y+JASmxVNXWk7+7nM3F5USEhZDZI5rePaKJCg/1+LsQ8S8uLo59+/axadMmpk+fzrJlyzo8gwpCOoRzjuL91eworSQ2MoyEqDASosMJD/16Jba6tp6Nu/azZude9pRXkxAdTkJ0OCmxkQzNiCc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QDYNl17d4Jz78rWfBK5sJu4kM1tCQzn8zTm3wzd9pJndQcP1NeKAWW38PkVaRQUh3U0IsMe3bb+pe4G/Oude8V2g59ZGz+1vMm9Vo/t1+P+/1Jp5WvK+c266mfUHPjGzZ5xzi4FHgDOdc0t8Fzia4mfZlr5PkVbRJibpVpxzZcBGMzsHGi6TaWajfU8n8vX5+S8JUITVwIBGl6M870AL+NY2/gjc5JsUD2z3bda6qNGse33PHej7FGkVFYR0dTFmlt/o9mMafqle5tt8s5yG6wJDwxrDs2a2ENgViDC+zVTXAG/53mcvUNqKRR8EJvuK5TfAAuBDYFWjeZ4CfuYbZB9I89+nSKvodN8iHczM4pxz+3x7Nd0PrHXO3e11LpGmtAYh0vGu8A1aL6dhs9Y/Pc4j4pfWIERExC+tQYiIiF8qCBER8UsFISIifqkgRETELxWEiIj4pYIQERG//j8CtJq0ybMJrAAAAABJRU5ErkJggg==\n"
},
"metadata": {
"needs_background": "light"
}
}
]
},
{
"cell_type": "code",
"source": [
"learn.fit_one_cycle(3, 1e-2, cbs=SaveModelCallback(monitor='valid_loss', fname='awd-lstm-stage-1'))"
],
"metadata": {
"id": "rVowARmiqN29",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 196
},
"outputId": "f135540b-9179-423d-e4c3-3d856979638e"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>accuracy</th>\n",
" <th>perplexity</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>3.859557</td>\n",
" <td>3.772070</td>\n",
" <td>0.335378</td>\n",
" <td>43.469940</td>\n",
" <td>1:51:30</td>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>3.663779</td>\n",
" <td>3.558650</td>\n",
" <td>0.353973</td>\n",
" <td>35.115761</td>\n",
" <td>1:51:33</td>\n",
" </tr>\n",
" <tr>\n",
" <td>2</td>\n",
" <td>3.552619</td>\n",
" <td>3.486112</td>\n",
" <td>0.362221</td>\n",
" <td>32.658718</td>\n",
" <td>1:51:57</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"Better model found at epoch 0 with valid_loss value: 3.7720696926116943.\n",
"Better model found at epoch 1 with valid_loss value: 3.558650016784668.\n",
"Better model found at epoch 2 with valid_loss value: 3.486111879348755.\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"learn = learn.load('awd-lstm-stage-1')"
],
"metadata": {
"id": "gTyq2TqTqlos"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"learn.unfreeze()\n",
"learn.lr_find()"
],
"metadata": {
"id": "-llb6RCJqpX4"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"learn.fit_one_cycle(3, lr_max=slice(1e-6, 1e-3), cbs=SaveModelCallback(monitor='valid_loss', fname='awd-lstm-stage-2'))"
],
"metadata": {
"id": "WE8VR9gQq0vj",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 196
},
"outputId": "abb5721c-fd0b-4708-bbc4-ea0d8dee7b8e"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>accuracy</th>\n",
" <th>perplexity</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>3.400496</td>\n",
" <td>3.409633</td>\n",
" <td>0.369413</td>\n",
" <td>30.254137</td>\n",
" <td>2:08:47</td>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>3.363057</td>\n",
" <td>3.364447</td>\n",
" <td>0.374696</td>\n",
" <td>28.917492</td>\n",
" <td>2:09:32</td>\n",
" </tr>\n",
" <tr>\n",
" <td>2</td>\n",
" <td>3.344105</td>\n",
" <td>3.354440</td>\n",
" <td>0.376010</td>\n",
" <td>28.629560</td>\n",
" <td>2:09:38</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"Better model found at epoch 0 with valid_loss value: 3.409632921218872.\n",
"Better model found at epoch 1 with valid_loss value: 3.3644466400146484.\n",
"Better model found at epoch 2 with valid_loss value: 3.3544397354125977.\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"learn = learn.load('awd-lstm-stage-2')\n",
"learn.save_encoder('awd-lstm-finetuned')"
],
"metadata": {
"id": "g3aQgr7lq7f4"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"# Dataloaders (Classifier)"
],
"metadata": {
"id": "HE19o2N4rmVl"
}
},
{
"cell_type": "code",
"source": [
"dls_clas = get_dls(bs=64, is_lm=False, seq_len=80, vocab=dls_lm.vocab)"
],
"metadata": {
"id": "S2ONHVdtrusy",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 17
},
"outputId": "33ea44cd-e0b8-4bfc-8e02-bd3af9b859e8"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
""
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
""
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"source": [
"dls_clas.show_batch(max_n=3)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 369
},
"id": "BRet8JODwLzB",
"outputId": "f78f9eed-4718-4df1-e0f7-70cddfab9c35"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>text</th>\n",
" <th>category</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>▁xxbos ▁xxmaj ▁fed ▁xxmaj ▁up ▁xxmaj ▁republicans ▁xxmaj ▁threaten ▁xxmaj ▁third ▁xxmaj ▁party ▁xxmaj ▁option ▁xxmaj ▁if ▁xxmaj ▁trump ▁xxmaj ▁is ▁xxmaj ▁the ▁xxmaj ▁nominee ▁i ▁ve ▁been ▁saying ▁for ▁a ▁long ▁time ▁now ▁that ▁the ▁xxmaj ▁republican ▁xxmaj ▁party ▁was ▁on ▁the ▁verge ▁of ▁splitting ▁and ▁i ▁was ▁right . ▁xxmaj ▁sort ▁of . ▁i ▁always ▁assumed ▁that ▁the ▁establishment ▁would ▁control ▁the ▁party ▁with ▁an ▁iron ▁fist ▁and ▁the ▁xxmaj ▁tea ▁xxmaj ▁party ▁white ▁supremacists ▁would ▁abandon ▁the ▁xxup ▁gop ▁to ▁form ▁their ▁own ▁xxmaj ▁white ▁xxmaj ▁power ▁party . ▁xxmaj ▁but ▁with ▁the ▁rise ▁of ▁xxmaj ▁donald ▁xxmaj ▁trump , ▁it ▁looks ▁like ▁the ▁establishment ▁is ▁going ▁to ▁abandon ▁the ▁party ▁and ▁run ▁a ▁candidate ▁that ▁s ▁not ▁a ▁raving ▁sociopath : s pur red ▁by ▁xxmaj ▁donald ▁xxup ▁j . ▁xxmaj ▁trump ▁s ▁mounting ▁victories , ▁a ▁small ▁but ▁influential ▁and ▁growing ▁group ▁of ▁conservative ▁leaders</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>▁xxbos ▁xxup ▁another ▁xxup ▁american ▁xxup ▁known ▁xxup ▁wolf ? ▁xxmaj ▁for t ▁xxmaj ▁lauderdale ▁xxmaj ▁shooter ▁xxmaj ▁known ▁to ▁xxup ▁fbi , ▁xxmaj ▁worked ▁for ▁xxmaj ▁security , ▁xxmaj ▁amid ▁xxmaj ▁backdrop ▁of ▁xxmaj ▁mass ▁xxmaj ▁drills ▁xxmaj ▁shawn ▁xxmaj ▁helton ▁21 st ▁xxmaj ▁century ▁wire another ▁shocking ▁active - shoot er ▁incident ▁rocks ▁xxmaj ▁america . ▁xxmaj ▁this ▁time , ▁according ▁to ▁xxmaj ▁florida ▁s ▁xxmaj ▁broward ▁xxmaj ▁county ▁xxmaj ▁sheriff ▁s ▁xxmaj ▁department , ▁ thirteen ▁people ▁were ▁shot , ▁including ▁five ▁dead , ▁after ▁an ▁apparent ▁shooting ▁rampage ▁took ▁place ▁at ▁xxmaj ▁for t ▁xxmaj ▁lauderdale ▁s ▁xxmaj ▁hollywood ▁xxmaj ▁international ▁xxmaj ▁airport ▁yesterday . at ▁the ▁moment , ▁there ▁is ▁still ▁no ▁clear ▁motive ▁for ▁the ▁shooting ▁attack ▁and ▁no ▁evidence ▁linking ▁the ▁suspect ▁to ▁terror . ▁xxmaj ▁however , ▁officials ▁have ▁yet ▁to ▁rule ▁out ▁the ▁possibility ▁of ▁terrorism . the ▁timing ▁of ▁this</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>▁xxbos ▁xxmaj ▁sunni stan : ▁xxup ▁us ▁and ▁xxmaj ▁allied ▁‘ safe ▁xxmaj ▁zone ’ ▁xxmaj ▁plan ▁to ▁xxmaj ▁take ▁xxmaj ▁territorial ▁xxmaj ▁booty ▁in ▁xxmaj ▁northern ▁xxmaj ▁syria ▁xxmaj ▁patrick ▁xxmaj ▁henningsen ▁21 st ▁xxmaj ▁century ▁wire remember ▁when ▁the ▁xxmaj ▁obama ▁xxmaj ▁administration ▁told ▁the ▁world ▁how ▁it ▁hoped ▁to ▁identify ▁5, ▁xxrep ▁3 ▁0 ▁reliable ▁non - jihad ist ▁moderate ▁rebels ▁hanging ▁out ▁in ▁xxmaj ▁turkey ▁and ▁xxmaj ▁jordan , ▁who ▁might ▁want ▁to ▁fight ▁for ▁xxmaj ▁washington ▁in ▁xxmaj ▁syria ? ▁xxmaj ▁after ▁all ▁the ▁drama ▁over ▁its ▁infamous ▁train ▁and ▁equip ▁program ▁to ▁create ▁their ▁own ▁xxmaj ▁arab ▁army ▁in ▁xxmaj ▁syria , ▁they ▁want ▁to ▁give ▁it ▁another ▁try . this ▁week , ▁xxmaj ▁pentagon ▁officials ▁announced ▁their ▁new ▁plan ▁to ▁train ▁up ▁to ▁7, ▁xxrep ▁3 ▁0 ▁more ▁moderate ▁fighters , ▁but ▁this ▁time ▁the ▁project ▁would ▁take ▁place ▁inside ▁xxmaj ▁syria ▁(</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
]
},
"metadata": {}
}
]
},
{
"cell_type": "markdown",
"source": [
"# Fine-Tuning the classifier"
],
"metadata": {
"id": "qgnuBE72wT1x"
}
},
{
"cell_type": "code",
"source": [
"learn = text_classifier_learner(dls_clas, AWD_LSTM, drop_mult=0.5, metrics=accuracy).to_fp16()"
],
"metadata": {
"id": "qxUlPVf1wO1M"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"learn = learn.load_encoder('awd-lstm-finetuned')"
],
"metadata": {
"id": "kWNvpR-Gw4Kq"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"learn.lr_find()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 300
},
"id": "2yxDw8ycw8iX",
"outputId": "e3a6972b-070c-4a6d-9e02-c71c6926b40d"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
""
]
},
"metadata": {}
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"SuggestedLRs(valley=0.0020892962347716093)"
]
},
"metadata": {},
"execution_count": 24
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
],
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEKCAYAAAAfGVI8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dd3xV9f3H8dcni5BBWAECAQICSiBhRdyKikUFxaKAiBMVrdtaf9XWWuuo1l0Vq1gVRxWRtoqrroKKOAhLdtgSZggQEiD7+/vjXm3ETMjNyc19Px+PPMg999xz3vcG8uas7zHnHCIiErrCvA4gIiLeUhGIiIQ4FYGISIhTEYiIhDgVgYhIiFMRiIiEuAivA9RV27ZtXUpKitcxRESCyrx583Y45xIrey7oiiAlJYXMzEyvY4iIBBUz21DVc9o1JCIS4lQEIiIhTkUgIhLigu4YgYhIVUpKSsjOzqawsNDrKJ6Jjo4mOTmZyMjIWr9GRSAiTUZ2djbx8fGkpKRgZl7HaXDOOXJzc8nOzqZbt261fp12DYlIk1FYWEibNm1CsgQAzIw2bdrUeYsoZIpge34h73632esYIhJgoVoCPziY9x8yRfDGtxu57rUFbN693+soIiIAxMXFAbB+/Xr69u3rWY6QKYIR/ToC8P7iLR4nEZFG47tp8FhfuKul78/vpnmdyBMhUw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e7D6Pq9ylSKxqGWiRAzCzOOVfgP4toErDKOfeY17lEDqQtApHAudJ/8Hgpvt1Rz3qcR6RS2iIQEQlx2iIQEQlxKgIRkRCnIhARCXEqAhGREKciEBEJcSoCEZEQ9/9GkhSeWIjZcwAAAABJRU5ErkJggg==\n"
},
"metadata": {
"needs_background": "light"
}
}
]
},
{
"cell_type": "code",
"source": [
"learn.fit_one_cycle(1, 1e-3, cbs=SaveModelCallback(monitor='valid_loss', fname='awd-lstm-text-classifier-stage-1'))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 98
},
"id": "snmMVgKlw-3K",
"outputId": "24db1099-dd9b-4a67-a8a8-e9a9e55691fe"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>accuracy</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>0.069285</td>\n",
" <td>0.006499</td>\n",
" <td>0.998775</td>\n",
" <td>18:34</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"Better model found at epoch 0 with valid_loss value: 0.006499091163277626.\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# freeze all except the last two parameter groups and finetune\n",
"learn.freeze_to(-2)\n",
"learn.fit_one_cycle(1, lr_max=slice(1e-2/(2.6**4),1e-2), cbs=SaveModelCallback(monitor='valid_loss', fname='awd-lstm-text-classifier-stage-2'))"
],
"metadata": {
"id": "uNPytEaGxEQ5",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 98
},
"outputId": "ffe49e2e-c202-4278-c68e-6f6cf3514f66"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>accuracy</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>0.032714</td>\n",
" <td>0.006911</td>\n",
" <td>0.996993</td>\n",
" <td>23:17</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"Better model found at epoch 0 with valid_loss value: 0.006911424454301596.\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# freeze all except the last three parameter groups and finetune\n",
"learn.freeze_to(-3)\n",
"learn.fit_one_cycle(1, lr_max=slice(5e-3/(2.6**4),5e-3), cbs=SaveModelCallback(monitor='valid_loss', fname='awd-lstm-text-classifier-stage-3'))"
],
"metadata": {
"id": "kzbXMWQ2xXgz",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 98
},
"outputId": "51d5d48d-91cb-47f1-9f3a-942c233d9b9c"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>accuracy</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>0.020288</td>\n",
" <td>0.001073</td>\n",
" <td>0.999443</td>\n",
" <td>38:31</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"Better model found at epoch 0 with valid_loss value: 0.0010730033973231912.\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# freeze the whole model and finetune\n",
"learn.load('awd-lstm-text-classifier-stage-3')\n",
"learn.unfreeze()\n",
"learn.fit_one_cycle(2, lr_max=slice(1e-3/(2.6**4),1e-3), cbs=SaveModelCallback(monitor='valid_loss', fname='awd-lstm-text-classifier-stage-4'))"
],
"metadata": {
"id": "RGpeZWEsxmOy",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 147
},
"outputId": "0714d548-7765-441b-ee37-6f2a6d8e2527"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>accuracy</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>0.013614</td>\n",
" <td>0.000811</td>\n",
" <td>0.999889</td>\n",
" <td>05:46</td>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>0.010649</td>\n",
" <td>0.000755</td>\n",
" <td>0.999555</td>\n",
" <td>04:57</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"Better model found at epoch 0 with valid_loss value: 0.0008106339373625815.\n",
"Better model found at epoch 1 with valid_loss value: 0.0007553881732746959.\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"learn = learn.load('awd-lstm-text-classifier-stage-4')\n",
"learn.show_results()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"id": "Jh3QaBZg3N8S",
"outputId": "30a637b1-6bfd-4c79-bdd3-b12785f88289"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
""
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>text</th>\n",
" <th>category</th>\n",
" <th>category_</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>▁xxbos ▁xxup ▁media ▁xxup ▁trip wire ? ▁xxmaj ▁ ping ▁xxmaj ▁p ong ▁xxmaj ▁pizza ▁xxmaj ▁conspiracy ▁xxmaj ▁propel s ▁xxmaj ▁internet ▁xxmaj ▁censorship ▁xxmaj ▁amid ▁‘ fake ▁xxmaj ▁news ’ ▁witch - hunt ▁xxmaj ▁funny ▁how ▁secrets ▁travel . ▁i ▁d ▁start ▁to ▁believe , ▁if ▁i ▁were ▁to ▁bleed . ▁xxmaj ▁lyrics ▁written ▁by ▁xxmaj ▁david ▁xxmaj ▁bowie ▁from ▁the ▁album ▁outside shawn ▁xxmaj ▁helton ▁21 st ▁xxmaj ▁century ▁xxmaj ▁wire ▁xxmaj ▁in ▁the ▁days ▁before ▁the ▁xxup ▁us ▁presidential ▁election ▁in ▁xxmaj ▁november ▁2016, ▁xxmaj ▁wikileaks ▁revealed ▁a ▁new ▁string ▁of ▁emails ▁connected ▁to ▁xxmaj ▁hillary ▁xxmaj ▁clinton ▁s ▁2016 ▁campaign ▁chairman , ▁xxmaj ▁john ▁xxmaj ▁podesta . ▁xxmaj ▁online ▁interpretation s ▁of ▁the ▁leaked ▁xxmaj ▁podesta ▁email ▁exchanges ▁subsequently ▁led ▁to ▁a ▁digital ▁firestorm ▁on ▁social ▁media , ▁producing ▁an ▁intense ▁ conspirator ial ▁open ▁source ▁investigation ▁still ▁in ▁search ▁of ▁its ▁smoking ▁gun . ▁xxmaj</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>▁xxbos ▁xxmaj ▁stephen ▁xxmaj ▁colbert ▁xxmaj ▁gets ▁xxmaj ▁donald ▁xxmaj ▁ rumsfeld ▁xxmaj ▁to ▁xxmaj ▁admit ▁xxmaj ▁the ▁xxmaj ▁iraq ▁xxmaj ▁war ▁xxmaj ▁was ▁xxmaj ▁all ▁a ▁xxmaj ▁lie ▁( video ) ▁xxmaj ▁donald ▁xxmaj ▁ rumsfeld ▁is ▁in ▁full ▁damage ▁control ▁mode ▁after ▁a ▁declassified ▁memo ▁from ▁2002 ▁making ▁the ▁rounds ▁revealed ▁that ▁he ▁lied ▁about ▁xxmaj ▁iraq ▁s ▁wmd s . ▁xxmaj ▁like ▁anyone ▁desperate ▁to ▁sway ▁public ▁opinion ▁and ▁keep ▁himself ▁out ▁of ▁jail , ▁xxmaj ▁ rumsfeld ▁is ▁giving ▁interviews ▁to ▁tell ▁his ▁side . ▁xxmaj ▁why ▁he ▁decided ▁to ▁go ▁xxmaj ▁the ▁xxmaj ▁late ▁xxmaj ▁show ▁with ▁xxmaj ▁stephen ▁xxmaj ▁colbert ▁is ▁unclear . ▁xxmaj ▁colbert ▁is ▁a ▁screaming ▁liberal , ▁very ▁smart ▁and ▁very ▁well - informed . ▁xxmaj ▁perhaps ▁xxmaj ▁ rumsfeld ▁thought ▁he ▁could ▁out man eu ver ▁the ▁comedian ? ▁xxmaj ▁maybe ▁he ▁thought ▁xxmaj ▁colbert ▁would ▁go ▁easy ▁on ▁him</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>▁xxbos ▁xxup ▁year ▁xxup ▁in ▁xxup ▁review : ▁2017 ▁xxmaj ▁top ▁xxmaj ▁ten ▁xxmaj ▁conspiracies ▁xxmaj ▁patrick ▁xxmaj ▁henningsen ▁and ▁xxmaj ▁shawn ▁xxmaj ▁helton ▁21 st ▁xxmaj ▁century ▁wire once ▁again , ▁we ▁ve ▁arrived ▁at ▁our ▁xxmaj ▁new ▁xxmaj ▁years ▁xxmaj ▁eve ▁wrap - up ▁of ▁some ▁of ▁the ▁most ▁compelling ▁and ▁ conspirator ial ▁stories ▁of ▁the ▁year . ▁xxmaj ▁like ▁in ▁years ▁past , ▁2017 ▁presented ▁a ▁polarizing ▁political ▁landscape , ▁further ▁exposing ▁the ▁current ▁establishment ▁paradigm . ▁xxmaj ▁unlike ▁the ▁establishment ▁gatekeeper s , ▁when ▁we ▁use ▁the ▁word ▁conspiracy ▁here , ▁we ▁are ▁talking ▁about ▁a ▁real ▁crime ▁scene . ▁xxmaj ▁whether ▁it ▁was ▁the ▁ousting ▁of ▁thousands ▁of ▁western - backed ▁terrorists ▁in ▁xxmaj ▁iraq ▁and ▁xxmaj ▁syria ▁or ▁a ▁string ▁of ▁known ▁wolf ▁attacks ▁amplified ▁by ▁made - to - order ▁media ▁ag it pro p , ▁or ▁the ▁heavily ▁manufactured ▁xxmaj ▁russia</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>▁xxbos ▁xxmaj ▁hillary ’ s ▁‘ russian ▁xxmaj ▁hack ’ ▁xxmaj ▁hoax : ▁xxmaj ▁the ▁xxmaj ▁biggest ▁xxmaj ▁lie ▁of ▁xxmaj ▁this ▁xxmaj ▁election ▁xxmaj ▁season ▁xxmaj ▁patrick ▁xxmaj ▁henningsen ▁21 st ▁xxmaj ▁century ▁wire the ▁longer ▁this ▁soap ▁opera ▁drags ▁on , ▁it ▁s ▁becoming ▁more ▁and ▁more ▁evident ▁that ▁the ▁xxmaj ▁russian ▁government ▁did ▁not ▁hack ▁into ▁the ▁xxup ▁dnc , ▁and ▁xxmaj ▁moscow ▁is ▁not ▁feeding ▁xxmaj ▁john ▁xxmaj ▁podesta ▁s ▁emails ▁to ▁xxmaj ▁wikileaks . ▁xxmaj ▁for ▁those ▁who ▁are ▁deeply ▁invested ▁in ▁this ▁now ▁official ▁conspiracy ▁theory , ▁however , ▁this ▁might ▁be ▁a ▁hard ▁pill ▁to ▁swallow . ▁xxmaj ▁the ▁xxmaj ▁white ▁xxmaj ▁house ▁and ▁the ▁xxmaj ▁hillary ▁xxmaj ▁clinton ▁campaign ▁are ▁now ▁married ▁to ▁the ▁idea ▁that ▁xxmaj ▁putin ▁is ▁hacking ▁the ▁xxup ▁us ▁elections . ▁xxmaj ▁in ▁response , ▁the ▁xxmaj ▁president ▁is ▁weighing ▁his ▁options ▁tougher ▁economic ▁sanctions , ▁re vo</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>▁xxbos ▁‘ one ▁for ▁the ▁xxmaj ▁ages ’ ▁xxmaj ▁full ▁xxmaj ▁video ▁and ▁xxmaj ▁transcript ▁of ▁xxmaj ▁trump ’ s ▁xxmaj ▁incredible ▁xxup ▁un ▁xxmaj ▁speech ▁[ video ] ▁a ▁speech ▁for ▁the ▁ages ▁was ▁given ▁today ▁by ▁xxmaj ▁president ▁xxmaj ▁donald ▁xxmaj ▁trump . ▁xxmaj ▁he ▁addressed ▁the ▁72 nd ▁meeting ▁of ▁the ▁xxmaj ▁united ▁xxmaj ▁nations ▁xxmaj ▁general ▁xxmaj ▁assembly ▁in ▁xxmaj ▁new ▁xxmaj ▁york ▁for ▁the ▁first ▁time ▁in ▁his ▁presidency . ▁xxmaj ▁the ▁transcript ▁is ▁below . president ▁xxup ▁trump : ▁xxmaj ▁mr . ▁xxmaj ▁secretary ▁xxmaj ▁general , ▁xxmaj ▁mr . ▁xxmaj ▁president , ▁world ▁leaders , ▁and ▁distinguished ▁delegates : ▁xxmaj ▁welcome ▁to ▁xxmaj ▁new ▁xxmaj ▁york . ▁xxmaj ▁it ▁is ▁a ▁profound ▁honor ▁to ▁stand ▁here ▁in ▁my ▁home ▁city , ▁as ▁a ▁representative ▁of ▁the ▁xxmaj ▁american ▁people , ▁to ▁address ▁the ▁people ▁of ▁the ▁world . as ▁millions ▁of ▁our ▁citizens</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>▁xxbos ▁xxup ▁scar s ▁& ▁xxup ▁strife : ▁‘ the ▁xxmaj ▁purge ▁xxmaj ▁election ▁xxmaj ▁year ’ ▁xxmaj ▁ag it pro p , ▁xxmaj ▁change ▁xxmaj ▁agents ▁& ▁xxmaj ▁false ▁left – right ▁xxmaj ▁state craft ▁xxmaj ▁your ▁government ▁thanks ▁you ▁for ▁your ▁participation . ▁xxup ▁psa ▁from ▁xxmaj ▁the ▁xxmaj ▁purge : ▁xxmaj ▁election ▁xxmaj ▁year ▁xxmaj ▁shawn ▁xxmaj ▁helton ▁21 st ▁xxmaj ▁century ▁xxmaj ▁wire ▁a ▁hyper - real ▁vision ▁of ▁xxmaj ▁america ▁serves ▁as ▁a ▁stark ▁backdrop ▁for ▁xxmaj ▁hollywood ▁s ▁social ▁science ▁fiction ▁horror ▁film , ▁xxmaj ▁the ▁xxmaj ▁purge : ▁xxmaj ▁election ▁year . the ▁xxmaj ▁purge : ▁xxmaj ▁election ▁xxmaj ▁year ▁( 2016) ▁is ▁the ▁third ▁installment ▁of ▁the ▁xxmaj ▁purge ▁film ▁franchise , ▁arriving ▁on ▁screen ▁just ▁in ▁time ▁for ▁the ▁hotly ▁contested ▁2016 ▁presidential ▁election ▁between ▁presumptive ▁nominees ▁xxmaj ▁donald ▁xxmaj ▁trump ▁and ▁xxmaj ▁hillary ▁clinton . the ▁film ▁s ▁recent ▁release</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>▁xxbos ▁xxup ▁bush - hi nck ley ▁xxup ▁nexus : ▁xxmaj ▁reagan ▁xxmaj ▁gunman ▁xxmaj ▁released , ▁xxmaj ▁reviving ▁xxmaj ▁conspiracy ▁xxmaj ▁suspicions ▁xxmaj ▁shawn ▁xxmaj ▁helton ▁21 st ▁xxmaj ▁century ▁wire on ▁the ▁eve ▁of ▁the ▁15 th ▁anniversary ▁of ▁the ▁9 ▁/ ▁11 ▁xxmaj ▁attacks , ▁the ▁man ▁implicated ▁in ▁shooting ▁the ▁40 th ▁xxmaj ▁president ▁of ▁the ▁xxmaj ▁united ▁xxmaj ▁states ▁will ▁be ▁released ▁from ▁captivity ▁after ▁35 ▁years . the ▁attempted ▁assassination ▁of ▁xxup ▁us ▁xxmaj ▁president ▁xxmaj ▁ronald ▁xxmaj ▁reagan ▁is ▁one ▁of ▁the ▁most ▁infamous ▁crimes ▁of ▁the ▁20 th ▁century . ▁xxmaj ▁like ▁the ▁assassination ▁of ▁xxup ▁jfk , ▁it ▁was ▁an ▁act ▁that ▁will ▁forever ▁be ▁shroud ed ▁in ▁conspiracy , ▁intrigue ▁and ▁mystery . ▁xxup ▁calculated ▁xxup ▁crime ▁xxmaj ▁photo ▁xxmaj ▁illustration ▁21 wire ▁s ▁xxmaj ▁shawn ▁helton although ▁it ▁s ▁been ▁over ▁three ▁decades ▁since ▁xxmaj ▁john ▁xxmaj ▁hi nck</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>▁xxbos ▁xxmaj ▁fake ▁xxmaj ▁news : ▁xxmaj ▁the ▁xxmaj ▁unravel ling ▁of ▁xxup ▁us ▁xxmaj ▁empire ▁xxmaj ▁from ▁xxmaj ▁within ▁xxmaj ▁setting ▁the ▁xxmaj ▁stage ▁of ▁the ▁press - president ▁war . us ▁ruling ▁ideology ▁and ▁xxmaj ▁washington ▁power ▁have ▁become ▁un s tu ck ▁as ▁never ▁before . ▁a ▁war ▁of ▁opposing ▁ cer t itude s ▁and ▁denunciation s ▁is ▁waged ▁day ▁to ▁day ▁between ▁the ▁long - ruling ▁xxup ▁us ▁corporate ▁media ▁and ▁the ▁xxmaj ▁white ▁xxmaj ▁house . ▁xxmaj ▁both ▁continuously ▁proclaim ▁ring ing ▁recrimination s ▁of ▁the ▁other ▁s ▁fake ▁news ▁ . ▁xxmaj ▁over ▁months ▁they ▁both ▁portray ▁each ▁other ▁as ▁male vol ent ▁liars . ▁xxmaj ▁pro f . ▁xxmaj ▁john ▁mc mur try ▁xxmaj ▁global ▁research us ▁bully ▁pulpit s ▁are ▁now ▁beyond ▁show ▁disagreements ▁and ▁successful ▁media ▁in qui s it ions ▁of ▁the ▁past . ▁xxmaj ▁slander ous ▁accusations ▁long</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>▁xxbos ▁xxmaj ▁hillary ▁xxmaj ▁clinton : ▁xxmaj ▁neocon ▁war - hawk ▁in ▁xxmaj ▁waiting ▁xxmaj ▁robert ▁xxmaj ▁parry ▁xxmaj ▁consortium ▁news if ▁there ▁were ▁any ▁doubts ▁that ▁xxmaj ▁hillary ▁xxmaj ▁clinton ▁favour s ▁a ▁neo - conservative ▁foreign ▁policy , ▁her ▁performance ▁at ▁xxmaj ▁thursday ▁s ▁debate ▁should ▁have ▁laid ▁them ▁to ▁rest . ▁xxmaj ▁in ▁every ▁meaningful ▁sense , ▁she ▁is ▁a ▁neocon ▁and ▁if ▁she ▁becomes ▁xxmaj ▁president ▁xxmaj ▁americans ▁should ▁expect ▁more ▁global ▁tensions ▁and ▁conflicts ▁in ▁pursuit ▁of ▁the ▁ neocons ▁signature ▁goal ▁of ▁regime ▁change ▁in ▁countries ▁that ▁get ▁in ▁their ▁way . beyond ▁sharing ▁this ▁neocon ▁regime ▁change ▁obsession , ▁former ▁xxmaj ▁secretary ▁of ▁xxmaj ▁state ▁xxmaj ▁clinton ▁also ▁talks ▁like ▁a ▁neocon . ▁xxmaj ▁one ▁of ▁their ▁trademark ▁skills ▁is ▁to ▁use ▁propaganda ▁or ▁perception ▁management ▁to ▁demonize ▁their ▁targets ▁and ▁to ▁roman tic ize ▁their ▁allies , ▁what ▁is ▁called ▁ glue</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
]
},
"metadata": {}
}
]
},
{
"cell_type": "markdown",
"source": [
"## Interpretation"
],
"metadata": {
"id": "r0HPiBWI4RkP"
}
},
{
"cell_type": "code",
"source": [
"learn = learn.load('awd-lstm-text-classifier-stage-4')\n",
"interp = get_classification_interpretation(learn)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 17
},
"id": "RqfvXi_t4Tc4",
"outputId": "3074d695-b7f1-4719-82ae-7795ab9de47a"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
""
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"source": [
"# top losses\n",
"plot_top_losses(interp)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"id": "ryJ3QtI24WDn",
"outputId": "fa86669f-521e-4873-b69a-016abbc1de7a"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
""
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>input</th>\n",
" <th>target</th>\n",
" <th>predicted</th>\n",
" <th>probability</th>\n",
" <th>loss</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>▁xxbos ▁xxmaj ▁stephen ▁xxmaj ▁colbert ▁xxmaj ▁gets ▁xxmaj ▁donald ▁xxmaj ▁ rumsfeld ▁xxmaj ▁to ▁xxmaj ▁admit ▁xxmaj ▁the ▁xxmaj ▁iraq ▁xxmaj ▁war ▁xxmaj ▁was ▁xxmaj ▁all ▁a ▁xxmaj ▁lie ▁( video ) ▁xxmaj ▁donald ▁xxmaj ▁ rumsfeld ▁is ▁in ▁full ▁damage ▁control ▁mode ▁after ▁a ▁declassified ▁memo ▁from ▁2002 ▁making ▁the ▁rounds ▁revealed ▁that ▁he ▁lied ▁about ▁xxmaj ▁iraq ▁s ▁wmd s . ▁xxmaj ▁like ▁anyone ▁desperate ▁to ▁sway ▁public ▁opinion ▁and ▁keep ▁himself ▁out ▁of ▁jail , ▁xxmaj ▁ rumsfeld ▁is ▁giving ▁interviews ▁to ▁tell ▁his ▁side . ▁xxmaj ▁why ▁he ▁decided ▁to ▁go ▁xxmaj ▁the ▁xxmaj ▁late ▁xxmaj ▁show ▁with ▁xxmaj ▁stephen ▁xxmaj ▁colbert ▁is ▁unclear . ▁xxmaj ▁colbert ▁is ▁a ▁screaming ▁liberal , ▁very ▁smart ▁and ▁very ▁well - informed . ▁xxmaj ▁perhaps ▁xxmaj ▁ rumsfeld ▁thought ▁he ▁could ▁out man eu ver ▁the ▁comedian ? ▁xxmaj ▁maybe ▁he ▁thought ▁xxmaj ▁colbert ▁would ▁go ▁easy ▁on ▁him</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0.9232470393180847</td>\n",
" <td>2.2531027793884277</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>▁xxbos ▁xxup ▁list ▁xxup ▁of ▁20 ▁“ vetted ” ▁xxmaj ▁refugees ▁xxmaj ▁who ▁xxmaj ▁were ▁xxmaj ▁charged ▁xxmaj ▁with ▁xxmaj ▁terrorism ▁xxmaj ▁after ▁xxmaj ▁entering ▁xxup ▁u . s : ” i ▁want ▁to ▁blow ▁myself ▁up ... i ▁am ▁against ▁xxmaj ▁america ” ▁xxmaj ▁while ▁the ▁lying ▁media ▁is ▁ perpetuating ▁the ▁lie ▁refugees ▁do ▁not ▁pose ▁a ▁terrorist ▁threat , ▁the ▁facts ▁show ▁otherwise . 1) ▁xxmaj ▁on ▁xxmaj ▁may ▁25, ▁2016, ▁in ▁the ▁xxup ▁u . s . ▁xxmaj ▁district ▁xxmaj ▁court ▁for ▁the ▁xxmaj ▁northern ▁xxmaj ▁district ▁of ▁xxmaj ▁texas , ▁xxmaj ▁bila l ▁xxmaj ▁a boo d ▁was ▁sentenced ▁to ▁four ▁years ▁in ▁prison ▁for ▁making ▁a ▁false ▁statement ▁to ▁the ▁xxup ▁fbi . ▁xxmaj ▁a boo d , ▁an ▁xxmaj ▁iraqi ▁translator ▁for ▁the ▁xxup ▁u . s . ▁military , ▁was ▁admitted ▁to ▁the ▁xxmaj ▁united ▁xxmaj ▁states ▁through ▁the ▁xxmaj ▁special ▁xxmaj</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0.6532513499259949</td>\n",
" <td>2.2531027793884277</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>▁xxbos ▁xxup ▁hillary ▁xxup ▁set ▁xxup ▁to ▁xxup ▁destroy ▁xxup ▁lives ▁xxmaj ▁of ▁xxmaj ▁proud , ▁hard - working , ▁xxmaj ▁black ▁xxmaj ▁coal ▁xxmaj ▁miners ▁xxmaj ▁to ▁xxmaj ▁satisfy ▁xxmaj ▁mostly ▁xxmaj ▁white ▁xxmaj ▁environmental ▁xxmaj ▁activists ▁[ video ] ▁xxmaj ▁stealing ▁xxmaj ▁jobs ▁xxmaj ▁from ▁xxmaj ▁minorities ▁xxmaj ▁to ▁xxmaj ▁satisfy ▁xxmaj ▁white ▁xxmaj ▁ environmentalist s ▁xxmaj ▁is ▁xxmaj ▁the ▁xxmaj ▁worst ▁xxmaj ▁kind ▁xxmaj ▁of ▁xxmaj ▁racism ▁xxmaj ▁it ▁s ▁always ▁about ▁the ▁money ▁for ▁xxmaj ▁hillary . ▁a ▁xxmaj ▁university ▁of ▁xxmaj ▁michigan ▁survey ▁in ▁xxmaj ▁may ▁found ▁that ▁leaders ▁of ▁environmental ▁groups ▁are ▁overwhelmingly ▁white ▁males , ▁with ▁ethnic ▁minorities ▁occupying ▁fewer ▁than ▁12% ▁of ▁leadership ▁positions . the ▁environmental ▁groups ▁that ▁are ▁calling ▁for ▁sweeping ▁changes ▁to ▁the ▁economy ▁moving ▁away ▁from ▁oil ▁and ▁coal ▁to ▁carbon - free ▁sources ▁of ▁energy ▁seem ▁incapable ▁of ▁making ▁a ▁transition ▁themselves . ▁xxmaj ▁these ▁almost</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0.9921080470085144</td>\n",
" <td>1.0165505409240723</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>▁xxbos ▁xxup ▁delegates ▁xxup ▁for ▁xxup ▁dummies : ▁xxmaj ▁how ▁xxmaj ▁they ’ re ▁awarded ... and ▁xxmaj ▁how ▁xxmaj ▁many ▁xxmaj ▁your ▁xxmaj ▁candidate ▁xxmaj ▁needs ▁xxmaj ▁to ▁xxmaj ▁win ▁[ video ] ▁xxmaj ▁stop ▁counting ▁the ▁votes ! ▁xxmaj ▁your ▁candidates ▁nomination ▁based ▁strictly ▁on ▁the ▁number ▁of ▁delegates ▁they ▁are ▁able ▁to ▁obtain ▁from ▁each ▁state ▁following ▁their ▁elections . watch ▁this ▁great ▁video ▁explaining ▁how ▁xxmaj ▁hillary ▁can ▁receive ▁less ▁votes , ▁but ▁still ▁win ▁with ▁super ▁delegates : the ▁nominating ▁contests ▁that ▁will ▁determine ▁the ▁xxmaj ▁democratic ▁and ▁xxmaj ▁republican ▁nominees ▁for ▁the ▁xxmaj ▁nov . ▁8 ▁xxup ▁u . s . ▁presidential ▁election ▁are ▁about ▁to ▁enter ▁a ▁critical ▁phase . ▁xxmaj ▁on ▁xxmaj ▁march ▁1, ▁known ▁as ▁xxmaj ▁super ▁xxmaj ▁tuesday , ▁primaries ▁or ▁caucuses ▁are ▁being ▁held ▁in ▁about ▁a ▁dozen ▁states , ▁and ▁they ▁could ▁be ▁turning ▁points ▁in ▁both ▁parties</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0.9738444089889526</td>\n",
" <td>0.7605207562446594</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>▁xxbos ▁xxup ▁priorities : ▁# ▁ blacklivesmatter ▁xxmaj ▁terrorists ▁xxmaj ▁protest ▁xxmaj ▁cops ▁xxmaj ▁in ▁gun - free ▁xxmaj ▁chicago , ▁xxmaj ▁while ▁xxmaj ▁ignoring ▁6 ▁xxmaj ▁murders , ▁21 people ▁xxmaj ▁shot ▁xxmaj ▁over ▁xxmaj ▁christmas ▁xxmaj ▁weekend ▁xxmaj ▁the ▁xxmaj ▁december ▁tally ▁in ▁xxmaj ▁chicago ▁( so ▁far ) ▁is : ▁xxmaj ▁december ▁to ▁xxmaj ▁date ▁xxmaj ▁shot ▁& ▁xxmaj ▁killed : ▁29 ▁xxmaj ▁shot ▁& ▁xxmaj ▁wounded : ▁18 9 ▁xxmaj ▁total ▁xxmaj ▁shot : ▁ 218 ▁xxmaj ▁total ▁xxmaj ▁homicides : ▁31 six ▁men ▁were ▁killed ▁and ▁at ▁least ▁21 ▁other ▁people ▁have ▁been ▁wounded ▁in ▁shootings ▁across ▁xxmaj ▁chicago ▁over ▁the ▁holiday ▁weekend . ▁xxmaj ▁the ▁latest ▁homicide ▁happened ▁early ▁xxmaj ▁sunday ▁in ▁the ▁xxmaj ▁en gle wood ▁neighborhood ▁on ▁the ▁xxmaj ▁south ▁side . about ▁2 :15 ▁a . m . , ▁29- year - old ▁xxmaj ▁ ty ree ▁xxmaj ▁white ▁was ▁outside</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0.995866060256958</td>\n",
" <td>0.08030933141708374</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>▁xxbos ▁xxup ▁russia ▁xxup ▁hits ▁xxup ▁obama ... hard : ▁“ we ▁are ▁reaching ▁a ▁really ▁terrifying ▁conclusion ▁for ▁the ▁whole ▁world : ▁xxmaj ▁that ▁the ▁xxmaj ▁white ▁xxmaj ▁house ▁is ▁defending ▁xxmaj ▁islamic ▁xxmaj ▁state . ▁u . s . - led ▁coalition ▁air ▁strikes ▁killed ▁dozens ▁of ▁xxmaj ▁syrian ▁soldiers ▁on ▁xxmaj ▁saturday , ▁endangering ▁a ▁u . s . - russian ▁ceasefire ▁and ▁prompting ▁an ▁emergency ▁xxup ▁u . n . ▁xxmaj ▁security ▁xxmaj ▁council ▁meeting ▁as ▁tensions ▁between ▁xxmaj ▁moscow ▁and ▁xxmaj ▁washington ▁escalated . just ▁a ▁few ▁days ▁ago ▁it ▁was ▁reported ▁that ▁xxmaj ▁putin ▁felt ▁that ▁if ▁anything ▁happened ▁to ▁damage ▁the ▁tentative ▁ceasefire ▁agreement ▁that ▁it ▁would ▁be ▁xxmaj ▁obama ▁s ▁fault . ▁xxmaj ▁seems ▁he ▁was ▁right . reuters ▁reported : the ▁xxmaj ▁united ▁xxmaj ▁states ▁military ▁said ▁the ▁coalition ▁stopped ▁the ▁attacks ▁against ▁what ▁it ▁had ▁believed ▁to ▁be ▁xxmaj ▁islamic</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0.9458513259887695</td>\n",
" <td>0.05556420981884003</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>▁xxbos ▁xxup ▁voting ▁xxup ▁machines ▁xxup ▁stolen ▁xxmaj ▁in ▁xxmaj ▁controversial ▁xxup ▁ga ▁xxmaj ▁election ▁xxmaj ▁where ▁xxmaj ▁dems ▁xxmaj ▁hope ▁xxmaj ▁to ▁xxmaj ▁embarrass ▁xxmaj ▁trump ▁xxmaj ▁with ▁30- yr ▁xxmaj ▁old ▁xxmaj ▁jon ▁xxmaj ▁ossoff ▁xxmaj ▁win ▁xxup ▁sandy ▁xxup ▁springs , ▁xxmaj ▁ga . , ▁xxmaj ▁april ▁18 ▁( reuters ) ▁xxmaj ▁for ▁xxup ▁u . s . ▁xxmaj ▁president ▁xxmaj ▁donald ▁xxmaj ▁trump , ▁an ▁off - year ▁congressional ▁election ▁on ▁xxmaj ▁tuesday ▁in ▁the ▁reliably ▁xxmaj ▁republican ▁northern ▁suburbs ▁of ▁xxmaj ▁atlanta ▁could ▁spell ▁trouble ▁if ▁xxmaj ▁democratic ▁up start ▁xxmaj ▁jon ▁xxmaj ▁ossoff ▁pulls ▁off ▁a ▁surprise ▁victory . watch ▁xxup ▁msnbc ▁xxmaj ▁morning ▁xxmaj ▁joe ▁show ▁hosts ▁and ▁guest ▁attempt ▁to ▁contain ▁their ▁excitement ▁over ▁the ▁possibility ▁of ▁a ▁xxmaj ▁democrat ▁winning ▁the ▁seat ▁of ▁former ▁xxmaj ▁house ▁xxmaj ▁leader ▁xxmaj ▁newt ▁xxmaj ▁gingrich ▁and ▁now , ▁in ▁a ▁special ▁election ▁they ▁are</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0.5126925706863403</td>\n",
" <td>0.02645277790725231</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>▁xxbos ▁xxup ▁voting ▁xxup ▁machines ▁xxup ▁stolen ▁xxmaj ▁in ▁xxmaj ▁controversial ▁xxup ▁ga ▁xxmaj ▁election ▁xxmaj ▁where ▁xxmaj ▁dems ▁xxmaj ▁hope ▁xxmaj ▁to ▁xxmaj ▁embarrass ▁xxmaj ▁trump ▁xxmaj ▁with ▁30- yr ▁xxmaj ▁old ▁xxmaj ▁jon ▁xxmaj ▁ossoff ▁xxmaj ▁win ▁xxup ▁sandy ▁xxup ▁springs , ▁xxmaj ▁ga . , ▁xxmaj ▁april ▁18 ▁( reuters ) ▁xxmaj ▁for ▁xxup ▁u . s . ▁xxmaj ▁president ▁xxmaj ▁donald ▁xxmaj ▁trump , ▁an ▁off - year ▁congressional ▁election ▁on ▁xxmaj ▁tuesday ▁in ▁the ▁reliably ▁xxmaj ▁republican ▁northern ▁suburbs ▁of ▁xxmaj ▁atlanta ▁could ▁spell ▁trouble ▁if ▁xxmaj ▁democratic ▁up start ▁xxmaj ▁jon ▁xxmaj ▁ossoff ▁pulls ▁off ▁a ▁surprise ▁victory . watch ▁xxup ▁msnbc ▁xxmaj ▁morning ▁xxmaj ▁joe ▁show ▁hosts ▁and ▁guest ▁attempt ▁to ▁contain ▁their ▁excitement ▁over ▁the ▁possibility ▁of ▁a ▁xxmaj ▁democrat ▁winning ▁the ▁seat ▁of ▁former ▁xxmaj ▁house ▁xxmaj ▁leader ▁xxmaj ▁newt ▁xxmaj ▁gingrich ▁and ▁now , ▁in ▁a ▁special ▁election ▁they ▁are</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0.5126925706863403</td>\n",
" <td>0.01297942828387022</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>▁xxbos ▁xxmaj ▁factbox : ▁xxmaj ▁trump ▁xxmaj ▁supreme ▁xxmaj ▁court ▁appointee ▁to ▁affect ▁pending ▁cases ▁xxmaj ▁neil ▁xxmaj ▁gorsuch , ▁xxmaj ▁president ▁xxmaj ▁donald ▁xxmaj ▁trump ’ s ▁appointee ▁to ▁the ▁xxup ▁u . s . ▁xxmaj ▁supreme ▁xxmaj ▁court ▁who ▁was ▁confirmed ▁by ▁the ▁xxmaj ▁senate ▁to ▁the ▁lifetime ▁job ▁on ▁xxmaj ▁friday ▁in ▁a ▁54- 45 ▁vote , ▁will ▁have ▁an ▁immediate ▁impact ▁on ▁cases ▁already ▁pending ▁before ▁the ▁justices . ▁xxmaj ▁the ▁nine - seat ▁court ▁has ▁operated ▁with ▁only ▁eight ▁justices ▁after ▁the ▁death ▁of ▁conservative ▁xxmaj ▁antonin ▁xxmaj ▁scalia ▁on ▁xxmaj ▁feb . ▁13, ▁2016, ▁with ▁four ▁liberals ▁and ▁four ▁conservatives . ▁xxmaj ▁gorsuch ’ s ▁confirmation ▁restore s ▁a ▁ 5-4 ▁conservative ▁majority . ▁xxmaj ▁the ▁new ▁justice ▁could ▁cast ▁the ▁deciding ▁vote ▁in ▁new ▁cases ▁before ▁the ▁court ▁as ▁well ▁as ▁some ▁cases ▁already ▁argued ▁during ▁the ▁current ▁term ▁that ▁ends ▁in ▁xxmaj</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0.532880961894989</td>\n",
" <td>0.011710472404956818</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"source": [
"# classification report\n",
"print_classification_report(interp)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 173
},
"id": "KW88vFbgAy1W",
"outputId": "3d040863-1fe9-4ecc-c51b-ca330e786436"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
""
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
" precision recall f1-score support\n",
"\n",
" 0 1.00 1.00 1.00 4284\n",
" 1 1.00 1.00 1.00 4696\n",
"\n",
" accuracy 1.00 8980\n",
" macro avg 1.00 1.00 1.00 8980\n",
"weighted avg 1.00 1.00 1.00 8980\n",
"\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# confusion matrix\n",
"plot_confusion_matrix(interp, figsize=(12, 12))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 743
},
"id": "mpjM3k5a4dIN",
"outputId": "3da6ded3-9345-4a01-d2e2-0138f7441172"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
""
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<Figure size 720x720 with 1 Axes>"
],
"image/png": "iVBORw0KGgo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QZP7k+e8mOS/J4ychvnCyfUVVbZXkF0ketP4OFWDjJJIBNhCTs8CvSfKZqlqZmQA+OMnfJPk/Sf5fkp+u4T2vSPK5qvpFknckOSXJ66pqSZI/TfK+JKdV1Yok30jyoiSvTPK5JN9P8sM5ODyAjYoPEwEAgMbdLQAAoBHJAADQiGQAAGhEMgAANCIZAAAakQwAAI1IBgCA5v8DOXF6lI/ylZUAAAAASUVORK5CYII=\n"
},
"metadata": {
"needs_background": "light"
}
}
]
},
{
"cell_type": "markdown",
"source": [
"## Examples of Misclassified labels"
],
"metadata": {
"id": "ot3O26boHSEk"
}
},
{
"cell_type": "markdown",
"source": [
"Factbox: Trump Supreme Court appointee to affect pending cases\n",
"\n",
"Neil Gorsuch, President Donald Trump’s appointee to the U.S. Supreme Court who was confirmed by the Senate to the lifetime job on Friday in a 54-45 vote, will have an immediate impact on cases already pending before the justices. The nine-seat court has operated with only eight justices after the death of conservative Antonin Scalia on Feb. 13, 2016, with four liberals and four conservatives. Gorsuch’s confirmation restores a 5-4 conservative majority. The new justice could cast the deciding vote in new cases before the court as well as some cases already argued during the current term that ends in June. The court could decide to hear fresh arguments in cases in which they otherwise would be split 4-4. Here is a list of five such cases in which Gorsuch could be pivotal. Religious rights: Trinity Lutheran Church v. Comer A case from Missouri to be argued on April 19 in which a church contends the state violated the U.S. Constitution’s First Amendment guarantee of religious freedom by denying it funds for a playground project because of a state ban on aid to religious organizations. Employee class-action lawsuits: Epic Systems Corp v. Lewis A significant case for business and labor on whether companies can head off costly class-action lawsuits by forcing employees to give up their right to pursue work-related legal claims as a group in court. An issue that has divided the court in the past, this case is set to be argued in the next term, which starts in October. Housing discrimination: Bank of America v. Miami The eight-justice court appeared closely divided when it heard arguments on Nov. 8 on whether the city of Miami could pursue lawsuits accusing major banks of predatory mortgage lending to black and Hispanic home buyers. The court may need to reargue the case with Gorsuch on board to avoid a 4-4 split. Cross-border shooting: Hernandez v. Mesa A 4-4 split appeared possible when the court heard arguments in this civil rights case on Feb. 21. The court has been asked to revive a civil rights lawsuit filed by the family of a Mexican teenager against a U.S. Border Patrol agent who fatally shot the 15-year-old from across the border in Texas in 2010. Corporate liability: Jesner v. Arab Bank In a case to be heard next term, the court agreed on Monday to consider reviving litigation that seeks to hold Arab Bank Plc ARBK.AM financially liable for militant attacks in Israel and the Palestinian territories and accuses the Jordan-based bank of being the “paymaster” to militant groups. The question of whether companies can be held liable for actions overseas under a federal law called the Alien Tort Statute is one the court also took up in 2013 but failed to decide.\n",
"\n",
"\n",
"- **Category**: politicsNews\n",
"- **Date**: April 7, 2017\n",
"- **Target** : Not Fake News\n",
"- **Prediction** : Fake News"
],
"metadata": {
"id": "OHdYBsFGHZ74"
}
},
{
"cell_type": "markdown",
"source": [
"# ROC curve"
],
"metadata": {
"id": "x48sYX_gALT1"
}
},
{
"cell_type": "code",
"source": [
"preds, y, loss = learn.get_preds(with_loss=True)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 17
},
"id": "0S3OTvrMAMq0",
"outputId": "7544b465-e94b-44d1-860e-74e1a1abe4fd"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
""
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"source": [
"probs = np.exp(preds[:, 1])\n",
"\n",
"# compute ROC curve\n",
"fpr, tpr, thresholds = roc_curve(y, probs, pos_label=1)\n",
"roc_auc = auc(fpr, tpr)\n",
"\n",
"print('ROC are is {}'.format(roc_auc))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "j0q5BFruAXfH",
"outputId": "40e71c84-e3ad-45f1-dbfa-dfb03fe240b0"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"ROC are is 0.9999998508773185\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"plt.figure()\n",
"plt.plot(fpr, tpr, color='darkorange', label='ROC curve (area = %0.2f)' % roc_auc)\n",
"plt.plot([0, 1], [0, 1], color='navy', linestyle='--')\n",
"plt.xlim([-0.01, 1.0])\n",
"plt.ylim([0.0, 1.01])\n",
"plt.xlabel('False Positive Rate')\n",
"plt.ylabel('True Positive Rate')\n",
"plt.title('Receiver operating characteristic')\n",
"plt.legend(loc=\"lower right\")"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 312
},
"id": "tPfpLqIGBArH",
"outputId": "e5f2f110-4cce-46fe-88f0-09336baaf524"
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x7f6f3c5d5490>"
]
},
"metadata": {},
"execution_count": 30
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
],
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEWCAYAAAB42tAoAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3deZxN9f/A8dfbWGYwY5dlRCGMPYOkpJBka1GWNjUSkm/7ooWoflqkkiUi2ggVQztRKtvIvktiZMu+mzHv3x/nzHQbM3cu5t47y/v5eNzH3HPP9j5nZu77fj6fc99HVBVjjDEmPXmCHYAxxpiszRKFMcYYryxRGGOM8coShTHGGK8sURhjjPHKEoUxxhivLFGY8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JSUksXLiQ0NBQr8fmue3nn3+ea6+9li+//JKtW7fSvHnzNPepqnz++edUq1btP9sbOHAgF110EStWrCApKSndfWd2i6J8+fLEx8enTMfHx1O+fHkALrroInbu3EnZsmXZuXMnpUv/e8vk5C62QMi1He/Hjp3m4Ye/5cor/y3iV7lycUsSJkcqWLAg77zzDkOHDiUxMZE77riDX375hdmzZwNOy6Nfv348+eSTADzxxBO88sorKZ+qk5KSGD169FnbbdWqVcoAOfzb9XTRRRexbt06kpKS+PLLL9ONS0S4+eabefTRR6lRowYlSpQA4Prrr2f48OEpyy1ffvb4To0aNdi8eXPK9KFDh1LeYCdMmJDuPlu3bs3w4cNTrixatmxZyvply5YlT548fPTRR5w5cybN9efPn8/y5cvPepxPkgAoW7YsERERLFy4EFXlww8/pGPHjgB06NCBiRMnAjBx4sSU1wE2btz4n643f8qViWL27C3UqjWKt99eRJ8+DRk0yIr4mZyvfv361KlTh0mTJhEWFsaMGTN46aWXqFatGrVr16Zhw4b07dsXgDp16vDWW2/RtWtXatSoQa1atdiyZctZ23zuuec4cOAAtWrVom7dusydOxdwrtZp164dV155ZUofe3o6d+7Mxx9/nNLtBPDOO+8QFxdHnTp1iIqKSjNJVa9enUOHDqV8un/yySd55plnqF+/vterm55//nkSEhKoU6cONWvW5PnnnwegT58+TJw4kbp167J+/fr/tELO15IlS4iMjGTq1Kk88MAD1KxZM2VevXr1Up6PHDmSHj16UKVKFSpXrkybNm0AePrpp/nhhx+oWrUqs2fP5umnn05ZZ+7cubRt2/aCY/SFeF43nR1ER0drXFwcfNbceaHzvHNaP7mIX9WqxRk3rgNXX10x02M0BmDdunXUqFEj2GHkaMOGDSM8PJwePXoEO5SA2r17N926dWPOnDlpzk/rb09Elqpq9PnsL9eMURw/nkDBgvno0KEaf/99hP79r7b6TMZkc71792bq1KnBDiPgtm3bxtChQwO2vxyfKHbvPspDD33D3r3H+fHHuylfPoLBg68LdljGmEwQGhrKXXfdFewwAq5hw4YB3V+OHaNwBoVWUKPGCG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