-
Notifications
You must be signed in to change notification settings - Fork 0
/
Untitled4.html
executable file
·2733 lines (2480 loc) · 256 KB
/
Untitled4.html
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
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>UTS | Data (https://pta.trunojoyo.ac.id/) TF-IDF — Fikri Ainun Najib</title>
<script data-cfasync="false">
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
document.documentElement.dataset.theme = localStorage.getItem("theme") || "light";
</script>
<!-- Loaded before other Sphinx assets -->
<link href="_static/styles/theme.css?digest=e353d410970836974a52" rel="stylesheet" />
<link href="_static/styles/bootstrap.css?digest=e353d410970836974a52" rel="stylesheet" />
<link href="_static/styles/pydata-sphinx-theme.css?digest=e353d410970836974a52" rel="stylesheet" />
<link href="_static/vendor/fontawesome/6.1.2/css/all.min.css?digest=e353d410970836974a52" rel="stylesheet" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.1.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.1.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.1.2/webfonts/fa-regular-400.woff2" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" href="_static/styles/sphinx-book-theme.css?digest=14f4ca6b54d191a8c7657f6c759bf11a5fb86285" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/togglebutton.css" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css" />
<link rel="stylesheet" type="text/css" href="_static/sphinx-thebe.css" />
<link rel="stylesheet" type="text/css" href="_static/design-style.4045f2051d55cab465a707391d5b2007.min.css" />
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="_static/scripts/bootstrap.js?digest=e353d410970836974a52" />
<link rel="preload" as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=e353d410970836974a52" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/clipboard.min.js"></script>
<script src="_static/copybutton.js"></script>
<script src="_static/scripts/sphinx-book-theme.js?digest=5a5c038af52cf7bc1a1ec88eea08e6366ee68824"></script>
<script>let toggleHintShow = 'Click to show';</script>
<script>let toggleHintHide = 'Click to hide';</script>
<script>let toggleOpenOnPrint = 'true';</script>
<script src="_static/togglebutton.js"></script>
<script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
<script src="_static/design-tabs.js"></script>
<script>const THEBE_JS_URL = "https://unpkg.com/[email protected]/lib/index.js"
const thebe_selector = ".thebe,.cell"
const thebe_selector_input = "pre"
const thebe_selector_output = ".output, .cell_output"
</script>
<script async="async" src="_static/sphinx-thebe.js"></script>
<script>DOCUMENTATION_OPTIONS.pagename = 'Untitled4';</script>
<link rel="shortcut icon" href="_static/y.jpg"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Tugas 7 | PageRank NetworkX" href="Untitled5.html" />
<link rel="prev" title="Tugas 6 | TimeSeries Dataset airline-passengers" href="Untitled3.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
</head>
<body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">
<a class="skip-link" href="#main-content">Skip to main content</a>
<input type="checkbox"
class="sidebar-toggle"
name="__primary"
id="__primary"/>
<label class="overlay overlay-primary" for="__primary"></label>
<input type="checkbox"
class="sidebar-toggle"
name="__secondary"
id="__secondary"/>
<label class="overlay overlay-secondary" for="__secondary"></label>
<div class="search-button__wrapper">
<div class="search-button__overlay"></div>
<div class="search-button__search-container">
<form class="bd-search d-flex align-items-center"
action="search.html"
method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search"
class="form-control"
name="q"
id="search-input"
placeholder="Search this book..."
aria-label="Search this book..."
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"/>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form></div>
</div>
<nav class="bd-header navbar navbar-expand-lg bd-navbar">
</nav>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
<div class="bd-sidebar-primary bd-sidebar">
<div class="sidebar-header-items sidebar-primary__section">
</div>
<div class="sidebar-primary-items__start sidebar-primary__section">
<div class="sidebar-primary-item">
<a class="navbar-brand logo" href="intro.html">
<img src="_static/x.jpg" class="logo__image only-light" alt="Logo image"/>
<script>document.write(`<img src="_static/x.jpg" class="logo__image only-dark" alt="Logo image"/>`);</script>
</a></div>
<div class="sidebar-primary-item"><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
<div class="bd-toc-item navbar-nav active">
<ul class="nav bd-sidenav bd-sidenav__home-link">
<li class="toctree-l1">
<a class="reference internal" href="intro.html">
Welcome to your Jupyter Book
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Home</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="markdown.html">Markdown Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="notebooks.html">Content with notebooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="markdown-notebooks.html">Notebooks with MyST Markdown</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Task</span></p>
<ul class="current nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="Untitled0.html"><strong>Tugas 1 | Crawling Twitter with snscrape</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="notebooks2.html"><strong>Tugas 2 | Web Scraping (https://pta.trunojoyo.ac.id/)</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="notebooks3.html"><strong>Tugas 3 | Web Scraping (https://www.tribunnews.com/)</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="Untitled1.html"><strong>Tugas 4 | Pipelines</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="Untitled2.html"><strong>Tugas 5 | Pipelines With PCA</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="Untitled3.html"><strong>Tugas 6 | TimeSeries Dataset airline-passengers</strong></a></li>
<li class="toctree-l1 current active"><a class="current reference internal" href="#"><strong>UTS | Data (https://pta.trunojoyo.ac.id/) TF-IDF</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="Untitled5.html"><strong>Tugas 7 | PageRank NetworkX</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="Untitled6.html"><strong>Tugas 8 | Extractive Summarizer</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="Untitled7.html"><strong>Tugas 9 | Topic Modelling</strong></a></li>
</ul>
</div>
</nav></div>
</div>
<div class="sidebar-primary-items__end sidebar-primary__section">
</div>
<div id="rtd-footer-container"></div>
</div>
<main id="main-content" class="bd-main">
<div class="sbt-scroll-pixel-helper"></div>
<div class="bd-content">
<div class="bd-article-container">
<div class="bd-header-article">
<div class="header-article-items header-article__inner">
<div class="header-article-items__start">
<div class="header-article-item"><label class="sidebar-toggle primary-toggle btn btn-sm" for="__primary" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-bars"></span>
</label></div>
</div>
<div class="header-article-items__end">
<div class="header-article-item">
<div class="article-header-buttons">
<div class="dropdown dropdown-launch-buttons">
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Launch interactive content">
<i class="fas fa-rocket"></i>
</button>
<ul class="dropdown-menu">
<li><a href="https://colab.research.google.com/github/LALA09-erha/prosaindata/blob/gh-pages/_sources/Untitled4.ipynb" target="_blank"
class="btn btn-sm dropdown-item"
title="Launch onColab"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<img src="_static/images/logo_colab.png">
</span>
<span class="btn__text-container">Colab</span>
</a>
</li>
</ul>
</div>
<div class="dropdown dropdown-source-buttons">
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Source repositories">
<i class="fab fa-github"></i>
</button>
<ul class="dropdown-menu">
<li><a href="https://github.com/LALA09-erha/prosaindata" target="_blank"
class="btn btn-sm btn-source-repository-button dropdown-item"
title="Source repository"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fab fa-github"></i>
</span>
<span class="btn__text-container">Repository</span>
</a>
</li>
<li><a href="https://github.com/LALA09-erha/prosaindata/issues/new?title=Issue%20on%20page%20%2FUntitled4.html&body=Your%20issue%20content%20here." target="_blank"
class="btn btn-sm btn-source-issues-button dropdown-item"
title="Open an issue"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-lightbulb"></i>
</span>
<span class="btn__text-container">Open issue</span>
</a>
</li>
</ul>
</div>
<div class="dropdown dropdown-download-buttons">
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Download this page">
<i class="fas fa-download"></i>
</button>
<ul class="dropdown-menu">
<li><a href="_sources/Untitled4.ipynb" target="_blank"
class="btn btn-sm btn-download-source-button dropdown-item"
title="Download source file"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-file"></i>
</span>
<span class="btn__text-container">.ipynb</span>
</a>
</li>
<li>
<button onclick="window.print()"
class="btn btn-sm btn-download-pdf-button dropdown-item"
title="Print to PDF"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-file-pdf"></i>
</span>
<span class="btn__text-container">.pdf</span>
</button>
</li>
</ul>
</div>
<button onclick="toggleFullScreen()"
class="btn btn-sm btn-fullscreen-button"
title="Fullscreen mode"
data-bs-placement="bottom" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-expand"></i>
</span>
</button>
<script>
document.write(`
<button class="theme-switch-button btn btn-sm btn-outline-primary navbar-btn rounded-circle" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="theme-switch" data-mode="light"><i class="fa-solid fa-sun"></i></span>
<span class="theme-switch" data-mode="dark"><i class="fa-solid fa-moon"></i></span>
<span class="theme-switch" data-mode="auto"><i class="fa-solid fa-circle-half-stroke"></i></span>
</button>
`);
</script>
<script>
document.write(`
<button class="btn btn-sm navbar-btn search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
</button>
`);
</script>
<label class="sidebar-toggle secondary-toggle btn btn-sm" for="__secondary"title="Toggle secondary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-list"></span>
</label>
</div></div>
</div>
</div>
</div>
<div id="jb-print-docs-body" class="onlyprint">
<h1>UTS | Data (https://pta.trunojoyo.ac.id/) TF-IDF</h1>
<!-- Table of contents -->
<div id="print-main-content">
<div id="jb-print-toc">
<div>
<h2> Contents </h2>
</div>
<nav aria-label="Page">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#proses-pengambilan-data-csv">Proses Pengambilan data CSV</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#preprocessing-data">Preprocessing Data</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#seleksi-column">Seleksi Column</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#install-libary-sastrawi">Install Libary Sastrawi</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#inisialisasi-variable">Inisialisasi Variable</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#cleaning-text">Cleaning Text</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#tokenisasi-data">Tokenisasi Data</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#menghapus-stopword-dengan-sastrawi">Menghapus StopWord dengan sastrawi</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#mengubah-menjadi-lower-case-dan-memeriksa-spesial-char">Mengubah menjadi lower case dan Memeriksa Spesial char</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#menghapus-angka">Menghapus Angka</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#menghapus-whitespase-karakter-kosong">Menghapus Whitespase (Karakter Kosong)</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#spell-checker">SPELL checker</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#stemming-kata-dengan-sastrawi">Stemming Kata Dengan Sastrawi</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#mengambil-data-yang-sudah-dilakukan-proses-sebelumnya">Mengambil data yang sudah dilakukan proses sebelumnya</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#mengubah-label-menjadi-angka">Mengubah Label menjadi angka</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#implementasi-ke-metode-tf-idf">Implementasi Ke METODE TF-IDF</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#implementasi-ke-pca">Implementasi ke PCA</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#split-data">Split Data</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#eksekusi-ke-model">Eksekusi ke Model</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#k-means-clustering">K-means Clustering</a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#untuk-percobaan-n-component-1-25">Untuk Percobaan n_component =1-25</a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#hasil-akurasi-tertinggi">Hasil Akurasi Tertinggi</a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#gausian-naive-bayes">Gausian Naive Bayes</a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#inisialisasi-libary">inisialisasi libary</a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id1">Untuk Percobaan n_component = 1-25</a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id2">Hasil Akurasi Tertinggi</a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#hasil-akurasi-pada-plot">Hasil Akurasi Pada Plot</a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#k-nearest-neighbor-k-nn">k-Nearest Neighbor (k-NN)</a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id3">inisialisasi libary</a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#untuk-percobaan-n-component-1-25-dan-n-neigboars-1-25">Untuk Percobaan n_component 1-25 dan n_neigboars 1-25</a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id4">Hasil Akurasi Tertinggi</a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id5">Hasil Akurasi pada Plot</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div id="searchbox"></div>
<article class="bd-article" role="main">
<div class="tex2jax_ignore mathjax_ignore section" id="uts-data-https-pta-trunojoyo-ac-id-tf-idf">
<h1><strong>UTS | Data (<a class="reference external" href="https://pta.trunojoyo.ac.id/">https://pta.trunojoyo.ac.id/</a>) TF-IDF</strong><a class="headerlink" href="#uts-data-https-pta-trunojoyo-ac-id-tf-idf" title="Permalink to this heading">#</a></h1>
<p>Data scraping atau yang juga sering disebut data extraction merupakan teknik atau metode otomatisasi yang memungkinkan seseorang untuk mengekstrak data dari sebuah website, database, aplikasi enterprise, atau sistem legacy yang kemudian dapat menyimpannya ke dalam sebuah file dengan format tabular atau spreadsheet.</p>
<p>Libary untuk scraping tersedia banyak, namun untuk kasus ini menggunakan libary <code class="docutils literal notranslate"><span class="pre">"BeautifulSoup"</span></code></p>
<hr class="docutils" />
<p>Untuk Pengambilan data dari Web PTA dapat dilihat pada link berikut : <a class="reference external" href="https://lala09-erha.github.io/prosaindata/notebooks2.html">https://lala09-erha.github.io/prosaindata/notebooks2.html</a></p>
<div class="section" id="proses-pengambilan-data-csv">
<h2>Proses Pengambilan data CSV<a class="headerlink" href="#proses-pengambilan-data-csv" title="Permalink to this heading">#</a></h2>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
<span class="c1"># path = "/content/drive/MyDrive/prosaindata/DataCrawling/Data_pta.csv"</span>
<span class="n">path</span> <span class="o">=</span> <span class="s2">"https://raw.githubusercontent.com/LALA09-erha/File-semester5/master/PSD/Data%20Crawling/Data_pta.csv"</span>
<span class="n">df</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">path</span><span class="p">)</span>
<span class="n">df</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_html">
<div id="df-8aaefa67-545c-4ca2-b832-bed45380e977">
<div class="colab-df-container">
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>Unnamed: 0</th>
<th>NIM</th>
<th>Judul</th>
<th>Penulis</th>
<th>Abstrak</th>
<th>Program Studi</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>0</td>
<td>40411100468</td>
<td>PERANCANGAN DAN IMPLEMENTASI SISTEM DATABASE T...</td>
<td>A.Ubaidillah S.Kom</td>
<td>Sistem informasi akademik (SIAKAD) merupakan s...</td>
<td>Teknik Informatika</td>
</tr>
<tr>
<th>1</th>
<td>1</td>
<td>40411100476</td>
<td>APLIKASI KONTROL DAN MONITORING JARINGAN KOMPU...</td>
<td>M. Basith Ardianto,</td>
<td>Berjalannya koneksi jaringan komputer dengan l...</td>
<td>Teknik Informatika</td>
</tr>
<tr>
<th>2</th>
<td>2</td>
<td>40411100480</td>
<td>RANCANG BANGUN APLIKASI PROXY SERVER UNTUK ENK...</td>
<td>Akhmad Suyandi, S.Kom</td>
<td>Web server adalah sebuah perangkat lunak serve...</td>
<td>Teknik Informatika</td>
</tr>
<tr>
<th>3</th>
<td>3</td>
<td>70411100070</td>
<td>SISTEM PENDUKUNG KEPUTUSAN OPTIMASI PENJADWALA...</td>
<td>Heri Supriyanto</td>
<td>Penjadwalan kuliah di Perguruan Tinggi merupak...</td>
<td>Teknik Informatika</td>
</tr>
<tr>
<th>4</th>
<td>4</td>
<td>80411100115</td>
<td>SISTEM AUGMENTED REALITY ANIMASI BENDA BERGERA...</td>
<td>Septian Rahman Hakim</td>
<td>Seiring perkembangan teknologi yang ada diduni...</td>
<td>Teknik Informatika</td>
</tr>
<tr>
<th>...</th>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
<tr>
<th>855</th>
<td>855</td>
<td>130411100057</td>
<td>Sistem Peramalan Stok Barang dengan menggunaka...</td>
<td>Devi Editya Susanti</td>
<td>Toko tas Deeolshop menjual berbagai macam tas ...</td>
<td>Teknik Informatika</td>
</tr>
<tr>
<th>856</th>
<td>856</td>
<td>150411100053</td>
<td>Sistem Rekomendasi Dalam Menentukan Posisi Dep...</td>
<td>Kumayyah</td>
<td>Sepak bola adalah salah satu olahraga yang saa...</td>
<td>Teknik Informatika</td>
</tr>
<tr>
<th>857</th>
<td>857</td>
<td>150411100038</td>
<td>MULTI CRITERIA DECISION MAKING UNTUK MENENTUKA...</td>
<td>Ahmad Faris Ihsan</td>
<td>Perguruan Tinggi merupakan salah satu jenjang ...</td>
<td>Teknik Informatika</td>
</tr>
<tr>
<th>858</th>
<td>858</td>
<td>160411100032</td>
<td>PENERAPAN ALGORITMA LONG-SHORT TERM MEMORY UNT...</td>
<td>Rachmad Agung Pambudi</td>
<td>Investasi saham selama ini memiliki resiko ker...</td>
<td>Teknik Informatika</td>
</tr>
<tr>
<th>859</th>
<td>859</td>
<td>160411100182</td>
<td>SISTEM PENCARIAN TEKS AL-QURAN TERJEMAHAN BERB...</td>
<td>Nadila Hidayanti</td>
<td>Information Retrieval (IR) merupakan pengambil...</td>
<td>Teknik Informatika</td>
</tr>
</tbody>
</table>
<p>860 rows × 6 columns</p>
</div>
<button class="colab-df-convert" onclick="convertToInteractive('df-8aaefa67-545c-4ca2-b832-bed45380e977')"
title="Convert this dataframe to an interactive table."
style="display:none;">
<svg xmlns="http://www.w3.org/2000/svg" height="24px"viewBox="0 0 24 24"
width="24px">
<path d="M0 0h24v24H0V0z" fill="none"/>
<path d="M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z"/><path d="M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z"/>
</svg>
</button>
<style>
.colab-df-container {
display:flex;
flex-wrap:wrap;
gap: 12px;
}
.colab-df-convert {
background-color: #E8F0FE;
border: none;
border-radius: 50%;
cursor: pointer;
display: none;
fill: #1967D2;
height: 32px;
padding: 0 0 0 0;
width: 32px;
}
.colab-df-convert:hover {
background-color: #E2EBFA;
box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);
fill: #174EA6;
}
[theme=dark] .colab-df-convert {
background-color: #3B4455;
fill: #D2E3FC;
}
[theme=dark] .colab-df-convert:hover {
background-color: #434B5C;
box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));
fill: #FFFFFF;
}
</style>
<script>
const buttonEl =
document.querySelector('#df-8aaefa67-545c-4ca2-b832-bed45380e977 button.colab-df-convert');
buttonEl.style.display =
google.colab.kernel.accessAllowed ? 'block' : 'none';
async function convertToInteractive(key) {
const element = document.querySelector('#df-8aaefa67-545c-4ca2-b832-bed45380e977');
const dataTable =
await google.colab.kernel.invokeFunction('convertToInteractive',
[key], {});
if (!dataTable) return;
const docLinkHtml = 'Like what you see? Visit the ' +
'<a target="_blank" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'
+ ' to learn more about interactive tables.';
element.innerHTML = '';
dataTable['output_type'] = 'display_data';
await google.colab.output.renderOutput(dataTable, element);
const docLink = document.createElement('div');
docLink.innerHTML = docLinkHtml;
element.appendChild(docLink);
}
</script>
</div>
</div>
</div></div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># path = "/content/drive/MyDrive/prosaindata/DataCrawling/dataset-baru.csv"</span>
<span class="n">path</span> <span class="o">=</span> <span class="s2">"https://raw.githubusercontent.com/LALA09-erha/File-semester5/master/PSD/Data%20Crawling/dataset-baru.csv"</span>
<span class="n">df</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">path</span><span class="p">)</span>
<span class="n">df</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_html">
<div id="df-8db62207-83e2-446e-98e7-78d657d88e5f">
<div class="colab-df-container">
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>Unnamed: 0</th>
<th>Abstrak</th>
<th>Kategori</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>0</td>
<td>Sistem informasi akademik (SIAKAD) merupaka...</td>
<td>RPL</td>
</tr>
<tr>
<th>1</th>
<td>1</td>
<td>Berjalannya koneksi jaringan komputer dengan l...</td>
<td>RPL</td>
</tr>
<tr>
<th>2</th>
<td>2</td>
<td>Web server adalah sebuah perangkat lunak serve...</td>
<td>RPL</td>
</tr>
<tr>
<th>3</th>
<td>3</td>
<td>Penjadwalan kuliah di Perguruan Tinggi me...</td>
<td>KOMPUTASI</td>
</tr>
<tr>
<th>4</th>
<td>4</td>
<td>Seiring perkembangan teknologi yang ada diduni...</td>
<td>RPL</td>
</tr>
<tr>
<th>...</th>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
<tr>
<th>800</th>
<td>804</td>
<td>Investasi saham selama ini memiliki resiko ker...</td>
<td>KOMPUTASI</td>
</tr>
<tr>
<th>801</th>
<td>805</td>
<td>Information Retrieval (IR) merupakan pengambil...</td>
<td>KOMPUTASI</td>
</tr>
<tr>
<th>802</th>
<td>806</td>
<td>Klasifikasi citra merupakan proses pengelompok...</td>
<td>KOMPUTASI</td>
</tr>
<tr>
<th>803</th>
<td>807</td>
<td>Identifikasi atribut pejalan kaki merupakan sa...</td>
<td>KOMPUTASI</td>
</tr>
<tr>
<th>804</th>
<td>808</td>
<td>Topik deteksi objek telah menarik perhatian ya...</td>
<td>KOMPUTASI</td>
</tr>
</tbody>
</table>
<p>805 rows × 3 columns</p>
</div>
<button class="colab-df-convert" onclick="convertToInteractive('df-8db62207-83e2-446e-98e7-78d657d88e5f')"
title="Convert this dataframe to an interactive table."
style="display:none;">
<svg xmlns="http://www.w3.org/2000/svg" height="24px"viewBox="0 0 24 24"
width="24px">
<path d="M0 0h24v24H0V0z" fill="none"/>
<path d="M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z"/><path d="M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z"/>
</svg>
</button>
<style>
.colab-df-container {
display:flex;
flex-wrap:wrap;
gap: 12px;
}
.colab-df-convert {
background-color: #E8F0FE;
border: none;
border-radius: 50%;
cursor: pointer;
display: none;
fill: #1967D2;
height: 32px;
padding: 0 0 0 0;
width: 32px;
}
.colab-df-convert:hover {
background-color: #E2EBFA;
box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);
fill: #174EA6;
}
[theme=dark] .colab-df-convert {
background-color: #3B4455;
fill: #D2E3FC;
}
[theme=dark] .colab-df-convert:hover {
background-color: #434B5C;
box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));
fill: #FFFFFF;
}
</style>
<script>
const buttonEl =
document.querySelector('#df-8db62207-83e2-446e-98e7-78d657d88e5f button.colab-df-convert');
buttonEl.style.display =
google.colab.kernel.accessAllowed ? 'block' : 'none';
async function convertToInteractive(key) {
const element = document.querySelector('#df-8db62207-83e2-446e-98e7-78d657d88e5f');
const dataTable =
await google.colab.kernel.invokeFunction('convertToInteractive',
[key], {});
if (!dataTable) return;
const docLinkHtml = 'Like what you see? Visit the ' +
'<a target="_blank" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'
+ ' to learn more about interactive tables.';
element.innerHTML = '';
dataTable['output_type'] = 'display_data';
await google.colab.output.renderOutput(dataTable, element);
const docLink = document.createElement('div');
docLink.innerHTML = docLinkHtml;
element.appendChild(docLink);
}
</script>
</div>
</div>
</div></div>
</div>
</div>
<div class="section" id="preprocessing-data">
<h2>Preprocessing Data<a class="headerlink" href="#preprocessing-data" title="Permalink to this heading">#</a></h2>
<div class="section" id="seleksi-column">
<h3>Seleksi Column<a class="headerlink" href="#seleksi-column" title="Permalink to this heading">#</a></h3>
<p>Drop Column yang dirasa tidak dibutuhkan.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">label</span> <span class="o">=</span> <span class="n">df</span><span class="p">[</span><span class="s1">'Kategori'</span><span class="p">]</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">df</span><span class="p">[</span><span class="s1">'Abstrak'</span><span class="p">]</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="install-libary-sastrawi">
<h3>Install Libary Sastrawi<a class="headerlink" href="#install-libary-sastrawi" title="Permalink to this heading">#</a></h3>
<p>Python Sastrawi merupakan library sederhana yang dapat mengubah kata berimbuhan bahasa Indonesia menjadi bentuk dasarnya.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="o">!</span>pip<span class="w"> </span>install<span class="w"> </span>Sastrawi
<span class="o">!</span>pip<span class="w"> </span>install<span class="w"> </span>symspellpy
<span class="o">!</span>pip<span class="w"> </span>install<span class="w"> </span>langdetect
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting Sastrawi
Downloading Sastrawi-1.0.1-py2.py3-none-any.whl (209 kB)
?25l ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ <span class=" -Color -Color-Green">0.0/209.7 kB</span> <span class=" -Color -Color-Red">?</span> eta <span class=" -Color -Color-Cyan">-:--:--</span>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ <span class=" -Color -Color-Green">209.7/209.7 kB</span> <span class=" -Color -Color-Red">6.2 MB/s</span> eta <span class=" -Color -Color-Cyan">0:00:00</span>
?25h
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Installing collected packages: Sastrawi
Successfully installed Sastrawi-1.0.1
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Collecting symspellpy
Downloading symspellpy-6.7.7-py3-none-any.whl (2.6 MB)
?25l ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ <span class=" -Color -Color-Green">0.0/2.6 MB</span> <span class=" -Color -Color-Red">?</span> eta <span class=" -Color -Color-Cyan">-:--:--</span>
━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ <span class=" -Color -Color-Green">0.5/2.6 MB</span> <span class=" -Color -Color-Red">13.2 MB/s</span> eta <span class=" -Color -Color-Cyan">0:00:01</span>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸ <span class=" -Color -Color-Green">2.6/2.6 MB</span> <span class=" -Color -Color-Red">42.2 MB/s</span> eta <span class=" -Color -Color-Cyan">0:00:01</span>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ <span class=" -Color -Color-Green">2.6/2.6 MB</span> <span class=" -Color -Color-Red">31.7 MB/s</span> eta <span class=" -Color -Color-Cyan">0:00:00</span>
?25h
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Collecting editdistpy>=0.1.3 (from symspellpy)
Downloading editdistpy-0.1.3.tar.gz (57 kB)
?25l ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ <span class=" -Color -Color-Green">0.0/57.2 kB</span> <span class=" -Color -Color-Red">?</span> eta <span class=" -Color -Color-Cyan">-:--:--</span>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ <span class=" -Color -Color-Green">57.2/57.2 kB</span> <span class=" -Color -Color-Red">7.0 MB/s</span> eta <span class=" -Color -Color-Cyan">0:00:00</span>
?25h
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> Installing build dependencies ... ?25l?25hdone
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> Getting requirements to build wheel ... ?25l?25hdone
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> Preparing metadata (pyproject.toml) ... ?25l?25hdone
Building wheels for collected packages: editdistpy
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> Building wheel for editdistpy (pyproject.toml) ... ?25l?25hdone
Created wheel for editdistpy: filename=editdistpy-0.1.3-cp310-cp310-linux_x86_64.whl size=141769 sha256=886fb392a9f0cc417041bae186db460c476deb2a147a940d41b64787b162ed24
Stored in directory: /root/.cache/pip/wheels/88/6a/a6/a1283cc145323a1fb3d475bd158ee60b248ab1985230d266fc
Successfully built editdistpy
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Installing collected packages: editdistpy, symspellpy
Successfully installed editdistpy-0.1.3 symspellpy-6.7.7
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting langdetect
Downloading langdetect-1.0.9.tar.gz (981 kB)
?25l ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ <span class=" -Color -Color-Green">0.0/981.5 kB</span> <span class=" -Color -Color-Red">?</span> eta <span class=" -Color -Color-Cyan">-:--:--</span>
━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━ <span class=" -Color -Color-Green">358.4/981.5 kB</span> <span class=" -Color -Color-Red">10.5 MB/s</span> eta <span class=" -Color -Color-Cyan">0:00:01</span>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ <span class=" -Color -Color-Green">981.5/981.5 kB</span> <span class=" -Color -Color-Red">16.6 MB/s</span> eta <span class=" -Color -Color-Cyan">0:00:00</span>
?25h
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> Preparing metadata (setup.py) ... ?25l?25hdone
Requirement already satisfied: six in /usr/local/lib/python3.10/dist-packages (from langdetect) (1.16.0)
Building wheels for collected packages: langdetect
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> Building wheel for langdetect (setup.py) ... ?25l?25hdone
Created wheel for langdetect: filename=langdetect-1.0.9-py3-none-any.whl size=993224 sha256=53687a37ad8de853c54580af5971366daf9686dde9de131f4c2e16ad47e7fbb3
Stored in directory: /root/.cache/pip/wheels/95/03/7d/59ea870c70ce4e5a370638b5462a7711ab78fba2f655d05106
Successfully built langdetect
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span><span class=" -Color -Color-Red">ERROR: Operation cancelled by user</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="inisialisasi-variable">
<h3>Inisialisasi Variable<a class="headerlink" href="#inisialisasi-variable" title="Permalink to this heading">#</a></h3>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">string</span>
<span class="kn">import</span> <span class="nn">re</span>
<span class="kn">from</span> <span class="nn">Sastrawi.StopWordRemover.StopWordRemoverFactory</span> <span class="kn">import</span> <span class="n">StopWordRemoverFactory</span>
<span class="kn">from</span> <span class="nn">Sastrawi.Stemmer.StemmerFactory</span> <span class="kn">import</span> <span class="n">StemmerFactory</span>
<span class="kn">from</span> <span class="nn">symspellpy</span> <span class="kn">import</span> <span class="n">SymSpell</span> <span class="p">,</span><span class="n">Verbosity</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">requests</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">joblib</span>
</pre></div>
</div>
</div>
</div>
<p>PreProsecessing data:</p>
<ul class="simple">
<li><p>Cleaning Text</p></li>
<li><p>tokenisasi data</p></li>
<li><p>menghapus stopword</p></li>
<li><p>mengubah menjadi lowercase dan menghapus spesial char</p></li>
<li><p>menghapus angka</p></li>
<li><p>menghapus whitespace</p></li>
<li><p>spell checker</p></li>
<li><p>stemming</p></li>
<li><p>mengubah label menjadi angka</p></li>
<li><p>implementasi ke TF-IDF</p></li>