-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathembeddings.html
1818 lines (1785 loc) · 200 KB
/
embeddings.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 xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<meta charset="utf-8">
<meta name="generator" content="quarto-1.3.450">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="author" content="Olivier Caron">
<meta name="author" content="Christophe Benavent">
<meta name="dcterms.date" content="2023-10-05">
<title>Systematic literature review</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
/* CSS for citations */
div.csl-bib-body { }
div.csl-entry {
clear: both;
}
.hanging-indent div.csl-entry {
margin-left:2em;
text-indent:-2em;
}
div.csl-left-margin {
min-width:2em;
float:left;
}
div.csl-right-inline {
margin-left:2em;
padding-left:1em;
}
div.csl-indent {
margin-left: 2em;
}</style>
<script src="embeddings_files/libs/clipboard/clipboard.min.js"></script>
<script src="embeddings_files/libs/quarto-html/quarto.js"></script>
<script src="embeddings_files/libs/quarto-html/popper.min.js"></script>
<script src="embeddings_files/libs/quarto-html/tippy.umd.min.js"></script>
<script src="embeddings_files/libs/quarto-html/anchor.min.js"></script>
<link href="embeddings_files/libs/quarto-html/tippy.css" rel="stylesheet">
<link href="embeddings_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-text-highlighting-styles">
<link href="embeddings_files/libs/quarto-html/quarto-syntax-highlighting-dark.css" rel="prefetch" class="quarto-color-scheme quarto-color-alternate" id="quarto-text-highlighting-styles">
<script src="embeddings_files/libs/bootstrap/bootstrap.min.js"></script>
<link href="embeddings_files/libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="embeddings_files/libs/bootstrap/bootstrap.min.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-bootstrap" data-mode="light">
<link href="embeddings_files/libs/bootstrap/bootstrap-dark.min.css" rel="prefetch" class="quarto-color-scheme quarto-color-alternate" id="quarto-bootstrap" data-mode="dark">
<script src="embeddings_files/libs/htmlwidgets-1.6.2/htmlwidgets.js"></script>
<script src="embeddings_files/libs/plotly-binding-4.10.2/plotly.js"></script>
<script src="embeddings_files/libs/typedarray-0.1/typedarray.min.js"></script>
<script src="embeddings_files/libs/jquery-3.5.1/jquery.min.js"></script>
<link href="embeddings_files/libs/crosstalk-1.2.0/css/crosstalk.min.css" rel="stylesheet">
<script src="embeddings_files/libs/crosstalk-1.2.0/js/crosstalk.min.js"></script>
<link href="embeddings_files/libs/plotly-htmlwidgets-css-2.11.1/plotly-htmlwidgets.css" rel="stylesheet">
<script src="embeddings_files/libs/plotly-main-2.11.1/plotly-latest.min.js"></script>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header id="title-block-header" class="quarto-title-block default toc-left page-columns page-full">
<div class="quarto-title-banner page-columns page-full">
<div class="quarto-title column-body">
<div class="quarto-title-block"><div><h1 class="title">Systematic literature review</h1><button type="button" class="btn code-tools-button dropdown-toggle" id="quarto-code-tools-menu" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi"></i> Code</button><ul class="dropdown-menu dropdown-menu-end" aria-labelelledby="quarto-code-tools-menu"><li><a id="quarto-show-all-code" class="dropdown-item" href="javascript:void(0)" role="button">Show All Code</a></li><li><a id="quarto-hide-all-code" class="dropdown-item" href="javascript:void(0)" role="button">Hide All Code</a></li><li><hr class="dropdown-divider"></li><li><a id="quarto-view-source" class="dropdown-item" href="javascript:void(0)" role="button">View Source</a></li></ul></div></div>
<p class="subtitle lead">An embeddings analysis</p>
</div>
</div>
<div class="quarto-title-meta-author">
<div class="quarto-title-meta-heading">Authors</div>
<div class="quarto-title-meta-heading">Affiliation</div>
<div class="quarto-title-meta-contents">
<p class="author">Olivier Caron </p>
</div>
<div class="quarto-title-meta-contents">
<p class="affiliation">
Paris Dauphine - PSL
</p>
</div>
<div class="quarto-title-meta-contents">
<p class="author">Christophe Benavent </p>
</div>
<div class="quarto-title-meta-contents">
<p class="affiliation">
Paris Dauphine - PSL
</p>
</div>
</div>
<div class="quarto-title-meta">
<div>
<div class="quarto-title-meta-heading">Published</div>
<div class="quarto-title-meta-contents">
<p class="date">October 5, 2023</p>
</div>
</div>
</div>
</header><div id="quarto-content" class="page-columns page-rows-contents page-layout-article toc-left">
<div id="quarto-sidebar-toc-left" class="sidebar toc-left">
<nav id="TOC" role="doc-toc" class="toc-active">
<h2 id="toc-title">Table of contents</h2>
<ul>
<li><a href="#libraries-and-loading-data" id="toc-libraries-and-loading-data" class="nav-link active" data-scroll-target="#libraries-and-loading-data"><span class="header-section-number">1</span> Libraries and loading data</a></li>
<li><a href="#loading-data" id="toc-loading-data" class="nav-link" data-scroll-target="#loading-data"><span class="header-section-number">2</span> Loading data</a></li>
<li><a href="#a-glimpse-of-data" id="toc-a-glimpse-of-data" class="nav-link" data-scroll-target="#a-glimpse-of-data"><span class="header-section-number">3</span> A glimpse of data</a></li>
<li><a href="#a-first-word2vec-embeddings-analysis-skip-gram" id="toc-a-first-word2vec-embeddings-analysis-skip-gram" class="nav-link" data-scroll-target="#a-first-word2vec-embeddings-analysis-skip-gram"><span class="header-section-number">4</span> A first Word2Vec embeddings analysis (skip-gram)</a></li>
<li><a href="#a-word2vec-embeddings-analysis-cbow" id="toc-a-word2vec-embeddings-analysis-cbow" class="nav-link" data-scroll-target="#a-word2vec-embeddings-analysis-cbow"><span class="header-section-number">5</span> A Word2Vec embeddings analysis (cbow)</a></li>
<li><a href="#part-of-speech-tagging-with-udpipe-straka-strakova-2017-tokenizing" id="toc-part-of-speech-tagging-with-udpipe-straka-strakova-2017-tokenizing" class="nav-link" data-scroll-target="#part-of-speech-tagging-with-udpipe-straka-strakova-2017-tokenizing"><span class="header-section-number">6</span> Part of speech tagging with UDPipe (<span class="citation" data-cites="straka-strakova-2017-tokenizing">Straka and Straková (2017)</span>)</a></li>
<li><a href="#top-20-nouns-with-udpipe" id="toc-top-20-nouns-with-udpipe" class="nav-link" data-scroll-target="#top-20-nouns-with-udpipe"><span class="header-section-number">7</span> Top 20 nouns with UDPipe</a></li>
<li><a href="#part-of-speech-tagging-with-trankit-nguyen2021trankit" id="toc-part-of-speech-tagging-with-trankit-nguyen2021trankit" class="nav-link" data-scroll-target="#part-of-speech-tagging-with-trankit-nguyen2021trankit"><span class="header-section-number">8</span> Part of speech tagging with Trankit (<span class="citation" data-cites="nguyen2021trankit">Nguyen et al. (2021)</span>)</a></li>
<li><a href="#top-20-nouns-with-trankit" id="toc-top-20-nouns-with-trankit" class="nav-link" data-scroll-target="#top-20-nouns-with-trankit"><span class="header-section-number">9</span> Top 20 nouns with Trankit</a></li>
<li><a href="#part-of-speech-tagging-with-stanza-qi2020stanza" id="toc-part-of-speech-tagging-with-stanza-qi2020stanza" class="nav-link" data-scroll-target="#part-of-speech-tagging-with-stanza-qi2020stanza"><span class="header-section-number">10</span> Part of speech tagging with Stanza (<span class="citation" data-cites="qi2020stanza">Qi et al. (2020)</span>)</a></li>
<li><a href="#top-20-nouns-with-stanza" id="toc-top-20-nouns-with-stanza" class="nav-link" data-scroll-target="#top-20-nouns-with-stanza"><span class="header-section-number">11</span> Top 20 nouns with Stanza</a></li>
</ul>
</nav>
</div>
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
</div>
<main class="content quarto-banner-title-block" id="quarto-document-content">
<section id="libraries-and-loading-data" class="level2" data-number="1">
<h2 data-number="1" class="anchored" data-anchor-id="libraries-and-loading-data"><span class="header-section-number">1</span> Libraries and loading data</h2>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(tidyverse)</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(word2vec)</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(quanteda)</span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(text)</span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(udpipe)</span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(plotly)</span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(text2vec)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
</section>
<section id="loading-data" class="level2" data-number="2">
<h2 data-number="2" class="anchored" data-anchor-id="loading-data"><span class="header-section-number">2</span> Loading data</h2>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="annotated-cell-2"><pre class="sourceCode r code-annotation-code code-with-copy"><code class="sourceCode r"><span id="annotated-cell-2-1"><a href="#annotated-cell-2-1" aria-hidden="true" tabindex="-1"></a>list_articles <span class="ot"><-</span> <span class="fu">read.csv2</span>(<span class="st">"nlp_full_data_final_18-08-2023.csv"</span>, <span class="at">encoding =</span> <span class="st">"UTF-8"</span>) <span class="sc">%>%</span></span>
<span id="annotated-cell-2-2"><a href="#annotated-cell-2-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">rename</span>(<span class="st">"entry_number"</span> <span class="ot">=</span> <span class="dv">1</span>)</span>
<span id="annotated-cell-2-3"><a href="#annotated-cell-2-3" aria-hidden="true" tabindex="-1"></a>list_references <span class="ot"><-</span> <span class="fu">read.csv2</span>(<span class="st">"nlp_references_final_18-08-2023.csv"</span>, <span class="at">encoding =</span> <span class="st">"UTF-8"</span>) <span class="sc">%>%</span></span>
<span id="annotated-cell-2-4"><a href="#annotated-cell-2-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">rename</span>(<span class="st">"citing_art"</span> <span class="ot">=</span> <span class="dv">1</span>)</span>
<span id="annotated-cell-2-5"><a href="#annotated-cell-2-5" aria-hidden="true" tabindex="-1"></a><span class="fu">colnames</span>(list_articles) <span class="ot"><-</span> <span class="fu">gsub</span>(<span class="st">"</span><span class="sc">\\</span><span class="st">.+"</span>, <span class="st">"_"</span>, <span class="fu">colnames</span>(list_articles))</span>
<span id="annotated-cell-2-6"><a href="#annotated-cell-2-6" aria-hidden="true" tabindex="-1"></a><span class="fu">colnames</span>(list_articles) <span class="ot"><-</span> <span class="fu">gsub</span>(<span class="st">"^[[:punct:]]+|[[:punct:]]+$"</span>, <span class="st">""</span>, <span class="fu">colnames</span>(list_articles))</span>
<span id="annotated-cell-2-7"><a href="#annotated-cell-2-7" aria-hidden="true" tabindex="-1"></a><span class="fu">colnames</span>(list_references) <span class="ot"><-</span> <span class="fu">gsub</span>(<span class="st">"</span><span class="sc">\\</span><span class="st">.+"</span>, <span class="st">"_"</span>, <span class="fu">colnames</span>(list_references))</span>
<span id="annotated-cell-2-8"><a href="#annotated-cell-2-8" aria-hidden="true" tabindex="-1"></a><span class="fu">colnames</span>(list_references) <span class="ot"><-</span> <span class="fu">gsub</span>(<span class="st">"^[[:punct:]]+|[[:punct:]]+$"</span>, <span class="st">""</span>, <span class="fu">colnames</span>(list_references))</span>
<span id="annotated-cell-2-9"><a href="#annotated-cell-2-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="annotated-cell-2-10"><a href="#annotated-cell-2-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="annotated-cell-2-11"><a href="#annotated-cell-2-11" aria-hidden="true" tabindex="-1"></a>data_embeddings <span class="ot"><-</span> list_articles <span class="sc">%>%</span></span>
<span id="annotated-cell-2-12"><a href="#annotated-cell-2-12" aria-hidden="true" tabindex="-1"></a> <span class="fu">distinct</span>(entry_number, <span class="at">.keep_all =</span> <span class="cn">TRUE</span>) <span class="sc">%>%</span></span>
<span id="annotated-cell-2-13"><a href="#annotated-cell-2-13" aria-hidden="true" tabindex="-1"></a> <span class="fu">filter</span>(marketing <span class="sc">==</span> <span class="dv">1</span>) <span class="sc">%>%</span></span>
<span id="annotated-cell-2-14"><a href="#annotated-cell-2-14" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="st">"year"</span> <span class="ot">=</span> <span class="fu">substr</span>(prism_coverDate, <span class="dv">7</span>, <span class="dv">10</span>)) <span class="sc">%>%</span></span>
<span id="annotated-cell-2-15"><a href="#annotated-cell-2-15" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">keywords =</span> <span class="fu">str_replace_all</span>(authkeywords, <span class="st">"</span><span class="sc">\\</span><span class="st">|"</span>, <span class="st">""</span>)) <span class="sc">%>%</span></span>
<span id="annotated-cell-2-16"><a href="#annotated-cell-2-16" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">keywords =</span> <span class="fu">str_squish</span>(keywords)) <span class="sc">%>%</span></span>
<span id="annotated-cell-2-17"><a href="#annotated-cell-2-17" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="st">"combined_text"</span> <span class="ot">=</span> <span class="fu">paste0</span>(dc_title,<span class="st">". "</span>, dc_description, <span class="st">". "</span>, keywords))</span>
<span id="annotated-cell-2-18"><a href="#annotated-cell-2-18" aria-hidden="true" tabindex="-1"></a></span>
<span id="annotated-cell-2-19"><a href="#annotated-cell-2-19" aria-hidden="true" tabindex="-1"></a><span class="co">#write.csv(data_embeddings,"data_for_embeddings.csv")</span></span>
<span id="annotated-cell-2-20"><a href="#annotated-cell-2-20" aria-hidden="true" tabindex="-1"></a><span class="co">#data_embeddings <- read.csv("data_for_embeddings.csv")</span></span>
<span id="annotated-cell-2-21"><a href="#annotated-cell-2-21" aria-hidden="true" tabindex="-1"></a><span class="co">#embeddings <- read.csv("embeddings_bge.csv")</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
</section>
<section id="a-glimpse-of-data" class="level2" data-number="3">
<h2 data-number="3" class="anchored" data-anchor-id="a-glimpse-of-data"><span class="header-section-number">3</span> A glimpse of data</h2>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>data_embeddings <span class="sc">%>%</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">head</span>(<span class="dv">5</span>) <span class="sc">%>%</span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(entry_number, dc_creator, combined_text, year)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code> entry_number dc_creator
1 1 Loupos P.
2 2 Krefeld-Schwalb A.
3 3 Kronrod A.
4 4 Chang H.H.
5 5 Dobrucalı Yelkenci B.
combined_text
1 What reviews foretell about opening weekend box office revenue: the harbinger of failure effect in the movie industry. We empirically investigate the harbinger of failure phenomenon in the motion picture industry by analyzing the pre-release reviews written on movies by film critics. We find that harbingers of failure do exist. Their positive (negative) pre-release movie reviews provide a strong predictive signal that the movie will turn out to be a flop (success). This signal persists even for the top critic category, which usually consists of professional critics, indicating that having expertise in a professional domain does not necessarily lead to correct predictions. Our findings challenge the current belief that positive reviews always help enhance box office revenue and shed new light on the influencer-predictor hypothesis. We further analyze the writing style of harbingers and provide new insights into their personality traits and cognitive biases.. Harbingers of failure Movies Preference heterogeneity Reviews Text analytics
2 Tighter nets for smaller fishes? Mapping the development of statistical practices in consumer research between 2008 and 2020. During the last decade, confidence in many social sciences, including consumer research, has been undermined by doubts about the replicability of empirical research findings. These doubts have led to increased calls to improve research practices and adopt new measures to increase the replicability of published work from various stakeholders such as funding agencies, journals, and scholars themselves. Despite these demands, it is unclear to which the research published in the leading consumer research journals has adhered to these calls for change. This article provides the first systematic empirical analysis of this question by surveying three crucial statistics of published consumer research over time: sample sizes, effect sizes, and the distribution of published p values. The authors compile a hand-coded sample of N = 258 articles published between 2008 and 2020 in the Journal of Consumer Psychology, the Journal of Consumer Research, and the Journal of Marketing Research. An automated text analysis across all publications in these three journals corroborates the representativeness of the hand-coded sample. Results reveal a substantial increase in sample sizes above and beyond the use of online samples along with a decrease in reported effect sizes. Effect and samples sizes are highly correlated which at least partially explains the reduction in reported effect sizes.. Experimental research methods False-positive results Review
3 Been There, Done That: How Episodic and Semantic Memory Affects the Language of Authentic and Fictitious Reviews. This article suggests a theory-driven approach to address the managerial problem of distinguishing between real and fake reviews. Building on memory research and linguistics, we predict that when recollecting an authentic experience in a product review, people rely to a greater extent on episodic memory. By contrast, when writing a fictitious review, people do not have episodic memory available to them. Therefore, they must rely to a greater extent on semantic memory. We suggest that reliance on these different memory types is reflected in the language used in authentic and fictitious reviews. We develop predictions about five linguistic features characterizing authentic versus fictitious reviews. We test our predictions via a multi-method approach, combining computational linguistics, experimental design, and machine learning. We employ a large-scale experiment to derive a dataset of reviews, as well as two datasets containing reviews from online platforms. We also test whether an algorithm relying on our theory-driven linguistic features is context independent, relative to other benchmark algorithms, and shows better cross-domain performance when tested across datasets. By developing a theory that extends memory and psycholinguistics research to the realm of word of mouth, this work contributes to our understanding of how authentic and fictitious reviews are created.. fake reviews lie detection linguistic features machine learning memory text analysis
4 More Voices Persuade: The Attentional Benefits of Voice Numerosity. The authors posit that in an initial exposure to a broadcast video, hearing different voices narrate (in succession) a persuasive message encourages consumers’ attention and processing of the message, thereby facilitating persuasion; this is referred to as the voice numerosity effect. Across four studies (plus validation and replication studies)—including two large-scale, real-world data sets (with more than 11,000 crowdfunding videos and over 3.6 million customer transactions, and more than 1,600 video ads) and two controlled experiments (with over 1,800 participants)—the results provide support for the hypothesized effect. The effect (1) has consequential, economic implications in a real-world marketplace, (2) is more pronounced when the message is easier to comprehend, (3) is more pronounced when consumers have the capacity to process the ad message, and (4) is mediated by the favorability of consumers’ cognitive responses. The authors demonstrate the use of machine learning, text mining, and natural language processing to process and analyze unstructured (multimedia) data. Theoretical and marketing implications are discussed.. advertising crowdfunding marketing communications persuasion sensory marketing videos voice voice numerosity
5 Online complaint handling: a text analytics-based classification framework. Purpose: This study aims to both identify content-based and interaction-based online consumer complaint types and predict complaint types according to the complaint magnitude rooted in complainants' personality traits, emotion, Twitter usage activity, as well as complaint's sentiment polarity, and interaction rate. Design/methodology/approach: In total, 297,000 complaint tweets were collected from Twitter, featuring over 220,000 consumer profiles and over 24 million user tweets. The obtained data were analyzed via two-step machine learning approach. Findings: This study proposes a set of content and profile features that can be employed for determining complaint types and reveals the relationship between content features, profile features and online complaint type. Originality/value: This study proposes a novel model for identifying types of online complaints, offering a set of content and profile features that can be used for predicting complaint type, and therefore introduces a flexible approach for enhancing online complaint management.. Complaint handling Machine learning Social CRM Text analytics Twitter
year
1 2023
2 2023
3 2023
4 2023
5 2023</code></pre>
</div>
</div>
</section>
<section id="a-first-word2vec-embeddings-analysis-skip-gram" class="level2" data-number="4">
<h2 data-number="4" class="anchored" data-anchor-id="a-first-word2vec-embeddings-analysis-skip-gram"><span class="header-section-number">4</span> A first Word2Vec embeddings analysis (skip-gram)</h2>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">set.seed</span>(<span class="dv">42</span>)</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>model <span class="ot"><-</span> <span class="fu">word2vec</span>(<span class="at">x =</span> <span class="fu">tolower</span>(data_embeddings<span class="sc">$</span>combined_text), <span class="at">type =</span> <span class="st">"skip-gram"</span>, <span class="at">dim =</span> <span class="dv">100</span>, <span class="at">iter =</span> <span class="dv">100</span>,, <span class="at">verbose=</span><span class="dv">10</span>, <span class="at">stopwords =</span> <span class="fu">stopwords</span>(<span class="st">"english"</span>), <span class="at">window =</span> <span class="st">"7"</span>)</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a>embedding <span class="ot"><-</span> <span class="fu">as.matrix</span>(model)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>lookslike <span class="ot"><-</span> <span class="fu">predict</span>(model, <span class="fu">c</span>(<span class="st">"text"</span>), <span class="at">type =</span> <span class="st">"nearest"</span>, <span class="at">top_n =</span> <span class="dv">20</span>) <span class="sc">%>%</span> <span class="fu">as.data.frame</span>()</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>lookslike</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code> text.term1 text.term2 text.similarity text.rank
1 text mining 0.9398133 1
2 text analysis 0.9035369 2
3 text using 0.8227125 3
4 text approach 0.7800652 4
5 text data 0.7243269 5
6 text combining 0.6864955 6
7 text automated 0.6830792 7
8 text based 0.6829328 8
9 text content 0.6822451 9
10 text g 0.6800215 10
11 text programming 0.6734449 11
12 text online 0.6709576 12
13 text software 0.6674001 13
14 text analytics 0.6666795 14
15 text language 0.6607617 15
16 text consumer 0.6499586 16
17 text uses 0.6492382 17
18 text leximancer 0.6413767 18
19 text nlp 0.6413354 19
20 text neuro 0.6397809 20</code></pre>
</div>
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb7"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>lookslike <span class="sc">%>%</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">ggplot</span>(<span class="fu">aes</span>(<span class="at">x=</span>text.similarity,<span class="at">y=</span><span class="fu">reorder</span>(text.term2,lookslike<span class="sc">$</span>text.similarity)))<span class="sc">+</span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_point</span>()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output-display">
<p><img src="embeddings_files/figure-html/unnamed-chunk-5-1.png" class="img-fluid" width="672"></p>
</div>
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb8"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>fig <span class="ot"><-</span> lookslike <span class="sc">%>%</span></span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">ggplot</span>(<span class="fu">aes</span>(<span class="at">x =</span> text.similarity, <span class="at">y =</span> <span class="fu">reorder</span>(text.term2, text.similarity))) <span class="sc">+</span></span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_point</span>(<span class="at">color =</span> <span class="st">"royalblue"</span>, <span class="at">size =</span> lookslike<span class="sc">$</span>text.similarity<span class="sc">+</span><span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme_minimal</span>() <span class="sc">+</span></span>
<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">labs</span>(<span class="at">x =</span> <span class="st">"similarity score"</span>,</span>
<span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a> <span class="at">y =</span> <span class="st">""</span>) <span class="sc">+</span></span>
<span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">ggtitle</span>(<span class="st">"Top 20 similarity scores with term 'text'"</span> ) <span class="sc">+</span></span>
<span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">plot.title =</span> <span class="fu">element_text</span>(<span class="at">hjust =</span> <span class="fl">0.5</span>))</span>
<span id="cb8-9"><a href="#cb8-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-10"><a href="#cb8-10" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplotly</span>(fig)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output-display">
<div class="plotly html-widget html-fill-item-overflow-hidden html-fill-item" id="htmlwidget-d86e629708c4d3d46610" style="width:100%;height:464px;"></div>
<script type="application/json" data-for="htmlwidget-d86e629708c4d3d46610">{"x":{"data":[{"x":[0.93981331586837769,0.90353685617446899,0.8227124810218811,0.78006523847579956,0.72432690858840942,0.68649548292160034,0.68307918310165405,0.68293279409408569,0.68224513530731201,0.68002146482467651,0.67344486713409424,0.67095756530761719,0.66740012168884277,0.6666795015335083,0.66076165437698364,0.64995855093002319,0.6492382287979126,0.64137673377990723,0.64133542776107788,0.63978087902069092],"y":[20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1],"text":["text.similarity: 0.9398133<br />reorder(text.term2, text.similarity): mining","text.similarity: 0.9035369<br />reorder(text.term2, text.similarity): analysis","text.similarity: 0.8227125<br />reorder(text.term2, text.similarity): using","text.similarity: 0.7800652<br />reorder(text.term2, text.similarity): approach","text.similarity: 0.7243269<br />reorder(text.term2, text.similarity): data","text.similarity: 0.6864955<br />reorder(text.term2, text.similarity): combining","text.similarity: 0.6830792<br />reorder(text.term2, text.similarity): automated","text.similarity: 0.6829328<br />reorder(text.term2, text.similarity): based","text.similarity: 0.6822451<br />reorder(text.term2, text.similarity): content","text.similarity: 0.6800215<br />reorder(text.term2, text.similarity): g","text.similarity: 0.6734449<br />reorder(text.term2, text.similarity): programming","text.similarity: 0.6709576<br />reorder(text.term2, text.similarity): online","text.similarity: 0.6674001<br />reorder(text.term2, text.similarity): software","text.similarity: 0.6666795<br />reorder(text.term2, text.similarity): analytics","text.similarity: 0.6607617<br />reorder(text.term2, text.similarity): language","text.similarity: 0.6499586<br />reorder(text.term2, text.similarity): consumer","text.similarity: 0.6492382<br />reorder(text.term2, text.similarity): uses","text.similarity: 0.6413767<br />reorder(text.term2, text.similarity): leximancer","text.similarity: 0.6413354<br />reorder(text.term2, text.similarity): nlp","text.similarity: 0.6397809<br />reorder(text.term2, text.similarity): neuro"],"type":"scatter","mode":"markers","marker":{"autocolorscale":false,"color":"rgba(65,105,225,1)","opacity":1,"size":[11.111105445801742,10.973997566643662,10.668519613311048,10.507333184790424,10.296668630885328,10.153683714979277,10.140771715659795,10.140218434371349,10.13761940903551,10.129214985164133,10.104358552947758,10.0949577271469,10.081512270949958,10.07878866721326,10.0564220007949,10.015591373593789,10.012868896244079,9.9831561591681535,9.9830000419316338,9.9771245821254464],"symbol":"circle","line":{"width":1.8897637795275593,"color":"rgba(65,105,225,1)"}},"hoveron":"points","showlegend":false,"xaxis":"x","yaxis":"y","hoverinfo":"text","frame":null}],"layout":{"margin":{"t":43.762557077625573,"r":7.3059360730593621,"b":40.182648401826491,"l":75.251141552511427},"font":{"color":"rgba(0,0,0,1)","family":"","size":14.611872146118724},"title":{"text":"Top 20 similarity scores with term 'text'","font":{"color":"rgba(0,0,0,1)","family":"","size":17.534246575342465},"x":0.5,"xref":"paper"},"xaxis":{"domain":[0,1],"automargin":true,"type":"linear","autorange":false,"range":[0.62477925717830662,0.95481493771076198],"tickmode":"array","ticktext":["0.7","0.8","0.9"],"tickvals":[0.70000000000000007,0.80000000000000004,0.90000000000000013],"categoryorder":"array","categoryarray":["0.7","0.8","0.9"],"nticks":null,"ticks":"","tickcolor":null,"ticklen":3.6529680365296811,"tickwidth":0,"showticklabels":true,"tickfont":{"color":"rgba(77,77,77,1)","family":"","size":11.68949771689498},"tickangle":-0,"showline":false,"linecolor":null,"linewidth":0,"showgrid":true,"gridcolor":"rgba(235,235,235,1)","gridwidth":0.66417600664176002,"zeroline":false,"anchor":"y","title":{"text":"similarity score","font":{"color":"rgba(0,0,0,1)","family":"","size":14.611872146118724}},"hoverformat":".2f"},"yaxis":{"domain":[0,1],"automargin":true,"type":"linear","autorange":false,"range":[0.40000000000000002,20.600000000000001],"tickmode":"array","ticktext":["neuro","nlp","leximancer","uses","consumer","language","analytics","software","online","programming","g","content","based","automated","combining","data","approach","using","analysis","mining"],"tickvals":[1,2,3,4.0000000000000009,5,6.0000000000000009,7,8,9,10,11,12.000000000000002,13,14.000000000000002,15,16,17,18,19,20],"categoryorder":"array","categoryarray":["neuro","nlp","leximancer","uses","consumer","language","analytics","software","online","programming","g","content","based","automated","combining","data","approach","using","analysis","mining"],"nticks":null,"ticks":"","tickcolor":null,"ticklen":3.6529680365296811,"tickwidth":0,"showticklabels":true,"tickfont":{"color":"rgba(77,77,77,1)","family":"","size":11.68949771689498},"tickangle":-0,"showline":false,"linecolor":null,"linewidth":0,"showgrid":true,"gridcolor":"rgba(235,235,235,1)","gridwidth":0.66417600664176002,"zeroline":false,"anchor":"x","title":{"text":"","font":{"color":"rgba(0,0,0,1)","family":"","size":14.611872146118724}},"hoverformat":".2f"},"shapes":[{"type":"rect","fillcolor":null,"line":{"color":null,"width":0,"linetype":[]},"yref":"paper","xref":"paper","x0":0,"x1":1,"y0":0,"y1":1}],"showlegend":false,"legend":{"bgcolor":null,"bordercolor":null,"borderwidth":0,"font":{"color":"rgba(0,0,0,1)","family":"","size":11.68949771689498}},"hovermode":"closest","barmode":"relative"},"config":{"doubleClick":"reset","modeBarButtonsToAdd":["hoverclosest","hovercompare"],"showSendToCloud":false},"source":"A","attrs":{"5c432162fc6":{"x":{},"y":{},"type":"scatter"}},"cur_data":"5c432162fc6","visdat":{"5c432162fc6":["function (y) ","x"]},"highlight":{"on":"plotly_click","persistent":false,"dynamic":false,"selectize":false,"opacityDim":0.20000000000000001,"selected":{"opacity":1},"debounce":0},"shinyEvents":["plotly_hover","plotly_click","plotly_selected","plotly_relayout","plotly_brushed","plotly_brushing","plotly_clickannotation","plotly_doubleclick","plotly_deselect","plotly_afterplot","plotly_sunburstclick"],"base_url":"https://plot.ly"},"evals":[],"jsHooks":[]}</script>
</div>
</div>
</section>
<section id="a-word2vec-embeddings-analysis-cbow" class="level2" data-number="5">
<h2 data-number="5" class="anchored" data-anchor-id="a-word2vec-embeddings-analysis-cbow"><span class="header-section-number">5</span> A Word2Vec embeddings analysis (cbow)</h2>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb9"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">set.seed</span>(<span class="dv">42</span>)</span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a>modelcbow <span class="ot"><-</span> <span class="fu">word2vec</span>(<span class="at">x =</span> <span class="fu">tolower</span>(data_embeddings<span class="sc">$</span>combined_text), <span class="at">type =</span> <span class="st">"cbow"</span>, <span class="at">dim =</span> <span class="dv">100</span>, <span class="at">iter =</span> <span class="dv">100</span>, <span class="at">verbose=</span><span class="dv">10</span>, <span class="at">stopwords =</span> <span class="fu">stopwords</span>(<span class="st">"english"</span>), <span class="at">window =</span> <span class="st">"7"</span>)</span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a>embedding1 <span class="ot"><-</span> <span class="fu">as.matrix</span>(modelcbow)</span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a><span class="co">#embedding <- predict(modelcbow, c("mining"), type = "embedding")</span></span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true" tabindex="-1"></a><span class="co">#embedding</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>lookslike <span class="ot"><-</span> <span class="fu">predict</span>(modelcbow, <span class="fu">c</span>(<span class="st">"text"</span>), <span class="at">type =</span> <span class="st">"nearest"</span>, <span class="at">top_n =</span> <span class="dv">20</span>) <span class="sc">%>%</span> <span class="fu">as.data.frame</span>()</span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a>lookslike</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code> text.term1 text.term2 text.similarity text.rank
1 text leximancer 0.6237223 1
2 text data 0.6044528 2
3 text technique 0.5650617 3
4 text extensive 0.5469280 4
5 text approach 0.5417628 5
6 text human 0.5401942 6
7 text combines 0.5397946 7
8 text methodologies 0.5390878 8
9 text 50 0.5382825 9
10 text programming 0.5371779 10
11 text auto 0.5353760 11
12 text combining 0.5350611 12
13 text lexicon 0.5346649 13
14 text content 0.5339657 14
15 text employing 0.5338814 15
16 text structured 0.5322220 16
17 text analysis 0.5291774 17
18 text liwc 0.5281757 18
19 text bibliometric 0.5161128 19
20 text adopts 0.5154158 20</code></pre>
</div>
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb12"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a>lookslike <span class="sc">%>%</span></span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">ggplot</span>(<span class="fu">aes</span>(<span class="at">x=</span>text.similarity,<span class="at">y=</span><span class="fu">reorder</span>(text.term2,lookslike<span class="sc">$</span>text.similarity)))<span class="sc">+</span></span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_point</span>()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output-display">
<p><img src="embeddings_files/figure-html/unnamed-chunk-7-1.png" class="img-fluid" width="672"></p>
</div>
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb13"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a>fig <span class="ot"><-</span> lookslike <span class="sc">%>%</span></span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">ggplot</span>(<span class="fu">aes</span>(<span class="at">x =</span> text.similarity, <span class="at">y =</span> <span class="fu">reorder</span>(text.term2, text.similarity))) <span class="sc">+</span></span>
<span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_point</span>(<span class="at">color =</span> <span class="st">"royalblue"</span>, <span class="at">size =</span> lookslike<span class="sc">$</span>text.similarity<span class="sc">+</span><span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme_minimal</span>() <span class="sc">+</span></span>
<span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">labs</span>(<span class="at">x =</span> <span class="st">"similarity score"</span>,</span>
<span id="cb13-6"><a href="#cb13-6" aria-hidden="true" tabindex="-1"></a> <span class="at">y =</span> <span class="st">""</span>) <span class="sc">+</span></span>
<span id="cb13-7"><a href="#cb13-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">ggtitle</span>(<span class="st">"Top 20 similarity scores with term 'text'"</span> ) <span class="sc">+</span></span>
<span id="cb13-8"><a href="#cb13-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">plot.title =</span> <span class="fu">element_text</span>(<span class="at">hjust =</span> <span class="fl">0.5</span>))</span>
<span id="cb13-9"><a href="#cb13-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-10"><a href="#cb13-10" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplotly</span>(fig)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output-display">
<div class="plotly html-widget html-fill-item-overflow-hidden html-fill-item" id="htmlwidget-7265d319dbe5ffe5798f" style="width:100%;height:464px;"></div>
<script type="application/json" data-for="htmlwidget-7265d319dbe5ffe5798f">{"x":{"data":[{"x":[0.62372231483459473,0.60445284843444824,0.56506168842315674,0.5469280481338501,0.54176276922225952,0.54019415378570557,0.53979456424713135,0.53908783197402954,0.53828251361846924,0.53717786073684692,0.53537595272064209,0.53506112098693848,0.53466486930847168,0.53396570682525635,0.53388136625289917,0.53222197294235229,0.52917736768722534,0.5281757116317749,0.5161128044128418,0.51541578769683838],"y":[20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1],"text":["text.similarity: 0.6237223<br />reorder(text.term2, text.similarity): leximancer","text.similarity: 0.6044528<br />reorder(text.term2, text.similarity): data","text.similarity: 0.5650617<br />reorder(text.term2, text.similarity): technique","text.similarity: 0.5469280<br />reorder(text.term2, text.similarity): extensive","text.similarity: 0.5417628<br />reorder(text.term2, text.similarity): approach","text.similarity: 0.5401942<br />reorder(text.term2, text.similarity): human","text.similarity: 0.5397946<br />reorder(text.term2, text.similarity): combines","text.similarity: 0.5390878<br />reorder(text.term2, text.similarity): methodologies","text.similarity: 0.5382825<br />reorder(text.term2, text.similarity): 50","text.similarity: 0.5371779<br />reorder(text.term2, text.similarity): programming","text.similarity: 0.5353760<br />reorder(text.term2, text.similarity): auto","text.similarity: 0.5350611<br />reorder(text.term2, text.similarity): combining","text.similarity: 0.5346649<br />reorder(text.term2, text.similarity): lexicon","text.similarity: 0.5339657<br />reorder(text.term2, text.similarity): content","text.similarity: 0.5338814<br />reorder(text.term2, text.similarity): employing","text.similarity: 0.5322220<br />reorder(text.term2, text.similarity): structured","text.similarity: 0.5291774<br />reorder(text.term2, text.similarity): analysis","text.similarity: 0.5281757<br />reorder(text.term2, text.similarity): liwc","text.similarity: 0.5161128<br />reorder(text.term2, text.similarity): bibliometric","text.similarity: 0.5154158<br />reorder(text.term2, text.similarity): adopts"],"type":"scatter","mode":"markers","marker":{"autocolorscale":false,"color":"rgba(65,105,225,1)","opacity":1,"size":[9.9164307962252405,9.8436013169175993,9.6947213420717748,9.6261847488523475,9.6066624348557852,9.6007338095837689,9.5992235499104179,9.5965524358073555,9.5935087128887027,9.5893336468794228,9.5825232858732932,9.581333370659296,9.5798357265202085,9.5771932226466383,9.5768744551290688,9.5706027323805447,9.5590955629123489,9.5553097762460784,9.5097176859697967,9.5070832920825392],"symbol":"circle","line":{"width":1.8897637795275593,"color":"rgba(65,105,225,1)"}},"hoveron":"points","showlegend":false,"xaxis":"x","yaxis":"y","hoverinfo":"text","frame":null}],"layout":{"margin":{"t":43.762557077625573,"r":7.3059360730593621,"b":40.182648401826491,"l":86.940639269406418},"font":{"color":"rgba(0,0,0,1)","family":"","size":14.611872146118724},"title":{"text":"Top 20 similarity scores with term 'text'","font":{"color":"rgba(0,0,0,1)","family":"","size":17.534246575342465},"x":0.5,"xref":"paper"},"xaxis":{"domain":[0,1],"automargin":true,"type":"linear","autorange":false,"range":[0.51000046133995058,0.62913764119148252],"tickmode":"array","ticktext":["0.54","0.57","0.60"],"tickvals":[0.54000000000000004,0.57000000000000006,0.59999999999999998],"categoryorder":"array","categoryarray":["0.54","0.57","0.60"],"nticks":null,"ticks":"","tickcolor":null,"ticklen":3.6529680365296811,"tickwidth":0,"showticklabels":true,"tickfont":{"color":"rgba(77,77,77,1)","family":"","size":11.68949771689498},"tickangle":-0,"showline":false,"linecolor":null,"linewidth":0,"showgrid":true,"gridcolor":"rgba(235,235,235,1)","gridwidth":0.66417600664176002,"zeroline":false,"anchor":"y","title":{"text":"similarity score","font":{"color":"rgba(0,0,0,1)","family":"","size":14.611872146118724}},"hoverformat":".2f"},"yaxis":{"domain":[0,1],"automargin":true,"type":"linear","autorange":false,"range":[0.40000000000000002,20.600000000000001],"tickmode":"array","ticktext":["adopts","bibliometric","liwc","analysis","structured","employing","content","lexicon","combining","auto","programming","50","methodologies","combines","human","approach","extensive","technique","data","leximancer"],"tickvals":[1,2,3,4.0000000000000009,5,6.0000000000000009,7,8,9,10,11,12.000000000000002,13,14.000000000000002,15,16,17,18,19,20],"categoryorder":"array","categoryarray":["adopts","bibliometric","liwc","analysis","structured","employing","content","lexicon","combining","auto","programming","50","methodologies","combines","human","approach","extensive","technique","data","leximancer"],"nticks":null,"ticks":"","tickcolor":null,"ticklen":3.6529680365296811,"tickwidth":0,"showticklabels":true,"tickfont":{"color":"rgba(77,77,77,1)","family":"","size":11.68949771689498},"tickangle":-0,"showline":false,"linecolor":null,"linewidth":0,"showgrid":true,"gridcolor":"rgba(235,235,235,1)","gridwidth":0.66417600664176002,"zeroline":false,"anchor":"x","title":{"text":"","font":{"color":"rgba(0,0,0,1)","family":"","size":14.611872146118724}},"hoverformat":".2f"},"shapes":[{"type":"rect","fillcolor":null,"line":{"color":null,"width":0,"linetype":[]},"yref":"paper","xref":"paper","x0":0,"x1":1,"y0":0,"y1":1}],"showlegend":false,"legend":{"bgcolor":null,"bordercolor":null,"borderwidth":0,"font":{"color":"rgba(0,0,0,1)","family":"","size":11.68949771689498}},"hovermode":"closest","barmode":"relative"},"config":{"doubleClick":"reset","modeBarButtonsToAdd":["hoverclosest","hovercompare"],"showSendToCloud":false},"source":"A","attrs":{"5c46ae36db4":{"x":{},"y":{},"type":"scatter"}},"cur_data":"5c46ae36db4","visdat":{"5c46ae36db4":["function (y) ","x"]},"highlight":{"on":"plotly_click","persistent":false,"dynamic":false,"selectize":false,"opacityDim":0.20000000000000001,"selected":{"opacity":1},"debounce":0},"shinyEvents":["plotly_hover","plotly_click","plotly_selected","plotly_relayout","plotly_brushed","plotly_brushing","plotly_clickannotation","plotly_doubleclick","plotly_deselect","plotly_afterplot","plotly_sunburstclick"],"base_url":"https://plot.ly"},"evals":[],"jsHooks":[]}</script>
</div>
</div>
</section>
<section id="part-of-speech-tagging-with-udpipe-straka-strakova-2017-tokenizing" class="level2" data-number="6">
<h2 data-number="6" class="anchored" data-anchor-id="part-of-speech-tagging-with-udpipe-straka-strakova-2017-tokenizing"><span class="header-section-number">6</span> Part of speech tagging with UDPipe (<span class="citation" data-cites="straka-strakova-2017-tokenizing">Straka and Straková (<a href="#ref-straka-strakova-2017-tokenizing" role="doc-biblioref">2017</a>)</span>)</h2>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb14"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="fu">udpipe_download_model</span>(<span class="at">language =</span> <span class="st">"english"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code> language
1 english-ewt
file_model
1 C:/Users/Olivier/Documents/GitHub/systematic_lit_review/english-ewt-ud-2.5-191206.udpipe
url
1 https://raw.githubusercontent.com/jwijffels/udpipe.models.ud.2.5/master/inst/udpipe-ud-2.5-191206/english-ewt-ud-2.5-191206.udpipe
download_failed download_message
1 FALSE OK</code></pre>
</div>
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb16"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a>udmodel_english <span class="ot"><-</span> <span class="fu">udpipe_load_model</span>(<span class="at">file =</span> <span class="st">"english-ewt-ud-2.5-191206.udpipe"</span>)</span>
<span id="cb16-2"><a href="#cb16-2" aria-hidden="true" tabindex="-1"></a>t1<span class="ot">=</span><span class="fu">Sys.time</span>()</span>
<span id="cb16-3"><a href="#cb16-3" aria-hidden="true" tabindex="-1"></a>UD <span class="ot"><-</span> <span class="fu">udpipe_annotate</span>(udmodel_english, <span class="at">x=</span>data_embeddings<span class="sc">$</span>combined_text, <span class="at">trace =</span><span class="dv">40</span>, <span class="at">parallel.cores =</span> <span class="dv">6</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>2023-10-05 10:22:40.647556 Annotating text fragment 1/405
2023-10-05 10:22:46.726197 Annotating text fragment 41/405
2023-10-05 10:22:53.383239 Annotating text fragment 81/405
2023-10-05 10:22:59.679681 Annotating text fragment 121/405
2023-10-05 10:23:06.868441 Annotating text fragment 161/405
2023-10-05 10:23:12.46403 Annotating text fragment 201/405
2023-10-05 10:23:18.375754 Annotating text fragment 241/405
2023-10-05 10:23:25.718799 Annotating text fragment 281/405
2023-10-05 10:23:32.045804 Annotating text fragment 321/405
2023-10-05 10:23:38.495724 Annotating text fragment 361/405
2023-10-05 10:23:44.557342 Annotating text fragment 401/405</code></pre>
</div>
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb18"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="fu">Sys.time</span>()<span class="sc">-</span>t1</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>Time difference of 1.074846 mins</code></pre>
</div>
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb20"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a>annotated_text <span class="ot"><-</span> UD <span class="sc">%>%</span> <span class="fu">as.data.frame</span>()</span>
<span id="cb20-2"><a href="#cb20-2" aria-hidden="true" tabindex="-1"></a><span class="co">#write.csv(annotated_text,"annotated_udpipe.csv")</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
</section>
<section id="top-20-nouns-with-udpipe" class="level2" data-number="7">
<h2 data-number="7" class="anchored" data-anchor-id="top-20-nouns-with-udpipe"><span class="header-section-number">7</span> Top 20 nouns with UDPipe</h2>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb21"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a>lemma <span class="ot"><-</span> annotated_text <span class="sc">%>%</span></span>
<span id="cb21-2"><a href="#cb21-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">filter</span>(upos <span class="sc">==</span> <span class="st">"NOUN"</span>) <span class="sc">%>%</span></span>
<span id="cb21-3"><a href="#cb21-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">group_by</span>(lemma) <span class="sc">%>%</span></span>
<span id="cb21-4"><a href="#cb21-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">summarize</span>(<span class="at">n =</span> <span class="fu">n</span>()) <span class="sc">%>%</span></span>
<span id="cb21-5"><a href="#cb21-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">top_n</span>(<span class="dv">20</span>)</span>
<span id="cb21-6"><a href="#cb21-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb21-7"><a href="#cb21-7" aria-hidden="true" tabindex="-1"></a>fig <span class="ot"><-</span> <span class="fu">ggplot</span>(lemma, <span class="fu">aes</span>(<span class="at">x =</span> n, <span class="at">y =</span> <span class="fu">reorder</span>(lemma, n))) <span class="sc">+</span></span>
<span id="cb21-8"><a href="#cb21-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_point</span>(<span class="at">color =</span> <span class="st">"royalblue"</span>) <span class="sc">+</span></span>
<span id="cb21-9"><a href="#cb21-9" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme_minimal</span>() <span class="sc">+</span></span>
<span id="cb21-10"><a href="#cb21-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">labs</span>(<span class="at">x =</span> <span class="st">"Frequency"</span>,</span>
<span id="cb21-11"><a href="#cb21-11" aria-hidden="true" tabindex="-1"></a> <span class="at">y =</span> <span class="st">"Lemma"</span>) <span class="sc">+</span></span>
<span id="cb21-12"><a href="#cb21-12" aria-hidden="true" tabindex="-1"></a> <span class="fu">ggtitle</span>(<span class="st">"Top 20 Most Frequent Nouns"</span>) <span class="sc">+</span></span>
<span id="cb21-13"><a href="#cb21-13" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">plot.title =</span> <span class="fu">element_text</span>(<span class="at">hjust =</span> <span class="fl">0.5</span>))</span>
<span id="cb21-14"><a href="#cb21-14" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb21-15"><a href="#cb21-15" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplotly</span>(fig)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output-display">
<div class="plotly html-widget html-fill-item-overflow-hidden html-fill-item" id="htmlwidget-b741d15aded458c1aae8" style="width:100%;height:464px;"></div>
<script type="application/json" data-for="htmlwidget-b741d15aded458c1aae8">{"x":{"data":[{"x":[690,268,310,677,358,464,417,215,423,377,349,414,545,221,761,225,308,551,665,213],"y":[19,5,7,18,9,14,12,2,13,10,8,11,15,3,20,4,6,16,17,1],"text":["n: 690<br />reorder(lemma, n): analysis","n: 268<br />reorder(lemma, n): approach","n: 310<br />reorder(lemma, n): brand","n: 677<br />reorder(lemma, n): consumer","n: 358<br />reorder(lemma, n): content","n: 464<br />reorder(lemma, n): customer","n: 417<br />reorder(lemma, n): data","n: 215<br />reorder(lemma, n): information","n: 423<br />reorder(lemma, n): marketing","n: 377<br />reorder(lemma, n): media","n: 349<br />reorder(lemma, n): mining","n: 414<br />reorder(lemma, n): product","n: 545<br />reorder(lemma, n): research","n: 221<br />reorder(lemma, n): result","n: 761<br />reorder(lemma, n): review","n: 225<br />reorder(lemma, n): sentiment","n: 308<br />reorder(lemma, n): service","n: 551<br />reorder(lemma, n): study","n: 665<br />reorder(lemma, n): text","n: 213<br />reorder(lemma, n): value"],"type":"scatter","mode":"markers","marker":{"autocolorscale":false,"color":"rgba(65,105,225,1)","opacity":1,"size":5.6692913385826778,"symbol":"circle","line":{"width":1.8897637795275593,"color":"rgba(65,105,225,1)"}},"hoveron":"points","showlegend":false,"xaxis":"x","yaxis":"y","hoverinfo":"text","frame":null}],"layout":{"margin":{"t":43.762557077625573,"r":7.3059360730593621,"b":40.182648401826491,"l":89.863013698630155},"font":{"color":"rgba(0,0,0,1)","family":"","size":14.611872146118724},"title":{"text":"Top 20 Most Frequent Nouns","font":{"color":"rgba(0,0,0,1)","family":"","size":17.534246575342465},"x":0.5,"xref":"paper"},"xaxis":{"domain":[0,1],"automargin":true,"type":"linear","autorange":false,"range":[185.59999999999999,788.39999999999998],"tickmode":"array","ticktext":["200","400","600"],"tickvals":[200,400,600],"categoryorder":"array","categoryarray":["200","400","600"],"nticks":null,"ticks":"","tickcolor":null,"ticklen":3.6529680365296811,"tickwidth":0,"showticklabels":true,"tickfont":{"color":"rgba(77,77,77,1)","family":"","size":11.68949771689498},"tickangle":-0,"showline":false,"linecolor":null,"linewidth":0,"showgrid":true,"gridcolor":"rgba(235,235,235,1)","gridwidth":0.66417600664176002,"zeroline":false,"anchor":"y","title":{"text":"Frequency","font":{"color":"rgba(0,0,0,1)","family":"","size":14.611872146118724}},"hoverformat":".2f"},"yaxis":{"domain":[0,1],"automargin":true,"type":"linear","autorange":false,"range":[0.40000000000000002,20.600000000000001],"tickmode":"array","ticktext":["value","information","result","sentiment","approach","service","brand","mining","content","media","product","data","marketing","customer","research","study","text","consumer","analysis","review"],"tickvals":[1,2,3,4.0000000000000009,5,6.0000000000000009,7,8,9,10,11,12.000000000000002,13,14.000000000000002,15,16,17,18,19,20],"categoryorder":"array","categoryarray":["value","information","result","sentiment","approach","service","brand","mining","content","media","product","data","marketing","customer","research","study","text","consumer","analysis","review"],"nticks":null,"ticks":"","tickcolor":null,"ticklen":3.6529680365296811,"tickwidth":0,"showticklabels":true,"tickfont":{"color":"rgba(77,77,77,1)","family":"","size":11.68949771689498},"tickangle":-0,"showline":false,"linecolor":null,"linewidth":0,"showgrid":true,"gridcolor":"rgba(235,235,235,1)","gridwidth":0.66417600664176002,"zeroline":false,"anchor":"x","title":{"text":"Lemma","font":{"color":"rgba(0,0,0,1)","family":"","size":14.611872146118724}},"hoverformat":".2f"},"shapes":[{"type":"rect","fillcolor":null,"line":{"color":null,"width":0,"linetype":[]},"yref":"paper","xref":"paper","x0":0,"x1":1,"y0":0,"y1":1}],"showlegend":false,"legend":{"bgcolor":null,"bordercolor":null,"borderwidth":0,"font":{"color":"rgba(0,0,0,1)","family":"","size":11.68949771689498}},"hovermode":"closest","barmode":"relative"},"config":{"doubleClick":"reset","modeBarButtonsToAdd":["hoverclosest","hovercompare"],"showSendToCloud":false},"source":"A","attrs":{"5c418364a19":{"x":{},"y":{},"type":"scatter"}},"cur_data":"5c418364a19","visdat":{"5c418364a19":["function (y) ","x"]},"highlight":{"on":"plotly_click","persistent":false,"dynamic":false,"selectize":false,"opacityDim":0.20000000000000001,"selected":{"opacity":1},"debounce":0},"shinyEvents":["plotly_hover","plotly_click","plotly_selected","plotly_relayout","plotly_brushed","plotly_brushing","plotly_clickannotation","plotly_doubleclick","plotly_deselect","plotly_afterplot","plotly_sunburstclick"],"base_url":"https://plot.ly"},"evals":[],"jsHooks":[]}</script>
</div>
</div>
</section>
<section id="part-of-speech-tagging-with-trankit-nguyen2021trankit" class="level2" data-number="8">
<h2 data-number="8" class="anchored" data-anchor-id="part-of-speech-tagging-with-trankit-nguyen2021trankit"><span class="header-section-number">8</span> Part of speech tagging with Trankit (<span class="citation" data-cites="nguyen2021trankit">Nguyen et al. (<a href="#ref-nguyen2021trankit" role="doc-biblioref">2021</a>)</span>)</h2>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb22"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> trankit <span class="im">import</span> Pipeline</span>
<span id="cb22-2"><a href="#cb22-2" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> pandas <span class="im">as</span> pd</span>
<span id="cb22-3"><a href="#cb22-3" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> pandas <span class="im">import</span> json_normalize</span>
<span id="cb22-4"><a href="#cb22-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb22-5"><a href="#cb22-5" aria-hidden="true" tabindex="-1"></a>df <span class="op">=</span> pd.read_csv(<span class="st">"data_for_embeddings.csv"</span>)</span>
<span id="cb22-6"><a href="#cb22-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb22-7"><a href="#cb22-7" aria-hidden="true" tabindex="-1"></a><span class="co"># initialize a pipeline for English</span></span>
<span id="cb22-8"><a href="#cb22-8" aria-hidden="true" tabindex="-1"></a>p <span class="op">=</span> Pipeline(<span class="st">'english'</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>Loading pretrained XLM-Roberta, this may take a while...
Loading tokenizer for english
Loading tagger for english
Loading lemmatizer for english
Loading NER tagger for english
==================================================
Active language: english
==================================================</code></pre>
</div>
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb24"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb24-2"><a href="#cb24-2" aria-hidden="true" tabindex="-1"></a><span class="co">#test = p.posdep(df.loc[:5]['combined_text'][1])</span></span>
<span id="cb24-3"><a href="#cb24-3" aria-hidden="true" tabindex="-1"></a><span class="co">#testdf = pd.DataFrame(pd.json_normalize(test['sentences'], 'tokens'))</span></span>
<span id="cb24-4"><a href="#cb24-4" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb24-5"><a href="#cb24-5" aria-hidden="true" tabindex="-1"></a><span class="co">#pos = p.posdep(all)</span></span>
<span id="cb24-6"><a href="#cb24-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb24-7"><a href="#cb24-7" aria-hidden="true" tabindex="-1"></a>results <span class="op">=</span> pd.DataFrame() </span>
<span id="cb24-8"><a href="#cb24-8" aria-hidden="true" tabindex="-1"></a><span class="co">#part of speech tagging</span></span>
<span id="cb24-9"><a href="#cb24-9" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> text <span class="kw">in</span> df[<span class="st">'combined_text'</span>]:</span>
<span id="cb24-10"><a href="#cb24-10" aria-hidden="true" tabindex="-1"></a> pos <span class="op">=</span> p.posdep(text)</span>
<span id="cb24-11"><a href="#cb24-11" aria-hidden="true" tabindex="-1"></a> pos_df <span class="op">=</span> pd.json_normalize(pos[<span class="st">'sentences'</span>], <span class="st">'tokens'</span>)</span>
<span id="cb24-12"><a href="#cb24-12" aria-hidden="true" tabindex="-1"></a> results <span class="op">=</span> pd.concat([results,pos_df])</span>
<span id="cb24-13"><a href="#cb24-13" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb24-14"><a href="#cb24-14" aria-hidden="true" tabindex="-1"></a><span class="co">#lemmatization</span></span>
<span id="cb24-15"><a href="#cb24-15" aria-hidden="true" tabindex="-1"></a>results_lemma <span class="op">=</span> pd.DataFrame() </span>
<span id="cb24-16"><a href="#cb24-16" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> text <span class="kw">in</span> df[<span class="st">'combined_text'</span>]:</span>
<span id="cb24-17"><a href="#cb24-17" aria-hidden="true" tabindex="-1"></a> lemma <span class="op">=</span> p.lemmatize(text)</span>
<span id="cb24-18"><a href="#cb24-18" aria-hidden="true" tabindex="-1"></a> lemma_df <span class="op">=</span> pd.json_normalize(lemma[<span class="st">'sentences'</span>], <span class="st">'tokens'</span>)</span>
<span id="cb24-19"><a href="#cb24-19" aria-hidden="true" tabindex="-1"></a> results_lemma <span class="op">=</span> pd.concat([results_lemma,lemma_df])</span>
<span id="cb24-20"><a href="#cb24-20" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb24-21"><a href="#cb24-21" aria-hidden="true" tabindex="-1"></a><span class="co">#join both data frames</span></span>
<span id="cb24-22"><a href="#cb24-22" aria-hidden="true" tabindex="-1"></a>results_complete <span class="op">=</span> pd.concat([results, results_lemma[<span class="st">'text'</span>].rename(<span class="st">"lemma"</span>)], axis<span class="op">=</span><span class="dv">1</span>)</span>
<span id="cb24-23"><a href="#cb24-23" aria-hidden="true" tabindex="-1"></a>results_complete[<span class="st">"lemma"</span>] <span class="op">=</span> results_complete[<span class="st">"text"</span>]</span>
<span id="cb24-24"><a href="#cb24-24" aria-hidden="true" tabindex="-1"></a><span class="co">#results_lemma.to_csv("lemmas_trankit.csv")</span></span>
<span id="cb24-25"><a href="#cb24-25" aria-hidden="true" tabindex="-1"></a><span class="co">#results_complete.to_csv("annotated_trankit.csv")</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
</section>
<section id="top-20-nouns-with-trankit" class="level2" data-number="9">
<h2 data-number="9" class="anchored" data-anchor-id="top-20-nouns-with-trankit"><span class="header-section-number">9</span> Top 20 nouns with Trankit</h2>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb25"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> pandas <span class="im">as</span> pd</span>
<span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> plotly.express <span class="im">as</span> px</span>
<span id="cb25-3"><a href="#cb25-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb25-4"><a href="#cb25-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Charger les données à partir du DataFrame "results"</span></span>
<span id="cb25-5"><a href="#cb25-5" aria-hidden="true" tabindex="-1"></a><span class="co"># Assurez-vous que "results" contient les mêmes colonnes que le fichier CSV original</span></span>
<span id="cb25-6"><a href="#cb25-6" aria-hidden="true" tabindex="-1"></a><span class="co"># (par exemple, "upos" et "lemma")</span></span>
<span id="cb25-7"><a href="#cb25-7" aria-hidden="true" tabindex="-1"></a>results_complete <span class="op">=</span> pd.read_csv(<span class="st">"annotated_trankit.csv"</span>)</span>
<span id="cb25-8"><a href="#cb25-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb25-9"><a href="#cb25-9" aria-hidden="true" tabindex="-1"></a><span class="co"># Filtrer les lignes où 'upos' est égal à "NOUN"</span></span>
<span id="cb25-10"><a href="#cb25-10" aria-hidden="true" tabindex="-1"></a>noun_data <span class="op">=</span> results_complete[results_complete[<span class="st">'upos'</span>] <span class="op">==</span> <span class="st">'NOUN'</span>]</span>
<span id="cb25-11"><a href="#cb25-11" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb25-12"><a href="#cb25-12" aria-hidden="true" tabindex="-1"></a><span class="co"># Regrouper par 'lemma' et compter le nombre d'occurrences</span></span>
<span id="cb25-13"><a href="#cb25-13" aria-hidden="true" tabindex="-1"></a>top_nouns <span class="op">=</span> noun_data[<span class="st">'lemma'</span>].value_counts().reset_index()</span>
<span id="cb25-14"><a href="#cb25-14" aria-hidden="true" tabindex="-1"></a>top_nouns.columns <span class="op">=</span> [<span class="st">'lemma'</span>, <span class="st">'n'</span>]</span>
<span id="cb25-15"><a href="#cb25-15" aria-hidden="true" tabindex="-1"></a>top_nouns <span class="op">=</span> top_nouns.head(<span class="dv">20</span>)</span>
<span id="cb25-16"><a href="#cb25-16" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb25-17"><a href="#cb25-17" aria-hidden="true" tabindex="-1"></a><span class="co"># Créer un graphique à l'aide de Plotly Express</span></span>
<span id="cb25-18"><a href="#cb25-18" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="st">"fig"</span> <span class="kw">not</span> <span class="kw">in</span> <span class="bu">globals</span>():</span>
<span id="cb25-19"><a href="#cb25-19" aria-hidden="true" tabindex="-1"></a> fig <span class="op">=</span> px.scatter(top_nouns, x<span class="op">=</span><span class="st">'n'</span>, y<span class="op">=</span><span class="st">'lemma'</span>, color<span class="op">=</span><span class="st">'lemma'</span>,</span>
<span id="cb25-20"><a href="#cb25-20" aria-hidden="true" tabindex="-1"></a> labels<span class="op">=</span>{<span class="st">'n'</span>: <span class="st">'Frequency'</span>, <span class="st">'lemma'</span>: <span class="st">'Lemma'</span>},</span>
<span id="cb25-21"><a href="#cb25-21" aria-hidden="true" tabindex="-1"></a> title<span class="op">=</span><span class="st">'Top 20 Most Frequent Nouns'</span>)</span>
<span id="cb25-22"><a href="#cb25-22" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb25-23"><a href="#cb25-23" aria-hidden="true" tabindex="-1"></a> <span class="co"># Personnaliser le style du graphique</span></span>
<span id="cb25-24"><a href="#cb25-24" aria-hidden="true" tabindex="-1"></a> fig.update_traces(marker<span class="op">=</span><span class="bu">dict</span>(size<span class="op">=</span><span class="dv">12</span>, opacity<span class="op">=</span><span class="fl">0.6</span>),</span>
<span id="cb25-25"><a href="#cb25-25" aria-hidden="true" tabindex="-1"></a> selector<span class="op">=</span><span class="bu">dict</span>(mode<span class="op">=</span><span class="st">'markers'</span>))</span>
<span id="cb25-26"><a href="#cb25-26" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb25-27"><a href="#cb25-27" aria-hidden="true" tabindex="-1"></a> fig.update_layout(title_x<span class="op">=</span><span class="fl">0.5</span>, title_font<span class="op">=</span><span class="bu">dict</span>(size<span class="op">=</span><span class="dv">20</span>))</span>
<span id="cb25-28"><a href="#cb25-28" aria-hidden="true" tabindex="-1"></a> fig.update_layout(template<span class="op">=</span><span class="st">"plotly_white"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output-display">
<div> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
<script src="https://cdn.plot.ly/plotly-2.18.2.min.js"></script> <div id="1d70fc4d-b111-4357-b4e2-03e798c7451b" class="plotly-graph-div" style="height:100%; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("1d70fc4d-b111-4357-b4e2-03e798c7451b")) { Plotly.newPlot( "1d70fc4d-b111-4357-b4e2-03e798c7451b", [{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"analysis","marker":{"color":"#636efa","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"analysis","orientation":"h","showlegend":true,"x":[681],"xaxis":"x","y":["analysis"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"text","marker":{"color":"#EF553B","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"text","orientation":"h","showlegend":true,"x":[598],"xaxis":"x","y":["text"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"research","marker":{"color":"#00cc96","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"research","orientation":"h","showlegend":true,"x":[546],"xaxis":"x","y":["research"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"reviews","marker":{"color":"#ab63fa","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"reviews","orientation":"h","showlegend":true,"x":[511],"xaxis":"x","y":["reviews"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"marketing","marker":{"color":"#FFA15A","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"marketing","orientation":"h","showlegend":true,"x":[464],"xaxis":"x","y":["marketing"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"study","marker":{"color":"#19d3f3","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"study","orientation":"h","showlegend":true,"x":[423],"xaxis":"x","y":["study"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"data","marker":{"color":"#FF6692","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"data","orientation":"h","showlegend":true,"x":[402],"xaxis":"x","y":["data"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"consumer","marker":{"color":"#B6E880","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"consumer","orientation":"h","showlegend":true,"x":[389],"xaxis":"x","y":["consumer"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"content","marker":{"color":"#FF97FF","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"content","orientation":"h","showlegend":true,"x":[384],"xaxis":"x","y":["content"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"mining","marker":{"color":"#FECB52","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"mining","orientation":"h","showlegend":true,"x":[367],"xaxis":"x","y":["mining"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"media","marker":{"color":"#636efa","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"media","orientation":"h","showlegend":true,"x":[360],"xaxis":"x","y":["media"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"consumers","marker":{"color":"#EF553B","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"consumers","orientation":"h","showlegend":true,"x":[326],"xaxis":"x","y":["consumers"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"brand","marker":{"color":"#00cc96","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"brand","orientation":"h","showlegend":true,"x":[293],"xaxis":"x","y":["brand"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"product","marker":{"color":"#ab63fa","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"product","orientation":"h","showlegend":true,"x":[279],"xaxis":"x","y":["product"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"customer","marker":{"color":"#FFA15A","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"customer","orientation":"h","showlegend":true,"x":[267],"xaxis":"x","y":["customer"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"approach","marker":{"color":"#19d3f3","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"approach","orientation":"h","showlegend":true,"x":[253],"xaxis":"x","y":["approach"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"review","marker":{"color":"#FF6692","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"review","orientation":"h","showlegend":true,"x":[239],"xaxis":"x","y":["review"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"service","marker":{"color":"#B6E880","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"service","orientation":"h","showlegend":true,"x":[216],"xaxis":"x","y":["service"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"information","marker":{"color":"#FF97FF","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"information","orientation":"h","showlegend":true,"x":[208],"xaxis":"x","y":["information"],"yaxis":"y","type":"scatter"},{"hovertemplate":"Lemma=%{y}<br>Frequency=%{x}<extra></extra>","legendgroup":"value","marker":{"color":"#FECB52","symbol":"circle","opacity":0.6,"size":12},"mode":"markers","name":"value","orientation":"h","showlegend":true,"x":[189],"xaxis":"x","y":["value"],"yaxis":"y","type":"scatter"}], {"template":{"data":{"barpolar":[{"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"type":"carpet"}],"choropleth":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"choropleth"}],"contourcarpet":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"contourcarpet"}],"contour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"contour"}],"heatmapgl":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmapgl"}],"heatmap":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmap"}],"histogram2dcontour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2dcontour"}],"histogram2d":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2d"}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"mesh3d":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"mesh3d"}],"parcoords":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"parcoords"}],"pie":[{"automargin":true,"type":"pie"}],"scatter3d":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter3d"}],"scattercarpet":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattercarpet"}],"scattergeo":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergeo"}],"scattergl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergl"}],"scattermapbox":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermapbox"}],"scatterpolargl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolargl"}],"scatterpolar":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolar"}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"scatterternary":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterternary"}],"surface":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"surface"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}]},"layout":{"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"autotypenumbers":"strict","coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]],"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]},"colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"geo":{"bgcolor":"white","lakecolor":"white","landcolor":"white","showlakes":true,"showland":true,"subunitcolor":"#C8D4E3"},"hoverlabel":{"align":"left"},"hovermode":"closest","mapbox":{"style":"light"},"paper_bgcolor":"white","plot_bgcolor":"white","polar":{"angularaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""},"bgcolor":"white","radialaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""}},"scene":{"xaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"yaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"zaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"ternary":{"aaxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"baxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"bgcolor":"white","caxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""}},"title":{"x":0.05},"xaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2},"yaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2}}},"xaxis":{"anchor":"y","domain":[0.0,1.0],"title":{"text":"Frequency"}},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"text":"Lemma"},"categoryorder":"array","categoryarray":["value","information","service","review","approach","customer","product","brand","consumers","media","mining","content","consumer","data","study","marketing","reviews","research","text","analysis"]},"legend":{"title":{"text":"Lemma"},"tracegroupgap":0},"title":{"text":"Top 20 Most Frequent Nouns","font":{"size":20},"x":0.5}}, {"responsive": true} ) }; </script> </div>
</div>
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb26"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb26-2"><a href="#cb26-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb26-3"><a href="#cb26-3" aria-hidden="true" tabindex="-1"></a><span class="co"># Afficher le graphique</span></span>
<span id="cb26-4"><a href="#cb26-4" aria-hidden="true" tabindex="-1"></a><span class="co">#fig.show()</span></span>
<span id="cb26-5"><a href="#cb26-5" aria-hidden="true" tabindex="-1"></a><span class="co">#fig.write_html("top_20_nouns_trankit_python.html")</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
</section>
<section id="part-of-speech-tagging-with-stanza-qi2020stanza" class="level2" data-number="10">
<h2 data-number="10" class="anchored" data-anchor-id="part-of-speech-tagging-with-stanza-qi2020stanza"><span class="header-section-number">10</span> Part of speech tagging with Stanza (<span class="citation" data-cites="qi2020stanza">Qi et al. (<a href="#ref-qi2020stanza" role="doc-biblioref">2020</a>)</span>)</h2>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb27"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> stanza</span>
<span id="cb27-2"><a href="#cb27-2" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> pandas <span class="im">as</span> pd</span>
<span id="cb27-3"><a href="#cb27-3" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> tqdm <span class="im">import</span> tqdm</span>
<span id="cb27-4"><a href="#cb27-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb27-5"><a href="#cb27-5" aria-hidden="true" tabindex="-1"></a><span class="co"># Initialisation du modèle Stanza</span></span>
<span id="cb27-6"><a href="#cb27-6" aria-hidden="true" tabindex="-1"></a>nlp <span class="op">=</span> stanza.Pipeline(lang<span class="op">=</span><span class="st">'en'</span>, processors<span class="op">=</span><span class="st">'tokenize, mwt, pos, lemma,ner'</span>, use_gpu<span class="op">=</span><span class="va">True</span>, tokenize_pretokenized<span class="op">=</span><span class="va">False</span>, tokenize_no_ssplit<span class="op">=</span><span class="va">True</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>2023-10-05 10:26:28 INFO: Checking for updates to resources.json in case models have been updated. Note: this behavior can be turned off with download_method=None or download_method=DownloadMethod.REUSE_RESOURCES
Downloading https://raw.githubusercontent.com/stanfordnlp/stanza-resources/main/resources_1.5.0.json: 0%| | 0.00/30.1k [00:00<?, ?B/s]
Downloading https://raw.githubusercontent.com/stanfordnlp/stanza-resources/main/resources_1.5.0.json: 216kB [00:00, 12.7MB/s]
2023-10-05 10:26:28 WARNING: Can not find mwt: default from official model list. Ignoring it.
2023-10-05 10:26:29 INFO: Loading these models for language: en (English):
=========================
| Processor | Package |
-------------------------
| tokenize | combined |
| pos | combined |
| lemma | combined |
| ner | ontonotes |
=========================
2023-10-05 10:26:29 INFO: Using device: cuda
2023-10-05 10:26:29 INFO: Loading: tokenize
2023-10-05 10:26:29 INFO: Loading: pos
2023-10-05 10:26:29 INFO: Loading: lemma
2023-10-05 10:26:29 INFO: Loading: ner
2023-10-05 10:26:29 INFO: Done loading processors!</code></pre>
</div>
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb29"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Chargement du DataFrame depuis le fichier CSV</span></span>
<span id="cb29-2"><a href="#cb29-2" aria-hidden="true" tabindex="-1"></a>df <span class="op">=</span> pd.read_csv(<span class="st">"data_for_embeddings.csv"</span>)</span>
<span id="cb29-3"><a href="#cb29-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb29-4"><a href="#cb29-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb29-5"><a href="#cb29-5" aria-hidden="true" tabindex="-1"></a>annotated_df <span class="op">=</span> pd.DataFrame()</span>
<span id="cb29-6"><a href="#cb29-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb29-7"><a href="#cb29-7" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> text <span class="kw">in</span> tqdm(df[<span class="st">'combined_text'</span>], desc<span class="op">=</span><span class="st">"Processing Texts"</span>):</span>
<span id="cb29-8"><a href="#cb29-8" aria-hidden="true" tabindex="-1"></a> doc <span class="op">=</span> nlp(text)</span>
<span id="cb29-9"><a href="#cb29-9" aria-hidden="true" tabindex="-1"></a> dicts <span class="op">=</span> doc.to_dict()</span>
<span id="cb29-10"><a href="#cb29-10" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb29-11"><a href="#cb29-11" aria-hidden="true" tabindex="-1"></a> <span class="co"># Convertissez le dictionnaire en un DataFrame temporaire</span></span>
<span id="cb29-12"><a href="#cb29-12" aria-hidden="true" tabindex="-1"></a> temp_df <span class="op">=</span> pd.DataFrame(dicts[<span class="dv">0</span>])</span>
<span id="cb29-13"><a href="#cb29-13" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb29-14"><a href="#cb29-14" aria-hidden="true" tabindex="-1"></a> <span class="co"># Ajoutez les données du DataFrame temporaire à testdf en ignorant l'index</span></span>
<span id="cb29-15"><a href="#cb29-15" aria-hidden="true" tabindex="-1"></a> annotated_df <span class="op">=</span> pd.concat([annotated_df, temp_df], ignore_index<span class="op">=</span><span class="va">True</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>
Processing Texts: 0%| | 0/405 [00:00<?, ?it/s]
Processing Texts: 0%| | 1/405 [00:00<02:28, 2.73it/s]
Processing Texts: 0%| | 2/405 [00:00<02:53, 2.33it/s]
Processing Texts: 1%| | 3/405 [00:01<03:01, 2.22it/s]
Processing Texts: 1%| | 4/405 [00:01<02:59, 2.23it/s]
Processing Texts: 1%|1 | 5/405 [00:02<02:51, 2.33it/s]
Processing Texts: 1%|1 | 6/405 [00:02<02:57, 2.24it/s]
Processing Texts: 2%|1 | 7/405 [00:03<03:12, 2.07it/s]
Processing Texts: 2%|1 | 8/405 [00:03<03:08, 2.11it/s]
Processing Texts: 2%|2 | 9/405 [00:04<03:16, 2.02it/s]
Processing Texts: 2%|2 | 10/405 [00:04<03:12, 2.05it/s]
Processing Texts: 3%|2 | 11/405 [00:05<02:53, 2.27it/s]
Processing Texts: 3%|2 | 12/405 [00:05<03:08, 2.09it/s]
Processing Texts: 3%|3 | 13/405 [00:06<03:37, 1.80it/s]
Processing Texts: 3%|3 | 14/405 [00:06<03:25, 1.90it/s]
Processing Texts: 4%|3 | 15/405 [00:07<03:32, 1.83it/s]
Processing Texts: 4%|3 | 16/405 [00:07<03:18, 1.96it/s]
Processing Texts: 4%|4 | 17/405 [00:08<03:32, 1.83it/s]
Processing Texts: 4%|4 | 18/405 [00:08<03:19, 1.94it/s]
Processing Texts: 5%|4 | 19/405 [00:09<03:18, 1.95it/s]
Processing Texts: 5%|4 | 20/405 [00:09<02:54, 2.21it/s]
Processing Texts: 5%|5 | 21/405 [00:10<03:16, 1.95it/s]
Processing Texts: 5%|5 | 22/405 [00:10<03:03, 2.09it/s]
Processing Texts: 6%|5 | 23/405 [00:11<02:56, 2.17it/s]
Processing Texts: 6%|5 | 24/405 [00:11<02:58, 2.13it/s]
Processing Texts: 6%|6 | 25/405 [00:12<03:07, 2.02it/s]
Processing Texts: 6%|6 | 26/405 [00:12<03:00, 2.10it/s]
Processing Texts: 7%|6 | 27/405 [00:13<03:28, 1.81it/s]
Processing Texts: 7%|6 | 28/405 [00:13<03:20, 1.88it/s]
Processing Texts: 7%|7 | 29/405 [00:14<03:22, 1.85it/s]
Processing Texts: 7%|7 | 30/405 [00:15<04:05, 1.53it/s]
Processing Texts: 8%|7 | 31/405 [00:16<03:58, 1.57it/s]
Processing Texts: 8%|7 | 32/405 [00:16<04:19, 1.44it/s]
Processing Texts: 8%|8 | 33/405 [00:17<03:44, 1.66it/s]
Processing Texts: 8%|8 | 34/405 [00:17<03:30, 1.76it/s]
Processing Texts: 9%|8 | 35/405 [00:18<03:14, 1.90it/s]
Processing Texts: 9%|8 | 36/405 [00:18<03:10, 1.94it/s]
Processing Texts: 9%|9 | 37/405 [00:19<03:00, 2.04it/s]
Processing Texts: 9%|9 | 38/405 [00:19<02:55, 2.09it/s]
Processing Texts: 10%|9 | 39/405 [00:19<02:50, 2.15it/s]
Processing Texts: 10%|9 | 40/405 [00:20<02:38, 2.30it/s]
Processing Texts: 10%|# | 41/405 [00:20<02:36, 2.33it/s]
Processing Texts: 10%|# | 42/405 [00:21<02:35, 2.33it/s]
Processing Texts: 11%|# | 43/405 [00:21<02:52, 2.10it/s]
Processing Texts: 11%|# | 44/405 [00:22<03:01, 1.99it/s]
Processing Texts: 11%|#1 | 45/405 [00:22<03:04, 1.95it/s]
Processing Texts: 11%|#1 | 46/405 [00:23<03:00, 1.99it/s]
Processing Texts: 12%|#1 | 47/405 [00:23<03:04, 1.94it/s]
Processing Texts: 12%|#1 | 48/405 [00:24<03:04, 1.94it/s]
Processing Texts: 12%|#2 | 49/405 [00:24<02:57, 2.01it/s]
Processing Texts: 12%|#2 | 50/405 [00:25<02:44, 2.16it/s]
Processing Texts: 13%|#2 | 51/405 [00:25<03:02, 1.94it/s]
Processing Texts: 13%|#2 | 52/405 [00:26<03:07, 1.88it/s]
Processing Texts: 13%|#3 | 53/405 [00:26<02:59, 1.96it/s]
Processing Texts: 13%|#3 | 54/405 [00:27<02:49, 2.07it/s]
Processing Texts: 14%|#3 | 55/405 [00:27<02:36, 2.23it/s]
Processing Texts: 14%|#3 | 56/405 [00:28<02:40, 2.18it/s]
Processing Texts: 14%|#4 | 57/405 [00:28<02:42, 2.15it/s]
Processing Texts: 14%|#4 | 58/405 [00:29<03:21, 1.73it/s]
Processing Texts: 15%|#4 | 59/405 [00:30<03:41, 1.56it/s]
Processing Texts: 15%|#4 | 60/405 [00:31<03:53, 1.48it/s]
Processing Texts: 15%|#5 | 61/405 [00:32<04:23, 1.31it/s]
Processing Texts: 15%|#5 | 62/405 [00:32<04:25, 1.29it/s]
Processing Texts: 16%|#5 | 63/405 [00:33<03:54, 1.46it/s]
Processing Texts: 16%|#5 | 64/405 [00:34<04:16, 1.33it/s]
Processing Texts: 16%|#6 | 65/405 [00:34<03:43, 1.52it/s]
Processing Texts: 16%|#6 | 66/405 [00:35<03:25, 1.65it/s]
Processing Texts: 17%|#6 | 67/405 [00:35<03:14, 1.74it/s]
Processing Texts: 17%|#6 | 68/405 [00:36<02:52, 1.95it/s]
Processing Texts: 17%|#7 | 69/405 [00:36<02:35, 2.16it/s]
Processing Texts: 17%|#7 | 70/405 [00:36<02:21, 2.37it/s]
Processing Texts: 18%|#7 | 71/405 [00:37<02:29, 2.24it/s]
Processing Texts: 18%|#7 | 72/405 [00:37<02:26, 2.27it/s]
Processing Texts: 18%|#8 | 73/405 [00:38<02:33, 2.17it/s]
Processing Texts: 18%|#8 | 74/405 [00:38<02:42, 2.04it/s]
Processing Texts: 19%|#8 | 75/405 [00:39<02:58, 1.85it/s]
Processing Texts: 19%|#8 | 76/405 [00:39<02:44, 2.00it/s]
Processing Texts: 19%|#9 | 77/405 [00:40<02:31, 2.17it/s]
Processing Texts: 19%|#9 | 78/405 [00:40<02:12, 2.46it/s]
Processing Texts: 20%|#9 | 79/405 [00:40<02:18, 2.36it/s]
Processing Texts: 20%|#9 | 80/405 [00:41<02:35, 2.08it/s]
Processing Texts: 20%|## | 81/405 [00:42<02:47, 1.94it/s]
Processing Texts: 20%|## | 82/405 [00:42<02:40, 2.01it/s]
Processing Texts: 20%|## | 83/405 [00:43<02:39, 2.02it/s]
Processing Texts: 21%|## | 84/405 [00:43<02:23, 2.23it/s]
Processing Texts: 21%|## | 85/405 [00:44<02:46, 1.92it/s]
Processing Texts: 21%|##1 | 86/405 [00:44<03:25, 1.55it/s]
Processing Texts: 21%|##1 | 87/405 [00:45<03:26, 1.54it/s]
Processing Texts: 22%|##1 | 88/405 [00:46<03:00, 1.76it/s]
Processing Texts: 22%|##1 | 89/405 [00:46<02:41, 1.96it/s]
Processing Texts: 22%|##2 | 90/405 [00:46<02:31, 2.08it/s]
Processing Texts: 22%|##2 | 91/405 [00:47<02:24, 2.17it/s]
Processing Texts: 23%|##2 | 92/405 [00:47<02:31, 2.06it/s]
Processing Texts: 23%|##2 | 93/405 [00:48<02:33, 2.03it/s]
Processing Texts: 23%|##3 | 94/405 [00:48<02:34, 2.01it/s]
Processing Texts: 23%|##3 | 95/405 [00:49<02:24, 2.14it/s]
Processing Texts: 24%|##3 | 96/405 [00:49<02:19, 2.21it/s]
Processing Texts: 24%|##3 | 97/405 [00:49<02:06, 2.44it/s]
Processing Texts: 24%|##4 | 98/405 [00:50<02:02, 2.50it/s]
Processing Texts: 25%|##4 | 100/405 [00:50<01:56, 2.61it/s]
Processing Texts: 25%|##4 | 101/405 [00:51<02:01, 2.50it/s]
Processing Texts: 25%|##5 | 102/405 [00:52<02:49, 1.79it/s]
Processing Texts: 25%|##5 | 103/405 [00:52<02:33, 1.97it/s]
Processing Texts: 26%|##5 | 104/405 [00:53<02:24, 2.09it/s]
Processing Texts: 26%|##5 | 105/405 [00:53<02:14, 2.23it/s]
Processing Texts: 26%|##6 | 106/405 [00:54<02:26, 2.05it/s]
Processing Texts: 26%|##6 | 107/405 [00:54<02:55, 1.70it/s]
Processing Texts: 27%|##6 | 108/405 [00:55<02:57, 1.68it/s]
Processing Texts: 27%|##6 | 109/405 [00:55<02:37, 1.88it/s]
Processing Texts: 27%|##7 | 110/405 [00:56<02:38, 1.86it/s]
Processing Texts: 27%|##7 | 111/405 [00:56<02:23, 2.06it/s]
Processing Texts: 28%|##7 | 112/405 [00:57<02:48, 1.74it/s]
Processing Texts: 28%|##7 | 113/405 [00:57<02:25, 2.01it/s]
Processing Texts: 28%|##8 | 114/405 [00:58<02:34, 1.88it/s]
Processing Texts: 28%|##8 | 115/405 [00:59<02:39, 1.82it/s]
Processing Texts: 29%|##8 | 116/405 [00:59<02:26, 1.97it/s]
Processing Texts: 29%|##8 | 117/405 [01:00<02:25, 1.97it/s]
Processing Texts: 29%|##9 | 118/405 [01:00<02:26, 1.95it/s]
Processing Texts: 29%|##9 | 119/405 [01:01<02:32, 1.88it/s]
Processing Texts: 30%|##9 | 120/405 [01:01<02:25, 1.97it/s]
Processing Texts: 30%|##9 | 121/405 [01:02<02:23, 1.98it/s]
Processing Texts: 30%|### | 122/405 [01:02<02:27, 1.92it/s]
Processing Texts: 30%|### | 123/405 [01:03<02:35, 1.82it/s]
Processing Texts: 31%|### | 124/405 [01:03<02:32, 1.85it/s]
Processing Texts: 31%|### | 125/405 [01:04<02:33, 1.83it/s]
Processing Texts: 31%|###1 | 126/405 [01:04<02:25, 1.91it/s]
Processing Texts: 31%|###1 | 127/405 [01:05<02:45, 1.68it/s]
Processing Texts: 32%|###1 | 128/405 [01:06<02:34, 1.79it/s]
Processing Texts: 32%|###1 | 129/405 [01:06<02:33, 1.80it/s]
Processing Texts: 32%|###2 | 130/405 [01:07<02:22, 1.93it/s]
Processing Texts: 32%|###2 | 131/405 [01:07<02:29, 1.83it/s]
Processing Texts: 33%|###2 | 132/405 [01:08<02:31, 1.81it/s]
Processing Texts: 33%|###2 | 133/405 [01:08<02:32, 1.78it/s]
Processing Texts: 33%|###3 | 134/405 [01:09<02:45, 1.63it/s]
Processing Texts: 33%|###3 | 135/405 [01:10<02:40, 1.68it/s]
Processing Texts: 34%|###3 | 136/405 [01:10<02:30, 1.79it/s]
Processing Texts: 34%|###3 | 137/405 [01:11<02:20, 1.90it/s]
Processing Texts: 34%|###4 | 138/405 [01:11<02:27, 1.81it/s]
Processing Texts: 34%|###4 | 139/405 [01:12<02:28, 1.80it/s]
Processing Texts: 35%|###4 | 140/405 [01:12<02:37, 1.68it/s]
Processing Texts: 35%|###4 | 141/405 [01:13<02:27, 1.79it/s]
Processing Texts: 35%|###5 | 142/405 [01:13<02:19, 1.89it/s]
Processing Texts: 35%|###5 | 143/405 [01:14<02:04, 2.11it/s]
Processing Texts: 36%|###5 | 144/405 [01:14<01:40, 2.60it/s]
Processing Texts: 36%|###5 | 145/405 [01:15<02:19, 1.86it/s]
Processing Texts: 36%|###6 | 146/405 [01:16<02:52, 1.50it/s]
Processing Texts: 36%|###6 | 147/405 [01:17<03:27, 1.24it/s]
Processing Texts: 37%|###6 | 148/405 [01:18<03:46, 1.14it/s]
Processing Texts: 37%|###6 | 149/405 [01:19<03:47, 1.13it/s]
Processing Texts: 37%|###7 | 150/405 [01:20<03:40, 1.15it/s]
Processing Texts: 37%|###7 | 151/405 [01:20<03:08, 1.35it/s]
Processing Texts: 38%|###7 | 152/405 [01:21<02:57, 1.43it/s]
Processing Texts: 38%|###7 | 153/405 [01:22<03:19, 1.26it/s]
Processing Texts: 38%|###8 | 154/405 [01:23<03:41, 1.13it/s]
Processing Texts: 38%|###8 | 155/405 [01:24<03:51, 1.08it/s]
Processing Texts: 39%|###8 | 156/405 [01:25<03:50, 1.08it/s]
Processing Texts: 39%|###8 | 157/405 [01:25<03:24, 1.21it/s]
Processing Texts: 39%|###9 | 158/405 [01:26<03:37, 1.14it/s]
Processing Texts: 39%|###9 | 159/405 [01:27<03:03, 1.34it/s]
Processing Texts: 40%|###9 | 160/405 [01:27<03:03, 1.34it/s]
Processing Texts: 40%|###9 | 161/405 [01:28<02:54, 1.39it/s]
Processing Texts: 40%|#### | 162/405 [01:29<02:39, 1.52it/s]
Processing Texts: 40%|#### | 163/405 [01:29<02:17, 1.76it/s]
Processing Texts: 40%|#### | 164/405 [01:30<02:24, 1.66it/s]
Processing Texts: 41%|#### | 165/405 [01:30<02:03, 1.94it/s]
Processing Texts: 41%|#### | 166/405 [01:31<02:22, 1.68it/s]
Processing Texts: 41%|####1 | 167/405 [01:31<02:10, 1.82it/s]
Processing Texts: 41%|####1 | 168/405 [01:32<02:16, 1.74it/s]
Processing Texts: 42%|####1 | 169/405 [01:32<02:10, 1.81it/s]
Processing Texts: 42%|####1 | 170/405 [01:33<02:14, 1.75it/s]
Processing Texts: 42%|####2 | 171/405 [01:33<02:00, 1.94it/s]
Processing Texts: 42%|####2 | 172/405 [01:34<02:03, 1.89it/s]
Processing Texts: 43%|####2 | 173/405 [01:34<02:00, 1.93it/s]
Processing Texts: 43%|####2 | 174/405 [01:35<01:57, 1.97it/s]
Processing Texts: 43%|####3 | 175/405 [01:35<01:46, 2.15it/s]
Processing Texts: 43%|####3 | 176/405 [01:36<01:55, 1.98it/s]
Processing Texts: 44%|####3 | 177/405 [01:37<02:15, 1.68it/s]
Processing Texts: 44%|####3 | 178/405 [01:37<02:08, 1.77it/s]
Processing Texts: 44%|####4 | 179/405 [01:38<02:07, 1.77it/s]
Processing Texts: 44%|####4 | 180/405 [01:38<01:49, 2.05it/s]
Processing Texts: 45%|####4 | 181/405 [01:39<01:52, 2.00it/s]
Processing Texts: 45%|####4 | 182/405 [01:39<01:56, 1.92it/s]
Processing Texts: 45%|####5 | 183/405 [01:40<01:56, 1.90it/s]
Processing Texts: 45%|####5 | 184/405 [01:40<01:51, 1.98it/s]
Processing Texts: 46%|####5 | 185/405 [01:40<01:38, 2.23it/s]
Processing Texts: 46%|####5 | 186/405 [01:41<01:46, 2.06it/s]
Processing Texts: 46%|####6 | 187/405 [01:42<01:53, 1.92it/s]
Processing Texts: 46%|####6 | 188/405 [01:42<01:56, 1.86it/s]
Processing Texts: 47%|####6 | 189/405 [01:43<01:56, 1.86it/s]
Processing Texts: 47%|####6 | 190/405 [01:43<01:50, 1.94it/s]
Processing Texts: 47%|####7 | 191/405 [01:44<01:52, 1.90it/s]
Processing Texts: 47%|####7 | 192/405 [01:44<01:43, 2.06it/s]
Processing Texts: 48%|####7 | 193/405 [01:44<01:29, 2.37it/s]
Processing Texts: 48%|####7 | 194/405 [01:45<01:45, 2.00it/s]
Processing Texts: 48%|####8 | 195/405 [01:45<01:36, 2.17it/s]
Processing Texts: 48%|####8 | 196/405 [01:46<01:31, 2.28it/s]
Processing Texts: 49%|####8 | 197/405 [01:46<01:24, 2.47it/s]
Processing Texts: 49%|####8 | 198/405 [01:47<01:21, 2.55it/s]
Processing Texts: 49%|####9 | 199/405 [01:47<01:19, 2.59it/s]
Processing Texts: 49%|####9 | 200/405 [01:47<01:25, 2.39it/s]
Processing Texts: 50%|####9 | 201/405 [01:48<01:29, 2.28it/s]
Processing Texts: 50%|####9 | 202/405 [01:48<01:26, 2.35it/s]
Processing Texts: 50%|##### | 203/405 [01:49<01:33, 2.16it/s]
Processing Texts: 50%|##### | 204/405 [01:50<01:55, 1.74it/s]
Processing Texts: 51%|##### | 205/405 [01:50<01:59, 1.67it/s]
Processing Texts: 51%|##### | 206/405 [01:51<02:03, 1.61it/s]
Processing Texts: 51%|#####1 | 207/405 [01:52<02:02, 1.62it/s]
Processing Texts: 51%|#####1 | 208/405 [01:52<01:49, 1.80it/s]
Processing Texts: 52%|#####1 | 209/405 [01:53<01:54, 1.71it/s]
Processing Texts: 52%|#####1 | 210/405 [01:53<01:48, 1.80it/s]
Processing Texts: 52%|#####2 | 211/405 [01:54<01:42, 1.89it/s]
Processing Texts: 52%|#####2 | 212/405 [01:54<01:58, 1.63it/s]
Processing Texts: 53%|#####2 | 213/405 [01:55<01:48, 1.77it/s]
Processing Texts: 53%|#####2 | 214/405 [01:55<01:44, 1.83it/s]
Processing Texts: 53%|#####3 | 215/405 [01:56<01:47, 1.77it/s]
Processing Texts: 53%|#####3 | 216/405 [01:57<01:46, 1.77it/s]
Processing Texts: 54%|#####3 | 217/405 [01:57<01:32, 2.04it/s]
Processing Texts: 54%|#####3 | 218/405 [01:58<02:00, 1.55it/s]
Processing Texts: 54%|#####4 | 219/405 [01:58<01:45, 1.76it/s]
Processing Texts: 54%|#####4 | 220/405 [01:59<01:36, 1.91it/s]
Processing Texts: 55%|#####4 | 221/405 [01:59<01:32, 1.99it/s]
Processing Texts: 55%|#####4 | 222/405 [02:00<01:34, 1.94it/s]
Processing Texts: 55%|#####5 | 223/405 [02:00<01:28, 2.07it/s]
Processing Texts: 55%|#####5 | 224/405 [02:01<01:35, 1.89it/s]
Processing Texts: 56%|#####5 | 225/405 [02:01<01:36, 1.86it/s]
Processing Texts: 56%|#####5 | 226/405 [02:02<01:30, 1.97it/s]
Processing Texts: 56%|#####6 | 227/405 [02:02<01:23, 2.13it/s]
Processing Texts: 56%|#####6 | 228/405 [02:03<01:28, 2.00it/s]
Processing Texts: 57%|#####6 | 229/405 [02:03<01:27, 2.00it/s]
Processing Texts: 57%|#####6 | 230/405 [02:04<01:27, 2.00it/s]
Processing Texts: 57%|#####7 | 231/405 [02:04<01:31, 1.91it/s]
Processing Texts: 57%|#####7 | 232/405 [02:05<01:32, 1.88it/s]
Processing Texts: 58%|#####7 | 233/405 [02:05<01:29, 1.93it/s]
Processing Texts: 58%|#####7 | 234/405 [02:06<01:37, 1.75it/s]
Processing Texts: 58%|#####8 | 235/405 [02:07<01:38, 1.72it/s]
Processing Texts: 58%|#####8 | 236/405 [02:07<01:33, 1.81it/s]
Processing Texts: 59%|#####8 | 237/405 [02:08<01:32, 1.81it/s]
Processing Texts: 59%|#####8 | 238/405 [02:08<01:30, 1.85it/s]
Processing Texts: 59%|#####9 | 239/405 [02:09<01:29, 1.85it/s]
Processing Texts: 59%|#####9 | 240/405 [02:09<01:19, 2.06it/s]
Processing Texts: 60%|#####9 | 241/405 [02:10<01:18, 2.10it/s]
Processing Texts: 60%|#####9 | 242/405 [02:10<01:29, 1.83it/s]
Processing Texts: 60%|###### | 243/405 [02:11<01:21, 1.98it/s]
Processing Texts: 60%|###### | 244/405 [02:11<01:19, 2.03it/s]
Processing Texts: 60%|###### | 245/405 [02:12<01:15, 2.12it/s]
Processing Texts: 61%|###### | 246/405 [02:12<01:14, 2.15it/s]
Processing Texts: 61%|###### | 247/405 [02:12<01:11, 2.22it/s]
Processing Texts: 61%|######1 | 248/405 [02:13<01:14, 2.11it/s]
Processing Texts: 61%|######1 | 249/405 [02:14<01:32, 1.68it/s]
Processing Texts: 62%|######1 | 250/405 [02:15<01:47, 1.44it/s]
Processing Texts: 62%|######1 | 251/405 [02:15<01:47, 1.43it/s]
Processing Texts: 62%|######2 | 252/405 [02:16<01:42, 1.49it/s]
Processing Texts: 62%|######2 | 253/405 [02:17<01:36, 1.58it/s]
Processing Texts: 63%|######2 | 254/405 [02:17<01:26, 1.75it/s]
Processing Texts: 63%|######2 | 255/405 [02:18<01:39, 1.50it/s]
Processing Texts: 63%|######3 | 256/405 [02:18<01:33, 1.60it/s]
Processing Texts: 63%|######3 | 257/405 [02:19<01:22, 1.80it/s]
Processing Texts: 64%|######3 | 258/405 [02:19<01:10, 2.09it/s]
Processing Texts: 64%|######3 | 259/405 [02:19<01:04, 2.26it/s]
Processing Texts: 64%|######4 | 260/405 [02:20<00:59, 2.42it/s]
Processing Texts: 64%|######4 | 261/405 [02:21<01:21, 1.78it/s]
Processing Texts: 65%|######4 | 262/405 [02:22<01:31, 1.56it/s]
Processing Texts: 65%|######4 | 263/405 [02:22<01:34, 1.51it/s]
Processing Texts: 65%|######5 | 264/405 [02:23<01:34, 1.50it/s]
Processing Texts: 65%|######5 | 265/405 [02:24<01:42, 1.37it/s]
Processing Texts: 66%|######5 | 266/405 [02:25<01:49, 1.27it/s]
Processing Texts: 66%|######5 | 267/405 [02:25<01:42, 1.35it/s]
Processing Texts: 66%|######6 | 268/405 [02:26<01:32, 1.48it/s]
Processing Texts: 66%|######6 | 269/405 [02:27<01:45, 1.29it/s]
Processing Texts: 67%|######6 | 270/405 [02:28<01:37, 1.38it/s]
Processing Texts: 67%|######6 | 271/405 [02:28<01:34, 1.42it/s]
Processing Texts: 67%|######7 | 272/405 [02:29<01:20, 1.65it/s]
Processing Texts: 67%|######7 | 273/405 [02:29<01:11, 1.85it/s]
Processing Texts: 68%|######7 | 274/405 [02:29<01:04, 2.02it/s]
Processing Texts: 68%|######7 | 275/405 [02:30<00:59, 2.19it/s]
Processing Texts: 68%|######8 | 276/405 [02:30<01:04, 2.00it/s]
Processing Texts: 68%|######8 | 277/405 [02:31<01:09, 1.84it/s]
Processing Texts: 69%|######8 | 278/405 [02:31<01:07, 1.89it/s]
Processing Texts: 69%|######8 | 279/405 [02:32<01:05, 1.93it/s]
Processing Texts: 69%|######9 | 280/405 [02:32<01:05, 1.91it/s]
Processing Texts: 69%|######9 | 281/405 [02:33<01:05, 1.90it/s]
Processing Texts: 70%|######9 | 282/405 [02:34<01:04, 1.89it/s]
Processing Texts: 70%|######9 | 283/405 [02:34<01:01, 1.99it/s]
Processing Texts: 70%|####### | 284/405 [02:34<00:55, 2.16it/s]
Processing Texts: 70%|####### | 285/405 [02:35<01:13, 1.62it/s]
Processing Texts: 71%|####### | 286/405 [02:36<01:10, 1.69it/s]
Processing Texts: 71%|####### | 287/405 [02:36<01:03, 1.86it/s]
Processing Texts: 71%|#######1 | 288/405 [02:37<01:06, 1.76it/s]
Processing Texts: 71%|#######1 | 289/405 [02:38<01:09, 1.66it/s]
Processing Texts: 72%|#######1 | 290/405 [02:38<01:11, 1.61it/s]
Processing Texts: 72%|#######1 | 291/405 [02:39<01:07, 1.68it/s]
Processing Texts: 72%|#######2 | 292/405 [02:39<01:09, 1.62it/s]
Processing Texts: 72%|#######2 | 293/405 [02:40<01:00, 1.84it/s]
Processing Texts: 73%|#######2 | 294/405 [02:40<00:57, 1.93it/s]
Processing Texts: 73%|#######2 | 295/405 [02:41<00:56, 1.93it/s]
Processing Texts: 73%|#######3 | 296/405 [02:41<00:56, 1.93it/s]
Processing Texts: 73%|#######3 | 297/405 [02:42<00:59, 1.82it/s]
Processing Texts: 74%|#######3 | 298/405 [02:42<00:52, 2.06it/s]
Processing Texts: 74%|#######3 | 299/405 [02:43<01:02, 1.70it/s]
Processing Texts: 74%|#######4 | 300/405 [02:44<00:58, 1.79it/s]
Processing Texts: 74%|#######4 | 301/405 [02:44<00:56, 1.83it/s]
Processing Texts: 75%|#######4 | 303/405 [02:45<00:47, 2.16it/s]
Processing Texts: 75%|#######5 | 304/405 [02:45<00:48, 2.08it/s]
Processing Texts: 75%|#######5 | 305/405 [02:46<00:49, 2.03it/s]
Processing Texts: 76%|#######5 | 306/405 [02:46<00:51, 1.93it/s]
Processing Texts: 76%|#######5 | 307/405 [02:47<00:49, 1.99it/s]
Processing Texts: 76%|#######6 | 308/405 [02:47<00:48, 1.98it/s]
Processing Texts: 76%|#######6 | 309/405 [02:48<00:47, 2.03it/s]
Processing Texts: 77%|#######6 | 310/405 [02:48<00:47, 2.01it/s]
Processing Texts: 77%|#######6 | 311/405 [02:49<01:00, 1.54it/s]
Processing Texts: 77%|#######7 | 312/405 [02:50<01:02, 1.49it/s]
Processing Texts: 77%|#######7 | 313/405 [02:50<00:49, 1.85it/s]
Processing Texts: 78%|#######7 | 314/405 [02:51<00:47, 1.93it/s]
Processing Texts: 78%|#######7 | 315/405 [02:51<00:47, 1.91it/s]
Processing Texts: 78%|#######8 | 316/405 [02:52<00:48, 1.82it/s]
Processing Texts: 78%|#######8 | 317/405 [02:52<00:49, 1.79it/s]
Processing Texts: 79%|#######8 | 318/405 [02:53<00:43, 2.01it/s]
Processing Texts: 79%|#######8 | 319/405 [02:53<00:39, 2.18it/s]
Processing Texts: 79%|#######9 | 320/405 [02:54<00:43, 1.96it/s]
Processing Texts: 79%|#######9 | 321/405 [02:54<00:41, 2.01it/s]
Processing Texts: 80%|#######9 | 322/405 [02:54<00:36, 2.30it/s]
Processing Texts: 80%|#######9 | 323/405 [02:55<00:33, 2.42it/s]
Processing Texts: 80%|######## | 324/405 [02:55<00:30, 2.67it/s]
Processing Texts: 80%|######## | 325/405 [02:55<00:28, 2.82it/s]
Processing Texts: 80%|######## | 326/405 [02:56<00:26, 3.03it/s]
Processing Texts: 81%|######## | 327/405 [02:56<00:33, 2.31it/s]
Processing Texts: 81%|######## | 328/405 [02:57<00:43, 1.78it/s]
Processing Texts: 81%|########1 | 329/405 [02:58<00:50, 1.50it/s]
Processing Texts: 81%|########1 | 330/405 [02:58<00:40, 1.83it/s]
Processing Texts: 82%|########1 | 331/405 [02:59<00:45, 1.64it/s]
Processing Texts: 82%|########1 | 332/405 [03:00<00:52, 1.40it/s]
Processing Texts: 82%|########2 | 333/405 [03:01<00:58, 1.24it/s]
Processing Texts: 82%|########2 | 334/405 [03:02<00:48, 1.45it/s]
Processing Texts: 83%|########2 | 335/405 [03:02<00:44, 1.59it/s]
Processing Texts: 83%|########2 | 336/405 [03:02<00:37, 1.84it/s]
Processing Texts: 83%|########3 | 337/405 [03:03<00:32, 2.07it/s]
Processing Texts: 83%|########3 | 338/405 [03:03<00:28, 2.31it/s]
Processing Texts: 84%|########3 | 339/405 [03:03<00:27, 2.37it/s]
Processing Texts: 84%|########3 | 340/405 [03:04<00:27, 2.32it/s]
Processing Texts: 84%|########4 | 341/405 [03:04<00:28, 2.21it/s]
Processing Texts: 84%|########4 | 342/405 [03:05<00:28, 2.20it/s]
Processing Texts: 85%|########4 | 343/405 [03:06<00:39, 1.56it/s]
Processing Texts: 85%|########4 | 344/405 [03:06<00:33, 1.84it/s]
Processing Texts: 85%|########5 | 345/405 [03:07<00:32, 1.83it/s]
Processing Texts: 85%|########5 | 346/405 [03:07<00:30, 1.91it/s]
Processing Texts: 86%|########5 | 347/405 [03:08<00:27, 2.14it/s]
Processing Texts: 86%|########5 | 348/405 [03:08<00:23, 2.39it/s]
Processing Texts: 86%|########6 | 349/405 [03:08<00:21, 2.58it/s]
Processing Texts: 86%|########6 | 350/405 [03:09<00:25, 2.18it/s]
Processing Texts: 87%|########6 | 351/405 [03:09<00:26, 2.00it/s]
Processing Texts: 87%|########6 | 352/405 [03:10<00:25, 2.07it/s]
Processing Texts: 87%|########7 | 353/405 [03:10<00:24, 2.11it/s]
Processing Texts: 87%|########7 | 354/405 [03:11<00:23, 2.19it/s]
Processing Texts: 88%|########7 | 355/405 [03:12<00:35, 1.42it/s]
Processing Texts: 88%|########7 | 356/405 [03:12<00:29, 1.65it/s]
Processing Texts: 88%|########8 | 357/405 [03:13<00:28, 1.71it/s]
Processing Texts: 88%|########8 | 358/405 [03:13<00:24, 1.95it/s]
Processing Texts: 89%|########8 | 359/405 [03:14<00:22, 2.05it/s]
Processing Texts: 89%|########8 | 360/405 [03:14<00:24, 1.87it/s]
Processing Texts: 89%|########9 | 361/405 [03:15<00:19, 2.23it/s]
Processing Texts: 89%|########9 | 362/405 [03:15<00:18, 2.31it/s]
Processing Texts: 90%|########9 | 363/405 [03:17<00:32, 1.28it/s]
Processing Texts: 90%|########9 | 364/405 [03:17<00:25, 1.59it/s]
Processing Texts: 90%|######### | 365/405 [03:17<00:23, 1.72it/s]
Processing Texts: 90%|######### | 366/405 [03:18<00:19, 2.00it/s]
Processing Texts: 91%|######### | 367/405 [03:18<00:17, 2.12it/s]
Processing Texts: 91%|######### | 368/405 [03:19<00:17, 2.09it/s]
Processing Texts: 91%|#########1| 369/405 [03:19<00:14, 2.47it/s]
Processing Texts: 91%|#########1| 370/405 [03:19<00:13, 2.56it/s]
Processing Texts: 92%|#########1| 371/405 [03:20<00:15, 2.18it/s]
Processing Texts: 92%|#########1| 372/405 [03:20<00:17, 1.89it/s]
Processing Texts: 92%|#########2| 373/405 [03:21<00:17, 1.83it/s]
Processing Texts: 92%|#########2| 374/405 [03:22<00:16, 1.84it/s]
Processing Texts: 93%|#########2| 375/405 [03:22<00:14, 2.04it/s]
Processing Texts: 93%|#########2| 376/405 [03:22<00:11, 2.44it/s]