File size: 163,358 Bytes
2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 2fb2dc0 7552785 479eb9c 7552785 2fb2dc0 |
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 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import os; os.chdir('..')"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>gpt3_text</th>\n",
" <th>wiki_bio_text</th>\n",
" <th>gpt3_sentences</th>\n",
" <th>annotation</th>\n",
" <th>wiki_bio_test_idx</th>\n",
" <th>gpt3_text_samples</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>John Russell Reynolds (1820–1876) was an Engli...</td>\n",
" <td>Sir John Russell Reynolds, 1st Baronet (22 May...</td>\n",
" <td>['John Russell Reynolds (1820–1876) was an Eng...</td>\n",
" <td>['major_inaccurate' 'major_inaccurate' 'major_...</td>\n",
" <td>62464</td>\n",
" <td>['John Russell Reynolds (1 November 1829 – 11...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Matthew Aylmer, 1st Baron Aylmer (1708–1794) w...</td>\n",
" <td>Admiral of the Fleet Matthew Aylmer, 1st Baron...</td>\n",
" <td>['Matthew Aylmer, 1st Baron Aylmer (1708–1794)...</td>\n",
" <td>['minor_inaccurate' 'minor_inaccurate' 'minor_...</td>\n",
" <td>49661</td>\n",
" <td>['\"Matthew Aylmer, 1st Baron Aylmer (c. 1650–1...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Rick Mahler (born Richard Alan Mahler on April...</td>\n",
" <td>Richard Keith Mahler (August 5, 1953 in Austin...</td>\n",
" <td>['Rick Mahler (born Richard Alan Mahler on Apr...</td>\n",
" <td>['minor_inaccurate' 'minor_inaccurate' 'accura...</td>\n",
" <td>20483</td>\n",
" <td>['Rick Mahler (January 8, 1956 – May 25, 2005)...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>James Blair (1732–1782) was an American lawyer...</td>\n",
" <td>James Blair (September 26, 1786 - April 1, 183...</td>\n",
" <td>['James Blair (1732–1782) was an American lawy...</td>\n",
" <td>['minor_inaccurate' 'major_inaccurate' 'major_...</td>\n",
" <td>71174</td>\n",
" <td>['James Blair (April 2, 1755 – March 8, 1842) ...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Tim Finchem (born August 24, 1947) is an Ameri...</td>\n",
" <td>Timothy W. Finchem (born April 19, 1947) is th...</td>\n",
" <td>['Tim Finchem (born August 24, 1947) is an Ame...</td>\n",
" <td>['minor_inaccurate' 'accurate' 'major_inaccura...</td>\n",
" <td>39945</td>\n",
" <td>['\"Tim Finchem (born May 27, 1953) is an Ameri...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" gpt3_text \\\n",
"0 John Russell Reynolds (1820–1876) was an Engli... \n",
"1 Matthew Aylmer, 1st Baron Aylmer (1708–1794) w... \n",
"2 Rick Mahler (born Richard Alan Mahler on April... \n",
"3 James Blair (1732–1782) was an American lawyer... \n",
"4 Tim Finchem (born August 24, 1947) is an Ameri... \n",
"\n",
" wiki_bio_text \\\n",
"0 Sir John Russell Reynolds, 1st Baronet (22 May... \n",
"1 Admiral of the Fleet Matthew Aylmer, 1st Baron... \n",
"2 Richard Keith Mahler (August 5, 1953 in Austin... \n",
"3 James Blair (September 26, 1786 - April 1, 183... \n",
"4 Timothy W. Finchem (born April 19, 1947) is th... \n",
"\n",
" gpt3_sentences \\\n",
"0 ['John Russell Reynolds (1820–1876) was an Eng... \n",
"1 ['Matthew Aylmer, 1st Baron Aylmer (1708–1794)... \n",
"2 ['Rick Mahler (born Richard Alan Mahler on Apr... \n",
"3 ['James Blair (1732–1782) was an American lawy... \n",
"4 ['Tim Finchem (born August 24, 1947) is an Ame... \n",
"\n",
" annotation wiki_bio_test_idx \\\n",
"0 ['major_inaccurate' 'major_inaccurate' 'major_... 62464 \n",
"1 ['minor_inaccurate' 'minor_inaccurate' 'minor_... 49661 \n",
"2 ['minor_inaccurate' 'minor_inaccurate' 'accura... 20483 \n",
"3 ['minor_inaccurate' 'major_inaccurate' 'major_... 71174 \n",
"4 ['minor_inaccurate' 'accurate' 'major_inaccura... 39945 \n",
"\n",
" gpt3_text_samples \n",
"0 ['John Russell Reynolds (1 November 1829 – 11... \n",
"1 ['\"Matthew Aylmer, 1st Baron Aylmer (c. 1650–1... \n",
"2 ['Rick Mahler (January 8, 1956 – May 25, 2005)... \n",
"3 ['James Blair (April 2, 1755 – March 8, 1842) ... \n",
"4 ['\"Tim Finchem (born May 27, 1953) is an Ameri... "
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"\n",
"df= pd.read_csv(\"data/original_data_gpt3.csv\")\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Paragraph</th>\n",
" <th>AI_generated</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Sir John Russell Reynolds, 1st Baronet (22 May...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Admiral of the Fleet Matthew Aylmer, 1st Baron...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Richard Keith Mahler (August 5, 1953 in Austin...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>James Blair (September 26, 1786 - April 1, 183...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Timothy W. Finchem (born April 19, 1947) is th...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>233</th>\n",
" <td>Baba Gündüz Kılıç (1918-1980) was a Turkish fo...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>234</th>\n",
" <td>Michael Replogle is an internationally recogni...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>235</th>\n",
" <td>William John Burke (Polonized as Burkeauskas; ...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>236</th>\n",
" <td>Ted Childs commenced training as a programme d...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>237</th>\n",
" <td>Edward Synge (1659–1741) was an Anglican clerg...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>238 rows × 2 columns</p>\n",
"</div>"
],
"text/plain": [
" Paragraph AI_generated\n",
"0 Sir John Russell Reynolds, 1st Baronet (22 May... 0\n",
"1 Admiral of the Fleet Matthew Aylmer, 1st Baron... 0\n",
"2 Richard Keith Mahler (August 5, 1953 in Austin... 0\n",
"3 James Blair (September 26, 1786 - April 1, 183... 0\n",
"4 Timothy W. Finchem (born April 19, 1947) is th... 0\n",
".. ... ...\n",
"233 Baba Gündüz Kılıç (1918-1980) was a Turkish fo... 0\n",
"234 Michael Replogle is an internationally recogni... 0\n",
"235 William John Burke (Polonized as Burkeauskas; ... 0\n",
"236 Ted Childs commenced training as a programme d... 0\n",
"237 Edward Synge (1659–1741) was an Anglican clerg... 0\n",
"\n",
"[238 rows x 2 columns]"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"new_df_human= pd.DataFrame({\n",
" \"Paragraph\": df.wiki_bio_text, \n",
" \"AI_generated\": pd.Series([0]*len(df))\n",
" \n",
" }\n",
")\n",
"new_df_human"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Paragraph</th>\n",
" <th>AI_generated</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>John Russell Reynolds (1820–1876) was an Engli...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Matthew Aylmer, 1st Baron Aylmer (1708–1794) w...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Rick Mahler (born Richard Alan Mahler on April...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>James Blair (1732–1782) was an American lawyer...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Tim Finchem (born August 24, 1947) is an Ameri...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>233</th>\n",
" <td>Gündüz Kılıç (born 28 April 1988) is a Turkish...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>234</th>\n",
" <td>Michael Replogle (born 1951) is an American en...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>235</th>\n",
" <td>Billy Burke (born October 28, 1894 – died Apri...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>236</th>\n",
" <td>Ted Childs (born October 15, 1956) is an Ameri...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>237</th>\n",
" <td>Edward Synge (1714–1798) was an Irish Anglican...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>238 rows × 2 columns</p>\n",
"</div>"
],
"text/plain": [
" Paragraph AI_generated\n",
"0 John Russell Reynolds (1820–1876) was an Engli... 1\n",
"1 Matthew Aylmer, 1st Baron Aylmer (1708–1794) w... 1\n",
"2 Rick Mahler (born Richard Alan Mahler on April... 1\n",
"3 James Blair (1732–1782) was an American lawyer... 1\n",
"4 Tim Finchem (born August 24, 1947) is an Ameri... 1\n",
".. ... ...\n",
"233 Gündüz Kılıç (born 28 April 1988) is a Turkish... 1\n",
"234 Michael Replogle (born 1951) is an American en... 1\n",
"235 Billy Burke (born October 28, 1894 – died Apri... 1\n",
"236 Ted Childs (born October 15, 1956) is an Ameri... 1\n",
"237 Edward Synge (1714–1798) was an Irish Anglican... 1\n",
"\n",
"[238 rows x 2 columns]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"new_df_ai= pd.DataFrame({\n",
" \"Paragraph\": df.gpt3_text, \n",
" \"AI_generated\": pd.Series([1]*len(df))\n",
" \n",
" }\n",
")\n",
"new_df_ai"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\"John Russell Reynolds (1820–1876) was an English lawyer, judge, and author. He was born in London, the son of a barrister, and was educated at Eton College and Trinity College, Cambridge. He was called to the bar in 1845, and became a Queen's Counsel in 1859. He was appointed a judge of the Court of Common Pleas in 1867, and was knighted in 1871.\\n\\nReynolds was a prolific author, writing on a wide range of topics. He wrote several books on legal topics, including The Law of Libel and Slander (1863), The Law of Copyright (1865), and The Law of Patents for Inventions (1868). He also wrote on a variety of other topics, including history, biography, and literature. He was a frequent contributor to the Saturday Review, and wrote several books on Shakespeare, including The Mystery of William Shakespeare (1848) and The Authorship of Shakespeare (1875). He also wrote a biography of the poet John Keats (1848).\""
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"new_df_ai.Paragraph.values[0]"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'Sir John Russell Reynolds, 1st Baronet (22 May 1828 – 29 May 1896) was a British neurologist and physician. Reynolds was born in Romsey, Hampshire, as the son of John Reynolds, an independent minister, and the grandson of Dr. Henry Revell Reynolds. He received general education from his father, and was educated in his profession at University College, London, where he obtained three gold medals in the medical school. In 1851, he graduated M.B. in the University of London, and obtained a scholarship and gold medal in medicine. In 1852, he took the degree of M.D., and began practice in Leeds. He soon after moved to London, and took a house, 38 Grosvenor Street, in which Dr. Marshall Hall had lived. Hall announced to his patients in a printed circular that Reynolds had succeeded him in practice. Such procedure was contrary to a recognised understanding among physicians, and Hall incurred the censure of the College of Physicians. Reynolds, who was ignorant of Hall\\'s intention, was in no way responsible for the circular, and was in no way involved in the censure. He was duly elected a Fellow of the College in 1859. In the same year, he was appointed Assistant Physician to University College Hospital, to which he continued attached throughout life. He had before been, in 1855, Assistant Physician to the Hospital for Sick Children, and in 1857 Assistant Physician to the Westminster Hospital. In 1865, he became Professor of the Principles and Practice of Medicine at University College, and in 1878 he was appointed Physician-in-Ordinary to the Queen\\'s Household. He gained a considerable practice as a physician, and was often consulted in difficult cases of nervous disease. In 1869, he was elected a Fellow of the Royal Society, and in 1883 Vice-President of the Royal Medical and Chirurgical Society. He delivered the Lumleian Lecture at the College of Physicians in 1867, the Harveian Oration in 1884, and was elected President in 1893, on the death of Sir Andrew Clark. He was re-elected in 1894 and 1895, and on 1 January in the latter year was created a Baronet. In the winter of 1895–96, he became too ill to offer himself for re-election as President of the College of Physicians. He died at his house in Grosvenor Street, London, after several weeks of illness of a pulmonary congestion, on 29 May 1896. He was married, first, to Miss Ainslie, and, secondly, to Frances, widow of C. J. C. Crespigny, but left no children. The \"Reynolds Baronetcy\", of Grosvenor Street, was created in the Baronetage of the United Kingdom on 28 February 1895 for John Russell Reynolds. The title became extinct on his death. Reynolds devoted himself from an early period to the study of nervous diseases, and in 1854 published an \"Essay on Vertigo\"; in 1855 \"Diagnosis of Diseases of the Brain, Spinal Cord, and Nerves\", as well as \"Tables for the Diagnosis of Diseases of the Brain\"; in 1861 a treatise on epilepsy; in 1871 \"Lectures on the Clinical Uses of Electricity\"; in 1872 \"The Scientific Value of the Legal Tests of Insanity\"; besides many papers in medical periodicals and the transactions of medical societies, and several addresses to medical associations. His writings on nervous diseases were useful contributions to a department of medicine in which much work remained undone, but in the flood of modern observations they have been submerged. He will chiefly be remembered among physicians as the editor of the \"System of Medicine\", in five volumes, published from 1866 to 1879, a collection of essays on diseases, written by the most competent men who could be induced to write – compositions of varying merit, but generally of high value. He himself wrote the parts on erysipelas, on inflammation of the lymphatics, and on several forms of nervous disease. He published in 1893 a \"Life of Dr. Walter Hayle Walshe\". Reynolds was a tall man, with dark hair, with a dignified delivery and some oratorical power. Reynolds died in London.'"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"new_df_human.Paragraph.values[0]\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Paragraph</th>\n",
" <th>AI_generated</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>John Russell Reynolds (1820–1876) was an Engli...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Matthew Aylmer, 1st Baron Aylmer (1708–1794) w...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Rick Mahler (born Richard Alan Mahler on April...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>James Blair (1732–1782) was an American lawyer...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Tim Finchem (born August 24, 1947) is an Ameri...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>233</th>\n",
" <td>Baba Gündüz Kılıç (1918-1980) was a Turkish fo...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>234</th>\n",
" <td>Michael Replogle is an internationally recogni...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>235</th>\n",
" <td>William John Burke (Polonized as Burkeauskas; ...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>236</th>\n",
" <td>Ted Childs commenced training as a programme d...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>237</th>\n",
" <td>Edward Synge (1659–1741) was an Anglican clerg...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>476 rows × 2 columns</p>\n",
"</div>"
],
"text/plain": [
" Paragraph AI_generated\n",
"0 John Russell Reynolds (1820–1876) was an Engli... 1\n",
"1 Matthew Aylmer, 1st Baron Aylmer (1708–1794) w... 1\n",
"2 Rick Mahler (born Richard Alan Mahler on April... 1\n",
"3 James Blair (1732–1782) was an American lawyer... 1\n",
"4 Tim Finchem (born August 24, 1947) is an Ameri... 1\n",
".. ... ...\n",
"233 Baba Gündüz Kılıç (1918-1980) was a Turkish fo... 0\n",
"234 Michael Replogle is an internationally recogni... 0\n",
"235 William John Burke (Polonized as Burkeauskas; ... 0\n",
"236 Ted Childs commenced training as a programme d... 0\n",
"237 Edward Synge (1659–1741) was an Anglican clerg... 0\n",
"\n",
"[476 rows x 2 columns]"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"concat_df= pd.concat([new_df_ai, new_df_human])\n",
"concat_df"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"cdf_shffeled= concat_df.sample(frac=1).reset_index(drop=True)\n"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"cdf_shffeled.to_csv(\"data/AI_checker_gpt3_remade.csv\", index=False)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Training Model"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ubuntu/SentenceStructureComparision/venv/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
}
],
"source": [
"from datasets import Dataset, load_dataset\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Paragraph</th>\n",
" <th>AI_generated</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>337</th>\n",
" <td>Arthur Sewall (November 25, 1835 – September 5...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>315</th>\n",
" <td>Cicero Hunt Lewis (1825–1904) was an American ...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75</th>\n",
" <td>Michael Joseph \"Micky\" Moody (born 30 August 1...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>102</th>\n",
" <td>Noel Anthony Hogan (born 25 December 1971) is ...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>305</th>\n",
" <td>Don R. Swanson (October 10, 1924 - November 18...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Guðlaugur Þór Þórðarson (born 19 December 1967...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>390</th>\n",
" <td>Sirið Stenberg (born 28 April 1988) is a Faroe...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>403</th>\n",
" <td>Johan Christian Claussen Dahl (February 24, 17...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>370</th>\n",
" <td>Richard Allen \"Rich\" Williams (born February 1...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>364</th>\n",
" <td>Riccardo Tisci (born 1974 in Taranto, Italy) i...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Paragraph AI_generated\n",
"337 Arthur Sewall (November 25, 1835 – September 5... 0\n",
"315 Cicero Hunt Lewis (1825–1904) was an American ... 1\n",
"75 Michael Joseph \"Micky\" Moody (born 30 August 1... 0\n",
"102 Noel Anthony Hogan (born 25 December 1971) is ... 1\n",
"305 Don R. Swanson (October 10, 1924 - November 18... 0\n",
"2 Guðlaugur Þór Þórðarson (born 19 December 1967... 0\n",
"390 Sirið Stenberg (born 28 April 1988) is a Faroe... 1\n",
"403 Johan Christian Claussen Dahl (February 24, 17... 0\n",
"370 Richard Allen \"Rich\" Williams (born February 1... 0\n",
"364 Riccardo Tisci (born 1974 in Taranto, Italy) i... 0"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df= pd.read_csv('data/AI_checker_gpt3_remade.csv')\n",
"\n",
"\n",
"df.sample(10)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Paragraph</th>\n",
" <th>AI_generated</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>98518</th>\n",
" <td>Hisako Shimizu Hibi (1907–1991) was a Japanese...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>242695</th>\n",
" <td>In 2009 Đặng Nhật Minh's film Don't Burn (Đừng...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>249411</th>\n",
" <td>Sallie Wilson (1932, Fort Worth, Texas – Febru...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>269581</th>\n",
" <td>Authentic leadership, while having no formal o...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>147495</th>\n",
" <td>Katherine Phillips is an American educator and...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>296421</th>\n",
" <td>Mardepodect (developmental code name PF-254592...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>272305</th>\n",
" <td>A rehearsal report is a form created by an art...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>277337</th>\n",
" <td>The Katoor Dynasty (also spelled Katur and Kat...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>209934</th>\n",
" <td>Peninsular Spanish , also known as the Spanish...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>238498</th>\n",
" <td>The softmax function, also known as softargmax...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Paragraph AI_generated\n",
"98518 Hisako Shimizu Hibi (1907–1991) was a Japanese... 0\n",
"242695 In 2009 Đặng Nhật Minh's film Don't Burn (Đừng... 0\n",
"249411 Sallie Wilson (1932, Fort Worth, Texas – Febru... 1\n",
"269581 Authentic leadership, while having no formal o... 0\n",
"147495 Katherine Phillips is an American educator and... 1\n",
"296421 Mardepodect (developmental code name PF-254592... 0\n",
"272305 A rehearsal report is a form created by an art... 1\n",
"277337 The Katoor Dynasty (also spelled Katur and Kat... 1\n",
"209934 Peninsular Spanish , also known as the Spanish... 0\n",
"238498 The softmax function, also known as softargmax... 1"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df2= pd.read_csv('data/AI_checker_remade.csv')\n",
"\n",
"\n",
"df2.sample(10)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Paragraph</th>\n",
" <th>AI_generated</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Syd Rapson (born Sydney Rapson, 28 April 1932 ...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Bertram Deacon (8 November 1922 – 3 January 19...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Guðlaugur Þór Þórðarson (born 19 December 1967...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Achille-Ferdinand Carrier (February 15, 1859 -...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Rick Mahler (born Richard Alan Mahler on April...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>299995</th>\n",
" <td>James Wrighten (b. 1745 - d. 1793) was an Amer...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>299996</th>\n",
" <td>The U-matrix (unified distance matrix) is a sy...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>299997</th>\n",
" <td>Holding Trevor is a 2007 American gay-themed p...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>299998</th>\n",
" <td>Jarvisfield is a heritage-listed former pastor...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>299999</th>\n",
" <td>The Silver Guardian is a Chinese web series c...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>300476 rows × 2 columns</p>\n",
"</div>"
],
"text/plain": [
" Paragraph AI_generated\n",
"0 Syd Rapson (born Sydney Rapson, 28 April 1932 ... 1\n",
"1 Bertram Deacon (8 November 1922 – 3 January 19... 0\n",
"2 Guðlaugur Þór Þórðarson (born 19 December 1967... 0\n",
"3 Achille-Ferdinand Carrier (February 15, 1859 -... 0\n",
"4 Rick Mahler (born Richard Alan Mahler on April... 1\n",
"... ... ...\n",
"299995 James Wrighten (b. 1745 - d. 1793) was an Amer... 1\n",
"299996 The U-matrix (unified distance matrix) is a sy... 1\n",
"299997 Holding Trevor is a 2007 American gay-themed p... 1\n",
"299998 Jarvisfield is a heritage-listed former pastor... 0\n",
"299999 The Silver Guardian is a Chinese web series c... 1\n",
"\n",
"[300476 rows x 2 columns]"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"concat_df= pd.concat([df, df2])\n",
"concat_df"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"df= concat_df.sample(frac=1).reset_index(drop=True)\n"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>text</th>\n",
" <th>label</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>121493</th>\n",
" <td>Ori Kritz (he: אורי קריץ) is an Israeli-born a...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28946</th>\n",
" <td>HMS Yarmouth was a 64-gun third rate ship of t...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>127419</th>\n",
" <td>Ryan Taylor (born June 18, 1992) is an America...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>44654</th>\n",
" <td>The 1962 Bluebonnet Bowl was an American colle...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>272756</th>\n",
" <td>Dichorisandrinae is a subtribe within the trib...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>91933</th>\n",
" <td>Phalaenopsis subparishii, also known as 短茎萼脊兰 ...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>214281</th>\n",
" <td>Thomas Forsyth Torrance (30 August 1913 – 5 O...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>51312</th>\n",
" <td>Yoann Maestri (; born 14 January 1988) is a Fr...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>131201</th>\n",
" <td>Lonnie Shields (born April 17, 1956) is an Ame...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>61440</th>\n",
" <td>John Shelton Fenty (born 10 December 1961) is ...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" text label\n",
"121493 Ori Kritz (he: אורי קריץ) is an Israeli-born a... 1\n",
"28946 HMS Yarmouth was a 64-gun third rate ship of t... 0\n",
"127419 Ryan Taylor (born June 18, 1992) is an America... 0\n",
"44654 The 1962 Bluebonnet Bowl was an American colle... 1\n",
"272756 Dichorisandrinae is a subtribe within the trib... 1\n",
"91933 Phalaenopsis subparishii, also known as 短茎萼脊兰 ... 1\n",
"214281 Thomas Forsyth Torrance (30 August 1913 – 5 O... 1\n",
"51312 Yoann Maestri (; born 14 January 1988) is a Fr... 0\n",
"131201 Lonnie Shields (born April 17, 1956) is an Ame... 1\n",
"61440 John Shelton Fenty (born 10 December 1961) is ... 1"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.rename(columns={\n",
" \"Paragraph\": \"text\", \n",
" \"AI_generated\": \"label\"\n",
"}, \n",
" inplace=True\n",
")\n",
"\n",
"df.sample(10)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ubuntu/SentenceStructureComparision/venv/lib/python3.10/site-packages/pyarrow/pandas_compat.py:373: FutureWarning: is_sparse is deprecated and will be removed in a future version. Check `isinstance(dtype, pd.SparseDtype)` instead.\n",
" if _pandas_api.is_sparse(col):\n"
]
},
{
"data": {
"text/plain": [
"Dataset({\n",
" features: ['text', 'label'],\n",
" num_rows: 300476\n",
"})"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dataset_df= Dataset.from_pandas(df)\n",
"dataset_df"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"DatasetDict({\n",
" train: Dataset({\n",
" features: ['text', 'label'],\n",
" num_rows: 240380\n",
" })\n",
" test: Dataset({\n",
" features: ['text', 'label'],\n",
" num_rows: 60096\n",
" })\n",
"})"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"new_data= dataset_df.train_test_split(test_size=0.2)\n",
"new_data"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.\n"
]
}
],
"source": [
"from transformers import AutoTokenizer\n",
"\n",
"tokenizer = AutoTokenizer.from_pretrained(\"models/trained_model_v11\")"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"def preprocess_function(examples):\n",
" return tokenizer(examples[\"text\"], truncation=True)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Map: 100%|██████████| 240380/240380 [01:00<00:00, 3995.57 examples/s]\n",
"Map: 100%|██████████| 60096/60096 [00:15<00:00, 3983.79 examples/s]\n"
]
}
],
"source": [
"tokenized_df = new_data.map(preprocess_function, batched=True)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-10-09 08:16:21.518621: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
"To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
"2023-10-09 08:16:22.221621: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n"
]
}
],
"source": [
"# from transformers import DataCollatorWithPadding\n",
"\n",
"# data_collator = DataCollatorWithPadding(tokenizer=tokenizer, return_tensors=\"tf\")\n",
"\n",
"\n",
"\n",
"\n",
"from transformers import DataCollatorWithPadding\n",
"\n",
"data_collator = DataCollatorWithPadding(tokenizer=tokenizer)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
"import evaluate\n",
"\n",
"accuracy = evaluate.load(\"accuracy\")"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"\n",
"\n",
"def compute_metrics(eval_pred):\n",
" predictions, labels = eval_pred\n",
" predictions = np.argmax(predictions, axis=1)\n",
" return accuracy.compute(predictions=predictions, references=labels)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"id2label = {0: \"NEGATIVE\", 1: \"POSITIVE\"}\n",
"label2id = {\"NEGATIVE\": 0, \"POSITIVE\": 1}"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
"from transformers import AutoModelForSequenceClassification, TrainingArguments, Trainer\n",
"\n",
"model = AutoModelForSequenceClassification.from_pretrained(\n",
" \"models/trained_model_v11\", num_labels=2, id2label=id2label, label2id=label2id\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"You're using a DistilBertTokenizerFast tokenizer. Please note that with a fast tokenizer, using the `__call__` method is faster than using a method to encode the text followed by a call to the `pad` method to get a padded encoding.\n"
]
},
{
"data": {
"text/html": [
"\n",
" <div>\n",
" \n",
" <progress value='30048' max='30048' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
" [30048/30048 1:25:21, Epoch 2/2]\n",
" </div>\n",
" <table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>Epoch</th>\n",
" <th>Training Loss</th>\n",
" <th>Validation Loss</th>\n",
" <th>Accuracy</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>0.006100</td>\n",
" <td>0.021362</td>\n",
" <td>0.995540</td>\n",
" </tr>\n",
" <tr>\n",
" <td>2</td>\n",
" <td>0.001000</td>\n",
" <td>0.024375</td>\n",
" <td>0.996223</td>\n",
" </tr>\n",
" </tbody>\n",
"</table><p>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"TrainOutput(global_step=30048, training_loss=0.006611945222465289, metrics={'train_runtime': 5122.033, 'train_samples_per_second': 93.861, 'train_steps_per_second': 5.866, 'total_flos': 4.576643477567117e+16, 'train_loss': 0.006611945222465289, 'epoch': 2.0})"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"training_args = TrainingArguments(\n",
" output_dir=\"gpt3_finetuned_model\",\n",
" learning_rate=2e-5,\n",
" per_device_train_batch_size=16,\n",
" per_device_eval_batch_size=16,\n",
" num_train_epochs=2,\n",
" weight_decay=0.01,\n",
" evaluation_strategy=\"epoch\",\n",
" save_strategy=\"epoch\",\n",
" load_best_model_at_end=True,\n",
" # push_to_hub=True,\n",
")\n",
"\n",
"trainer = Trainer(\n",
" model=model,\n",
" args=training_args,\n",
" train_dataset=tokenized_df[\"train\"],\n",
" eval_dataset=tokenized_df[\"test\"],\n",
" tokenizer=tokenizer,\n",
" data_collator=data_collator,\n",
" compute_metrics=compute_metrics,\n",
")\n",
"\n",
"trainer.train()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Inference"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'/home/ubuntu/SentenceStructureComparision'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import os; os.chdir('..')\n",
"%pwd"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ubuntu/SentenceStructureComparision/venv/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-10-09 09:42:37.342580: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
"To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
"2023-10-09 09:42:38.742297: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n",
"Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.\n"
]
}
],
"source": [
"from transformers import pipeline\n",
"\n",
"classifier = pipeline(\"text-classification\", model=\"gpt3_finetuned_model/checkpoint-30048\", device=\"cuda\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# from transformers import AutoModelForSequenceClassification, AutoTokenizer\n",
"# model_name= \"gpt3_finetuned_model/checkpoint-480\"\n",
"# AutoTokenizer.from_pretrained(model_name)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.9999996423721313}]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier('''Water intoxication, also known as water poisoning, hyperhydration, overhydration, or water toxemia, is a potentially fatal disturbance in brain functions that results when the normal balance of electrolytes in the body is pushed outside safe limits by excessive water intake.\n",
"\n",
"Under normal circumstances, accidentally consuming too much water is exceptionally rare. Nearly all deaths related to water intoxication in normal individuals have resulted either from water-drinking contests, in which individuals attempt to consume large amounts of water, or from long bouts of exercise during which excessive amounts of fluid were consumed.[1] In addition, water cure, a method of torture in which the victim is forced to consume excessive amounts of water, can cause water intoxication.[1]\n",
"\n",
"Water, like any other substance, can be considered a poison when over-consumed in a brief period of time. Water intoxication mostly occurs when water is being consumed in a high quantity without adequate electrolyte intake.[2]\n",
"\n",
"Excess of body water may also be a result of a medical condition or improper treatment; see \"hyponatremia\" for some examples. Water is considered one of the least toxic chemical compounds, with an LD50 exceeding 90 ml/kg in rats;[3] drinking six liters in three hours has caused the death of a human.[4]'''\n",
"\n",
")\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.9995008707046509}]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s1= '''Basketball is a team sport played by two teams of five players each. The primary objective is to score points by shooting the basketball through the opponent's hoop, which is mounted on a backboard 10 feet (3.048 meters) above the ground. The team with the most points at the end of the game wins. Basketball is played on a rectangular court, typically indoors, with a surface made of wood or synthetic materials. The rules and regulations are governed by various organizations, such as FIBA (International Basketball Federation) and the NBA (National Basketball Association). The following is a general outline of the basic rules of basketball:\n",
"\n",
"1. Game duration: A regulation basketball game is divided into four quarters, each lasting 12 minutes in the NBA and 10 minutes in FIBA play. College basketball in the US has two 20-minute halves. If the game is tied at the end of regulation, overtime periods are played until a winner is determined.\n",
"\n",
"2. Starting play: The game begins with a jump ball at the center of the court, where the referee throws the ball into the air, and one player from each team tries to gain possession by tapping it to a teammate.\n",
"\n",
"3. Scoring: Points are scored by shooting the ball through the hoop. A field goal made from inside the three-point arc is worth two points, while a field goal made from outside the arc is worth three points. Free throws, awarded after a foul, are worth one point each.\n",
"\n",
"4. Possession and dribbling: A player in possession of the ball must either pass it to a teammate or dribble (bounce) the ball while moving.'''\n",
"\n",
"\n",
"classifier(s1)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Paragraph</th>\n",
" <th>AI_generated</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Syd Rapson (born Sydney Rapson, 28 April 1932 ...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Bertram Deacon (8 November 1922 – 3 January 19...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Guðlaugur Þór Þórðarson (born 19 December 1967...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Achille-Ferdinand Carrier (February 15, 1859 -...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Rick Mahler (born Richard Alan Mahler on April...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Paragraph AI_generated\n",
"0 Syd Rapson (born Sydney Rapson, 28 April 1932 ... 1\n",
"1 Bertram Deacon (8 November 1922 – 3 January 19... 0\n",
"2 Guðlaugur Þór Þórðarson (born 19 December 1967... 0\n",
"3 Achille-Ferdinand Carrier (February 15, 1859 -... 0\n",
"4 Rick Mahler (born Richard Alan Mahler on April... 1"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"df= pd.read_csv(\"data/AI_checker_gpt3_remade.csv\")\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([['Syd Rapson (born Sydney Rapson, 28 April 1932 – 28 April 2017) was an English Labour Party politician who served as Member of Parliament (MP) for Portsmouth South from 1997 to 2010.\\n\\nRapson was born in Portsmouth and educated at Portsmouth Grammar School and the University of Southampton. He worked as a teacher and a lecturer before entering politics. He was a councillor on Portsmouth City Council from 1973 to 1997, and was leader of the council from 1983 to 1997.\\n\\nRapson was elected to the House of Commons at the 1997 general election, and held the seat until he stood down at the 2010 general election. He was a member of the Defence Select Committee from 1997 to 2010, and was a member of the Parliamentary Labour Party Defence Committee from 1997 to 2005. He was also a member of the Parliamentary Labour Party Home Affairs Committee from 2005 to 2010.',\n",
" 1],\n",
" [\"Rick Mahler (born Richard Alan Mahler on April 18, 1957 in Atlanta, Georgia) was an American professional baseball pitcher who played for the Atlanta Braves, Cincinnati Reds, Montreal Expos, and Minnesota Twins of Major League Baseball (MLB) from 1978 to 1990. He was a two-time All-Star and won the National League (NL) ERA title in 1985.\\n\\nMahler was drafted by the Braves in the first round of the 1975 amateur draft. He made his major league debut with the Braves in 1978, and was a member of the team's starting rotation for the next five seasons. He was an All-Star in 1983 and 1985, and won the NL ERA title in 1985 with a 2.87 ERA. He was traded to the Reds in 1984, and then to the Expos in 1986. He was traded to the Twins in 1989, and finished his career with them in 1990.\\n\\nMahler was known for his durability, as he pitched over 200 innings in six consecutive seasons from 1983 to 1988. He finished his career with a record of 119–121, a 3.90 ERA, and 1,07\",\n",
" 1],\n",
" [\"Frederick Thomas Brentnall (1862–1937) was an English architect and surveyor. He was born in 1862 in Birmingham, England, and was educated at King Edward's School, Birmingham. He was articled to the Birmingham architect, J.H. Chamberlain, and then worked in the offices of William Bidlake and J.H. Chamberlain. In 1887 he set up his own practice in Birmingham.\\n\\nBrentnall was a prolific architect and surveyor, designing a wide range of buildings including churches, schools, factories, warehouses, offices, shops, and private residences. He was particularly noted for his work in the Arts and Crafts style, and was a member of the Birmingham Artisans' Guild. He was also a member of the Birmingham Architectural Association, and was a Fellow of the Royal Institute of British Architects. He was a keen advocate of the use of reinforced concrete in construction, and was a pioneer in the use of this material in the Midlands. He was also a keen advocate of the use of natural materials such as brick and stone, and was a pioneer in the use of\",\n",
" 1],\n",
" ['Alan Dinehart (April 17, 1888 – October 28, 1944) was an American actor of the silent and early sound film eras. He appeared in more than 200 films between 1915 and 1944, often playing suave, debonair leading men.\\n\\nDinehart was born in New York City and began his career on the stage. He made his film debut in 1915 and quickly became a popular leading man in silent films. He was often cast as a romantic lead opposite stars such as Mary Pickford, Lillian Gish, and Clara Bow. He also appeared in a number of westerns, including The Covered Wagon (1923) and The Iron Horse (1924).\\n\\nIn the early 1930s, Dinehart transitioned to sound films, appearing in a number of popular films such as The Big Broadcast (1932), The Invisible Man (1933), and The Little Minister (1934). He continued to appear in films until his death in 1944.',\n",
" 1],\n",
" [\"Freddie Frith (1917–1994) was an English motorcycle racer who competed in the Isle of Man TT races and other international events. He was born in London and began racing in the 1930s. He won the Isle of Man TT in 1938 and 1939, and was the first rider to win the Senior TT twice in succession. He also won the North West 200 in 1938 and 1939, and the Ulster Grand Prix in 1938 and 1939.\\n\\nFrith was a popular figure in the racing world, and was known for his daring and aggressive riding style. He was also known for his willingness to help other riders, and was often seen helping to push other riders' bikes to the start line. He retired from racing in 1947, but continued to be involved in the sport, working as a mechanic and team manager. He died in 1994, aged 77.\",\n",
" 1]], dtype=object)"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[df.AI_generated==1].values[:5]"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 0.9999998807907104}]"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier('''Political stability is the ability of a government to maintain order and authority within its borders. It is essential for economic growth, as it provides a foundation for investment and trade.\n",
"There are many factors that contribute to political stability, including:\n",
"A strong rule of law: The rule of law is the principle that everyone is subject to the same laws, regardless of their social status or political affiliation. A strong rule of law helps to prevent corruption and ensures that everyone has equal opportunity to succeed.\n",
"A well-functioning government: A well-functioning government is one that is able to provide essential services, such as security, education, and healthcare. It is also able to manage the economy effectively and to respond to crises.\n",
"A vibrant civil society: A vibrant civil society is one that is made up of active and engaged citizens. Civil society organizations can help to hold the government accountable and to promote democracy and good governance.\n",
"Political stability is not always easy to achieve, but it is essential for economic growth. By investing in political stability, we can create a foundation for long-term prosperity.\n",
"Here are some of the benefits of political stability:''')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 0.9997896552085876}]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# AI generated\n",
"classifier(\"To write a compelling sales copy, focus on understanding your target audience and their pain points. Craft a captivating headline to grab attention, followed by a concise and persuasive introduction. Highlight the benefits and unique selling points of your product or service, using persuasive language and storytelling techniques. Create a sense of urgency and offer a clear call-to-action to drive conversions. Revise and refine your copy for clarity and impact.\")\n"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 0.9999992847442627}]"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Human -> Undetectable AI\n",
"classifier(\n",
" \"Creating a great sales copy starts with identifying your target audience and their pain points. Create headlines that will tell the reader enough to reach a conclusion but make them want to know more. Then write a brief and effective introduction paragraph. Let the readers know how your products/services can help them using persuasive language and storytelling techniques. Make your reader feel a bit urgent when reading your copy and add a call-to-action to encourage them to take action. Revise and refine your copy for clarity and impact.\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 0.9999995231628418}]"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# AI\n",
"\n",
"classifier(\"Writing a compelling product description involves understanding your audience, highlighting key features, and emphasizing benefits. Use clear, concise language and incorporate persuasive techniques. Provide accurate information, address potential concerns, and use SEO-friendly keywords. Remember, your goal is to convince customers that your product will improve their lives.\")"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.9709567427635193}]"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Human -> Undetectable AI\n",
"\n",
"classifier(\n",
" \"When crafting a product description that captivates your audience, it's important to understand them, showcase what your product is capable of, and emphasize how it is helpful. Utilize clear and concise language while incorporating persuasion techniques. Ensure accuracy in providing information and address any potential concerns they may have Additionally, incorporating SEO-friendly keywords will help maximize visibility. Always keep in mind that the ultimate goal is to convince customers that your product will enhance their lives.\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 1.0}]"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# AI written\n",
"\n",
"classifier(\"A business strategy is an outline of the actions and decisions a company plans to take to reach its goals and objectives. It defines what the company needs to do to reach its goals, which can help guide the decision-making process for hiring as well as resource allocation. A good business strategy is essential for any company that wants to be successful in the long run.\")"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 1.0}]"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Human -> Undetectable AI\n",
"\n",
"classifier(\"A business strategy outlines the actions and decisions a company will take to achieve its goals and objectives. It provides direction for hiring and resource allocation, helping guide the decision-making process. A strong business strategy is crucial for long-term success.\")"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 0.999936580657959}]"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# AI\n",
"classifier(\n",
" \"Autumn, the season of transformation, sweeps in with a burst of vibrant colors, transforming the world around us. Leaves turn from their ordinary green into fiery shades of red, orange, and yellow. Nature becomes an artist, creating landscapes that seem straight out of a dream. The cool air, crisp and invigorating, carries with it the scent of fallen leaves, promising cozy evenings by the fireplace. It's a time for apple picking, pumpkin carving, and leisurely walks through rustling foliage. The magic of autumn lies in its ability to remind us that change can be breathtakingly beautiful, even as we bid farewell to the warmth of summer. So, embrace this season of transition and find solace in the symphony of colors and the gentle rustle of fallen leaves underfoot.\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ubuntu/SentenceStructureComparision/venv/lib/python3.10/site-packages/transformers/pipelines/base.py:1101: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n",
" warnings.warn(\n"
]
},
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 0.9999960660934448}]"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# human\n",
"classifier(\n",
" '''Autumn is the season for all senses. The feel of cooler temperatures after a long summer. A warm, visually pleasing palate of reds, oranges and browns. The taste of pumpkin spice in everything. The sound of crunching leaves underfoot. The smell of woodsmoke.\n",
"\n",
"The many elements of autumn either intrinsically deliver happiness or trigger memories of past joy from which we can keep taking bites, as from a freshly baked apple pie.'''\n",
")\n"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 0.9999985694885254}]"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# blog\n",
"classifier(\n",
" '''Like spring, fall is a season of transition, a reminder of the value of change, in this case from bright, buzzing, verdant summer toward the dark, quiet calm of winter. It’s a journey inward; first experiential, then intellectual and finally into the collective unconscious.'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 0.9999998807907104}]"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# wikipedia \n",
"classifier(\n",
" '''Autumn, also known as fall in North American English,[1] is one of the four temperate seasons on Earth. Outside the tropics, autumn marks the transition from summer to winter, in September (Northern Hemisphere) or March (Southern Hemisphere). Autumn is the season when the duration of daylight becomes noticeably shorter and the temperature cools considerably. Day length decreases and night length increases as the season progresses until the Winter Solstice in December (Northern Hemisphere) and June (Southern Hemisphere). One of its main features in temperate climates is the striking change in colour for the leaves of deciduous trees as they prepare to shed.'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[\"Bertram Deacon (8 November 1922 – 3 January 1974) was an Australian rules footballer who played for Carlton in the Victorian Football League (VFL). He is remembered for being Carlton's first ever Brownlow Medal winner. A centre half back, Deacon began his league career in 1942. He was a premiership player for Carlton in 1945 (after acting as captain-coach of an army stores team that won all ten games in a services competition in Darwin) and 1947, the latter in a year which he won both a Brownlow Medal and shared Carlton's Best and Fairest Medal with his captain, Ern Henfry. The previous season Deacon had finished fourth in the Brownlow Medal count but this time around finished on top, thus becoming Carlton's inaugural winner of the award. Deacon left Carlton after the 1951 season and became captain-coach for Preston in the Victorian Football Association (VFA), the club where he had played for prior to being recruited by Carlton. He later served as Carlton vice-president and club secretary. He is the centre half back in Carlton's official 'Team of the Century'. Off the field, Deacon worked for many years for long-serving VFL and Carlton president Sir Kenneth Luke. Bertram Deacon died of a heart attack on 3 January 1974 while on holiday at Balnarring. Deacon was just 51 years of age and died despite the desperate efforts of his Preston team-mate, Pat Foley, to revive him.\",\n",
" 0],\n",
" [\"Guðlaugur Þór Þórðarson (born 19 December 1967) is an Icelandic politician. He has been a member of the Althing (Iceland's parliament) for the Independence Party since 2003 and served as the Minister of Health from 24 May 2007 to 1 February 2009. He is the first MP of the Reykjavík North constituency, after beating the Minister of Justice and Ecclesiastical Affairs, Björn Bjarnason, in the primary election. Guðlaugur graduated with a BA degree in political sciences from the University of Iceland in 1996. He is married to Ágústa Johnson, and is the father of two children. Guðlaugur started his involvement in the Independence Party in 1987 when he was elected to the board of the National Youth Organisation of the Independence Party, in which he served until 1997; of which he was Vice Chairman from 1989 to 1993 and Chairman from 1993 to 1997. He was then elected to the Reykjavík City Council in 1998 and sat two four-year terms there. He sat on the Parliamentary Committee on Welfare Issues from 2003 to 2006, the Committee on Fisheries from 2003 to 2007, and the Committee on the Environment from 2003 to 2007 (Chairman from 2004 to 2007).\",\n",
" 0],\n",
" ['Achille-Ferdinand Carrier (February 15, 1859 - March 21, 1930) was a lawyer, judge, and political figure in Quebec. He represented Gaspé in the Legislative Assembly of Quebec from 1890 to 1892 as a Liberal. He was born in Saint-Roch, Canada East, the son of Ferdinand Carrier and Mary Ann Donahue, and was educated at the Séminaire de Québec and the Université Laval. Carrier was called to the Quebec bar in 1882. He was also a member of the Minnesota bar and practised in Minneapolis in 1885 and 1886. Carrier was the editor of the \"L\\'Écho de l\\'Ouest\", a French-Canadian newspaper in Minneapolis. He ran unsuccessfully for a seat in the Canadian House of Commons in 1887. Carrier was defeated when he ran for reelection in 1892; he also ran unsuccessfully for the Terrebonne seat in 1897. He served as judge in the Magistrate\\'s Court for Terrebonne, Joliette and Ottawa districts from 1898 to 1924. Carrier died in Quebec City at the age of 71. He was the uncle of Oscar Lefebvre Boulanger.',\n",
" 0],\n",
" ['John Howe (born August 21, 1957) is a Canadian book illustrator, living in Neuchâtel, Switzerland. One year after graduating from high school, he studied at a college in Strasbourg, France, then at the École des Arts Décoratifs. He is best known for his work based on J.R.R. Tolkien\\'s worlds. Howe and noted Tolkien artist Alan Lee served as chief conceptual designers for Peter Jackson\\'s \"The Lord of the Rings\" movie trilogy, and Howe also did the illustration for the \"Lord of the Rings\" board game created by Reiner Knizia. Howe also re-illustrated the maps of \"The Lord of the Rings\", \"The Hobbit\", and \"The Silmarillion\" from 1996 to 2003. His work is not limited to this, and includes images of myths such as the Anglo Saxon legend of Beowulf (he also illustrated Knizia\\'s board game). Howe has illustrated many other books, many of which belong to the fantasy genre (such as Robin Hobb\\'s books). He also contributed to the film adaptation of C.S. Lewis\\'s \"The Lion, the Witch, and the Wardrobe\". In 2005, a limited edition of George R.R. Martin\\'s novel \"A Clash of Kings\" was released by Meisha Merlin, complete with numerous illustrations by Howe. Howe has also illustrated cards for the \"Magic: The Gathering\" collectible card game. For the \"The Hobbit\" films, former director Guillermo del Toro and current director Peter Jackson have been in consultation with Howe and fellow conceptual artist Alan Lee to ensure continuity of design. Howe is a member of the living history group The Company of Saynt George.',\n",
" 0],\n",
" ['Lionel Aldridge (February 14, 1941 - February 12, 1998) was an American professional football player. Aldridge was an All-Skyline tackle and co-captain of the Utah State Aggies. He was drafted in 1963 after a standout college career at Utah State. One of the few rookies to start for coach Vince Lombardi, Aldridge enjoyed an eleven-year NFL career. As a Packer, he played a role in three straight NFL championships (1965-66-67) and in Packer victories in Super Bowls I and II. Traded to the San Diego Chargers, Aldridge played two seasons in San Diego before retiring from professional football in 1973. After retiring, Aldridge worked as a sports analyst in Milwaukee and for Packers radio and NBC until manifesting paranoid schizophrenia in the late 1970s. Homeless for a time in part due to misdiagnosis, he eventually reached a form of equilibrium. He became an advocate for the homeless and the mentally ill until his death in 1998. His advocacy work included serving as a board member for the Mental Health Association of Milwaukee and working as a speaker for the National Alliance on Mental Illness.',\n",
" 0]], dtype=object)"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[df.AI_generated==0].values[:5]\n"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"s= \"\"\"John Howe (born August 21, 1957) is a Canadian book illustrator, living in Neuchâtel, Switzerland. One year after graduating from high school, he studied at a college in Strasbourg, France, then at the École des Arts Décoratifs. He is best known for his work based on J.R.R. Tolkien\\'s worlds. Howe and noted Tolkien artist Alan Lee served as chief conceptual designers for Peter Jackson\\'s \"The Lord of the Rings\" movie trilogy, and Howe also did the illustration for the \"Lord of the Rings\" board game created by Reiner Knizia. Howe also re-illustrated the maps of \"The Lord of the Rings\", \"The Hobbit\", and \"The Silmarillion\" from 1996 to 2003. His work is not limited to this, and includes images of myths such as the Anglo Saxon legend of Beowulf (he also illustrated Knizia\\'s board game). Howe has illustrated many other books, many of which belong to the fantasy genre (such as Robin Hobb\\'s books). He also contributed to the film adaptation of C.S. Lewis\\'s \"The Lion, the Witch, and the Wardrobe\". In 2005, a limited edition of George R.R. Martin\\'s novel \"A Clash of Kings\" was released by Meisha Merlin, complete with numerous illustrations by Howe. Howe has also illustrated cards for the \"Magic: The Gathering\" collectible card game. For the \"The Hobbit\" films, former director Guillermo del Toro and current director Peter Jackson have been in consultation with Howe and fellow conceptual artist Alan Lee to ensure continuity of design. Howe is a member of the living history group The Company of Saynt George.\"\"\""
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.9999998807907104}]"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier(s)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Paragraph</th>\n",
" <th>AI_generated</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Syd Rapson (born Sydney Rapson, 28 April 1932 ...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Bertram Deacon (8 November 1922 – 3 January 19...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Guðlaugur Þór Þórðarson (born 19 December 1967...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Achille-Ferdinand Carrier (February 15, 1859 -...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Rick Mahler (born Richard Alan Mahler on April...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Paragraph AI_generated\n",
"0 Syd Rapson (born Sydney Rapson, 28 April 1932 ... 1\n",
"1 Bertram Deacon (8 November 1922 – 3 January 19... 0\n",
"2 Guðlaugur Þór Þórðarson (born 19 December 1967... 0\n",
"3 Achille-Ferdinand Carrier (February 15, 1859 -... 0\n",
"4 Rick Mahler (born Richard Alan Mahler on April... 1"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ubuntu/SentenceStructureComparision/venv/lib/python3.10/site-packages/transformers/pipelines/base.py:1101: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n",
" warnings.warn(\n"
]
},
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 1.0}]"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# classifier(\"My name is Deepankar Sharma.\")"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ubuntu/SentenceStructureComparision/venv/lib/python3.10/site-packages/transformers/pipelines/base.py:1101: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n",
" warnings.warn(\n"
]
},
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.9999998807907104}]"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier(\n",
" '''Some cultures regard the autumnal equinox as \"mid-autumn\", while others with a longer temperature lag treat the equinox as the start of autumn.[2] In the English-speaking world of high latitude countries, autumn traditionally began with Lammas Day and ended around Hallowe'en, the approximate mid-points between midsummer, the autumnal equinox, and midwinter. Meteorologists (and Australia[3][4] and most of the temperate countries in the southern hemisphere)[5][6] use a definition based on Gregorian calendar months, with autumn being September, October, and November in the northern hemisphere,[7] and March, April, and May in the southern hemisphere.\n",
"\n",
"In the higher latitude countries in the Northern Hemisphere, autumn traditionally starts with the September equinox (21 to 24 September)[8] and ends with the winter solstice (21 or 22 December).[9] Popular culture in the United States associates Labor Day, the first Monday in September, as the end of summer and the start of autumn; certain summer traditions, such as wearing white, are discouraged after that date.[10] As daytime and nighttime temperatures decrease, trees change colour and then shed their leaves.[11] Persians celebrate the beginning of the autumn on Mehregan.\n",
"\n",
"Under the traditional East Asian solar term system, autumn starts on or around 8 August and ends on or about 7 November. In Ireland, the autumn months according to the national meteorological service, Met Éireann, are September, October, and November.[12] However, according to the Irish Calendar, which is based on ancient Gaelic traditions, autumn lasts throughout the months of August, September, and October, or possibly a few days later, depending on tradition. In the Irish language, September is known as Meán Fómhair (\"middle of autumn\") and October as Deireadh Fómhair (\"end of autumn\").[13][14] Late Roman Republic scholar Marcus Terentius Varro defined autumn as lasting from the third day before the Ides of Sextilis (August 11) to the fifth day before the Ides of November (November 9).[15]'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.9999998807907104}]"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier('''The word autumn (/ˈɔːtəm/) is derived from Latin autumnus, archaic auctumnus, possibly from the ancient Etruscan root autu- and has within it connotations of the passing of the year.[16] Alternative etymologies include Proto-Indo-European *h₃ewǵ- (\"cold\") or *h₂sows- (\"dry\").[17]\n",
"\n",
"After the Greek era, the word continued to be used as the Old French word autompne (automne in modern French) or autumpne in Middle English,[18] and was later normalised to the original Latin. In the Medieval period, there are rare examples of its use as early as the 12th century, but by the 16th century, it was in common use.\n",
"\n",
"Before the 16th century, harvest was the term usually used to refer to the season, as it is common in other West Germanic languages to this day (cf. Dutch herfst, German Herbst, and Scots hairst). However, as more people gradually moved from working the land to living in towns, the word harvest lost its reference to the time of year and came to refer only to the actual activity of reaping, and autumn, as well as fall, began to replace it as a reference to the season.[19][20][better source needed]\n",
"\n",
"The alternative word fall for the season traces its origins to old Germanic languages. The exact derivation is unclear, with the Old English fiæll or feallan and the Old Norse fall all being possible candidates. However, these words all have the meaning \"to fall from a height\" and are clearly derived either from a common root or from each other. The term came to denote the season in 16th-century England, a contraction of Middle English expressions like \"fall of the leaf\" and \"fall of the year\". Compare the origin of spring from \"spring of the leaf\" and \"spring of the year\".[21]\n",
"\n",
"During the 17th century, Englishmen began emigrating to the new North American colonies, and the settlers took the English language with them. While the term fall gradually became nearly obsolete in Britain, it became the more common term in North America.[22]\n",
"\n",
"The name backend, a once common name for the season in Northern England, has today been largely replaced by the name autumn.[23]''')"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.9994685053825378}]"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier(\n",
" '''Indian summer, period of dry, unseasonably warm weather in late October or November in the central and eastern United States. The term originated in New England and probably arose from the Indians’ practice of gathering winter stores at this time. This autumn warm period also occurs in Europe, where in Britain it is called All-hallown summer or Old Wives’ summer. Indian summer may occur several times in some years and not at all in others; it often persists for a week or longer. The nights are cool and may bring frost, and the days have hazy skies and light winds. The lack of clouds causes the daytime hours to be quite pleasant as the air usually has a low relative humidity and the trees have their autumn foliage.\n",
"\n",
"In the United States, an Indian summer period occurs when a cool, shallow polar air mass stagnates and becomes a deep, warm high-pressure centre. This centre is characterized by a strong low-level temperature inversion that produces a stable air stratification. As a result, vertical air motions are inhibited, and smoke and dust are concentrated near the ground, which accounts for the haziness.'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 0.9999936819076538}]"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier(\"\"\"Autumn, with its crisp air and the earthy scent of fallen leaves, is a season of unparalleled beauty and transformation. As the days grow shorter and the sun's angle lowers in the sky, the once-green leaves of trees burst into a magnificent display of warm hues – fiery reds, vibrant oranges, and rich golds. It's a time when nature becomes an artist, painting landscapes with its vibrant palette. The gentle rustle of leaves underfoot and the taste of freshly picked apples evoke a sense of nostalgia and warmth. Autumn invites us to cozy up with a hot drink, watch the world change, and embrace the idea that even in the midst of change, there is a unique and serene beauty that can be found in letting go, just as the trees release their leaves to prepare for the coming winter.\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.9999955892562866}]"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier(\"Autumn, that glorious season of transition, heralds its arrival with a symphony of sensory delights. The air turns crisper, carrying with it the earthy fragrance of fallen leaves, while the sun, with its lowered angle, casts a soft, golden glow upon the world. It's the time when nature dons its artist's robe, meticulously crafting landscapes adorned in a dazzling array of colors - from the fiery reds and burnt oranges to the deep, lustrous golds. As the leaves gently cascade to the ground, they form a vibrant carpet that beckons us to take leisurely walks and relish the satisfying crunch underfoot. There's a certain nostalgia that permeates the season, evoking memories of warm apple pies, pumpkin patches, and cozy fireside gatherings. Autumn serves as a reminder that change is inevitable, but it carries with it a unique beauty and a promise of renewal, just as the trees shed their leaves to prepare for the serene embrace of winter.\")"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.9999998807907104}]"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier('''Autumn, that magnificent season of transformation, unfurls its tapestry of wonder with a graceful and undeniable presence. As the calendar turns, the very atmosphere seems to shift, bearing the crisp, clean scent of fallen leaves and the promise of cool, invigorating days. The sun, now casting its warm embrace at a lower angle, bathes the world in a soft, golden light that dances upon the landscape. Nature, in all its boundless artistry, takes center stage, meticulously painting the trees in a breathtaking spectrum of colors that defy mere description – from the fiery reds that blaze like an artist's passion, to the vibrant oranges that resonate with life, and the rich, gilded golds that evoke feelings of timeless elegance.\\n\\nThis is the season when the trees, as if in a grand act of surrender, let go of their leaves, allowing them to flutter gracefully to the ground. As they blanket the earth, they form a carpet of memories that beckon us to take unhurried strolls, delighting in the satisfying rustle and gentle crunch beneath our footsteps. Autumn carries with it a peculiar sense of nostalgia, invoking memories of orchard gatherings for apple-picking, the artistry of intricately carved pumpkins, and the cherished warmth of fireside gatherings. It serves as a poignant reminder that change, inevitable and relentless, possesses its own unique beauty – a beauty that lies in the impermanence of things, in the promise of renewal, just as the trees shed their leaves to prepare for the serene hush of winter's embrace.''')"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 1.0}]"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier(\n",
" '''Rick Mahler (born Richard Alan Mahler on April 18, 1957 in Atlanta, Georgia) was an American professional baseball pitcher who played for the Atlanta Braves, Cincinnati Reds, Montreal Expos, and Minnesota Twins of Major League Baseball (MLB) from 1978 to 1990. He was a two-time All-Star and won the National League (NL) ERA title in 1985.\\n\\nMahler was drafted by the Braves in the first round of the 1975 amateur draft. He made his major league debut with the Braves in 1978, and was a member of the team's starting rotation for the next five seasons. He was an All-Star in 1983 and 1985, and won the NL ERA title in 1985 with a 2.87 ERA. He was traded to the Reds in 1984, and then to the Expos in 1986. He was traded to the Twins in 1989, and finished his career with them in 1990.\\n\\nMahler was known for his durability, as he pitched over 200 innings in six consecutive seasons from 1983 to 1988. He finished his career with a record of 119–121, a 3.90 ERA, and 1,07\",\n",
" '''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 1.0}]"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier(\n",
" '''Rick Mahler was a Major League Baseball (MLB) pitcher who played in the league for 11 seasons. He was born on August 5, 1953, in Austin, Texas, and he passed away on December 9, 2005. Mahler's MLB career began in 1979 when he made his debut with the Atlanta Braves. He was known for his time as a starting pitcher with the Braves, Cincinnati Reds, Montreal Expos, and Florida Marlins.\n",
"\n",
"During his career, Rick Mahler was known for his consistency and durability as a pitcher. He was not an overpowering pitcher but relied on control and finesse. His best season came in 1985 when he had a 17-15 record with the Atlanta Braves and was named an All-Star. He was a reliable innings-eater for several teams throughout his career.\n",
"\n",
"Rick Mahler retired from professional baseball in 1991. After his playing career, he continued to be involved in the game as a coach and instructor. He passed away in 2005 at the age of 52. While not one of the most widely recognized names in baseball, Mahler had a respectable career and made his mark on the sport during his time as a pitcher.'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.999908447265625}]"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier(\"\"\"Autumn, often referred to as fall, is one of the four temperate seasons that follows summer and precedes winter. It typically begins in September (Northern Hemisphere) or March (Southern Hemisphere) and lasts until December (Northern Hemisphere) or June (Southern Hemisphere). Autumn is characterized by a gradual change in weather and the environment.\n",
"\n",
"One of the most striking features of autumn is the transformation of foliage. Deciduous trees shed their leaves, which transition from their usual green to a breathtaking array of colors, including reds, oranges, yellows, and browns. This phenomenon is often called \"fall foliage\" and attracts tourists and nature enthusiasts to witness the vibrant displays in various regions around the world.\n",
"\n",
"The season also brings cooler temperatures and shorter daylight hours as the Earth tilts away from the sun. This shift in sunlight triggers a cascade of natural events, including the maturation of many fruits and nuts, making it a fruitful time for harvesting. Apple picking, pumpkin carving, and the preparation of hearty, warming meals are cherished autumn traditions in many cultures.\n",
"\n",
"Autumn is often associated with a sense of change and introspection. The crisp air and the sound of leaves crunching underfoot create a unique sensory experience. It's a season that invites people to reflect on the passing of time and the beauty of impermanence.\n",
"\n",
"In many places, autumn festivals and holidays like Halloween and Thanksgiving are celebrated, bringing communities together for various activities and traditions. Overall, autumn is a season of both visual and sensory splendor, where the world transforms, and nature puts on a dazzling show before the arrival of winter's chill.\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Paragraph</th>\n",
" <th>AI_generated</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Syd Rapson (born Sydney Rapson, 28 April 1932 ...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Bertram Deacon (8 November 1922 – 3 January 19...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Guðlaugur Þór Þórðarson (born 19 December 1967...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Achille-Ferdinand Carrier (February 15, 1859 -...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Rick Mahler (born Richard Alan Mahler on April...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>471</th>\n",
" <td>John Loder (1904–1972) was a British sound eng...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>472</th>\n",
" <td>Paul Caddis (born 28 October 1988) is a Scotti...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>473</th>\n",
" <td>Richard Michael \"Kip\" Carpenter (14 August 192...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>474</th>\n",
" <td>Tadeusz Szeligowski (1896–1963) was a Polish c...</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>475</th>\n",
" <td>Iwakuma made his professional debut with the B...</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>476 rows × 2 columns</p>\n",
"</div>"
],
"text/plain": [
" Paragraph AI_generated\n",
"0 Syd Rapson (born Sydney Rapson, 28 April 1932 ... 1\n",
"1 Bertram Deacon (8 November 1922 – 3 January 19... 0\n",
"2 Guðlaugur Þór Þórðarson (born 19 December 1967... 0\n",
"3 Achille-Ferdinand Carrier (February 15, 1859 -... 0\n",
"4 Rick Mahler (born Richard Alan Mahler on April... 1\n",
".. ... ...\n",
"471 John Loder (1904–1972) was a British sound eng... 1\n",
"472 Paul Caddis (born 28 October 1988) is a Scotti... 1\n",
"473 Richard Michael \"Kip\" Carpenter (14 August 192... 0\n",
"474 Tadeusz Szeligowski (1896–1963) was a Polish c... 1\n",
"475 Iwakuma made his professional debut with the B... 0\n",
"\n",
"[476 rows x 2 columns]"
]
},
"execution_count": 45,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 0.9999958276748657}]"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# ChatGPT\n",
"\n",
"classifier('''Paul Caddis is a Scottish professional footballer who primarily plays as a defender, specifically as a right-back or right-wing-back. He was born on April 19, 1988, in Irvine, Scotland. Caddis has had a career spanning multiple clubs in English and Scottish football.\n",
"\n",
"Caddis began his professional career with Scottish club Celtic in 2006, but he spent much of his early career on loan spells at other clubs to gain experience. In 2010, he joined Swindon Town on loan and played a crucial role in helping them achieve promotion from League Two to League One. His performances earned him a permanent move to Swindon Town in 2010.\n",
"\n",
"During his time at Swindon Town, Paul Caddis established himself as a dependable right-back and captain of the team. He also had a brief loan spell at Birmingham City in 2013, which eventually led to a permanent transfer in the same year. He became a regular starter for Birmingham City and continued to be a valuable member of the squad during his time there.\n",
"\n",
"Caddis later moved to Blackburn Rovers in 2016, where he spent a couple of seasons before joining Bradford City in 2018. He continued to ply his trade in the lower divisions of English football.\n",
"\n",
"Please note that player careers in professional sports can change over time, and my knowledge is based on information available up to September 2021. For the most up-to-date information on Paul Caddis's career, you may want to refer to more recent sources or the official website of his current club.''')"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ubuntu/SentenceStructureComparision/venv/lib/python3.10/site-packages/transformers/pipelines/base.py:1101: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n",
" warnings.warn(\n"
]
},
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 0.9999995231628418}]"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Chat-GPT\n",
"classifier('''\n",
" \n",
" Virat Kohli is an Indian international cricketer and one of the most renowned and accomplished batsmen in the world. He was born on November 5, 1988, in Delhi, India. Kohli is known for his aggressive and charismatic style of play, and he has been a prominent figure in Indian cricket for many years.\n",
"\n",
"Kohli's journey in professional cricket began when he represented the Indian Under-19 cricket team, and he quickly made his mark as a promising talent. He made his debut for the senior Indian cricket team in August 2008 during an ODI (One Day International) against Sri Lanka.\n",
"\n",
"Over the years, Virat Kohli has achieved numerous records and accolades in international cricket. He has consistently been one of the top run-scorers in all formats of the game. In Test cricket, he has served as the captain of the Indian team and has been instrumental in India's success in Test matches, both at home and overseas. Under his leadership, India achieved its first-ever Test series win in Australia in the 2018-2019 season.\n",
"\n",
"In limited-overs cricket, Kohli has been a dynamic and dominant force, amassing numerous centuries and helping India win several important tournaments, including the 2011 ICC Cricket World Cup and the ICC Champions Trophy in 2013. He has also been the captain of the Indian cricket team in ODIs and T20Is.\n",
"\n",
"Virat Kohli is known for his fitness, dedication to the sport, and his ability to consistently perform under pressure. He has received numerous awards and recognitions, including the prestigious Sir Garfield Sobers Trophy for ICC Cricketer of the Year multiple times. He has also been a part of Royal Challengers Bangalore in the Indian Premier League (IPL).\n",
"\n",
"Kohli is not only a cricketing icon but also a prominent figure in Indian sports and popular culture. His passion for the game and his commitment to excellence have made him one of the most celebrated and respected cricketers globally. Please note that my knowledge is based on information available up to September 2021, and there may have been developments in Virat Kohli's career since then.''')"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ubuntu/SentenceStructureComparision/venv/lib/python3.10/site-packages/transformers/pipelines/base.py:1101: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n",
" warnings.warn(\n"
]
},
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.9999997615814209}]"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# wikipedia article\n",
"\n",
"classifier(\n",
" '''Virat Kohli (Hindi pronunciation: [ʋɪˈɾɑːʈ ˈkoːɦli] ⓘ; born 5 November 1988) is an Indian international cricketer and the former captain of the Indian national cricket team who plays for Royal Challengers Bangalore in the IPL and Delhi in domestic cricket. Considered to be one of the best cricketers in the world, he is widely regarded as one of the greatest batsmen in the history of the sport.[4] Nicknamed \"The King\", due to his dominant style of play and popularity, Kohli holds numerous records in his career across all formats. In 2020, the International Cricket Council named him the male cricketer of the decade. Kohli has also contributed to India's successes, captaining the team from 2014 to 2022, and winning the 2011 World Cup and the 2013 Champions trophy. He is among the only four Indian cricketers who have played over 500 matches for India.[5]\n",
"\n",
"Born and raised in New Delhi, Kohli trained at the West Delhi Cricket Academy and started his youth career with the Delhi Under-15 team. He made his international debut in 2008 and quickly became a key player in the ODI team and later made his Test debut in 2011. In 2013, Kohli reached the number one spot in the ICC rankings for ODI batsmen for the first time. During 2014 T20 World Cup, he set a record for the most runs scored in the tournament. In 2018, he achieved yet another milestone, becoming the world's top-ranked Test batsman, making him the only Indian cricketer to hold the number one spot in all three formats of the game. His form continued in 2019, when he became the first player to score 20,000 international runs in a single decade. In 2021, Kohli made the decision to step down as the captain of the Indian national team for T20Is, following the T20 World Cup and in early 2022 he stepped down as the captain of the Test team as well.'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.9999998807907104}]"
]
},
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\n",
"# Wikipedia\n",
"classifier(\n",
" '''Donald John Trump (born June 14, 1946) is an American politician, media personality, and businessman who served as the 45th president of the United States from 2017 to 2021.\n",
"\n",
"Trump received a BS in economics from the University of Pennsylvania in 1968, and his father named him president of his real-estate business in 1971. Trump renamed it the Trump Organization and expanded its operations to building and renovating skyscrapers, hotels, casinos, and golf courses. After a series of business reversals in the late twentieth century, he successfully launched various side ventures that required little capital, mostly by licensing the Trump name. From 2004 to 2015, he co-produced and hosted the reality television series The Apprentice, in which he portrayed a fictionalized version of himself as a wealthy and successful executive. He and his businesses have been plaintiff or defendant in more than 4,000 state and federal legal actions, including six business bankruptcies.\n",
"\n",
"Trump won the 2016 presidential election as the Republican nominee against Democratic nominee Hillary Clinton while losing the popular vote.[a] During the campaign, his political positions were described as populist, protectionist, isolationist, and nationalist. His election and policies sparked numerous protests. He was the first U.S. president with no prior military or government service. The 2017–2019 special counsel investigation established that Russia had interfered in the 2016 election to favor Trump's campaign. Trump promoted conspiracy theories and made many false and misleading statements during his campaigns and presidency, to a degree unprecedented in American politics. Many of his comments and actions have been characterized as racially charged or racist and many as misogynistic.'''\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.9999955892562866}]"
]
},
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# ChatGPT\n",
"\n",
"classifier(\n",
" '''Donald Trump is an American businessman, television personality, and politician who served as the 45th President of the United States from January 20, 2017, to January 20, 2021. He was born on June 14, 1946, in Queens, New York City. Trump is a controversial and polarizing figure in American politics and has had a significant impact on the country's political landscape.\n",
"\n",
"Before entering politics, Donald Trump was primarily known as a real estate developer and businessman. He inherited his father's real estate business and expanded it into the Trump Organization, which became involved in various ventures, including luxury hotels, casinos, and golf courses. His name became synonymous with luxury branding, and he hosted the reality TV show \"The Apprentice\" for several years.\n",
"\n",
"In 2015, Donald Trump announced his candidacy for the Republican Party's nomination for President of the United States. He ran on a platform that emphasized immigration reform, tax cuts, deregulation, and a tough stance on international trade. His unconventional campaign style and use of social media, particularly Twitter, attracted significant attention.\n",
"\n",
"Despite facing a crowded field of Republican candidates, Trump secured the nomination and went on to win the 2016 presidential election against the Democratic candidate, Hillary Clinton. His presidency was marked by a range of policies and actions, including tax reform, deregulation, appointment of federal judges, and changes to immigration policy. His administration was also marked by controversy, including investigations into Russian interference in the 2016 election and his impeachment by the House of Representatives in 2019 (he was acquitted by the Senate).\n",
"\n",
"In 2020, Donald Trump sought re-election but was defeated by the Democratic candidate, Joe Biden. His tenure as President was marked by significant political polarization, with both ardent supporters and vehement critics.\n",
"\n",
"Donald Trump's leadership and policies continue to be a subject of debate and discussion in American politics, and he remains a prominent figure in the Republican Party as of my last knowledge update in September 2021. Please note that there may have been developments or changes in his political activities or status since that time.'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 39,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ubuntu/SentenceStructureComparision/venv/lib/python3.10/site-packages/transformers/pipelines/base.py:1101: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n",
" warnings.warn(\n"
]
},
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.9999998807907104}]"
]
},
"execution_count": 39,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# wikipedia article\n",
"\n",
"classifier(\n",
" '''The Flash (or simply Flash) is the name of several superheroes appearing in American comic books published by DC Comics. Created by writer Gardner Fox and artist Harry Lampert, the original Flash first appeared in Flash Comics #1 (cover dated January 1940, released November 1939).[1] Nicknamed \"the Scarlet Speedster\", all incarnations of the Flash possess \"superspeed\", which includes the ability to run, move, and think extremely fast, use superhuman reflexes, and seemingly violate certain laws of physics.\n",
"\n",
"Thus far, at least five different characters—each of whom somehow gained the power of \"the Speed Force\"—have assumed the mantle of the Flash in DC's history: college athlete Jay Garrick (1940–1951, 1961–2011, 2017–present), forensic scientist Barry Allen (1956–1985, 2008–present), Barry's nephew Wally West (1986–2011, 2016–present), Barry's grandson Bart Allen (2006–2007), and Chinese-American Avery Ho (2017–present). Each incarnation of the Flash has been a key member of at least one of DC's premier teams: the Justice Society of America, the Justice League, and the Teen Titans.\n",
"\n",
"The Flash is one of DC Comics' most popular characters and has been integral to the publisher's many reality-changing \"crisis\" story lines over the years. The original meeting of the Golden Age Flash Jay Garrick and Silver Age Flash Barry Allen in \"Flash of Two Worlds\" (1961) introduced the Multiverse storytelling concept to DC readers, which would become the basis for many DC stories in the years to come.\n",
"\n",
"Like his Justice League colleagues Wonder Woman, Superman and Batman, the Flash has a distinctive cast of adversaries, including Gorilla Grodd, the various Rogues (unique among DC supervillains for their code of honor) and the various psychopathic \"speedsters\" who go by the names Reverse-Flash or Zoom. Other supporting characters in Flash stories include Barry's wife Iris West, Wally's wife Linda Park, Bart's girlfriend Valerie Perez, friendly fellow speedster Max Mercury, and Central City police department members David Singh and Patty Spivot.'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 40,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ubuntu/SentenceStructureComparision/venv/lib/python3.10/site-packages/transformers/pipelines/base.py:1101: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n",
" warnings.warn(\n"
]
},
{
"data": {
"text/plain": [
"[{'label': 'NEGATIVE', 'score': 0.9999996423721313}]"
]
},
"execution_count": 40,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Chat-gpt\n",
"classifier(\n",
" '''\"The Flash\" is a popular fictional superhero character and the alter ego of multiple comic book characters published by DC Comics. The character made his first appearance in \"Flash Comics #1\" in 1940 and has since become one of DC Comics' most iconic and enduring superheroes.\n",
"\n",
"The most well-known incarnation of The Flash is Barry Allen, a forensic scientist who gains super-speed abilities after being struck by lightning and exposed to chemicals in his lab. Barry Allen's superhero persona, The Flash, is known for his signature red costume with a lightning bolt emblem on his chest and a cowl that covers his face.\n",
"\n",
"The Flash possesses the ability to move at incredibly high speeds, which enables him to run on water, phase through objects, and even travel through time. He uses his powers to fight crime in the fictional Central City, often facing off against a rogues' gallery of supervillains, including Reverse-Flash, Captain Cold, and Gorilla Grodd.\n",
"\n",
"The character of The Flash has been adapted into various forms of media over the years, including television series, animated shows, and movies. Notably, there is a live-action television series titled \"The Flash\" that premiered in 2014 as part of the Arrowverse, a shared universe of DC Comics-based television shows. In this series, Grant Gustin portrays Barry Allen/The Flash.\n",
"\n",
"The character has also appeared in animated TV series, such as \"Justice League\" and \"Justice League Unlimited,\" as well as animated movies and video games. Additionally, there have been discussions and plans for a standalone Flash movie in the DC Extended Universe (DCEU) with Ezra Miller reprising the role.\n",
"\n",
"The Flash has remained a beloved and enduring character in the world of superhero comics, captivating audiences with his incredible speed and heroics for over eight decades.'''\n",
")"
]
},
{
"cell_type": "raw",
"metadata": {},
"source": [
"The Flash is the name of several superheroes appearing in American comic books published by DC Comics. Created by writer Gardner Fox and artist Harry Lampert, the original Flash first appeared in Flash Comics. Nicknamed \"the Scarlet Speedster\", all incarnations of the Flash possess \"superspeed\", which includes the ability to run, move, and think extremely fast, use superhuman reflexes, and seemingly violate certain laws of physics.\n",
"\n",
"Thus far, at least five different characters—each of whom somehow gained the power of \"the Speed Force\"—have assumed the mantle of the Flash in DC's history: college athlete Jay Garrick, forensic scientist Barry Allen, Barry's nephew Wally West, Barry's grandson Bart Allen, and Chinese-American Avery Ho. Each incarnation of the Flash has been a key member of at least one of DC's premier teams: the Justice Society of America, the Justice League, and the Teen Titans.\n",
"\n",
"The Flash is one of DC Comics' most popular characters and has been integral to the publisher's many reality-changing \"crisis\" story lines over the years. The original meeting of the Golden Age Flash Jay Garrick and Silver Age Flash Barry Allen in \"Flash of Two Worlds\" introduced the Multiverse storytelling concept to DC readers, which would become the basis for many DC stories in the years to come.\n",
"\n",
"Like his Justice League colleagues Wonder Woman, Superman and Batman, the Flash has a distinctive cast of adversaries, including Gorilla Grodd, the various Rogues and the various psychopathic \"speedsters\" who go by the names Reverse-Flash or Zoom. Other supporting characters in Flash stories include Barry's wife Iris West, Wally's wife Linda Park, Bart's girlfriend Valerie Perez, friendly fellow speedster Max Mercury, and Central City police department members David Singh and Patty Spivot."
]
},
{
"cell_type": "code",
"execution_count": 41,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ubuntu/SentenceStructureComparision/venv/lib/python3.10/site-packages/transformers/pipelines/base.py:1101: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n",
" warnings.warn(\n"
]
},
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 1.0}]"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier('''GeeksforGeeks is a computer science portal for geeks who want to learn and practice various topics related to programming, data structures, algorithms, and more. It offers articles, videos, courses, quizzes, and interview preparation materials for students and professionals.''')"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ubuntu/SentenceStructureComparision/venv/lib/python3.10/site-packages/transformers/pipelines/base.py:1101: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n",
" warnings.warn(\n"
]
},
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 0.9999998807907104}]"
]
},
"execution_count": 42,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier('''The Amazing Spider-Man is a comic book series published by Marvel Comics, featuring the adventures of the fictional superhero Spider-Man. The series was created by writer Stan Lee and artist Steve Ditko, and it was first published in 1963. The series has been adapted into various media, including television shows, films, and video games. The most recent film adaptation of the series was released in 2012, directed by Marc Webb and starring Andrew Garfield as Peter Parker/Spider-Man .''')"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ubuntu/SentenceStructureComparision/venv/lib/python3.10/site-packages/transformers/pipelines/base.py:1101: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n",
" warnings.warn(\n"
]
},
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 0.9999988079071045}]"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier(\n",
" '''The Amazing Spider-Man is an ongoing American superhero comic book series featuring the Marvel Comics superhero Spider-Man as its title character and main protagonist. Being in the mainstream continuity of the franchise, it was the character's first title, launching seven months after his introduction in the final issue of Amazing Fantasy. '''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ubuntu/SentenceStructureComparision/venv/lib/python3.10/site-packages/transformers/pipelines/base.py:1101: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n",
" warnings.warn(\n"
]
},
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 0.9999998807907104}]"
]
},
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier('''\n",
" \n",
" The Flash is a superhero character from DC Comics. The character was created by writer Gardner Fox and artist Harry Lampert, and first appeared in Flash Comics #1 in 1940. The Flash's real name is Barry Allen, a forensic scientist who gains the power of superhuman speed after being struck by lightning. The Flash is known for his red costume with a lightning bolt symbol on his chest, and his ability to move at incredible speeds, which he uses to fight crime and protect the citizens of Central City. The character has been adapted into various media, including television shows, films, and video games. The most recent television adaptation of the series was released in 2014, starring Grant Gustin as Barry Allen/The Flash. The character has also appeared in various animated series and films, including Justice League: The Flashpoint Paradox (2013) and Justice League: War (2014).\n",
" ''')"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'label': 'POSITIVE', 'score': 1.0}]"
]
},
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"classifier(\n",
" '''\"The Flash\" is a popular fictional superhero character and the alter ego of multiple comic book characters published by DC Comics. The character made his first appearance in \"Flash Comics #1\" in 1940 and has since become one of DC Comics' most iconic and enduring superheroes.\n",
"\n",
"The most well-known incarnation of The Flash is Barry Allen, a forensic scientist who gains super-speed abilities after being struck by lightning and exposed to chemicals in his lab. Barry Allen's superhero persona, The Flash, is known for his signature red costume with a lightning bolt emblem on his chest and a cowl that covers his face.\n",
"The Flash possesses the ability to move at incredibly high speeds, which enables him to run on water, phase through objects, and even travel through time. He uses his powers to fight crime in the fictional Central City, often facing off against a rogues' gallery of supervillains, including Reverse-Flash, Captain Cold, and Gorilla Grodd.\n",
"\n",
"The character of The Flash has been adapted into various forms of media over the years, including television series, animated shows, and movies. Notably, there is a live-action television series titled \"The Flash\" that premiered in 2014 as part of the Arrowverse, a shared universe of DC Comics-based television shows. In this series, Grant Gustin portrays Barry Allen/The Flash.\n",
"\n",
"The character has also appeared in animated TV series, such as \"Justice League\" and \"Justice League Unlimited,\" as well as animated movies and video games. Additionally, there have been discussions and plans for a standalone Flash movie in the DC Extended Universe (DCEU) with Ezra Miller reprising the role.\n",
"\n",
"The Flash has remained a beloved and enduring character in the world of superhero comics, captivating audiences with his incredible speed and heroics for over eight decades.\n",
"'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Inference Part v2"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"import os; os.chdir('..')"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"s= '''The Flash possesses the ability to move at incredibly high speeds, which enables him to run on water, phase through objects, and even travel through time. He uses his powers to fight crime in the fictional Central City, often facing off against a rogues' gallery of supervillains, including Reverse-Flash, Captain Cold, and Gorilla Grodd.\n",
"\n",
"The character of The Flash has been adapted into various forms of media over the years, including television series, animated shows, and movies. Notably, there is a live-action television series titled \"The Flash\" that premiered in 2014 as part of the Arrowverse, a shared universe of DC Comics-based television shows. In this series, Grant Gustin portrays Barry Allen/The Flash.\n",
"\n",
"The character has also appeared in animated TV series, such as \"Justice League\" and \"Justice League Unlimited,\" as well as animated movies and video games. Additionally, there have been discussions and plans for a standalone Flash movie in the DC Extended Universe (DCEU) with Ezra Miller reprising the role.\n",
"\n",
"The Flash has remained a beloved and enduring character in the world of superhero comics, captivating audiences with his incredible speed and heroics for over eight decades.'''"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.\n"
]
}
],
"source": [
"from transformers import AutoTokenizer\n",
"\n",
"tokenizer = AutoTokenizer.from_pretrained(\"gpt3_finetuned_model/checkpoint-30048\")\n",
"inputs = tokenizer(s, return_tensors=\"pt\")"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'input_ids': tensor([[ 101, 1996, 5956, 14882, 1996, 3754, 2000, 2693, 2012, 11757,\n",
" 2152, 10898, 1010, 2029, 12939, 2032, 2000, 2448, 2006, 2300,\n",
" 1010, 4403, 2083, 5200, 1010, 1998, 2130, 3604, 2083, 2051,\n",
" 1012, 2002, 3594, 2010, 4204, 2000, 2954, 4126, 1999, 1996,\n",
" 7214, 2430, 2103, 1010, 2411, 5307, 2125, 2114, 1037, 12406,\n",
" 2015, 1005, 3916, 1997, 3565, 26548, 28247, 1010, 2164, 7901,\n",
" 1011, 5956, 1010, 2952, 3147, 1010, 1998, 23526, 24665, 7716,\n",
" 2094, 1012, 1996, 2839, 1997, 1996, 5956, 2038, 2042, 5967,\n",
" 2046, 2536, 3596, 1997, 2865, 2058, 1996, 2086, 1010, 2164,\n",
" 2547, 2186, 1010, 6579, 3065, 1010, 1998, 5691, 1012, 5546,\n",
" 1010, 2045, 2003, 1037, 2444, 1011, 2895, 2547, 2186, 4159,\n",
" 1000, 1996, 5956, 1000, 2008, 5885, 1999, 2297, 2004, 2112,\n",
" 1997, 1996, 8612, 16070, 1010, 1037, 4207, 5304, 1997, 5887,\n",
" 5888, 1011, 2241, 2547, 3065, 1012, 1999, 2023, 2186, 1010,\n",
" 3946, 26903, 2378, 17509, 6287, 5297, 1013, 1996, 5956, 1012,\n",
" 1996, 2839, 2038, 2036, 2596, 1999, 6579, 2694, 2186, 1010,\n",
" 2107, 2004, 1000, 3425, 2223, 1000, 1998, 1000, 3425, 2223,\n",
" 14668, 1010, 1000, 2004, 2092, 2004, 6579, 5691, 1998, 2678,\n",
" 2399, 1012, 5678, 1010, 2045, 2031, 2042, 10287, 1998, 3488,\n",
" 2005, 1037, 26609, 5956, 3185, 1999, 1996, 5887, 3668, 5304,\n",
" 1006, 5887, 13765, 1007, 2007, 16245, 4679, 16360, 6935, 2075,\n",
" 1996, 2535, 1012, 1996, 5956, 2038, 2815, 1037, 11419, 1998,\n",
" 16762, 2839, 1999, 1996, 2088, 1997, 16251, 5888, 1010, 14408,\n",
" 17441, 9501, 2007, 2010, 9788, 3177, 1998, 14779, 2015, 2005,\n",
" 2058, 2809, 5109, 1012, 102]]), 'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1]])}"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"inputs"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"import torch\n",
"from transformers import AutoModelForSequenceClassification\n",
"with torch.no_grad():\n",
" logits = model(**inputs).logits\n",
"model = AutoModelForSequenceClassification.from_pretrained(\"gpt3_finetuned_model/checkpoint-30048\")\n"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"tensor([[ 3.8886, -3.8942]])"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"logits"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'NEGATIVE'"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"predicted_class_id = logits.argmax().item()\n",
"model.config.id2label[predicted_class_id]"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"logits: tensor([[-8.4513, 8.3008]])\n"
]
},
{
"data": {
"text/plain": [
"'POSITIVE'"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s= '''\"The Flash\" is a popular fictional superhero character and the alter ego of multiple comic book characters published by DC Comics. The character made his first appearance in \"Flash Comics #1\" in 1940 and has since become one of DC Comics' most iconic and enduring superheroes.\n",
"\n",
"The most well-known incarnation of The Flash is Barry Allen, a forensic scientist who gains super-speed abilities after being struck by lightning and exposed to chemicals in his lab. Barry Allen's superhero persona, The Flash, is known for his signature red costume with a lightning bolt emblem on his chest and a cowl that covers his face.'''\n",
"\n",
"inputs = tokenizer(s, return_tensors=\"pt\")\n",
"with torch.no_grad():\n",
" logits = model(**inputs).logits\n",
" \n",
"print(\"logits: \", logits)\n",
"predicted_class_id = logits.argmax().item()\n",
"model.config.id2label[predicted_class_id]"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"logits: tensor([[ 8.0543, -7.4965]])\n"
]
},
{
"data": {
"text/plain": [
"'NEGATIVE'"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s= '''Donald John Trump (born June 14, 1946) is an American politician, media personality, and businessman who served as the 45th president of the United States from 2017 to 2021.\n",
"\n",
"Trump received a BS in economics from the University of Pennsylvania in 1968, and his father named him president of his real-estate business in 1971. Trump renamed it the Trump Organization and expanded its operations to building and renovating skyscrapers, hotels, casinos, and golf courses. After a series of business reversals in the late twentieth century, he successfully launched various side ventures that required little capital, mostly by licensing the Trump name. From 2004 to 2015, he co-produced and hosted the reality television series The Apprentice, in which he portrayed a fictionalized version of himself as a wealthy and successful executive. He and his businesses have been plaintiff or defendant in more than 4,000 state and federal legal actions, including six business bankruptcies.\n",
"\n",
"Trump won the 2016 presidential election as the Republican nominee against Democratic nominee Hillary Clinton while losing the popular vote.[a] During the campaign, his political positions were described as populist, protectionist, isolationist, and nationalist. His election and policies sparked numerous protests. He was the first U.S. president with no prior military or government service. The 2017–2019 special counsel investigation established that Russia had interfered in the 2016 election to favor Trump's campaign. Trump promoted conspiracy theories and made many false and misleading statements during his campaigns and presidency, to a degree unprecedented in American politics. Many of his comments and actions have been characterized as racially charged or racist and many as misogynistic.'''\n",
" \n",
"inputs = tokenizer(s, return_tensors=\"pt\")\n",
"with torch.no_grad():\n",
" logits = model(**inputs).logits\n",
" \n",
"print(\"logits: \", logits)\n",
"predicted_class_id = logits.argmax().item()\n",
"model.config.id2label[predicted_class_id]"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"logits: tensor([[-4.0940, 4.3727]])\n"
]
},
{
"data": {
"text/plain": [
"'POSITIVE'"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s= '''To write a compelling sales copy, focus on understanding your target audience and their pain points. Craft a captivating headline to grab attention, followed by a concise and persuasive introduction. Highlight the benefits and unique selling points of your product or service, using persuasive language and storytelling techniques. Create a sense of urgency and offer a clear call-to-action to drive conversions. Revise and refine your copy for clarity and impact.'''\n",
" \n",
"inputs = tokenizer(s, return_tensors=\"pt\")\n",
"with torch.no_grad():\n",
" logits = model(**inputs).logits\n",
" \n",
"print(\"logits: \", logits)\n",
"predicted_class_id = logits.argmax().item()\n",
"model.config.id2label[predicted_class_id]"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"logits: tensor([[ 7.3291, -6.8746]])\n"
]
},
{
"data": {
"text/plain": [
"'NEGATIVE'"
]
},
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s= '''The Flash (or simply Flash) is the name of several superheroes in the DC Comics universe. Each iteration of the character possesses superhuman speed, allowing them to move at incredible velocities, run on water, phase through solid objects, and even time travel. The most iconic Flash is Barry Allen, who first appeared in 1956 and became the Scarlet Speedster known for his distinctive red costume with a lightning bolt emblem.\n",
"\n",
"Barry Allen's origin story involves a lightning strike combined with a chemical accident, granting him his incredible speed powers. He adopts the superhero persona of The Flash to fight crime in Central City. His adventures often revolve around thwarting supervillains and metahuman threats, while also serving as a founding member of the Justice League.\n",
"'''\n",
"\n",
"\n",
"s= '''The Flash (or simply Flash) is the name of several superheroes appearing in American comic books published by DC Comics. Created by writer Gardner Fox and artist Harry Lampert, the original Flash first appeared in Flash Comics #1 (cover dated January 1940, released November 1939).[1] Nicknamed \"the Scarlet Speedster\", all incarnations of the Flash possess \"superspeed\", which includes the ability to run, move, and think extremely fast, use superhuman reflexes, and seemingly violate certain laws of physics.\n",
"\n",
"Thus far, at least five different characters—each of whom somehow gained the power of \"the Speed Force\"—have assumed the mantle of the Flash in DC's history: college athlete Jay Garrick (1940–1951, 1961–2011, 2017–present), forensic scientist Barry Allen (1956–1985, 2008–present), Barry's nephew Wally West (1986–2011, 2016–present), Barry's grandson Bart Allen (2006–2007), and Chinese-American Avery Ho (2017–present). Each incarnation of the Flash has been a key member of at least one of DC's premier teams: the Justice Society of America, the Justice League, and the Teen Titans.'''\n",
"inputs = tokenizer(s, return_tensors=\"pt\")\n",
"with torch.no_grad():\n",
" logits = model(**inputs).logits\n",
" \n",
"print(\"logits: \", logits)\n",
"predicted_class_id = logits.argmax().item()\n",
"model.config.id2label[predicted_class_id]"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [],
"source": [
"def predict(sentence):\n",
" inputs = tokenizer(sentence, return_tensors=\"pt\")\n",
" with torch.no_grad():\n",
" logits = model(**inputs).logits\n",
" \n",
" print(\"logits: \", logits)\n",
" predicted_class_id = logits.argmax().item()\n",
" print(model.config.id2label[predicted_class_id])\n",
" label= \"Human Written\" if model.config.id2label[predicted_class_id]=='NEGATIVE' else 'AI written'\n",
" print(\"Label: \", label)"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"logits: tensor([[-7.7618, 7.7867]])\n",
"POSITIVE\n",
"Label: AI written\n"
]
}
],
"source": [
"predict('''The Flash (or simply Flash) is the name of several superheroes in the DC Comics universe. Each iteration of the character possesses superhuman speed, allowing them to move at incredible velocities, run on water, phase through solid objects, and even time travel. The most iconic Flash is Barry Allen, who first appeared in 1956 and became the Scarlet Speedster known for his distinctive red costume with a lightning bolt emblem.\n",
"\n",
"Barry Allen's origin story involves a lightning strike combined with a chemical accident, granting him his incredible speed powers. He adopts the superhero persona of The Flash to fight crime in Central City. His adventures often revolve around thwarting supervillains and metahuman threats, while also serving as a founding member of the Justice League.\n",
"\n",
"''')"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"logits: tensor([[ 7.3291, -6.8746]])\n",
"NEGATIVE\n",
"Label: Human Written\n"
]
}
],
"source": [
"predict(\n",
" '''The Flash (or simply Flash) is the name of several superheroes appearing in American comic books published by DC Comics. Created by writer Gardner Fox and artist Harry Lampert, the original Flash first appeared in Flash Comics #1 (cover dated January 1940, released November 1939).[1] Nicknamed \"the Scarlet Speedster\", all incarnations of the Flash possess \"superspeed\", which includes the ability to run, move, and think extremely fast, use superhuman reflexes, and seemingly violate certain laws of physics.\n",
"\n",
"Thus far, at least five different characters—each of whom somehow gained the power of \"the Speed Force\"—have assumed the mantle of the Flash in DC's history: college athlete Jay Garrick (1940–1951, 1961–2011, 2017–present), forensic scientist Barry Allen (1956–1985, 2008–present), Barry's nephew Wally West (1986–2011, 2016–present), Barry's grandson Bart Allen (2006–2007), and Chinese-American Avery Ho (2017–present). Each incarnation of the Flash has been a key member of at least one of DC's premier teams: the Justice Society of America, the Justice League, and the Teen Titans.'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"logits: tensor([[ 8.0190, -7.4839]])\n",
"NEGATIVE\n",
"Label: Human Written\n"
]
}
],
"source": [
"predict(\n",
" '''The Flash first appeared in the Golden Age Flash Comics #1 (January 1940), from All-American Publications, one of three companies that would eventually merge to form DC Comics. Created by writer Gardner Fox and artist Harry Lampert, this Flash was Jay Garrick, a college student who gained his speed through the inhalation of hard water vapors. When re-introduced in the 1960s Garrick's origin was modified slightly, gaining his powers through exposure to heavy water.\n",
"\n",
"Jay Garrick was a popular character in the 1940s, supporting both Flash Comics and All-Flash Quarterly (later published bi-monthly as simply All-Flash); co-starring in Comic Cavalcade; and being a charter member of the Justice Society of America, the first superhero team, whose adventures ran in All Star Comics. With superheroes' post-war decline in popularity, Flash Comics was canceled with issue #104 (1949) which featured an evil version of the Flash called the Rival. The Justice Society's final Golden Age story ran in All Star Comics #57 (1951; the title itself continued as All Star Western).'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"logits: tensor([[-2.8285, 3.1423]])\n",
"POSITIVE\n",
"Label: AI written\n"
]
}
],
"source": [
"predict(\n",
" '''The Flash first appeared in the Golden Age of comic books, debuting in \"Flash Comics #1\" in 1940. Created by writer Gardner Fox and artist Harry Lampert, the character's secret identity was Jay Garrick, a college student who gained super-speed abilities after inhaling the fumes of \"hard water\" during a lab accident. Jay Garrick's Flash became a beloved figure during the Golden Age of comics, known for his winged helmet and red costume with lightning bolt accents.\n",
"\n",
"However, the character experienced a revitalization during the Silver Age of comics in the late 1950s. This era saw the creation of a new Flash, Barry Allen, in \"Showcase #4\" in 1956. Barry, a police scientist, became the Scarlet Speedster after being struck by lightning and doused in chemicals while working in his laboratory. This event led to the iconic origin story that many fans recognize today.'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"logits: tensor([[ 7.9124, -7.3888]])\n",
"NEGATIVE\n",
"Label: Human Written\n"
]
}
],
"source": [
"predict(\n",
" '''Virat Kohli (Hindi pronunciation: [ʋɪˈɾɑːʈ ˈkoːɦli] ⓘ; born 5 November 1988) is an Indian international cricketer and the former captain of the Indian national cricket team who plays for Royal Challengers Bangalore in the IPL and Delhi in domestic cricket. Considered to be one of the best cricketers in the world, he is widely regarded as one of the greatest batsmen in the history of the sport.[4] Nicknamed \"The King\", due to his dominant style of play and popularity, Kohli holds numerous records in his career across all formats. In 2020, the International Cricket Council named him the male cricketer of the decade. Kohli has also contributed to India's successes, captaining the team from 2014 to 2022, and winning the 2011 World Cup and the 2013 Champions trophy. He is among the only four Indian cricketers who have played over 500 matches for India.[5]\n",
"\n",
"Born and raised in New Delhi, Kohli trained at the West Delhi Cricket Academy and started his youth career with the Delhi Under-15 team. He made his international debut in 2008 and quickly became a key player in the ODI team and later made his Test debut in 2011. In 2013, Kohli reached the number one spot in the ICC rankings for ODI batsmen for the first time. During 2014 T20 World Cup, he set a record for the most runs scored in the tournament. In 2018, he achieved yet another milestone, becoming the world's top-ranked Test batsman, making him the only Indian cricketer to hold the number one spot in all three formats of the game. His form continued in 2019, when he became the first player to score 20,000 international runs in a single decade. In 2021, Kohli made the decision to step down as the captain of the Indian national team for T20Is, following the T20 World Cup and in early 2022 he stepped down as the captain of the Test team as well.'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"logits: tensor([[-8.4224, 8.2709]])\n",
"POSITIVE\n",
"Label: AI written\n"
]
}
],
"source": [
"predict(\n",
" '''Virat Kohli is an Indian cricketing sensation who has left an indelible mark on the world of sports. Born in Delhi, India, Kohli's journey from a young aspiring cricketer to becoming one of the greatest batsmen in the history of the game is nothing short of remarkable.\n",
"\n",
"Kohli's cricketing prowess was evident from a tender age, and he quickly rose through the ranks of junior cricket in India. He made his debut for the Indian national team in 2008, and since then, he has been a symbol of consistency and excellence. His distinctive blend of aggression and technical finesse at the crease has earned him a reputation as a modern-day batting maestro.'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 50,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"logits: tensor([[ 7.4143, -6.9287]])\n",
"NEGATIVE\n",
"Label: Human Written\n"
]
}
],
"source": [
"predict(\n",
" '''Ah, spring. It’s our season of hope, holding a promise that change is a-comin’, for the better. The river will “flow again after it was frozen,” Ernest Hemingway wrote of the season in “A Moveable Feast.”\n",
"\n",
"Spring signifies coming out of the darkness. We’ve tipped the balance from longer nights to longer days. Equinox means “equal night” of light and dark (roughly), and through the rest of the season we can benefit — experientially and metaphorically – from more time spent in the light.\n",
"\n",
"“If we had no winter, the spring would not be so pleasant,” wrote English poet Anne Bradstreet. “If we did not sometimes taste of adversity, prosperity would not be so welcome.”\n",
"\n",
"'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 51,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"logits: tensor([[-2.8957, 3.2729]])\n",
"POSITIVE\n",
"Label: AI written\n"
]
}
],
"source": [
"predict(\n",
" '''Ah, spring. It's our season of hope, holding a promise of renewal and rebirth. As the days grow longer and the frost of winter slowly relinquishes its grip, the world awakens from its slumber. The air, once cold and crisp, becomes infused with the delicate fragrance of blooming flowers and fresh grass. Spring carries with it a sense of magic as nature's dormant forces burst forth in a riot of color and life.\n",
"\n",
"The most captivating transformation occurs in the trees, as they begin to bud and sprout tender green leaves. Cherry blossoms, daffodils, and tulips adorn gardens and parks, painting the landscape with their vibrant hues. Birds return from their migratory journeys, filling the air with their melodic symphonies, and animals emerge from hibernation, venturing out in search of sustenance and companionship.'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 52,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"logits: tensor([[ 8.1593, -7.5862]])\n",
"NEGATIVE\n",
"Label: Human Written\n"
]
}
],
"source": [
"predict(\n",
" '''Born and raised in New Delhi, Kohli trained at the West Delhi Cricket Academy and started his youth career with the Delhi Under-15 team. He made his international debut in 2008 and quickly became a key player in the ODI team and later made his Test debut in 2011. In 2013, Kohli reached the number one spot in the ICC rankings for ODI batsmen for the first time. During 2014 T20 World Cup, he set a record for the most runs scored in the tournament. In 2018, he achieved yet another milestone, becoming the world's top-ranked Test batsman, making him the only Indian cricketer to hold the number one spot in all three formats of the game. His form continued in 2019, when he became the first player to score 20,000 international runs in a single decade. In 2021, Kohli made the decision to step down as the captain of the Indian national team for T20Is, following the T20 World Cup and in early 2022 he stepped down as the captain of the Test team as well.\n",
"\n",
"He has received many accolades for his performances on the cricket field. He was recognized as the ICC ODI Player of the Year in 2012 and has won the Sir Garfield Sobers Trophy, given to the ICC Cricketer of the Year, on two occasions, in 2017 and 2018 respectively. Subsequently, Kohli also won ICC Test Player of the Year and ICC ODI Player of the Year awards in 2018, becoming the first player to win both awards in the same year. Additionally, he was named the Wisden Leading Cricketer in the World for three consecutive years, from 2016 to 2018. At the national level, Kohli was honoured with the Arjuna Award in 2013, the Padma Shri under the sports category in 2017 and the Khel Ratna award, India's highest sporting honour, in 2018.'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 53,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"logits: tensor([[-6.4534, 6.6134]])\n",
"POSITIVE\n",
"Label: AI written\n"
]
}
],
"source": [
"predict(\n",
" '''\"The Flash\" can refer to several different things:\n",
"\n",
"1. **The Flash (DC Comics character)**: The Flash is the name of several superheroes appearing in American comic books published by DC Comics³.\n",
"\n",
"2. **The Flash (2014 TV series)**: This is an American superhero television series developed by Greg Berlanti, Andrew Kreisberg, and Geoff Johns, airing on The CW. It is based on the Barry Allen incarnation of DC Comics character the Flash, a costumed superhero crime-fighter with the power to move at superhuman speeds².\n",
"\n",
"3. **The Flash (2023 film)**: This is a 2023 American superhero film based on the DC Comics character of the same name. Produced by Warner Bros. Pictures, DC Studios, Double Dream, and the Disco Factory, and distributed by Warner Bros. Pictures, it is the 13th installment in the DC Extended Universe (DCEU)¹.\n",
"'''\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
|