search_string_methodology.ipynb 42.6 KB
Newer Older
Dan Tutunaru's avatar
Dan Tutunaru committed
1
2
3
4
{
 "cells": [
  {
   "cell_type": "code",
Dan Tutunaru's avatar
Dan Tutunaru committed
5
   "execution_count": 1,
Dan Tutunaru's avatar
Dan Tutunaru committed
6
7
8
9
10
11
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
Dan Tutunaru's avatar
Dan Tutunaru committed
12
13
14
15
16
17
      "[nltk_data] Downloading package punkt to\n",
      "[nltk_data]     C:\\Users\\tutun\\AppData\\Roaming\\nltk_data...\n",
      "[nltk_data]   Package punkt is already up-to-date!\n",
      "[nltk_data] Downloading package wordnet to\n",
      "[nltk_data]     C:\\Users\\tutun\\AppData\\Roaming\\nltk_data...\n",
      "[nltk_data]   Package wordnet is already up-to-date!\n",
Dan Tutunaru's avatar
Dan Tutunaru committed
18
19
20
21
22
23
24
      "[nltk_data] Downloading package stopwords to\n",
      "[nltk_data]     C:\\Users\\tutun\\AppData\\Roaming\\nltk_data...\n",
      "[nltk_data]   Package stopwords is already up-to-date!\n"
     ]
    }
   ],
   "source": [
Dan Tutunaru's avatar
Dan Tutunaru committed
25
    "import fitz  # this is pymupdf\n",
Dan Tutunaru's avatar
Dan Tutunaru committed
26
27
28
    "from nltk.corpus import stopwords\n",
    "from wordcloud import STOPWORDS\n",
    "import nltk\n",
Dan Tutunaru's avatar
Dan Tutunaru committed
29
30
31
32
33
    "from spacy.lang.en.stop_words import STOP_WORDS\n",
    "import re\n",
    "import nltk as nlp\n",
    "nltk.download('punkt')\n",
    "nltk.download('wordnet')\n",
Dan Tutunaru's avatar
Dan Tutunaru committed
34
    "nltk.download('stopwords')\n",
Dan Tutunaru's avatar
Dan Tutunaru committed
35
36
37
38
39
    "import pandas as pd\n",
    "from sklearn.feature_extraction.text import TfidfVectorizer\n",
    "import ntpath\n",
    "import itertools\n",
    "import os"
Dan Tutunaru's avatar
Dan Tutunaru committed
40
41
42
43
   ]
  },
  {
   "cell_type": "code",
Dan Tutunaru's avatar
Dan Tutunaru committed
44
   "execution_count": 2,
Dan Tutunaru's avatar
Dan Tutunaru committed
45
46
47
48
49
50
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
Dan Tutunaru's avatar
Dan Tutunaru committed
51
52
53
54
55
56
57
58
59
60
61
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\papers\\Paper1.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\papers\\Paper10.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\papers\\Paper11.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\papers\\Paper12.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\papers\\Paper14.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\papers\\Paper17.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\papers\\Paper3.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\papers\\Paper4.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\papers\\Paper5.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\papers\\Paper8.pdf\n",
      "<class 'str'>\n"
Dan Tutunaru's avatar
Dan Tutunaru committed
62
63
64
65
     ]
    }
   ],
   "source": [
Dan Tutunaru's avatar
Dan Tutunaru committed
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
    "folderpath = r\"D:\\UNI\\THESIS\\START 21.06.21\\Search String\\papers\" # make sure to put the 'r' in front\n",
    "filepaths  = [os.path.join(folderpath, name) for name in os.listdir(folderpath)]\n",
    "all_files = []\n",
    "all_files_cleaned = []\n",
    "words_list=[]\n",
    "\n",
    "for path in filepaths:\n",
    "    print(path)\n",
    "    all_files2 = []\n",
    "    with fitz.open(path) as doc:\n",
    "        page_content = \"\"\n",
    "        for page in doc:\n",
    "            page_content += page.getText()\n",
    "        \n",
    "        page_content = page_content.split()\n",
    "        all_files.append(page_content)\n",
    "        \n",
    "\n",
    "#Here we get an array of arrays, where are stored strings of papers\n",
    "#we need to clean each array of this list, and add to another\n",
    "for e in range(len(all_files)):\n",
    "    list_em = []\n",
    "    for d in all_files[e]:\n",
    "        d=re.sub(r'http\\S+', '', d) #remove links\n",
    "        d=re.sub(\"[^a-zA-Z]\", \" \", d) #remove all characters except letters\n",
    "        d=d.lower() #convert all words to lowercase\n",
    "        d=nltk.word_tokenize(d) #split sentences into word\n",
    "        d=[word for word in d if not word in STOPWORDS] #remove the stopwords\n",
    "        lemma=nlp.WordNetLemmatizer() \n",
    "        d=[lemma.lemmatize(word) for word in d] #identify the correct form of the word in the dictionary\n",
    "        d=\" \".join(d)\n",
    "        list_em.append(d)\n",
    "    all_files[e] = list_em\n",
    "\n",
    "\n",
    "for e in range(len(all_files)):\n",
    "    all_files[e] = list(filter(None, all_files[e]))\n",
    "\n",
    "for e in range(len(all_files)):\n",
    "    all_files[e]=str(all_files[e]).split()\n",
    "    all_files[e]=[word.replace(\"'\",\"\") for word in all_files[e] ]\n",
    "    all_files[e]=[word.replace(\"[\", \"\") for word in all_files[e] ]\n",
    "    all_files[e]=[word.replace(\"]\",\"\") for word in all_files[e] ]\n",
    "    all_files[e]=[word.replace(\",\", \"\") for word in all_files[e] ]\n",
    "    all_files[e] = ' '.join( all_files[e])\n",
    "\n",
    "print(type(all_files[e]))\n",
    "nr_R_docs = len(all_files)"
Dan Tutunaru's avatar
Dan Tutunaru committed
114
115
116
117
   ]
  },
  {
   "cell_type": "code",
Dan Tutunaru's avatar
Dan Tutunaru committed
118
   "execution_count": 3,
Dan Tutunaru's avatar
Dan Tutunaru committed
119
   "metadata": {},
Dan Tutunaru's avatar
Dan Tutunaru committed
120
   "outputs": [],
Dan Tutunaru's avatar
Dan Tutunaru committed
121
   "source": [
Dan Tutunaru's avatar
Dan Tutunaru committed
122
123
124
125
126
127
128
129
130
    "vectorizer = TfidfVectorizer()\n",
    "vectors = vectorizer.fit_transform(all_files)\n",
    "feature_names = vectorizer.get_feature_names()\n",
    "dense = vectors.todense()\n",
    "denselist = dense.tolist()\n",
    "dfR = pd.DataFrame(denselist, columns=feature_names)\n",
    "\n",
    "s = dfR.sum()\n",
    "dfFinal = dfR[s.sort_values(ascending=False).index[:20]]#size can differ"
Dan Tutunaru's avatar
Dan Tutunaru committed
131
132
133
134
   ]
  },
  {
   "cell_type": "code",
Dan Tutunaru's avatar
Dan Tutunaru committed
135
   "execution_count": 4,
Dan Tutunaru's avatar
Dan Tutunaru committed
136
137
138
139
140
141
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
Dan Tutunaru's avatar
Dan Tutunaru committed
142
143
144
145
146
147
      "C:\\Users\\tutun\\anaconda3\\lib\\site-packages\\pandas\\core\\indexing.py:670: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  iloc._setitem_with_indexer(indexer, value)\n",
      "\n"
Dan Tutunaru's avatar
Dan Tutunaru committed
148
149
150
151
     ]
    },
    {
     "data": {
Dan Tutunaru's avatar
Dan Tutunaru committed
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
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>software</th>\n",
       "      <th>data</th>\n",
       "      <th>model</th>\n",
       "      <th>estimation</th>\n",
       "      <th>effort</th>\n",
       "      <th>project</th>\n",
       "      <th>learning</th>\n",
       "      <th>ml</th>\n",
       "      <th>engineering</th>\n",
       "      <th>bug</th>\n",
       "      <th>set</th>\n",
       "      <th>result</th>\n",
       "      <th>used</th>\n",
       "      <th>machine</th>\n",
       "      <th>method</th>\n",
       "      <th>algorithm</th>\n",
       "      <th>regression</th>\n",
       "      <th>based</th>\n",
       "      <th>quality</th>\n",
       "      <th>dataset</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.240318</td>\n",
       "      <td>0.069322</td>\n",
       "      <td>0.138645</td>\n",
       "      <td>0.172016</td>\n",
       "      <td>0.167045</td>\n",
       "      <td>0.115537</td>\n",
       "      <td>0.083187</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.050836</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.067025</td>\n",
       "      <td>0.060744</td>\n",
       "      <td>0.097051</td>\n",
       "      <td>0.060079</td>\n",
       "      <td>0.147888</td>\n",
       "      <td>0.041593</td>\n",
       "      <td>0.342227</td>\n",
       "      <td>0.055458</td>\n",
       "      <td>0.006093</td>\n",
       "      <td>0.048746</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.666105</td>\n",
       "      <td>0.114749</td>\n",
       "      <td>0.025189</td>\n",
       "      <td>0.010081</td>\n",
       "      <td>0.006131</td>\n",
       "      <td>0.002799</td>\n",
       "      <td>0.064372</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.260285</td>\n",
       "      <td>0.010011</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.027988</td>\n",
       "      <td>0.027988</td>\n",
       "      <td>0.013994</td>\n",
       "      <td>0.011195</td>\n",
       "      <td>0.004064</td>\n",
       "      <td>0.064372</td>\n",
       "      <td>0.011070</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.237186</td>\n",
       "      <td>0.070415</td>\n",
       "      <td>0.211244</td>\n",
       "      <td>0.249185</td>\n",
       "      <td>0.109600</td>\n",
       "      <td>0.107475</td>\n",
       "      <td>0.096357</td>\n",
       "      <td>0.178922</td>\n",
       "      <td>0.044472</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.162370</td>\n",
       "      <td>0.185302</td>\n",
       "      <td>0.092651</td>\n",
       "      <td>0.122299</td>\n",
       "      <td>0.177890</td>\n",
       "      <td>0.118384</td>\n",
       "      <td>0.081533</td>\n",
       "      <td>0.004886</td>\n",
       "      <td>0.112383</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.369171</td>\n",
       "      <td>0.032670</td>\n",
       "      <td>0.133947</td>\n",
       "      <td>0.133368</td>\n",
       "      <td>0.347103</td>\n",
       "      <td>0.107811</td>\n",
       "      <td>0.094743</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.016335</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.008615</td>\n",
       "      <td>0.085881</td>\n",
       "      <td>0.094743</td>\n",
       "      <td>0.088209</td>\n",
       "      <td>0.016335</td>\n",
       "      <td>0.130680</td>\n",
       "      <td>0.037949</td>\n",
       "      <td>0.042471</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.051689</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.259433</td>\n",
       "      <td>0.061445</td>\n",
       "      <td>0.034136</td>\n",
       "      <td>0.098366</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.095581</td>\n",
       "      <td>0.061445</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.027309</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.027004</td>\n",
       "      <td>0.044867</td>\n",
       "      <td>0.095581</td>\n",
       "      <td>0.047790</td>\n",
       "      <td>0.054617</td>\n",
       "      <td>0.068272</td>\n",
       "      <td>0.009913</td>\n",
       "      <td>0.061445</td>\n",
       "      <td>0.378056</td>\n",
       "      <td>0.270040</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.200215</td>\n",
       "      <td>0.178653</td>\n",
       "      <td>0.203295</td>\n",
       "      <td>0.125744</td>\n",
       "      <td>0.053981</td>\n",
       "      <td>0.070845</td>\n",
       "      <td>0.095487</td>\n",
       "      <td>0.582442</td>\n",
       "      <td>0.058524</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.085284</td>\n",
       "      <td>0.050607</td>\n",
       "      <td>0.052364</td>\n",
       "      <td>0.070845</td>\n",
       "      <td>0.030802</td>\n",
       "      <td>0.043123</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.086246</td>\n",
       "      <td>0.073101</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.061183</td>\n",
       "      <td>0.012036</td>\n",
       "      <td>0.005015</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.047239</td>\n",
       "      <td>0.036108</td>\n",
       "      <td>0.036108</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.023069</td>\n",
       "      <td>0.016144</td>\n",
       "      <td>0.140175</td>\n",
       "      <td>0.032958</td>\n",
       "      <td>0.017051</td>\n",
       "      <td>0.028084</td>\n",
       "      <td>0.081243</td>\n",
       "      <td>0.025075</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.038114</td>\n",
       "      <td>0.009257</td>\n",
       "      <td>0.002645</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0.281433</td>\n",
       "      <td>0.459902</td>\n",
       "      <td>0.137284</td>\n",
       "      <td>0.074175</td>\n",
       "      <td>0.060148</td>\n",
       "      <td>0.041185</td>\n",
       "      <td>0.061778</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.178469</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.022555</td>\n",
       "      <td>0.006864</td>\n",
       "      <td>0.048049</td>\n",
       "      <td>0.048049</td>\n",
       "      <td>0.054914</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.048049</td>\n",
       "      <td>0.027150</td>\n",
       "      <td>0.009050</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0.052742</td>\n",
       "      <td>0.055672</td>\n",
       "      <td>0.023441</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.012838</td>\n",
       "      <td>0.046882</td>\n",
       "      <td>0.049812</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.017581</td>\n",
       "      <td>0.649807</td>\n",
       "      <td>0.227930</td>\n",
       "      <td>0.060978</td>\n",
       "      <td>0.043952</td>\n",
       "      <td>0.041022</td>\n",
       "      <td>0.002930</td>\n",
       "      <td>0.011720</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.026371</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.011590</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.149478</td>\n",
       "      <td>0.158537</td>\n",
       "      <td>0.122300</td>\n",
       "      <td>0.103333</td>\n",
       "      <td>0.109150</td>\n",
       "      <td>0.194774</td>\n",
       "      <td>0.172126</td>\n",
       "      <td>0.009112</td>\n",
       "      <td>0.018119</td>\n",
       "      <td>0.016202</td>\n",
       "      <td>0.125414</td>\n",
       "      <td>0.143879</td>\n",
       "      <td>0.022648</td>\n",
       "      <td>0.135889</td>\n",
       "      <td>0.113241</td>\n",
       "      <td>0.054356</td>\n",
       "      <td>0.046039</td>\n",
       "      <td>0.036237</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Total</th>\n",
       "      <td>2.517263</td>\n",
       "      <td>1.213401</td>\n",
       "      <td>1.034496</td>\n",
       "      <td>0.966268</td>\n",
       "      <td>0.913234</td>\n",
       "      <td>0.818997</td>\n",
       "      <td>0.815413</td>\n",
       "      <td>0.770476</td>\n",
       "      <td>0.694999</td>\n",
       "      <td>0.692164</td>\n",
       "      <td>0.681447</td>\n",
       "      <td>0.664840</td>\n",
       "      <td>0.643543</td>\n",
       "      <td>0.640606</td>\n",
       "      <td>0.631398</td>\n",
       "      <td>0.618818</td>\n",
       "      <td>0.558576</td>\n",
       "      <td>0.540296</td>\n",
       "      <td>0.509613</td>\n",
       "      <td>0.506142</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
Dan Tutunaru's avatar
Dan Tutunaru committed
451
      "text/plain": [
Dan Tutunaru's avatar
Dan Tutunaru committed
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
       "       software      data     model  estimation    effort   project  learning  \\\n",
       "0      0.240318  0.069322  0.138645    0.172016  0.167045  0.115537  0.083187   \n",
       "1      0.666105  0.114749  0.025189    0.010081  0.006131  0.002799  0.064372   \n",
       "2      0.237186  0.070415  0.211244    0.249185  0.109600  0.107475  0.096357   \n",
       "3      0.369171  0.032670  0.133947    0.133368  0.347103  0.107811  0.094743   \n",
       "4      0.259433  0.061445  0.034136    0.098366  0.000000  0.095581  0.061445   \n",
       "5      0.200215  0.178653  0.203295    0.125744  0.053981  0.070845  0.095487   \n",
       "6      0.061183  0.012036  0.005015    0.000000  0.047239  0.036108  0.036108   \n",
       "7      0.281433  0.459902  0.137284    0.074175  0.060148  0.041185  0.061778   \n",
       "8      0.052742  0.055672  0.023441    0.000000  0.012838  0.046882  0.049812   \n",
       "9      0.149478  0.158537  0.122300    0.103333  0.109150  0.194774  0.172126   \n",
       "Total  2.517263  1.213401  1.034496    0.966268  0.913234  0.818997  0.815413   \n",
       "\n",
       "             ml  engineering       bug       set    result      used  \\\n",
       "0      0.000000     0.050836  0.000000  0.067025  0.060744  0.097051   \n",
       "1      0.000000     0.260285  0.010011  0.000000  0.000000  0.027988   \n",
       "2      0.178922     0.044472  0.000000  0.000000  0.162370  0.185302   \n",
       "3      0.000000     0.016335  0.000000  0.008615  0.085881  0.094743   \n",
       "4      0.000000     0.027309  0.000000  0.027004  0.044867  0.095581   \n",
       "5      0.582442     0.058524  0.000000  0.085284  0.050607  0.052364   \n",
       "6      0.000000     0.023069  0.016144  0.140175  0.032958  0.017051   \n",
       "7      0.000000     0.178469  0.000000  0.000000  0.022555  0.006864   \n",
       "8      0.000000     0.017581  0.649807  0.227930  0.060978  0.043952   \n",
       "9      0.009112     0.018119  0.016202  0.125414  0.143879  0.022648   \n",
       "Total  0.770476     0.694999  0.692164  0.681447  0.664840  0.643543   \n",
       "\n",
       "        machine    method  algorithm  regression     based   quality   dataset  \n",
       "0      0.060079  0.147888   0.041593    0.342227  0.055458  0.006093  0.048746  \n",
       "1      0.027988  0.013994   0.011195    0.004064  0.064372  0.011070  0.000000  \n",
       "2      0.092651  0.122299   0.177890    0.118384  0.081533  0.004886  0.112383  \n",
       "3      0.088209  0.016335   0.130680    0.037949  0.042471  0.000000  0.051689  \n",
       "4      0.047790  0.054617   0.068272    0.009913  0.061445  0.378056  0.270040  \n",
       "5      0.070845  0.030802   0.043123    0.000000  0.086246  0.073101  0.000000  \n",
       "6      0.028084  0.081243   0.025075    0.000000  0.038114  0.009257  0.002645  \n",
       "7      0.048049  0.048049   0.054914    0.000000  0.048049  0.027150  0.009050  \n",
       "8      0.041022  0.002930   0.011720    0.000000  0.026371  0.000000  0.011590  \n",
       "9      0.135889  0.113241   0.054356    0.046039  0.036237  0.000000  0.000000  \n",
       "Total  0.640606  0.631398   0.618818    0.558576  0.540296  0.509613  0.506142  "
Dan Tutunaru's avatar
Dan Tutunaru committed
490
491
      ]
     },
Dan Tutunaru's avatar
Dan Tutunaru committed
492
     "execution_count": 4,
Dan Tutunaru's avatar
Dan Tutunaru committed
493
494
495
496
497
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
Dan Tutunaru's avatar
Dan Tutunaru committed
498
499
    "dfFinal.loc['Total'] = pd.Series(dfFinal.sum())\n",
    "dfFinal"
Dan Tutunaru's avatar
Dan Tutunaru committed
500
501
502
503
   ]
  },
  {
   "cell_type": "code",
Dan Tutunaru's avatar
Dan Tutunaru committed
504
   "execution_count": 5,
Dan Tutunaru's avatar
Dan Tutunaru committed
505
506
507
508
509
510
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
Dan Tutunaru's avatar
Dan Tutunaru committed
511
512
513
514
515
516
517
518
519
520
521
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\ir papers\\Biba et al. - 2011 - Engineering SLS Algorithms for Statistical Relatio.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\ir papers\\Das et al. - 2014 - An online software for decision tree classificatio.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\ir papers\\Geeganage et al. - 2013 - A web based software system for database generatio.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\ir papers\\Han-Tai Shiao and Cherkassky - 2012 - Implementation and comparison of SVM-based Multi-T.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\ir papers\\Imam et al. - 2014 - An expert code generator using rule-based and fram.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\ir papers\\Kanewala and Bieman - 2013 - Using machine learning techniques to detect metamo.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\ir papers\\Li et al. - 2013 - The Determination Method for Software Reliability .pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\ir papers\\Mirowski and LeCun - 2012 - Statistical Machine Learning and Dissolved Gas Ana.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\ir papers\\Saudabayev et al. - 2013 - An intelligent object manipulation framework for i.pdf\n",
      "D:\\UNI\\THESIS\\START 21.06.21\\Search String\\ir papers\\Walkinshaw et al. - 2013 - Inferring Extended Finite State Machine models fro.pdf\n",
      "<class 'str'>\n"
Dan Tutunaru's avatar
Dan Tutunaru committed
522
523
524
525
     ]
    }
   ],
   "source": [
Dan Tutunaru's avatar
Dan Tutunaru committed
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
    "folderpath = r\"D:\\UNI\\THESIS\\START 21.06.21\\Search String\\ir papers\" # make sure to put the 'r' in front\n",
    "filepaths  = [os.path.join(folderpath, name) for name in os.listdir(folderpath)]\n",
    "all_files = []\n",
    "all_files_cleaned = []\n",
    "words_list=[]\n",
    "\n",
    "for path in filepaths:\n",
    "    print(path)\n",
    "    all_files2 = []\n",
    "    with fitz.open(path) as doc:\n",
    "        page_content = \"\"\n",
    "        for page in doc:\n",
    "            page_content += page.getText()\n",
    "        \n",
    "        page_content = page_content.split()\n",
    "        all_files.append(page_content)\n",
    "        \n",
    "\n",
    "#Here we get an array of arrays, where are stored strings of papers\n",
    "#we need to clean each array of this list, and add to another\n",
    "for e in range(len(all_files)):\n",
    "    list_em = []\n",
    "    for d in all_files[e]:\n",
    "        d=re.sub(r'http\\S+', '', d) #remove links\n",
    "        d=re.sub(\"[^a-zA-Z]\", \" \", d) #remove all characters except letters\n",
    "        d=d.lower() #convert all words to lowercase\n",
    "        d=nltk.word_tokenize(d) #split sentences into word\n",
    "        d=[word for word in d if not word in STOPWORDS] #remove the stopwords\n",
    "        lemma=nlp.WordNetLemmatizer() \n",
    "        d=[lemma.lemmatize(word) for word in d] #identify the correct form of the word in the dictionary\n",
    "        d=\" \".join(d)\n",
    "        list_em.append(d)\n",
    "    all_files[e] = list_em\n",
    "\n",
    "\n",
    "for e in range(len(all_files)):\n",
    "    all_files[e] = list(filter(None, all_files[e]))\n",
    "\n",
    "for e in range(len(all_files)):\n",
    "    all_files[e]=str(all_files[e]).split()\n",
    "    all_files[e]=[word.replace(\"'\",\"\") for word in all_files[e] ]\n",
    "    all_files[e]=[word.replace(\"[\", \"\") for word in all_files[e] ]\n",
    "    all_files[e]=[word.replace(\"]\",\"\") for word in all_files[e] ]\n",
    "    all_files[e]=[word.replace(\",\", \"\") for word in all_files[e] ]\n",
    "    all_files[e] = ' '.join( all_files[e])\n",
    "\n",
    "print(type(all_files[e]))"
Dan Tutunaru's avatar
Dan Tutunaru committed
573
574
575
576
   ]
  },
  {
   "cell_type": "code",
Dan Tutunaru's avatar
Dan Tutunaru committed
577
   "execution_count": 6,
Dan Tutunaru's avatar
Dan Tutunaru committed
578
579
580
   "metadata": {},
   "outputs": [],
   "source": [
Dan Tutunaru's avatar
Dan Tutunaru committed
581
582
583
584
585
586
587
588
589
    "vectorizer = TfidfVectorizer()\n",
    "vectors = vectorizer.fit_transform(all_files)\n",
    "feature_names = vectorizer.get_feature_names()\n",
    "dense = vectors.todense()\n",
    "denselist = dense.tolist()\n",
    "dfIR = pd.DataFrame(denselist, columns=feature_names)\n",
    "\n",
    "s = dfIR.sum()\n",
    "dfFinalIR = dfIR[s.sort_values(ascending=False).index[:]]#size can differ"
Dan Tutunaru's avatar
Dan Tutunaru committed
590
591
592
593
   ]
  },
  {
   "cell_type": "code",
Dan Tutunaru's avatar
Dan Tutunaru committed
594
   "execution_count": 7,
Dan Tutunaru's avatar
Dan Tutunaru committed
595
596
597
   "metadata": {},
   "outputs": [
    {
Dan Tutunaru's avatar
Dan Tutunaru committed
598
     "name": "stderr",
Dan Tutunaru's avatar
Dan Tutunaru committed
599
600
     "output_type": "stream",
     "text": [
Dan Tutunaru's avatar
Dan Tutunaru committed
601
602
603
604
605
606
      "C:\\Users\\tutun\\anaconda3\\lib\\site-packages\\pandas\\core\\indexing.py:670: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  iloc._setitem_with_indexer(indexer, value)\n",
      "\n"
Dan Tutunaru's avatar
Dan Tutunaru committed
607
     ]
Dan Tutunaru's avatar
Dan Tutunaru committed
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
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>data</th>\n",
       "      <th>software</th>\n",
       "      <th>system</th>\n",
       "      <th>set</th>\n",
       "      <th>learning</th>\n",
       "      <th>algorithm</th>\n",
       "      <th>reliability</th>\n",
       "      <th>metamorphic</th>\n",
       "      <th>classi</th>\n",
       "      <th>ieee</th>\n",
       "      <th>...</th>\n",
       "      <th>rehg</th>\n",
       "      <th>deep</th>\n",
       "      <th>median</th>\n",
       "      <th>measurable</th>\n",
       "      <th>anticipated</th>\n",
       "      <th>troubling</th>\n",
       "      <th>tsai</th>\n",
       "      <th>conse</th>\n",
       "      <th>executing</th>\n",
       "      <th>prolonging</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.010818</td>\n",
       "      <td>0.003606</td>\n",
       "      <td>0.028848</td>\n",
       "      <td>0.072121</td>\n",
       "      <td>0.229269</td>\n",
       "      <td>0.191120</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.029630</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.232704</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.071196</td>\n",
       "      <td>0.071196</td>\n",
       "      <td>0.280333</td>\n",
       "      <td>0.053397</td>\n",
       "      <td>0.039022</td>\n",
       "      <td>0.062296</td>\n",
       "      <td>0.014531</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.036563</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.222192</td>\n",
       "      <td>0.002415</td>\n",
       "      <td>0.002415</td>\n",
       "      <td>0.113511</td>\n",
       "      <td>0.100603</td>\n",
       "      <td>0.004830</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.078870</td>\n",
       "      <td>0.019845</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.061424</td>\n",
       "      <td>0.122847</td>\n",
       "      <td>0.100735</td>\n",
       "      <td>0.022112</td>\n",
       "      <td>0.008080</td>\n",
       "      <td>0.004914</td>\n",
       "      <td>0.004012</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.015702</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.047526</td>\n",
       "      <td>0.082257</td>\n",
       "      <td>0.010968</td>\n",
       "      <td>0.131610</td>\n",
       "      <td>0.088165</td>\n",
       "      <td>0.029247</td>\n",
       "      <td>0.008954</td>\n",
       "      <td>0.573259</td>\n",
       "      <td>0.161173</td>\n",
       "      <td>0.033377</td>\n",
       "      <td>...</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.003726</td>\n",
       "      <td>0.465784</td>\n",
       "      <td>0.070799</td>\n",
       "      <td>0.013042</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.005589</td>\n",
       "      <td>0.559763</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.017010</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0.144610</td>\n",
       "      <td>0.001878</td>\n",
       "      <td>0.007512</td>\n",
       "      <td>0.052586</td>\n",
       "      <td>0.096759</td>\n",
       "      <td>0.125830</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.174793</td>\n",
       "      <td>0.063441</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0.053229</td>\n",
       "      <td>0.024840</td>\n",
       "      <td>0.095813</td>\n",
       "      <td>0.056778</td>\n",
       "      <td>0.015560</td>\n",
       "      <td>0.049681</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.061557</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.247107</td>\n",
       "      <td>0.075866</td>\n",
       "      <td>0.101878</td>\n",
       "      <td>0.130056</td>\n",
       "      <td>0.040394</td>\n",
       "      <td>0.132224</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.141574</td>\n",
       "      <td>0.033643</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Total</th>\n",
       "      <td>0.861829</td>\n",
       "      <td>0.850690</td>\n",
       "      <td>0.699300</td>\n",
       "      <td>0.645214</td>\n",
       "      <td>0.617853</td>\n",
       "      <td>0.605732</td>\n",
       "      <td>0.587260</td>\n",
       "      <td>0.573259</td>\n",
       "      <td>0.556410</td>\n",
       "      <td>0.543473</td>\n",
       "      <td>...</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "      <td>0.004514</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>11 rows × 4644 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           data  software    system       set  learning  algorithm  \\\n",
       "0      0.010818  0.003606  0.028848  0.072121  0.229269   0.191120   \n",
       "1      0.000000  0.000000  0.000000  0.000000  0.000000   0.000000   \n",
       "2      0.071196  0.071196  0.280333  0.053397  0.039022   0.062296   \n",
       "3      0.222192  0.002415  0.002415  0.113511  0.100603   0.004830   \n",
       "4      0.061424  0.122847  0.100735  0.022112  0.008080   0.004914   \n",
       "5      0.047526  0.082257  0.010968  0.131610  0.088165   0.029247   \n",
       "6      0.003726  0.465784  0.070799  0.013042  0.000000   0.005589   \n",
       "7      0.144610  0.001878  0.007512  0.052586  0.096759   0.125830   \n",
       "8      0.053229  0.024840  0.095813  0.056778  0.015560   0.049681   \n",
       "9      0.247107  0.075866  0.101878  0.130056  0.040394   0.132224   \n",
       "Total  0.861829  0.850690  0.699300  0.645214  0.617853   0.605732   \n",
       "\n",
       "       reliability  metamorphic    classi      ieee  ...      rehg      deep  \\\n",
       "0         0.000000     0.000000  0.000000  0.029630  ...  0.000000  0.000000   \n",
       "1         0.000000     0.000000  0.000000  0.232704  ...  0.000000  0.000000   \n",
       "2         0.014531     0.000000  0.000000  0.036563  ...  0.000000  0.000000   \n",
       "3         0.000000     0.000000  0.078870  0.019845  ...  0.000000  0.000000   \n",
       "4         0.004012     0.000000  0.000000  0.015702  ...  0.000000  0.000000   \n",
       "5         0.008954     0.573259  0.161173  0.033377  ...  0.004514  0.004514   \n",
       "6         0.559763     0.000000  0.000000  0.017010  ...  0.000000  0.000000   \n",
       "7         0.000000     0.000000  0.174793  0.063441  ...  0.000000  0.000000   \n",
       "8         0.000000     0.000000  0.000000  0.061557  ...  0.000000  0.000000   \n",
       "9         0.000000     0.000000  0.141574  0.033643  ...  0.000000  0.000000   \n",
       "Total     0.587260     0.573259  0.556410  0.543473  ...  0.004514  0.004514   \n",
       "\n",
       "         median  measurable  anticipated  troubling      tsai     conse  \\\n",
       "0      0.000000    0.000000     0.000000   0.000000  0.000000  0.000000   \n",
       "1      0.000000    0.000000     0.000000   0.000000  0.000000  0.000000   \n",
       "2      0.000000    0.000000     0.000000   0.000000  0.000000  0.000000   \n",
       "3      0.000000    0.000000     0.000000   0.000000  0.000000  0.000000   \n",
       "4      0.000000    0.000000     0.000000   0.000000  0.000000  0.000000   \n",
       "5      0.004514    0.004514     0.004514   0.004514  0.004514  0.004514   \n",
       "6      0.000000    0.000000     0.000000   0.000000  0.000000  0.000000   \n",
       "7      0.000000    0.000000     0.000000   0.000000  0.000000  0.000000   \n",
       "8      0.000000    0.000000     0.000000   0.000000  0.000000  0.000000   \n",
       "9      0.000000    0.000000     0.000000   0.000000  0.000000  0.000000   \n",
       "Total  0.004514    0.004514     0.004514   0.004514  0.004514  0.004514   \n",
       "\n",
       "       executing  prolonging  \n",
       "0       0.000000    0.000000  \n",
       "1       0.000000    0.000000  \n",
       "2       0.000000    0.000000  \n",
       "3       0.000000    0.000000  \n",
       "4       0.000000    0.000000  \n",
       "5       0.004514    0.004514  \n",
       "6       0.000000    0.000000  \n",
       "7       0.000000    0.000000  \n",
       "8       0.000000    0.000000  \n",
       "9       0.000000    0.000000  \n",
       "Total   0.004514    0.004514  \n",
       "\n",
       "[11 rows x 4644 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
Dan Tutunaru's avatar
Dan Tutunaru committed
982
983
984
    }
   ],
   "source": [
Dan Tutunaru's avatar
Dan Tutunaru committed
985
986
    "dfFinalIR.loc['Total'] = pd.Series(dfFinalIR.sum())\n",
    "dfFinalIR"
Dan Tutunaru's avatar
Dan Tutunaru committed
987
988
989
990
   ]
  },
  {
   "cell_type": "code",
Dan Tutunaru's avatar
Dan Tutunaru committed
991
   "execution_count": 8,
Dan Tutunaru's avatar
Dan Tutunaru committed
992
993
994
995
996
997
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
Dan Tutunaru's avatar
Dan Tutunaru committed
998
      "{'software': 2.517263208982406, 'data': 1.2134012566134262, 'model': 1.0344957091499052, 'estimation': 0.9662677388444173, 'effort': 0.9132337305241053, 'project': 0.8189967414678352, 'learning': 0.8154134989393526, 'ml': 0.7704755850394172, 'engineering': 0.6949993152810754, 'bug': 0.6921640977624443, 'set': 0.6814467548658427, 'result': 0.6648397325136443, 'used': 0.6435431216891457, 'machine': 0.6406061688746805, 'method': 0.6313983299179621, 'algorithm': 0.6188177925258712, 'regression': 0.5585759603443816, 'based': 0.5402956107390704, 'quality': 0.5096129940531924, 'dataset': 0.5061422092827657}\n"
Dan Tutunaru's avatar
Dan Tutunaru committed
999
1000
     ]
    }
For faster browsing, not all history is shown. View entire blame