Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

DS4SEtutorial.html 38 KB

You have to be logged in to leave a comment. Sign In
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
  1. ---
  2. title: Title
  3. keywords: fastai
  4. sidebar: home_sidebar
  5. summary: "summary"
  6. ---
  7. <!--
  8. #################################################
  9. ### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
  10. #################################################
  11. # file to edit: nbs/DS4SEtutorial.ipynb
  12. # command to build the docs after a change: nbdev_build_docs
  13. -->
  14. <div class="container" id="notebook-container">
  15. <div class="cell border-box-sizing code_cell rendered">
  16. </div>
  17. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  18. <div class="text_cell_render border-box-sizing rendered_html">
  19. <h1 id="DS4SE-Tutorial">DS4SE Tutorial<a class="anchor-link" href="#DS4SE-Tutorial">&#182;</a></h1>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  24. <div class="text_cell_render border-box-sizing rendered_html">
  25. <p>This quick tutorial uses <a href="https://pypi.org/project/ds4se/">DS4SE API</a> to:</p>
  26. <ol>
  27. <li>Calculate traceability value between one pair of artifacts.</li>
  28. <li><p>For source and target artifact class in Libest dataset, calculate:</p>
  29. <blockquote><p>1) the number of documents in each class</p>
  30. <p>2) the vocab size of each class</p>
  31. <p>3) the average number of token in each documents of each class</p>
  32. <p>4) the top three most frequent tokens in source and target artifact classes</p>
  33. <p>5) the top three most frequent tokens in source artifact class</p>
  34. <p>6) the number of shared vocabulary between source and target artifact class</p>
  35. <p>7) the cross entropy value of source and target artifact class</p>
  36. </blockquote>
  37. </li>
  38. </ol>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  43. <div class="text_cell_render border-box-sizing rendered_html">
  44. <p>This is a quick introduction on how to use the DS4SE API, to follow this tutorial in Google Colab, click the right arrow button in each cell in sequence or click Runtime-&gt; Run all to run all the cells at once</p>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  49. <div class="text_cell_render border-box-sizing rendered_html">
  50. <p>Download and install dependent libraries of DS4SE.</p>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="cell border-box-sizing code_cell rendered">
  55. <div class="input">
  56. <div class="inner_cell">
  57. <div class="input_area">
  58. <div class=" highlight hl-ipython3"><pre><span></span><span class="o">!</span>pip install --upgrade gensim
  59. <span class="o">!</span>pip install nbdev
  60. <span class="o">!</span>pip install sentencepiece
  61. <span class="o">!</span>pip install dit
  62. </pre></div>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="output_wrapper">
  67. <div class="output">
  68. <div class="output_area">
  69. <div class="output_subarea output_stream output_stdout output_text">
  70. <pre>Requirement already up-to-date: gensim in /usr/local/lib/python3.6/dist-packages (3.8.3)
  71. Requirement already satisfied, skipping upgrade: scipy&gt;=0.18.1 in /usr/local/lib/python3.6/dist-packages (from gensim) (1.4.1)
  72. Requirement already satisfied, skipping upgrade: six&gt;=1.5.0 in /usr/local/lib/python3.6/dist-packages (from gensim) (1.15.0)
  73. Requirement already satisfied, skipping upgrade: numpy&gt;=1.11.3 in /usr/local/lib/python3.6/dist-packages (from gensim) (1.18.5)
  74. Requirement already satisfied, skipping upgrade: smart-open&gt;=1.8.1 in /usr/local/lib/python3.6/dist-packages (from gensim) (3.0.0)
  75. Requirement already satisfied, skipping upgrade: requests in /usr/local/lib/python3.6/dist-packages (from smart-open&gt;=1.8.1-&gt;gensim) (2.23.0)
  76. Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,&lt;1.26,&gt;=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests-&gt;smart-open&gt;=1.8.1-&gt;gensim) (1.24.3)
  77. Requirement already satisfied, skipping upgrade: idna&lt;3,&gt;=2.5 in /usr/local/lib/python3.6/dist-packages (from requests-&gt;smart-open&gt;=1.8.1-&gt;gensim) (2.10)
  78. Requirement already satisfied, skipping upgrade: certifi&gt;=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests-&gt;smart-open&gt;=1.8.1-&gt;gensim) (2020.6.20)
  79. Requirement already satisfied, skipping upgrade: chardet&lt;4,&gt;=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests-&gt;smart-open&gt;=1.8.1-&gt;gensim) (3.0.4)
  80. Requirement already satisfied: nbdev in /usr/local/lib/python3.6/dist-packages (1.1.5)
  81. Requirement already satisfied: jupyter-client in /usr/local/lib/python3.6/dist-packages (from nbdev) (5.3.5)
  82. Requirement already satisfied: nbformat&gt;=4.4.0 in /usr/local/lib/python3.6/dist-packages (from nbdev) (5.0.8)
  83. Requirement already satisfied: ipykernel in /usr/local/lib/python3.6/dist-packages (from nbdev) (4.10.1)
  84. Requirement already satisfied: pyyaml in /usr/local/lib/python3.6/dist-packages (from nbdev) (3.13)
  85. Requirement already satisfied: pip in /usr/local/lib/python3.6/dist-packages (from nbdev) (19.3.1)
  86. Requirement already satisfied: packaging in /usr/local/lib/python3.6/dist-packages (from nbdev) (20.4)
  87. Requirement already satisfied: nbconvert&lt;6 in /usr/local/lib/python3.6/dist-packages (from nbdev) (5.6.1)
  88. Requirement already satisfied: fastcore&gt;=1.3.1 in /usr/local/lib/python3.6/dist-packages (from nbdev) (1.3.6)
  89. Requirement already satisfied: python-dateutil&gt;=2.1 in /usr/local/lib/python3.6/dist-packages (from jupyter-client-&gt;nbdev) (2.8.1)
  90. Requirement already satisfied: tornado&gt;=4.1 in /usr/local/lib/python3.6/dist-packages (from jupyter-client-&gt;nbdev) (5.1.1)
  91. Requirement already satisfied: traitlets in /usr/local/lib/python3.6/dist-packages (from jupyter-client-&gt;nbdev) (4.3.3)
  92. Requirement already satisfied: jupyter-core&gt;=4.6.0 in /usr/local/lib/python3.6/dist-packages (from jupyter-client-&gt;nbdev) (4.6.3)
  93. Requirement already satisfied: pyzmq&gt;=13 in /usr/local/lib/python3.6/dist-packages (from jupyter-client-&gt;nbdev) (19.0.2)
  94. Requirement already satisfied: ipython-genutils in /usr/local/lib/python3.6/dist-packages (from nbformat&gt;=4.4.0-&gt;nbdev) (0.2.0)
  95. Requirement already satisfied: jsonschema!=2.5.0,&gt;=2.4 in /usr/local/lib/python3.6/dist-packages (from nbformat&gt;=4.4.0-&gt;nbdev) (2.6.0)
  96. Requirement already satisfied: ipython&gt;=4.0.0 in /usr/local/lib/python3.6/dist-packages (from ipykernel-&gt;nbdev) (5.5.0)
  97. Requirement already satisfied: pyparsing&gt;=2.0.2 in /usr/local/lib/python3.6/dist-packages (from packaging-&gt;nbdev) (2.4.7)
  98. Requirement already satisfied: six in /usr/local/lib/python3.6/dist-packages (from packaging-&gt;nbdev) (1.15.0)
  99. Requirement already satisfied: entrypoints&gt;=0.2.2 in /usr/local/lib/python3.6/dist-packages (from nbconvert&lt;6-&gt;nbdev) (0.3)
  100. Requirement already satisfied: mistune&lt;2,&gt;=0.8.1 in /usr/local/lib/python3.6/dist-packages (from nbconvert&lt;6-&gt;nbdev) (0.8.4)
  101. Requirement already satisfied: testpath in /usr/local/lib/python3.6/dist-packages (from nbconvert&lt;6-&gt;nbdev) (0.4.4)
  102. Requirement already satisfied: bleach in /usr/local/lib/python3.6/dist-packages (from nbconvert&lt;6-&gt;nbdev) (3.2.1)
  103. Requirement already satisfied: defusedxml in /usr/local/lib/python3.6/dist-packages (from nbconvert&lt;6-&gt;nbdev) (0.6.0)
  104. Requirement already satisfied: pandocfilters&gt;=1.4.1 in /usr/local/lib/python3.6/dist-packages (from nbconvert&lt;6-&gt;nbdev) (1.4.3)
  105. Requirement already satisfied: jinja2&gt;=2.4 in /usr/local/lib/python3.6/dist-packages (from nbconvert&lt;6-&gt;nbdev) (2.11.2)
  106. Requirement already satisfied: pygments in /usr/local/lib/python3.6/dist-packages (from nbconvert&lt;6-&gt;nbdev) (2.6.1)
  107. Requirement already satisfied: decorator in /usr/local/lib/python3.6/dist-packages (from traitlets-&gt;jupyter-client-&gt;nbdev) (4.4.2)
  108. Requirement already satisfied: pickleshare in /usr/local/lib/python3.6/dist-packages (from ipython&gt;=4.0.0-&gt;ipykernel-&gt;nbdev) (0.7.5)
  109. Requirement already satisfied: setuptools&gt;=18.5 in /usr/local/lib/python3.6/dist-packages (from ipython&gt;=4.0.0-&gt;ipykernel-&gt;nbdev) (50.3.2)
  110. Requirement already satisfied: prompt-toolkit&lt;2.0.0,&gt;=1.0.4 in /usr/local/lib/python3.6/dist-packages (from ipython&gt;=4.0.0-&gt;ipykernel-&gt;nbdev) (1.0.18)
  111. Requirement already satisfied: simplegeneric&gt;0.8 in /usr/local/lib/python3.6/dist-packages (from ipython&gt;=4.0.0-&gt;ipykernel-&gt;nbdev) (0.8.1)
  112. Requirement already satisfied: pexpect; sys_platform != &#34;win32&#34; in /usr/local/lib/python3.6/dist-packages (from ipython&gt;=4.0.0-&gt;ipykernel-&gt;nbdev) (4.8.0)
  113. Requirement already satisfied: webencodings in /usr/local/lib/python3.6/dist-packages (from bleach-&gt;nbconvert&lt;6-&gt;nbdev) (0.5.1)
  114. Requirement already satisfied: MarkupSafe&gt;=0.23 in /usr/local/lib/python3.6/dist-packages (from jinja2&gt;=2.4-&gt;nbconvert&lt;6-&gt;nbdev) (1.1.1)
  115. Requirement already satisfied: wcwidth in /usr/local/lib/python3.6/dist-packages (from prompt-toolkit&lt;2.0.0,&gt;=1.0.4-&gt;ipython&gt;=4.0.0-&gt;ipykernel-&gt;nbdev) (0.2.5)
  116. Requirement already satisfied: ptyprocess&gt;=0.5 in /usr/local/lib/python3.6/dist-packages (from pexpect; sys_platform != &#34;win32&#34;-&gt;ipython&gt;=4.0.0-&gt;ipykernel-&gt;nbdev) (0.6.0)
  117. Requirement already satisfied: sentencepiece in /usr/local/lib/python3.6/dist-packages (0.1.94)
  118. Requirement already satisfied: dit in /usr/local/lib/python3.6/dist-packages (1.2.3)
  119. Requirement already satisfied: boltons in /usr/local/lib/python3.6/dist-packages (from dit) (20.2.1)
  120. Requirement already satisfied: debtcollector in /usr/local/lib/python3.6/dist-packages (from dit) (2.2.0)
  121. Requirement already satisfied: numpy&gt;=1.11 in /usr/local/lib/python3.6/dist-packages (from dit) (1.18.5)
  122. Requirement already satisfied: scipy&gt;=0.15.0 in /usr/local/lib/python3.6/dist-packages (from dit) (1.4.1)
  123. Requirement already satisfied: prettytable in /usr/local/lib/python3.6/dist-packages (from dit) (1.0.1)
  124. Requirement already satisfied: six&gt;=1.4.0 in /usr/local/lib/python3.6/dist-packages (from dit) (1.15.0)
  125. Requirement already satisfied: networkx in /usr/local/lib/python3.6/dist-packages (from dit) (2.5)
  126. Requirement already satisfied: contextlib2 in /usr/local/lib/python3.6/dist-packages (from dit) (0.5.5)
  127. Requirement already satisfied: pbr!=2.1.0,&gt;=2.0.0 in /usr/local/lib/python3.6/dist-packages (from debtcollector-&gt;dit) (5.5.1)
  128. Requirement already satisfied: wrapt&gt;=1.7.0 in /usr/local/lib/python3.6/dist-packages (from debtcollector-&gt;dit) (1.12.1)
  129. Requirement already satisfied: setuptools in /usr/local/lib/python3.6/dist-packages (from prettytable-&gt;dit) (50.3.2)
  130. Requirement already satisfied: wcwidth in /usr/local/lib/python3.6/dist-packages (from prettytable-&gt;dit) (0.2.5)
  131. Requirement already satisfied: decorator&gt;=4.3.0 in /usr/local/lib/python3.6/dist-packages (from networkx-&gt;dit) (4.4.2)
  132. </pre>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  139. <div class="text_cell_render border-box-sizing rendered_html">
  140. <p>Download and install DS4SE. Import TensorFlow into your program:</p>
  141. </div>
  142. </div>
  143. </div>
  144. <div class="cell border-box-sizing code_cell rendered">
  145. <div class="input">
  146. <div class="inner_cell">
  147. <div class="input_area">
  148. <div class=" highlight hl-ipython3"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">ds4se</span>
  149. </pre></div>
  150. </div>
  151. </div>
  152. </div>
  153. <div class="output_wrapper">
  154. <div class="output">
  155. <div class="output_area">
  156. <div class="output_subarea output_stream output_stdout output_text">
  157. <pre>Requirement already satisfied: ds4se in /usr/local/lib/python3.6/dist-packages (0.2.1)
  158. </pre>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. <div class="cell border-box-sizing code_cell rendered">
  165. <div class="input">
  166. <div class="inner_cell">
  167. <div class="input_area">
  168. <div class=" highlight hl-ipython3"><pre><span></span><span class="kn">import</span> <span class="nn">ds4se.facade</span> <span class="k">as</span> <span class="nn">facade</span>
  169. </pre></div>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  175. <div class="text_cell_render border-box-sizing rendered_html">
  176. <p>Import other libraries needed for this tutorial:</p>
  177. </div>
  178. </div>
  179. </div>
  180. <div class="cell border-box-sizing code_cell rendered">
  181. <div class="input">
  182. <div class="inner_cell">
  183. <div class="input_area">
  184. <div class=" highlight hl-ipython3"><pre><span></span><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
  185. <span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
  186. </pre></div>
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  192. <div class="text_cell_render border-box-sizing rendered_html">
  193. <p>Load and prapare <a href="https://github.com/WM-SEMERU/ds4se/tree/master/nbs/test_data">Libest dataset</a>. Convert the column name in which actual file content is stored into "contents".</p>
  194. </div>
  195. </div>
  196. </div>
  197. <div class="cell border-box-sizing code_cell rendered">
  198. <div class="input">
  199. <div class="inner_cell">
  200. <div class="input_area">
  201. <div class=" highlight hl-ipython3"><pre><span></span><span class="o">!</span>wget https://raw.githubusercontent.com/WM-SEMERU/ds4se/SE_Proj2_Facade/nbs/test_data/%5Blibest-pre-req%5D.csv
  202. <span class="o">!</span>wget https://raw.githubusercontent.com/WM-SEMERU/ds4se/SE_Proj2_Facade/nbs/test_data/%5Blibest-pre-tc%5D.csv
  203. </pre></div>
  204. </div>
  205. </div>
  206. </div>
  207. <div class="output_wrapper">
  208. <div class="output">
  209. <div class="output_area">
  210. <div class="output_subarea output_stream output_stdout output_text">
  211. <pre>--2020-11-21 04:17:44-- https://raw.githubusercontent.com/WM-SEMERU/ds4se/SE_Proj2_Facade/nbs/test_data/%5Blibest-pre-req%5D.csv
  212. Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
  213. Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.
  214. HTTP request sent, awaiting response... 200 OK
  215. Length: 60790 (59K) [text/plain]
  216. Saving to: ‘[libest-pre-req].csv.1’
  217. [libest-pre-req].cs 100%[===================&gt;] 59.37K --.-KB/s in 0.01s
  218. 2020-11-21 04:17:44 (4.28 MB/s) - ‘[libest-pre-req].csv.1’ saved [60790/60790]
  219. --2020-11-21 04:17:44-- https://raw.githubusercontent.com/WM-SEMERU/ds4se/SE_Proj2_Facade/nbs/test_data/%5Blibest-pre-tc%5D.csv
  220. Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
  221. Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.
  222. HTTP request sent, awaiting response... 200 OK
  223. Length: 343900 (336K) [text/plain]
  224. Saving to: ‘[libest-pre-tc].csv.1’
  225. [libest-pre-tc].csv 100%[===================&gt;] 335.84K --.-KB/s in 0.04s
  226. 2020-11-21 04:17:45 (8.32 MB/s) - ‘[libest-pre-tc].csv.1’ saved [343900/343900]
  227. </pre>
  228. </div>
  229. </div>
  230. </div>
  231. </div>
  232. </div>
  233. <div class="cell border-box-sizing code_cell rendered">
  234. <div class="input">
  235. <div class="inner_cell">
  236. <div class="input_area">
  237. <div class=" highlight hl-ipython3"><pre><span></span><span class="n">source_file</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="s2">&quot;[libest-pre-req].csv&quot;</span><span class="p">,</span><span class="n">names</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;ids&#39;</span><span class="p">,</span> <span class="s1">&#39;text&#39;</span><span class="p">],</span> <span class="n">header</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="s1">&#39; &#39;</span><span class="p">)</span>
  238. <span class="n">target_file</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="s2">&quot;[libest-pre-tc].csv&quot;</span><span class="p">,</span><span class="n">names</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;ids&#39;</span><span class="p">,</span> <span class="s1">&#39;text&#39;</span><span class="p">],</span> <span class="n">header</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="s1">&#39; &#39;</span><span class="p">)</span>
  239. <span class="n">source_file</span> <span class="o">=</span> <span class="n">source_file</span><span class="o">.</span><span class="n">rename</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;text&quot;</span><span class="p">:</span><span class="s2">&quot;contents&quot;</span><span class="p">})</span>
  240. <span class="n">target_file</span> <span class="o">=</span> <span class="n">target_file</span><span class="o">.</span><span class="n">rename</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;text&quot;</span><span class="p">:</span><span class="s2">&quot;contents&quot;</span><span class="p">})</span>
  241. </pre></div>
  242. </div>
  243. </div>
  244. </div>
  245. </div>
  246. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  247. <div class="text_cell_render border-box-sizing rendered_html">
  248. <p>Create a pandas dataframe to store the result:</p>
  249. </div>
  250. </div>
  251. </div>
  252. <div class="cell border-box-sizing code_cell rendered">
  253. <div class="input">
  254. <div class="inner_cell">
  255. <div class="input_area">
  256. <div class=" highlight hl-ipython3"><pre><span></span><span class="n">d</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;source&#39;</span><span class="p">:</span> <span class="p">[],</span> <span class="s1">&#39;target&#39;</span><span class="p">:</span> <span class="p">[],</span> <span class="s1">&#39;distance&#39;</span><span class="p">:[],</span><span class="s1">&#39;similarity/traceability&#39;</span><span class="p">:[]}</span>
  257. <span class="n">output_df</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">d</span><span class="p">)</span>
  258. </pre></div>
  259. </div>
  260. </div>
  261. </div>
  262. </div>
  263. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  264. <div class="text_cell_render border-box-sizing rendered_html">
  265. <p>Retrive one element from source artifact and one element from target artifact to calculate traceability. Store id information for reference.</p>
  266. </div>
  267. </div>
  268. </div>
  269. <div class="cell border-box-sizing code_cell rendered">
  270. <div class="input">
  271. <div class="inner_cell">
  272. <div class="input_area">
  273. <div class=" highlight hl-ipython3"><pre><span></span><span class="n">source_id</span> <span class="o">=</span> <span class="n">source_file</span><span class="p">[</span><span class="s2">&quot;ids&quot;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
  274. <span class="n">target_id</span> <span class="o">=</span> <span class="n">target_file</span><span class="p">[</span><span class="s2">&quot;ids&quot;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
  275. <span class="n">source_string</span> <span class="o">=</span> <span class="n">source_file</span><span class="p">[</span><span class="s2">&quot;contents&quot;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span>
  276. <span class="n">target_string</span> <span class="o">=</span> <span class="n">target_file</span><span class="p">[</span><span class="s2">&quot;contents&quot;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span>
  277. </pre></div>
  278. </div>
  279. </div>
  280. </div>
  281. </div>
  282. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  283. <div class="text_cell_render border-box-sizing rendered_html">
  284. <p>Call TraceLinkValue method to calcuate the distance and traceability values of this pair. In this example we used word2vec technique.</p>
  285. </div>
  286. </div>
  287. </div>
  288. <div class="cell border-box-sizing code_cell rendered">
  289. <div class="input">
  290. <div class="inner_cell">
  291. <div class="input_area">
  292. <div class=" highlight hl-ipython3"><pre><span></span><span class="n">TLV</span> <span class="o">=</span> <span class="n">facade</span><span class="o">.</span><span class="n">TraceLinkValue</span><span class="p">(</span><span class="n">source_string</span><span class="p">,</span> <span class="n">target_string</span><span class="p">,</span> <span class="s2">&quot;word2vec&quot;</span><span class="p">)</span>
  293. <span class="n">distance</span> <span class="o">=</span> <span class="n">TLV</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
  294. <span class="n">traceability</span> <span class="o">=</span> <span class="n">TLV</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
  295. </pre></div>
  296. </div>
  297. </div>
  298. </div>
  299. <div class="output_wrapper">
  300. <div class="output">
  301. <div class="output_area">
  302. <div class="output_subarea output_stream output_stderr output_text">
  303. <pre>2020-11-21 04:17:45,247 : INFO : adding document #0 to Dictionary(0 unique tokens: [])
  304. 2020-11-21 04:17:45,256 : INFO : built Dictionary(1815 unique tokens: [&#39;@return&#39;, &#39;Converts&#39;, &#39;The&#39;, &#39;a&#39;, &#39;and&#39;]...) from 153 documents (total 5769 corpus positions)
  305. 2020-11-21 04:17:45,257 : INFO : loading Word2Vec object from /usr/local/lib/python3.6/dist-packages/ds4se/model/word2vec_libest.model
  306. 2020-11-21 04:17:45,327 : INFO : loading wv recursively from /usr/local/lib/python3.6/dist-packages/ds4se/model/word2vec_libest.model.wv.* with mmap=None
  307. 2020-11-21 04:17:45,330 : INFO : setting ignored attribute vectors_norm to None
  308. 2020-11-21 04:17:45,332 : INFO : loading vocabulary recursively from /usr/local/lib/python3.6/dist-packages/ds4se/model/word2vec_libest.model.vocabulary.* with mmap=None
  309. 2020-11-21 04:17:45,332 : INFO : loading trainables recursively from /usr/local/lib/python3.6/dist-packages/ds4se/model/word2vec_libest.model.trainables.* with mmap=None
  310. 2020-11-21 04:17:45,333 : INFO : setting ignored attribute cum_table to None
  311. 2020-11-21 04:17:45,334 : INFO : loaded /usr/local/lib/python3.6/dist-packages/ds4se/model/word2vec_libest.model
  312. 2020-11-21 04:17:45,366 : INFO : precomputing L2-norms of word weight vectors
  313. 2020-11-21 04:17:45,370 : INFO : constructing a sparse term similarity matrix using &lt;gensim.models.keyedvectors.WordEmbeddingSimilarityIndex object at 0x7f3cc1334518&gt;
  314. 2020-11-21 04:17:45,374 : INFO : iterating over columns in dictionary order
  315. 2020-11-21 04:17:45,379 : INFO : PROGRESS: at 0.06% columns (1 / 1815, 0.055096% density, 0.055096% projected density)
  316. 2020-11-21 04:17:45,624 : INFO : PROGRESS: at 55.15% columns (1001 / 1815, 0.140033% density, 0.209102% projected density)
  317. 2020-11-21 04:17:45,746 : INFO : constructed a sparse term similarity matrix with 0.173668% density
  318. 2020-11-21 04:17:45,765 : INFO : adding document #0 to Dictionary(0 unique tokens: [])
  319. 2020-11-21 04:17:45,768 : INFO : built Dictionary(502 unique tokens: [&#39;accompani&#39;, &#39;addit&#39;, &#39;agre&#39;, &#39;agreement&#39;, &#39;algorithm&#39;]...) from 2 documents (total 2134 corpus positions)
  320. 2020-11-21 04:17:49,106 : INFO : Computed distances or similarities (&#39;source&#39;, &#39;target&#39;)[[0.4005029238604272, 0.7140292126228072]]
  321. </pre>
  322. </div>
  323. </div>
  324. </div>
  325. </div>
  326. </div>
  327. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  328. <div class="text_cell_render border-box-sizing rendered_html">
  329. <p>Display the result:</p>
  330. </div>
  331. </div>
  332. </div>
  333. <div class="cell border-box-sizing code_cell rendered">
  334. <div class="input">
  335. <div class="inner_cell">
  336. <div class="input_area">
  337. <div class=" highlight hl-ipython3"><pre><span></span><span class="nb">print</span><span class="p">(</span><span class="s2">&quot;The traceability value between artifacts </span><span class="si">{}</span><span class="s2"> and </span><span class="si">{}</span><span class="s2"> is </span><span class="si">{}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">source_id</span><span class="p">,</span><span class="n">target_id</span><span class="p">,</span><span class="nb">format</span><span class="p">(</span><span class="n">traceability</span><span class="p">,</span><span class="s1">&#39;.2f&#39;</span><span class="p">)))</span>
  338. </pre></div>
  339. </div>
  340. </div>
  341. </div>
  342. <div class="output_wrapper">
  343. <div class="output">
  344. <div class="output_area">
  345. <div class="output_subarea output_stream output_stdout output_text">
  346. <pre>The traceability value between artifacts RQ46-pre.txt and us3496.c is 0.71
  347. </pre>
  348. </div>
  349. </div>
  350. </div>
  351. </div>
  352. </div>
  353. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  354. <div class="text_cell_render border-box-sizing rendered_html">
  355. <p>Call <strong>NumDoc</strong> method to count the number of documents in each artifacts:</p>
  356. </div>
  357. </div>
  358. </div>
  359. <div class="cell border-box-sizing code_cell rendered">
  360. <div class="input">
  361. <div class="inner_cell">
  362. <div class="input_area">
  363. <div class=" highlight hl-ipython3"><pre><span></span><span class="n">num_docs</span> <span class="o">=</span> <span class="n">facade</span><span class="o">.</span><span class="n">NumDoc</span><span class="p">(</span><span class="n">source_file</span><span class="p">,</span> <span class="n">target_file</span><span class="p">)</span>
  364. </pre></div>
  365. </div>
  366. </div>
  367. </div>
  368. </div>
  369. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  370. <div class="text_cell_render border-box-sizing rendered_html">
  371. <p>Display the number of documents result:</p>
  372. </div>
  373. </div>
  374. </div>
  375. <div class="cell border-box-sizing code_cell rendered">
  376. <div class="input">
  377. <div class="inner_cell">
  378. <div class="input_area">
  379. <div class=" highlight hl-ipython3"><pre><span></span><span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Source artifacts contains </span><span class="si">{}</span><span class="s2"> documents, Target artifacts contains </span><span class="si">{}</span><span class="s2"> documents.&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">num_docs</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="n">num_docs</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span>
  380. </pre></div>
  381. </div>
  382. </div>
  383. </div>
  384. <div class="output_wrapper">
  385. <div class="output">
  386. <div class="output_area">
  387. <div class="output_subarea output_stream output_stdout output_text">
  388. <pre>Source artifacts contains 52 documents, Target artifacts contains 21 documents.
  389. </pre>
  390. </div>
  391. </div>
  392. </div>
  393. </div>
  394. </div>
  395. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  396. <div class="text_cell_render border-box-sizing rendered_html">
  397. <p>Call <strong>VocabSize</strong> method to count the vocabulary size of each artifacts:</p>
  398. </div>
  399. </div>
  400. </div>
  401. <div class="cell border-box-sizing code_cell rendered">
  402. <div class="input">
  403. <div class="inner_cell">
  404. <div class="input_area">
  405. <div class=" highlight hl-ipython3"><pre><span></span><span class="n">vocab_size</span> <span class="o">=</span> <span class="n">facade</span><span class="o">.</span><span class="n">VocabSize</span><span class="p">(</span><span class="n">source_file</span><span class="p">,</span><span class="n">target_file</span><span class="p">)</span>
  406. </pre></div>
  407. </div>
  408. </div>
  409. </div>
  410. </div>
  411. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  412. <div class="text_cell_render border-box-sizing rendered_html">
  413. <p>Display the vocabulary size of each artifacts:</p>
  414. </div>
  415. </div>
  416. </div>
  417. <div class="cell border-box-sizing code_cell rendered">
  418. <div class="input">
  419. <div class="inner_cell">
  420. <div class="input_area">
  421. <div class=" highlight hl-ipython3"><pre><span></span><span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Source artifacts&#39;s vocab size is </span><span class="si">{}</span><span class="s2">. Target artifacts&#39;s vocab size is </span><span class="si">{}</span><span class="s2">.&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">vocab_size</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="n">vocab_size</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span>
  422. </pre></div>
  423. </div>
  424. </div>
  425. </div>
  426. <div class="output_wrapper">
  427. <div class="output">
  428. <div class="output_area">
  429. <div class="output_subarea output_stream output_stdout output_text">
  430. <pre>Source artifacts&#39;s vocab size is 2349. Target artifacts&#39;s vocab size is 3168.
  431. </pre>
  432. </div>
  433. </div>
  434. </div>
  435. </div>
  436. </div>
  437. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  438. <div class="text_cell_render border-box-sizing rendered_html">
  439. <p>Computes the average number of token in each class and also the difference between them using <strong>AverageToken</strong> method:</p>
  440. </div>
  441. </div>
  442. </div>
  443. <div class="cell border-box-sizing code_cell rendered">
  444. <div class="input">
  445. <div class="inner_cell">
  446. <div class="input_area">
  447. <div class=" highlight hl-ipython3"><pre><span></span><span class="n">token</span> <span class="o">=</span> <span class="n">facade</span><span class="o">.</span><span class="n">AverageToken</span><span class="p">(</span><span class="n">source_file</span><span class="p">,</span> <span class="n">target_file</span><span class="p">)</span>
  448. </pre></div>
  449. </div>
  450. </div>
  451. </div>
  452. </div>
  453. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  454. <div class="text_cell_render border-box-sizing rendered_html">
  455. <p>Display the result:</p>
  456. </div>
  457. </div>
  458. </div>
  459. <div class="cell border-box-sizing code_cell rendered">
  460. <div class="input">
  461. <div class="inner_cell">
  462. <div class="input_area">
  463. <div class=" highlight hl-ipython3"><pre><span></span><span class="nb">print</span><span class="p">(</span><span class="s2">&quot;On average, each document in source artifact class contains </span><span class="si">{}</span><span class="s2"> tokens and each document in target artifact class contains </span><span class="si">{}</span><span class="s2"> tokens &quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">token</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="n">token</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span>
  464. </pre></div>
  465. </div>
  466. </div>
  467. </div>
  468. <div class="output_wrapper">
  469. <div class="output">
  470. <div class="output_area">
  471. <div class="output_subarea output_stream output_stdout output_text">
  472. <pre>On average, each document in source artifact class contains 365.21153846153845 tokens and each document in target artifact class contains 4970.476190476191 tokens
  473. </pre>
  474. </div>
  475. </div>
  476. </div>
  477. </div>
  478. </div>
  479. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  480. <div class="text_cell_render border-box-sizing rendered_html">
  481. <p>To find out the most frequent token in both source and target artifacts, use <strong>VocabShared</strong> method</p>
  482. </div>
  483. </div>
  484. </div>
  485. <div class="cell border-box-sizing code_cell rendered">
  486. <div class="input">
  487. <div class="inner_cell">
  488. <div class="input_area">
  489. <div class=" highlight hl-ipython3"><pre><span></span><span class="n">vocab_shared</span> <span class="o">=</span> <span class="n">facade</span><span class="o">.</span><span class="n">VocabShared</span><span class="p">(</span><span class="n">source_file</span><span class="p">,</span> <span class="n">target_file</span><span class="p">)</span>
  490. </pre></div>
  491. </div>
  492. </div>
  493. </div>
  494. </div>
  495. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  496. <div class="text_cell_render border-box-sizing rendered_html">
  497. <p>Display the result:</p>
  498. </div>
  499. </div>
  500. </div>
  501. <div class="cell border-box-sizing code_cell rendered">
  502. <div class="input">
  503. <div class="inner_cell">
  504. <div class="input_area">
  505. <div class=" highlight hl-ipython3"><pre><span></span><span class="nb">print</span><span class="p">(</span><span class="s2">&quot;the top three most frequent token used in two artifact classes and their corresponding count and frenquency is:&quot;</span><span class="p">)</span>
  506. <span class="n">vocab_shared</span>
  507. </pre></div>
  508. </div>
  509. </div>
  510. </div>
  511. <div class="output_wrapper">
  512. <div class="output">
  513. <div class="output_area">
  514. <div class="output_subarea output_stream output_stdout output_text">
  515. <pre>the top three most frequent token used in two artifact classes and their corresponding count and frenquency is:
  516. </pre>
  517. </div>
  518. </div>
  519. <div class="output_area">
  520. <div class="output_text output_subarea output_execute_result">
  521. <pre>{&#39;1&#39;: [2903, 0.02353065144969239],
  522. &#39;8&#39;: [2241, 0.01816472266578045],
  523. &#39;▁&#39;: [53876, 0.43669906217830773]}</pre>
  524. </div>
  525. </div>
  526. </div>
  527. </div>
  528. </div>
  529. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  530. <div class="text_cell_render border-box-sizing rendered_html">
  531. <p>Use <strong>Vocab</strong> method for the most frequent token in just source artifacts class:</p>
  532. </div>
  533. </div>
  534. </div>
  535. <div class="cell border-box-sizing code_cell rendered">
  536. <div class="input">
  537. <div class="inner_cell">
  538. <div class="input_area">
  539. <div class=" highlight hl-ipython3"><pre><span></span><span class="n">vocab</span> <span class="o">=</span> <span class="n">facade</span><span class="o">.</span><span class="n">Vocab</span><span class="p">(</span><span class="n">source_file</span><span class="p">)</span>
  540. </pre></div>
  541. </div>
  542. </div>
  543. </div>
  544. </div>
  545. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  546. <div class="text_cell_render border-box-sizing rendered_html">
  547. <p>Display the result:</p>
  548. </div>
  549. </div>
  550. </div>
  551. <div class="cell border-box-sizing code_cell rendered">
  552. <div class="input">
  553. <div class="inner_cell">
  554. <div class="input_area">
  555. <div class=" highlight hl-ipython3"><pre><span></span><span class="nb">print</span><span class="p">(</span><span class="s2">&quot;the top three most frequent token used in source artifact classes and their corresponding count and frenquency is:&quot;</span><span class="p">)</span>
  556. <span class="n">vocab</span>
  557. </pre></div>
  558. </div>
  559. </div>
  560. </div>
  561. <div class="output_wrapper">
  562. <div class="output">
  563. <div class="output_area">
  564. <div class="output_subarea output_stream output_stdout output_text">
  565. <pre>the top three most frequent token used in source artifact classes and their corresponding count and frenquency is:
  566. </pre>
  567. </div>
  568. </div>
  569. <div class="output_area">
  570. <div class="output_text output_subarea output_execute_result">
  571. <pre>{&#39;client&#39;: [291, 0.01532304775946501],
  572. &#39;est&#39;: [281, 0.014796482544363119],
  573. &#39;▁&#39;: [8912, 0.4692749196988047]}</pre>
  574. </div>
  575. </div>
  576. </div>
  577. </div>
  578. </div>
  579. <div class="cell border-box-sizing code_cell rendered">
  580. <div class="input">
  581. <div class="inner_cell">
  582. <div class="input_area">
  583. <div class=" highlight hl-ipython3"><pre><span></span><span class="n">sharedvocabsize</span> <span class="o">=</span> <span class="n">facade</span><span class="o">.</span><span class="n">SharedVocabSize</span><span class="p">(</span><span class="n">source_file</span><span class="p">,</span> <span class="n">target_file</span><span class="p">)</span>
  584. </pre></div>
  585. </div>
  586. </div>
  587. </div>
  588. </div>
  589. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  590. <div class="text_cell_render border-box-sizing rendered_html">
  591. <p>Display the result:</p>
  592. </div>
  593. </div>
  594. </div>
  595. <div class="cell border-box-sizing code_cell rendered">
  596. <div class="input">
  597. <div class="inner_cell">
  598. <div class="input_area">
  599. <div class=" highlight hl-ipython3"><pre><span></span><span class="nb">print</span><span class="p">(</span><span class="s2">&quot;the number of shared token between source and target artifact classes is </span><span class="si">{}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">sharedvocabsize</span><span class="p">))</span>
  600. </pre></div>
  601. </div>
  602. </div>
  603. </div>
  604. <div class="output_wrapper">
  605. <div class="output">
  606. <div class="output_area">
  607. <div class="output_subarea output_stream output_stdout output_text">
  608. <pre>the number of shared token between source and target artifact classes is 5042
  609. </pre>
  610. </div>
  611. </div>
  612. </div>
  613. </div>
  614. </div>
  615. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  616. <div class="text_cell_render border-box-sizing rendered_html">
  617. <p>Use <strong>CrossEntropy</strong> methods to calcualte cross entropy of source and target class:</p>
  618. </div>
  619. </div>
  620. </div>
  621. <div class="cell border-box-sizing code_cell rendered">
  622. <div class="input">
  623. <div class="inner_cell">
  624. <div class="input_area">
  625. <div class=" highlight hl-ipython3"><pre><span></span><span class="n">entropy</span> <span class="o">=</span> <span class="n">facade</span><span class="o">.</span><span class="n">CrossEntropy</span><span class="p">(</span><span class="n">source_file</span><span class="p">,</span> <span class="n">target_file</span><span class="p">)</span>
  626. </pre></div>
  627. </div>
  628. </div>
  629. </div>
  630. </div>
  631. <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
  632. <div class="text_cell_render border-box-sizing rendered_html">
  633. <p>Display the result:</p>
  634. </div>
  635. </div>
  636. </div>
  637. <div class="cell border-box-sizing code_cell rendered">
  638. <div class="input">
  639. <div class="inner_cell">
  640. <div class="input_area">
  641. <div class=" highlight hl-ipython3"><pre><span></span><span class="nb">print</span><span class="p">(</span><span class="s2">&quot;The cross entropy value of source and target artifacts is </span><span class="si">{}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">format</span><span class="p">(</span><span class="n">entropy</span><span class="p">,</span><span class="s2">&quot;.2f&quot;</span><span class="p">)))</span>
  642. </pre></div>
  643. </div>
  644. </div>
  645. </div>
  646. <div class="output_wrapper">
  647. <div class="output">
  648. <div class="output_area">
  649. <div class="output_subarea output_stream output_stdout output_text">
  650. <pre>The cross entropy value of source and target artifacts is 6.16
  651. </pre>
  652. </div>
  653. </div>
  654. </div>
  655. </div>
  656. </div>
  657. </div>
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...