Best Python code snippet using autotest_python
Profiler.py
Source:Profiler.py
1__author__ = 'chintanpanchamia'2import csv3record = open('record.csv','a')4csvwriter1 = csv.writer(record)5agreeableness = 06agreeableness_counter = 07agreeableness_reverse = 08agreeableness_reverse_counter = 09conscientiousness = 010conscientiousness_counter = 011conscientiousness_reverse = 012conscientiousness_reverse_counter = 013openness = 014openness_counter = 015openness_reverse = 016openness_reverse_counter = 017extraversion = 018extraversion_counter = 019extraversion_reverse = 020extraversion_reverse_counter = 021neuroticism = 022neuroticism_counter = 023neuroticism_reverse = 024neuroticism_reverse_counter = 025dmap = {'I am the life of the party.':'extraversion',26 'I feel little concern for others.':'agreeableness_reverse',27 'I am always prepared.':'conscientiousness',28 'I get stressed out easily.':'neuroticism',29 'I have a rich vocabulary.':'openness',30 'I do not talk a lot.':'extraversion_reverse',31 'I am interested in people.':'agreeableness',32 'I leave my belongings around.':'conscientiousness_reverse',33 'I am relaxed most of the time.':'neuroticism_reverse',34 'I have difficulty understanding abstract ideas.':'openness_reverse',35 'I feel comfortable around people.':'extraversion',36 'I insult people.':'agreeableness_reverse',37 'I pay attention to details.':'conscientiousness',38 'I worry about things.':'neuroticism',39 'I have a vivid imagination.':'openness',40 'I keep in the background.':'extraversion_reverse',41 'I sympathize with others feelings.':'agreeableness',42 'I make a mess of things.':'conscientiousness_reverse',43 'I seldom feel blue.':'neuroticism_reverse',44 'I am not interested in abstract ideas.':'openness_reverse',45 'I start conversations.':'extraversion',46 'I am not interested in other peoples problems.':'agreeableness_reverse',47 'I get chores done right away.':'conscientiousness',48 'I am easily disturbed.':'neuroticism',49 'I have excellent ideas.':'openness',50 'I have little to say.':'extraversion_reverse',51 'I have a soft heart.':'agreeableness',52 'I often forget to put things back in their proper place.':'conscientiousness_reverse',53 'I get upset easily.':'neuroticism',54 'I do not have a good imagination.':'openness_reverse',55 'I talk to a lot of different people at parties.':'extraversion',56 'I am not really interested in others.':'agreeableness_reverse',57 'I like order.':'conscientiousness',58 'I change my mood a lot.':'neuroticism',59 'I am quick to understand things.':'openness',60 'I do not like to draw attention to myself.':'extraversion_reverse',61 'I take time out for others.':'agreeableness',62 'I shirk my duties.':'conscientiousness_reverse',63 'I have frequent mood swings.':'neuroticism',64 'I use difficult words.':'openness',65 'I do not mind being the center of attention.':'extraversion',66 'I feel others emotions.':'agreeableness',67 'I follow a schedule.':'conscientiousness',68 'I get irritated easily.':'neuroticism',69 'I spend time reflecting on things.':'extraversion_reverse',70 'I am quiet around strangers.':'extraversion_reverse',71 'I make people feel at ease.':'agreeableness',72 'I am exacting in my work.':'conscientiousness',73 'I often feel blue.':'neuroticism',74 'I am full of ideas.':'openness'}75while(True):76 name = str(raw_input("Enter your name:"))77 print '\n\n\n\nQuestionnaire\n\n\n\n'78 print 'Answer the following questions, with the prefix "I think that.."\n\n\n\n'79 q = 'I am the life of the party.'80 num = int(raw_input(q + '\n'))81 m = dmap[q]82 if(m is 'agreeableness'):83 agreeableness = agreeableness + num 84 agreeableness_counter = agreeableness_counter + 185 elif(m is 'agreeableness_reverse'):86 agreeableness_reverse = agreeableness_reverse + num 87 agreeableness_reverse_counter = agreeableness_reverse_counter + 188 elif(m is 'openness'):89 openness = openness + num90 openness_counter = openness_counter + 191 elif(m is 'openness_reverse'):92 openness_reverse = openness_reverse + num93 openness_reverse_counter = openness_reverse_counter + 194 elif(m is 'conscientiousness'):95 conscientiousness = conscientiousness + num96 conscientiousness_counter = conscientiousness_counter + 197 elif(m is 'conscientiousness_reverse'):98 conscientiousness_reverse = conscientiousness_reverse + num99 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1100 elif(m is 'extraversion'):101 extraversion = extraversion + num102 extraversion_counter = extraversion_counter + 1103 elif(m is 'extraversion_reverse'):104 extraversion_reverse = extraversion_reverse + num105 extraversion_reverse_counter = extraversion_reverse_counter + 1106 elif(m is 'neuroticism'):107 neuroticism = neuroticism + num108 neuroticism_counter = neuroticism_counter + 1109 else:110 neuroticism_reverse = neuroticism_reverse + num111 neuroticism_reverse_counter = neuroticism_reverse_counter + 1112 q = 'I feel little concern for others.'113 num = int(raw_input(q + '\n'))114 m = dmap[q]115 if(m is 'agreeableness'):116 agreeableness = agreeableness + num 117 agreeableness_counter = agreeableness_counter + 1118 elif(m is 'agreeableness_reverse'):119 agreeableness_reverse = agreeableness_reverse + num 120 agreeableness_reverse_counter = agreeableness_reverse_counter + 1121 elif(m is 'openness'):122 openness = openness + num123 openness_counter = openness_counter + 1124 elif(m is 'openness_reverse'):125 openness_reverse = openness_reverse + num126 openness_reverse_counter = openness_reverse_counter + 1127 elif(m is 'conscientiousness'):128 conscientiousness = conscientiousness + num129 conscientiousness_counter = conscientiousness_counter + 1130 elif(m is 'conscientiousness_reverse'):131 conscientiousness_reverse = conscientiousness_reverse + num132 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1133 elif(m is 'extraversion'):134 extraversion = extraversion + num135 extraversion_counter = extraversion_counter + 1136 elif(m is 'extraversion_reverse'):137 extraversion_reverse = extraversion_reverse + num138 extraversion_reverse_counter = extraversion_reverse_counter + 1139 elif(m is 'neuroticism'):140 neuroticism = neuroticism + num141 neuroticism_counter = neuroticism_counter + 1142 else:143 neuroticism_reverse = neuroticism_reverse + num144 neuroticism_reverse_counter = neuroticism_reverse_counter + 1145 q = 'I am always prepared.'146 num = int(raw_input(q + '\n'))147 m = dmap[q]148 if(m is 'agreeableness'):149 agreeableness = agreeableness + num 150 agreeableness_counter = agreeableness_counter + 1151 elif(m is 'agreeableness_reverse'):152 agreeableness_reverse = agreeableness_reverse + num 153 agreeableness_reverse_counter = agreeableness_reverse_counter + 1154 elif(m is 'openness'):155 openness = openness + num156 openness_counter = openness_counter + 1157 elif(m is 'openness_reverse'):158 openness_reverse = openness_reverse + num159 openness_reverse_counter = openness_reverse_counter + 1160 elif(m is 'conscientiousness'):161 conscientiousness = conscientiousness + num162 conscientiousness_counter = conscientiousness_counter + 1163 elif(m is 'conscientiousness_reverse'):164 conscientiousness_reverse = conscientiousness_reverse + num165 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1166 elif(m is 'extraversion'):167 extraversion = extraversion + num168 extraversion_counter = extraversion_counter + 1169 elif(m is 'extraversion_reverse'):170 extraversion_reverse = extraversion_reverse + num171 extraversion_reverse_counter = extraversion_reverse_counter + 1172 elif(m is 'neuroticism'):173 neuroticism = neuroticism + num174 neuroticism_counter = neuroticism_counter + 1175 else:176 neuroticism_reverse = neuroticism_reverse + num177 neuroticism_reverse_counter = neuroticism_reverse_counter + 1178 q = 'I get stressed out easily.'179 num = int(raw_input(q + '\n'))180 m = dmap[q]181 if(m is 'agreeableness'):182 agreeableness = agreeableness + num 183 agreeableness_counter = agreeableness_counter + 1184 elif(m is 'agreeableness_reverse'):185 agreeableness_reverse = agreeableness_reverse + num 186 agreeableness_reverse_counter = agreeableness_reverse_counter + 1187 elif(m is 'openness'):188 openness = openness + num189 openness_counter = openness_counter + 1190 elif(m is 'openness_reverse'):191 openness_reverse = openness_reverse + num192 openness_reverse_counter = openness_reverse_counter + 1193 elif(m is 'conscientiousness'):194 conscientiousness = conscientiousness + num195 conscientiousness_counter = conscientiousness_counter + 1196 elif(m is 'conscientiousness_reverse'):197 conscientiousness_reverse = conscientiousness_reverse + num198 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1199 elif(m is 'extraversion'):200 extraversion = extraversion + num201 extraversion_counter = extraversion_counter + 1202 elif(m is 'extraversion_reverse'):203 extraversion_reverse = extraversion_reverse + num204 extraversion_reverse_counter = extraversion_reverse_counter + 1205 elif(m is 'neuroticism'):206 neuroticism = neuroticism + num207 neuroticism_counter = neuroticism_counter + 1208 else:209 neuroticism_reverse = neuroticism_reverse + num210 neuroticism_reverse_counter = neuroticism_reverse_counter + 1211 q = 'I have a rich vocabulary.'212 num = int(raw_input(q + '\n'))213 m = dmap[q]214 if(m is 'agreeableness'):215 agreeableness = agreeableness + num 216 agreeableness_counter = agreeableness_counter + 1217 elif(m is 'agreeableness_reverse'):218 agreeableness_reverse = agreeableness_reverse + num 219 agreeableness_reverse_counter = agreeableness_reverse_counter + 1220 elif(m is 'openness'):221 openness = openness + num222 openness_counter = openness_counter + 1223 elif(m is 'openness_reverse'):224 openness_reverse = openness_reverse + num225 openness_reverse_counter = openness_reverse_counter + 1226 elif(m is 'conscientiousness'):227 conscientiousness = conscientiousness + num228 conscientiousness_counter = conscientiousness_counter + 1229 elif(m is 'conscientiousness_reverse'):230 conscientiousness_reverse = conscientiousness_reverse + num231 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1232 elif(m is 'extraversion'):233 extraversion = extraversion + num234 extraversion_counter = extraversion_counter + 1235 elif(m is 'extraversion_reverse'):236 extraversion_reverse = extraversion_reverse + num237 extraversion_reverse_counter = extraversion_reverse_counter + 1238 elif(m is 'neuroticism'):239 neuroticism = neuroticism + num240 neuroticism_counter = neuroticism_counter + 1241 else:242 neuroticism_reverse = neuroticism_reverse + num243 neuroticism_reverse_counter = neuroticism_reverse_counter + 1244 q = 'I do not talk a lot.'245 num = int(raw_input(q + '\n'))246 m = dmap[q]247 if(m is 'agreeableness'):248 agreeableness = agreeableness + num 249 agreeableness_counter = agreeableness_counter + 1250 elif(m is 'agreeableness_reverse'):251 agreeableness_reverse = agreeableness_reverse + num 252 agreeableness_reverse_counter = agreeableness_reverse_counter + 1253 elif(m is 'openness'):254 openness = openness + num255 openness_counter = openness_counter + 1256 elif(m is 'openness_reverse'):257 openness_reverse = openness_reverse + num258 openness_reverse_counter = openness_reverse_counter + 1259 elif(m is 'conscientiousness'):260 conscientiousness = conscientiousness + num261 conscientiousness_counter = conscientiousness_counter + 1262 elif(m is 'conscientiousness_reverse'):263 conscientiousness_reverse = conscientiousness_reverse + num264 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1265 elif(m is 'extraversion'):266 extraversion = extraversion + num267 extraversion_counter = extraversion_counter + 1268 elif(m is 'extraversion_reverse'):269 extraversion_reverse = extraversion_reverse + num270 extraversion_reverse_counter = extraversion_reverse_counter + 1271 elif(m is 'neuroticism'):272 neuroticism = neuroticism + num273 neuroticism_counter = neuroticism_counter + 1274 else:275 neuroticism_reverse = neuroticism_reverse + num276 neuroticism_reverse_counter = neuroticism_reverse_counter + 1277 q = 'I am interested in people.'278 num = int(raw_input(q + '\n'))279 m = dmap[q]280 if(m is 'agreeableness'):281 agreeableness = agreeableness + num 282 agreeableness_counter = agreeableness_counter + 1283 elif(m is 'agreeableness_reverse'):284 agreeableness_reverse = agreeableness_reverse + num 285 agreeableness_reverse_counter = agreeableness_reverse_counter + 1286 elif(m is 'openness'):287 openness = openness + num288 openness_counter = openness_counter + 1289 elif(m is 'openness_reverse'):290 openness_reverse = openness_reverse + num291 openness_reverse_counter = openness_reverse_counter + 1292 elif(m is 'conscientiousness'):293 conscientiousness = conscientiousness + num294 conscientiousness_counter = conscientiousness_counter + 1295 elif(m is 'conscientiousness_reverse'):296 conscientiousness_reverse = conscientiousness_reverse + num297 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1298 elif(m is 'extraversion'):299 extraversion = extraversion + num300 extraversion_counter = extraversion_counter + 1301 elif(m is 'extraversion_reverse'):302 extraversion_reverse = extraversion_reverse + num303 extraversion_reverse_counter = extraversion_reverse_counter + 1304 elif(m is 'neuroticism'):305 neuroticism = neuroticism + num306 neuroticism_counter = neuroticism_counter + 1307 else:308 neuroticism_reverse = neuroticism_reverse + num309 neuroticism_reverse_counter = neuroticism_reverse_counter + 1310 q = 'I leave my belongings around.'311 num = int(raw_input(q + '\n'))312 m = dmap[q]313 if(m is 'agreeableness'):314 agreeableness = agreeableness + num 315 agreeableness_counter = agreeableness_counter + 1316 elif(m is 'agreeableness_reverse'):317 agreeableness_reverse = agreeableness_reverse + num 318 agreeableness_reverse_counter = agreeableness_reverse_counter + 1319 elif(m is 'openness'):320 openness = openness + num321 openness_counter = openness_counter + 1322 elif(m is 'openness_reverse'):323 openness_reverse = openness_reverse + num324 openness_reverse_counter = openness_reverse_counter + 1325 elif(m is 'conscientiousness'):326 conscientiousness = conscientiousness + num327 conscientiousness_counter = conscientiousness_counter + 1328 elif(m is 'conscientiousness_reverse'):329 conscientiousness_reverse = conscientiousness_reverse + num330 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1331 elif(m is 'extraversion'):332 extraversion = extraversion + num333 extraversion_counter = extraversion_counter + 1334 elif(m is 'extraversion_reverse'):335 extraversion_reverse = extraversion_reverse + num336 extraversion_reverse_counter = extraversion_reverse_counter + 1337 elif(m is 'neuroticism'):338 neuroticism = neuroticism + num339 neuroticism_counter = neuroticism_counter + 1340 else:341 neuroticism_reverse = neuroticism_reverse + num342 neuroticism_reverse_counter = neuroticism_reverse_counter + 1343 q = 'I am relaxed most of the time.'344 num = int(raw_input(q + '\n'))345 m = dmap[q]346 if(m is 'agreeableness'):347 agreeableness = agreeableness + num 348 agreeableness_counter = agreeableness_counter + 1349 elif(m is 'agreeableness_reverse'):350 agreeableness_reverse = agreeableness_reverse + num 351 agreeableness_reverse_counter = agreeableness_reverse_counter + 1352 elif(m is 'openness'):353 openness = openness + num354 openness_counter = openness_counter + 1355 elif(m is 'openness_reverse'):356 openness_reverse = openness_reverse + num357 openness_reverse_counter = openness_reverse_counter + 1358 elif(m is 'conscientiousness'):359 conscientiousness = conscientiousness + num360 conscientiousness_counter = conscientiousness_counter + 1361 elif(m is 'conscientiousness_reverse'):362 conscientiousness_reverse = conscientiousness_reverse + num363 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1364 elif(m is 'extraversion'):365 extraversion = extraversion + num366 extraversion_counter = extraversion_counter + 1367 elif(m is 'extraversion_reverse'):368 extraversion_reverse = extraversion_reverse + num369 extraversion_reverse_counter = extraversion_reverse_counter + 1370 elif(m is 'neuroticism'):371 neuroticism = neuroticism + num372 neuroticism_counter = neuroticism_counter + 1373 else:374 neuroticism_reverse = neuroticism_reverse + num375 neuroticism_reverse_counter = neuroticism_reverse_counter + 1376 q = 'I have difficulty understanding abstract ideas.'377 num = int(raw_input(q + '\n'))378 m = dmap[q]379 if(m is 'agreeableness'):380 agreeableness = agreeableness + num 381 agreeableness_counter = agreeableness_counter + 1382 elif(m is 'agreeableness_reverse'):383 agreeableness_reverse = agreeableness_reverse + num 384 agreeableness_reverse_counter = agreeableness_reverse_counter + 1385 elif(m is 'openness'):386 openness = openness + num387 openness_counter = openness_counter + 1388 elif(m is 'openness_reverse'):389 openness_reverse = openness_reverse + num390 openness_reverse_counter = openness_reverse_counter + 1391 elif(m is 'conscientiousness'):392 conscientiousness = conscientiousness + num393 conscientiousness_counter = conscientiousness_counter + 1394 elif(m is 'conscientiousness_reverse'):395 conscientiousness_reverse = conscientiousness_reverse + num396 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1397 elif(m is 'extraversion'):398 extraversion = extraversion + num399 extraversion_counter = extraversion_counter + 1400 elif(m is 'extraversion_reverse'):401 extraversion_reverse = extraversion_reverse + num402 extraversion_reverse_counter = extraversion_reverse_counter + 1403 elif(m is 'neuroticism'):404 neuroticism = neuroticism + num405 neuroticism_counter = neuroticism_counter + 1406 else:407 neuroticism_reverse = neuroticism_reverse + num408 neuroticism_reverse_counter = neuroticism_reverse_counter + 1409 q = 'I feel comfortable around people.'410 num = int(raw_input(q + '\n'))411 m = dmap[q]412 if(m is 'agreeableness'):413 agreeableness = agreeableness + num 414 agreeableness_counter = agreeableness_counter + 1415 elif(m is 'agreeableness_reverse'):416 agreeableness_reverse = agreeableness_reverse + num 417 agreeableness_reverse_counter = agreeableness_reverse_counter + 1418 elif(m is 'openness'):419 openness = openness + num420 openness_counter = openness_counter + 1421 elif(m is 'openness_reverse'):422 openness_reverse = openness_reverse + num423 openness_reverse_counter = openness_reverse_counter + 1424 elif(m is 'conscientiousness'):425 conscientiousness = conscientiousness + num426 conscientiousness_counter = conscientiousness_counter + 1427 elif(m is 'conscientiousness_reverse'):428 conscientiousness_reverse = conscientiousness_reverse + num429 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1430 elif(m is 'extraversion'):431 extraversion = extraversion + num432 extraversion_counter = extraversion_counter + 1433 elif(m is 'extraversion_reverse'):434 extraversion_reverse = extraversion_reverse + num435 extraversion_reverse_counter = extraversion_reverse_counter + 1436 elif(m is 'neuroticism'):437 neuroticism = neuroticism + num438 neuroticism_counter = neuroticism_counter + 1439 else:440 neuroticism_reverse = neuroticism_reverse + num441 neuroticism_reverse_counter = neuroticism_reverse_counter + 1442 q = 'I insult people.'443 num = int(raw_input(q + '\n'))444 m = dmap[q]445 if(m is 'agreeableness'):446 agreeableness = agreeableness + num 447 agreeableness_counter = agreeableness_counter + 1448 elif(m is 'agreeableness_reverse'):449 agreeableness_reverse = agreeableness_reverse + num 450 agreeableness_reverse_counter = agreeableness_reverse_counter + 1451 elif(m is 'openness'):452 openness = openness + num453 openness_counter = openness_counter + 1454 elif(m is 'openness_reverse'):455 openness_reverse = openness_reverse + num456 openness_reverse_counter = openness_reverse_counter + 1457 elif(m is 'conscientiousness'):458 conscientiousness = conscientiousness + num459 conscientiousness_counter = conscientiousness_counter + 1460 elif(m is 'conscientiousness_reverse'):461 conscientiousness_reverse = conscientiousness_reverse + num462 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1463 elif(m is 'extraversion'):464 extraversion = extraversion + num465 extraversion_counter = extraversion_counter + 1466 elif(m is 'extraversion_reverse'):467 extraversion_reverse = extraversion_reverse + num468 extraversion_reverse_counter = extraversion_reverse_counter + 1469 elif(m is 'neuroticism'):470 neuroticism = neuroticism + num471 neuroticism_counter = neuroticism_counter + 1472 else:473 neuroticism_reverse = neuroticism_reverse + num474 neuroticism_reverse_counter = neuroticism_reverse_counter + 1475 q = 'I pay attention to details.'476 num = int(raw_input(q + '\n'))477 m = dmap[q]478 if(m is 'agreeableness'):479 agreeableness = agreeableness + num 480 agreeableness_counter = agreeableness_counter + 1481 elif(m is 'agreeableness_reverse'):482 agreeableness_reverse = agreeableness_reverse + num 483 agreeableness_reverse_counter = agreeableness_reverse_counter + 1484 elif(m is 'openness'):485 openness = openness + num486 openness_counter = openness_counter + 1487 elif(m is 'openness_reverse'):488 openness_reverse = openness_reverse + num489 openness_reverse_counter = openness_reverse_counter + 1490 elif(m is 'conscientiousness'):491 conscientiousness = conscientiousness + num492 conscientiousness_counter = conscientiousness_counter + 1493 elif(m is 'conscientiousness_reverse'):494 conscientiousness_reverse = conscientiousness_reverse + num495 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1496 elif(m is 'extraversion'):497 extraversion = extraversion + num498 extraversion_counter = extraversion_counter + 1499 elif(m is 'extraversion_reverse'):500 extraversion_reverse = extraversion_reverse + num501 extraversion_reverse_counter = extraversion_reverse_counter + 1502 elif(m is 'neuroticism'):503 neuroticism = neuroticism + num504 neuroticism_counter = neuroticism_counter + 1505 else:506 neuroticism_reverse = neuroticism_reverse + num507 neuroticism_reverse_counter = neuroticism_reverse_counter + 1508 q = 'I worry about things.'509 num = int(raw_input(q + '\n'))510 m = dmap[q]511 if(m is 'agreeableness'):512 agreeableness = agreeableness + num 513 agreeableness_counter = agreeableness_counter + 1514 elif(m is 'agreeableness_reverse'):515 agreeableness_reverse = agreeableness_reverse + num 516 agreeableness_reverse_counter = agreeableness_reverse_counter + 1517 elif(m is 'openness'):518 openness = openness + num519 openness_counter = openness_counter + 1520 elif(m is 'openness_reverse'):521 openness_reverse = openness_reverse + num522 openness_reverse_counter = openness_reverse_counter + 1523 elif(m is 'conscientiousness'):524 conscientiousness = conscientiousness + num525 conscientiousness_counter = conscientiousness_counter + 1526 elif(m is 'conscientiousness_reverse'):527 conscientiousness_reverse = conscientiousness_reverse + num528 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1529 elif(m is 'extraversion'):530 extraversion = extraversion + num531 extraversion_counter = extraversion_counter + 1532 elif(m is 'extraversion_reverse'):533 extraversion_reverse = extraversion_reverse + num534 extraversion_reverse_counter = extraversion_reverse_counter + 1535 elif(m is 'neuroticism'):536 neuroticism = neuroticism + num537 neuroticism_counter = neuroticism_counter + 1538 else:539 neuroticism_reverse = neuroticism_reverse + num540 neuroticism_reverse_counter = neuroticism_reverse_counter + 1541 q = 'I have a vivid imagination.'542 num = int(raw_input(q + '\n'))543 m = dmap[q]544 if(m is 'agreeableness'):545 agreeableness = agreeableness + num 546 agreeableness_counter = agreeableness_counter + 1547 elif(m is 'agreeableness_reverse'):548 agreeableness_reverse = agreeableness_reverse + num 549 agreeableness_reverse_counter = agreeableness_reverse_counter + 1550 elif(m is 'openness'):551 openness = openness + num552 openness_counter = openness_counter + 1553 elif(m is 'openness_reverse'):554 openness_reverse = openness_reverse + num555 openness_reverse_counter = openness_reverse_counter + 1556 elif(m is 'conscientiousness'):557 conscientiousness = conscientiousness + num558 conscientiousness_counter = conscientiousness_counter + 1559 elif(m is 'conscientiousness_reverse'):560 conscientiousness_reverse = conscientiousness_reverse + num561 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1562 elif(m is 'extraversion'):563 extraversion = extraversion + num564 extraversion_counter = extraversion_counter + 1565 elif(m is 'extraversion_reverse'):566 extraversion_reverse = extraversion_reverse + num567 extraversion_reverse_counter = extraversion_reverse_counter + 1568 elif(m is 'neuroticism'):569 neuroticism = neuroticism + num570 neuroticism_counter = neuroticism_counter + 1571 else:572 neuroticism_reverse = neuroticism_reverse + num573 neuroticism_reverse_counter = neuroticism_reverse_counter + 1574 q = 'I keep in the background.'575 num = int(raw_input(q + '\n'))576 m = dmap[q]577 if(m is 'agreeableness'):578 agreeableness = agreeableness + num 579 agreeableness_counter = agreeableness_counter + 1580 elif(m is 'agreeableness_reverse'):581 agreeableness_reverse = agreeableness_reverse + num 582 agreeableness_reverse_counter = agreeableness_reverse_counter + 1583 elif(m is 'openness'):584 openness = openness + num585 openness_counter = openness_counter + 1586 elif(m is 'openness_reverse'):587 openness_reverse = openness_reverse + num588 openness_reverse_counter = openness_reverse_counter + 1589 elif(m is 'conscientiousness'):590 conscientiousness = conscientiousness + num591 conscientiousness_counter = conscientiousness_counter + 1592 elif(m is 'conscientiousness_reverse'):593 conscientiousness_reverse = conscientiousness_reverse + num594 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1595 elif(m is 'extraversion'):596 extraversion = extraversion + num597 extraversion_counter = extraversion_counter + 1598 elif(m is 'extraversion_reverse'):599 extraversion_reverse = extraversion_reverse + num600 extraversion_reverse_counter = extraversion_reverse_counter + 1601 elif(m is 'neuroticism'):602 neuroticism = neuroticism + num603 neuroticism_counter = neuroticism_counter + 1604 else:605 neuroticism_reverse = neuroticism_reverse + num606 neuroticism_reverse_counter = neuroticism_reverse_counter + 1607 q = 'I sympathize with others feelings.'608 num = int(raw_input(q + '\n'))609 m = dmap[q]610 if(m is 'agreeableness'):611 agreeableness = agreeableness + num 612 agreeableness_counter = agreeableness_counter + 1613 elif(m is 'agreeableness_reverse'):614 agreeableness_reverse = agreeableness_reverse + num 615 agreeableness_reverse_counter = agreeableness_reverse_counter + 1616 elif(m is 'openness'):617 openness = openness + num618 openness_counter = openness_counter + 1619 elif(m is 'openness_reverse'):620 openness_reverse = openness_reverse + num621 openness_reverse_counter = openness_reverse_counter + 1622 elif(m is 'conscientiousness'):623 conscientiousness = conscientiousness + num624 conscientiousness_counter = conscientiousness_counter + 1625 elif(m is 'conscientiousness_reverse'):626 conscientiousness_reverse = conscientiousness_reverse + num627 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1628 elif(m is 'extraversion'):629 extraversion = extraversion + num630 extraversion_counter = extraversion_counter + 1631 elif(m is 'extraversion_reverse'):632 extraversion_reverse = extraversion_reverse + num633 extraversion_reverse_counter = extraversion_reverse_counter + 1634 elif(m is 'neuroticism'):635 neuroticism = neuroticism + num636 neuroticism_counter = neuroticism_counter + 1637 else:638 neuroticism_reverse = neuroticism_reverse + num639 neuroticism_reverse_counter = neuroticism_reverse_counter + 1640 q = 'I make a mess of things.'641 num = int(raw_input(q + '\n'))642 m = dmap[q]643 if(m is 'agreeableness'):644 agreeableness = agreeableness + num 645 agreeableness_counter = agreeableness_counter + 1646 elif(m is 'agreeableness_reverse'):647 agreeableness_reverse = agreeableness_reverse + num 648 agreeableness_reverse_counter = agreeableness_reverse_counter + 1649 elif(m is 'openness'):650 openness = openness + num651 openness_counter = openness_counter + 1652 elif(m is 'openness_reverse'):653 openness_reverse = openness_reverse + num654 openness_reverse_counter = openness_reverse_counter + 1655 elif(m is 'conscientiousness'):656 conscientiousness = conscientiousness + num657 conscientiousness_counter = conscientiousness_counter + 1658 elif(m is 'conscientiousness_reverse'):659 conscientiousness_reverse = conscientiousness_reverse + num660 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1661 elif(m is 'extraversion'):662 extraversion = extraversion + num663 extraversion_counter = extraversion_counter + 1664 elif(m is 'extraversion_reverse'):665 extraversion_reverse = extraversion_reverse + num666 extraversion_reverse_counter = extraversion_reverse_counter + 1667 elif(m is 'neuroticism'):668 neuroticism = neuroticism + num669 euroticism_counter = neuroticism_counter + 1670 else:671 neuroticism_reverse = neuroticism_reverse + num672 neuroticism_reverse_counter = neuroticism_reverse_counter + 1673 q = 'I seldom feel blue.'674 num = int(raw_input(q + '\n'))675 m = dmap[q]676 if(m is 'agreeableness'):677 agreeableness = agreeableness + num 678 agreeableness_counter = agreeableness_counter + 1679 elif(m is 'agreeableness_reverse'):680 agreeableness_reverse = agreeableness_reverse + num 681 agreeableness_reverse_counter = agreeableness_reverse_counter + 1682 elif(m is 'openness'):683 openness = openness + num684 openness_counter = openness_counter + 1685 elif(m is 'openness_reverse'):686 openness_reverse = openness_reverse + num687 openness_reverse_counter = openness_reverse_counter + 1688 elif(m is 'conscientiousness'):689 conscientiousness = conscientiousness + num690 conscientiousness_counter = conscientiousness_counter + 1691 elif(m is 'conscientiousness_reverse'):692 conscientiousness_reverse = conscientiousness_reverse + num693 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1694 elif(m is 'extraversion'):695 extraversion = extraversion + num696 extraversion_counter = extraversion_counter + 1697 elif(m is 'extraversion_reverse'):698 extraversion_reverse = extraversion_reverse + num699 extraversion_reverse_counter = extraversion_reverse_counter + 1700 elif(m is 'neuroticism'):701 neuroticism = neuroticism + num702 neuroticism_counter = neuroticism_counter + 1703 else:704 neuroticism_reverse = neuroticism_reverse + num705 neuroticism_reverse_counter = neuroticism_reverse_counter + 1706 q = 'I am not interested in abstract ideas.'707 num = int(raw_input(q + '\n'))708 m = dmap[q]709 if(m is 'agreeableness'):710 agreeableness = agreeableness + num 711 agreeableness_counter = agreeableness_counter + 1712 elif(m is 'agreeableness_reverse'):713 agreeableness_reverse = agreeableness_reverse + num 714 agreeableness_reverse_counter = agreeableness_reverse_counter + 1715 elif(m is 'openness'):716 openness = openness + num717 openness_counter = openness_counter + 1718 elif(m is 'openness_reverse'):719 openness_reverse = openness_reverse + num720 openness_reverse_counter = openness_reverse_counter + 1721 elif(m is 'conscientiousness'):722 conscientiousness = conscientiousness + num723 conscientiousness_counter = conscientiousness_counter + 1724 elif(m is 'conscientiousness_reverse'):725 conscientiousness_reverse = conscientiousness_reverse + num726 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1727 elif(m is 'extraversion'):728 extraversion = extraversion + num729 extraversion_counter = extraversion_counter + 1730 elif(m is 'extraversion_reverse'):731 extraversion_reverse = extraversion_reverse + num732 extraversion_reverse_counter = extraversion_reverse_counter + 1733 elif(m is 'neuroticism'):734 neuroticism = neuroticism + num735 neuroticism_counter = neuroticism_counter + 1736 else:737 neuroticism_reverse = neuroticism_reverse + num738 neuroticism_reverse_counter = neuroticism_reverse_counter + 1739 q = 'I start conversations.'740 num = int(raw_input(q + '\n'))741 m = dmap[q]742 if(m is 'agreeableness'):743 agreeableness = agreeableness + num 744 agreeableness_counter = agreeableness_counter + 1745 elif(m is 'agreeableness_reverse'):746 agreeableness_reverse = agreeableness_reverse + num 747 agreeableness_reverse_counter = agreeableness_reverse_counter + 1748 elif(m is 'openness'):749 openness = openness + num750 openness_counter = openness_counter + 1751 elif(m is 'openness_reverse'):752 openness_reverse = openness_reverse + num753 openness_reverse_counter = openness_reverse_counter + 1754 elif(m is 'conscientiousness'):755 conscientiousness = conscientiousness + num756 conscientiousness_counter = conscientiousness_counter + 1757 elif(m is 'conscientiousness_reverse'):758 conscientiousness_reverse = conscientiousness_reverse + num759 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1760 elif(m is 'extraversion'):761 extraversion = extraversion + num762 extraversion_counter = extraversion_counter + 1763 elif(m is 'extraversion_reverse'):764 extraversion_reverse = extraversion_reverse + num765 extraversion_reverse_counter = extraversion_reverse_counter + 1766 elif(m is 'neuroticism'):767 neuroticism = neuroticism + num768 neuroticism_counter = neuroticism_counter + 1769 else:770 neuroticism_reverse = neuroticism_reverse + num771 neuroticism_reverse_counter = neuroticism_reverse_counter + 1772 q = 'I am not interested in other peoples problems.'773 num = int(raw_input(q + '\n'))774 m = dmap[q]775 if(m is 'agreeableness'):776 agreeableness = agreeableness + num 777 agreeableness_counter = agreeableness_counter + 1778 elif(m is 'agreeableness_reverse'):779 agreeableness_reverse = agreeableness_reverse + num 780 agreeableness_reverse_counter = agreeableness_reverse_counter + 1781 elif(m is 'openness'):782 openness = openness + num783 openness_counter = openness_counter + 1784 elif(m is 'openness_reverse'):785 openness_reverse = openness_reverse + num786 openness_reverse_counter = openness_reverse_counter + 1787 elif(m is 'conscientiousness'):788 conscientiousness = conscientiousness + num789 conscientiousness_counter = conscientiousness_counter + 1790 elif(m is 'conscientiousness_reverse'):791 conscientiousness_reverse = conscientiousness_reverse + num792 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1793 elif(m is 'extraversion'):794 extraversion = extraversion + num795 extraversion_counter = extraversion_counter + 1796 elif(m is 'extraversion_reverse'):797 extraversion_reverse = extraversion_reverse + num798 extraversion_reverse_counter = extraversion_reverse_counter + 1799 elif(m is 'neuroticism'):800 neuroticism = neuroticism + num801 neuroticism_counter = neuroticism_counter + 1802 else:803 neuroticism_reverse = neuroticism_reverse + num804 neuroticism_reverse_counter = neuroticism_reverse_counter + 1805 q = 'I get chores done right away.'806 num = int(raw_input(q + '\n'))807 m = dmap[q]808 if(m is 'agreeableness'):809 agreeableness = agreeableness + num 810 agreeableness_counter = agreeableness_counter + 1811 elif(m is 'agreeableness_reverse'):812 agreeableness_reverse = agreeableness_reverse + num 813 agreeableness_reverse_counter = agreeableness_reverse_counter + 1814 elif(m is 'openness'):815 openness = openness + num816 openness_counter = openness_counter + 1817 elif(m is 'openness_reverse'):818 openness_reverse = openness_reverse + num819 openness_reverse_counter = openness_reverse_counter + 1820 elif(m is 'conscientiousness'):821 conscientiousness = conscientiousness + num822 conscientiousness_counter = conscientiousness_counter + 1823 elif(m is 'conscientiousness_reverse'):824 conscientiousness_reverse = conscientiousness_reverse + num825 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1826 elif(m is 'extraversion'):827 extraversion = extraversion + num828 extraversion_counter = extraversion_counter + 1829 elif(m is 'extraversion_reverse'):830 extraversion_reverse = extraversion_reverse + num831 extraversion_reverse_counter = extraversion_reverse_counter + 1832 elif(m is 'neuroticism'):833 neuroticism = neuroticism + num834 neuroticism_counter = neuroticism_counter + 1835 else:836 neuroticism_reverse = neuroticism_reverse + num837 neuroticism_reverse_counter = neuroticism_reverse_counter + 1838 q = 'I am easily disturbed.'839 num = int(raw_input(q + '\n'))840 m = dmap[q]841 if(m is 'agreeableness'):842 agreeableness = agreeableness + num 843 agreeableness_counter = agreeableness_counter + 1844 elif(m is 'agreeableness_reverse'):845 agreeableness_reverse = agreeableness_reverse + num 846 agreeableness_reverse_counter = agreeableness_reverse_counter + 1847 elif(m is 'openness'):848 openness = openness + num849 openness_counter = openness_counter + 1850 elif(m is 'openness_reverse'):851 openness_reverse = openness_reverse + num852 openness_reverse_counter = openness_reverse_counter + 1853 elif(m is 'conscientiousness'):854 conscientiousness = conscientiousness + num855 conscientiousness_counter = conscientiousness_counter + 1856 elif(m is 'conscientiousness_reverse'):857 conscientiousness_reverse = conscientiousness_reverse + num858 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1859 elif(m is 'extraversion'):860 extraversion = extraversion + num861 extraversion_counter = extraversion_counter + 1862 elif(m is 'extraversion_reverse'):863 extraversion_reverse = extraversion_reverse + num864 extraversion_reverse_counter = extraversion_reverse_counter + 1865 elif(m is 'neuroticism'):866 neuroticism = neuroticism + num867 neuroticism_counter = neuroticism_counter + 1868 else:869 neuroticism_reverse = neuroticism_reverse + num870 neuroticism_reverse_counter = neuroticism_reverse_counter + 1871 q = 'I have excellent ideas.'872 num = int(raw_input(q + '\n'))873 m = dmap[q]874 if(m is 'agreeableness'):875 agreeableness = agreeableness + num 876 agreeableness_counter = agreeableness_counter + 1877 elif(m is 'agreeableness_reverse'):878 agreeableness_reverse = agreeableness_reverse + num 879 agreeableness_reverse_counter = agreeableness_reverse_counter + 1880 elif(m is 'openness'):881 openness = openness + num882 openness_counter = openness_counter + 1883 elif(m is 'openness_reverse'):884 openness_reverse = openness_reverse + num885 openness_reverse_counter = openness_reverse_counter + 1886 elif(m is 'conscientiousness'):887 conscientiousness = conscientiousness + num888 conscientiousness_counter = conscientiousness_counter + 1889 elif(m is 'conscientiousness_reverse'):890 conscientiousness_reverse = conscientiousness_reverse + num891 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1892 elif(m is 'extraversion'):893 extraversion = extraversion + num894 extraversion_counter = extraversion_counter + 1895 elif(m is 'extraversion_reverse'):896 extraversion_reverse = extraversion_reverse + num897 extraversion_reverse_counter = extraversion_reverse_counter + 1898 elif(m is 'neuroticism'):899 neuroticism = neuroticism + num900 neuroticism_counter = neuroticism_counter + 1901 else:902 neuroticism_reverse = neuroticism_reverse + num903 neuroticism_reverse_counter = neuroticism_reverse_counter + 1904 q = 'I have little to say.'905 num = int(raw_input(q + '\n'))906 m = dmap[q]907 if(m is 'agreeableness'):908 agreeableness = agreeableness + num 909 agreeableness_counter = agreeableness_counter + 1910 elif(m is 'agreeableness_reverse'):911 agreeableness_reverse = agreeableness_reverse + num 912 agreeableness_reverse_counter = agreeableness_reverse_counter + 1913 elif(m is 'openness'):914 openness = openness + num915 openness_counter = openness_counter + 1916 elif(m is 'openness_reverse'):917 openness_reverse = openness_reverse + num918 openness_reverse_counter = openness_reverse_counter + 1919 elif(m is 'conscientiousness'):920 conscientiousness = conscientiousness + num921 conscientiousness_counter = conscientiousness_counter + 1922 elif(m is 'conscientiousness_reverse'):923 conscientiousness_reverse = conscientiousness_reverse + num924 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1925 elif(m is 'extraversion'):926 extraversion = extraversion + num927 extraversion_counter = extraversion_counter + 1928 elif(m is 'extraversion_reverse'):929 extraversion_reverse = extraversion_reverse + num930 extraversion_reverse_counter = extraversion_reverse_counter + 1931 elif(m is 'neuroticism'):932 neuroticism = neuroticism + num933 neuroticism_counter = neuroticism_counter + 1934 else:935 neuroticism_reverse = neuroticism_reverse + num936 neuroticism_reverse_counter = neuroticism_reverse_counter + 1937 q = 'I have a soft heart.'938 num = int(raw_input(q + '\n'))939 m = dmap[q]940 if(m is 'agreeableness'):941 agreeableness = agreeableness + num 942 agreeableness_counter = agreeableness_counter + 1943 elif(m is 'agreeableness_reverse'):944 agreeableness_reverse = agreeableness_reverse + num 945 agreeableness_reverse_counter = agreeableness_reverse_counter + 1946 elif(m is 'openness'):947 openness = openness + num948 openness_counter = openness_counter + 1949 elif(m is 'openness_reverse'):950 openness_reverse = openness_reverse + num951 openness_reverse_counter = openness_reverse_counter + 1952 elif(m is 'conscientiousness'):953 conscientiousness = conscientiousness + num954 conscientiousness_counter = conscientiousness_counter + 1955 elif(m is 'conscientiousness_reverse'):956 conscientiousness_reverse = conscientiousness_reverse + num957 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1958 elif(m is 'extraversion'):959 extraversion = extraversion + num960 extraversion_counter = extraversion_counter + 1961 elif(m is 'extraversion_reverse'):962 extraversion_reverse = extraversion_reverse + num963 extraversion_reverse_counter = extraversion_reverse_counter + 1964 elif(m is 'neuroticism'):965 neuroticism = neuroticism + num966 neuroticism_counter = neuroticism_counter + 1967 else:968 neuroticism_reverse = neuroticism_reverse + num969 neuroticism_reverse_counter = neuroticism_reverse_counter + 1970 q = 'I often forget to put things back in their proper place.'971 num = int(raw_input(q + '\n'))972 m = dmap[q]973 if(m is 'agreeableness'):974 agreeableness = agreeableness + num 975 agreeableness_counter = agreeableness_counter + 1976 elif(m is 'agreeableness_reverse'):977 agreeableness_reverse = agreeableness_reverse + num 978 agreeableness_reverse_counter = agreeableness_reverse_counter + 1979 elif(m is 'openness'):980 openness = openness + num981 openness_counter = openness_counter + 1982 elif(m is 'openness_reverse'):983 openness_reverse = openness_reverse + num984 openness_reverse_counter = openness_reverse_counter + 1985 elif(m is 'conscientiousness'):986 conscientiousness = conscientiousness + num987 conscientiousness_counter = conscientiousness_counter + 1988 elif(m is 'conscientiousness_reverse'):989 conscientiousness_reverse = conscientiousness_reverse + num990 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 1991 elif(m is 'extraversion'):992 extraversion = extraversion + num993 extraversion_counter = extraversion_counter + 1994 elif(m is 'extraversion_reverse'):995 extraversion_reverse = extraversion_reverse + num996 extraversion_reverse_counter = extraversion_reverse_counter + 1997 elif(m is 'neuroticism'):998 neuroticism = neuroticism + num999 neuroticism_counter = neuroticism_counter + 11000 else:1001 neuroticism_reverse = neuroticism_reverse + num1002 neuroticism_reverse_counter = neuroticism_reverse_counter + 11003 q = 'I get upset easily.'1004 num = int(raw_input(q + '\n'))1005 m = dmap[q]1006 if(m is 'agreeableness'):1007 agreeableness = agreeableness + num 1008 agreeableness_counter = agreeableness_counter + 11009 elif(m is 'agreeableness_reverse'):1010 agreeableness_reverse = agreeableness_reverse + num 1011 agreeableness_reverse_counter = agreeableness_reverse_counter + 11012 elif(m is 'openness'):1013 openness = openness + num1014 openness_counter = openness_counter + 11015 elif(m is 'openness_reverse'):1016 openness_reverse = openness_reverse + num1017 openness_reverse_counter = openness_reverse_counter + 11018 elif(m is 'conscientiousness'):1019 conscientiousness = conscientiousness + num1020 conscientiousness_counter = conscientiousness_counter + 11021 elif(m is 'conscientiousness_reverse'):1022 conscientiousness_reverse = conscientiousness_reverse + num1023 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11024 elif(m is 'extraversion'):1025 extraversion = extraversion + num1026 extraversion_counter = extraversion_counter + 11027 elif(m is 'extraversion_reverse'):1028 extraversion_reverse = extraversion_reverse + num1029 extraversion_reverse_counter = extraversion_reverse_counter + 11030 elif(m is 'neuroticism'):1031 neuroticism = neuroticism + num1032 neuroticism_counter = neuroticism_counter + 11033 else:1034 neuroticism_reverse = neuroticism_reverse + num1035 neuroticism_reverse_counter = neuroticism_reverse_counter + 11036 q = 'I do not have a good imagination.'1037 num = int(raw_input(q + '\n'))1038 m = dmap[q]1039 if(m is 'agreeableness'):1040 agreeableness = agreeableness + num 1041 agreeableness_counter = agreeableness_counter + 11042 elif(m is 'agreeableness_reverse'):1043 agreeableness_reverse = agreeableness_reverse + num 1044 agreeableness_reverse_counter = agreeableness_reverse_counter + 11045 elif(m is 'openness'):1046 openness = openness + num1047 openness_counter = openness_counter + 11048 elif(m is 'openness_reverse'):1049 openness_reverse = openness_reverse + num1050 openness_reverse_counter = openness_reverse_counter + 11051 elif(m is 'conscientiousness'):1052 conscientiousness = conscientiousness + num1053 conscientiousness_counter = conscientiousness_counter + 11054 elif(m is 'conscientiousness_reverse'):1055 conscientiousness_reverse = conscientiousness_reverse + num1056 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11057 elif(m is 'extraversion'):1058 extraversion = extraversion + num1059 extraversion_counter = extraversion_counter + 11060 elif(m is 'extraversion_reverse'):1061 extraversion_reverse = extraversion_reverse + num1062 extraversion_reverse_counter = extraversion_reverse_counter + 11063 elif(m is 'neuroticism'):1064 neuroticism = neuroticism + num1065 neuroticism_counter = neuroticism_counter + 11066 else:1067 neuroticism_reverse = neuroticism_reverse + num1068 neuroticism_reverse_counter = neuroticism_reverse_counter + 11069 q = 'I talk to a lot of different people at parties.'1070 num = int(raw_input(q + '\n'))1071 m = dmap[q]1072 if(m is 'agreeableness'):1073 agreeableness = agreeableness + num 1074 agreeableness_counter = agreeableness_counter + 11075 elif(m is 'agreeableness_reverse'):1076 agreeableness_reverse = agreeableness_reverse + num 1077 agreeableness_reverse_counter = agreeableness_reverse_counter + 11078 elif(m is 'openness'):1079 openness = openness + num1080 openness_counter = openness_counter + 11081 elif(m is 'openness_reverse'):1082 openness_reverse = openness_reverse + num1083 openness_reverse_counter = openness_reverse_counter + 11084 elif(m is 'conscientiousness'):1085 conscientiousness = conscientiousness + num1086 conscientiousness_counter = conscientiousness_counter + 11087 elif(m is 'conscientiousness_reverse'):1088 conscientiousness_reverse = conscientiousness_reverse + num1089 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11090 elif(m is 'extraversion'):1091 extraversion = extraversion + num1092 extraversion_counter = extraversion_counter + 11093 elif(m is 'extraversion_reverse'):1094 extraversion_reverse = extraversion_reverse + num1095 extraversion_reverse_counter = extraversion_reverse_counter + 11096 elif(m is 'neuroticism'):1097 neuroticism = neuroticism + num1098 neuroticism_counter = neuroticism_counter + 11099 else:1100 neuroticism_reverse = neuroticism_reverse + num1101 neuroticism_reverse_counter = neuroticism_reverse_counter + 11102 q = 'I am not really interested in others.'1103 num = int(raw_input(q + '\n'))1104 m = dmap[q]1105 if(m is 'agreeableness'):1106 agreeableness = agreeableness + num1107 agreeableness_counter = agreeableness_counter + 11108 elif(m is 'agreeableness_reverse'):1109 agreeableness_reverse = agreeableness_reverse + num1110 agreeableness_reverse_counter = agreeableness_reverse_counter + 11111 elif(m is 'openness'):1112 openness = openness + num1113 openness_counter = openness_counter + 11114 elif(m is 'openness_reverse'):1115 openness_reverse = openness_reverse + num1116 openness_reverse_counter = openness_reverse_counter + 11117 elif(m is 'conscientiousness'):1118 conscientiousness = conscientiousness + num1119 conscientiousness_counter = conscientiousness_counter + 11120 elif(m is 'conscientiousness_reverse'):1121 conscientiousness_reverse = conscientiousness_reverse + num1122 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11123 elif(m is 'extraversion'):1124 extraversion = extraversion + num1125 extraversion_counter = extraversion_counter + 11126 elif(m is 'extraversion_reverse'):1127 extraversion_reverse = extraversion_reverse + num1128 extraversion_reverse_counter = extraversion_reverse_counter + 11129 elif(m is 'neuroticism'):1130 neuroticism = neuroticism + num1131 neuroticism_counter = neuroticism_counter + 11132 else:1133 neuroticism_reverse = neuroticism_reverse + num1134 neuroticism_reverse_counter = neuroticism_reverse_counter + 11135 q = 'I like order.'1136 num = int(raw_input(q + '\n'))1137 m = dmap[q]1138 if(m is 'agreeableness'):1139 agreeableness = agreeableness + num1140 agreeableness_counter = agreeableness_counter + 11141 elif(m is 'agreeableness_reverse'):1142 agreeableness_reverse = agreeableness_reverse + num1143 agreeableness_reverse_counter = agreeableness_reverse_counter + 11144 elif(m is 'openness'):1145 openness = openness + num1146 openness_counter = openness_counter + 11147 elif(m is 'openness_reverse'):1148 openness_reverse = openness_reverse + num1149 openness_reverse_counter = openness_reverse_counter + 11150 elif(m is 'conscientiousness'):1151 conscientiousness = conscientiousness + num1152 conscientiousness_counter = conscientiousness_counter + 11153 elif(m is 'conscientiousness_reverse'):1154 conscientiousness_reverse = conscientiousness_reverse + num1155 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11156 elif(m is 'extraversion'):1157 extraversion = extraversion + num1158 extraversion_counter = extraversion_counter + 11159 elif(m is 'extraversion_reverse'):1160 extraversion_reverse = extraversion_reverse + num1161 extraversion_reverse_counter = extraversion_reverse_counter + 11162 elif(m is 'neuroticism'):1163 neuroticism = neuroticism + num1164 neuroticism_counter = neuroticism_counter + 11165 else:1166 neuroticism_reverse = neuroticism_reverse + num1167 neuroticism_reverse_counter = neuroticism_reverse_counter + 11168 q = 'I change my mood a lot.'1169 num = int(raw_input(q + '\n'))1170 m = dmap[q]1171 if(m is 'agreeableness'):1172 agreeableness = agreeableness + num1173 agreeableness_counter = agreeableness_counter + 11174 elif(m is 'agreeableness_reverse'):1175 agreeableness_reverse = agreeableness_reverse + num1176 agreeableness_reverse_counter = agreeableness_reverse_counter + 11177 elif(m is 'openness'):1178 openness = openness + num1179 openness_counter = openness_counter + 11180 elif(m is 'openness_reverse'):1181 openness_reverse = openness_reverse + num1182 openness_reverse_counter = openness_reverse_counter + 11183 elif(m is 'conscientiousness'):1184 conscientiousness = conscientiousness + num1185 conscientiousness_counter = conscientiousness_counter + 11186 elif(m is 'conscientiousness_reverse'):1187 conscientiousness_reverse = conscientiousness_reverse + num1188 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11189 elif(m is 'extraversion'):1190 extraversion = extraversion + num1191 extraversion_counter = extraversion_counter + 11192 elif(m is 'extraversion_reverse'):1193 extraversion_reverse = extraversion_reverse + num1194 extraversion_reverse_counter = extraversion_reverse_counter + 11195 elif(m is 'neuroticism'):1196 neuroticism = neuroticism + num1197 neuroticism_counter = neuroticism_counter + 11198 else:1199 neuroticism_reverse = neuroticism_reverse + num1200 neuroticism_reverse_counter = neuroticism_reverse_counter + 11201 q = 'I am quick to understand things.'1202 num = int(raw_input(q + '\n'))1203 m = dmap[q]1204 if(m is 'agreeableness'):1205 agreeableness = agreeableness + num1206 agreeableness_counter = agreeableness_counter + 11207 elif(m is 'agreeableness_reverse'):1208 agreeableness_reverse = agreeableness_reverse + num1209 agreeableness_reverse_counter = agreeableness_reverse_counter + 11210 elif(m is 'openness'):1211 openness = openness + num1212 openness_counter = openness_counter + 11213 elif(m is 'openness_reverse'):1214 openness_reverse = openness_reverse + num1215 openness_reverse_counter = openness_reverse_counter + 11216 elif(m is 'conscientiousness'):1217 conscientiousness = conscientiousness + num1218 conscientiousness_counter = conscientiousness_counter + 11219 elif(m is 'conscientiousness_reverse'):1220 conscientiousness_reverse = conscientiousness_reverse + num1221 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11222 elif(m is 'extraversion'):1223 extraversion = extraversion + num1224 extraversion_counter = extraversion_counter + 11225 elif(m is 'extraversion_reverse'):1226 extraversion_reverse = extraversion_reverse + num1227 extraversion_reverse_counter = extraversion_reverse_counter + 11228 elif(m is 'neuroticism'):1229 neuroticism = neuroticism + num1230 neuroticism_counter = neuroticism_counter + 11231 else:1232 neuroticism_reverse = neuroticism_reverse + num1233 neuroticism_reverse_counter = neuroticism_reverse_counter + 11234 q = 'I do not like to draw attention to myself.'1235 num = int(raw_input(q + '\n'))1236 m = dmap[q]1237 if(m is 'agreeableness'):1238 agreeableness = agreeableness + num1239 agreeableness_counter = agreeableness_counter + 11240 elif(m is 'agreeableness_reverse'):1241 agreeableness_reverse = agreeableness_reverse + num1242 agreeableness_reverse_counter = agreeableness_reverse_counter + 11243 elif(m is 'openness'):1244 openness = openness + num1245 openness_counter = openness_counter + 11246 elif(m is 'openness_reverse'):1247 openness_reverse = openness_reverse + num1248 openness_reverse_counter = openness_reverse_counter + 11249 elif(m is 'conscientiousness'):1250 conscientiousness = conscientiousness + num1251 conscientiousness_counter = conscientiousness_counter + 11252 elif(m is 'conscientiousness_reverse'):1253 conscientiousness_reverse = conscientiousness_reverse + num1254 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11255 elif(m is 'extraversion'):1256 extraversion = extraversion + num1257 extraversion_counter = extraversion_counter + 11258 elif(m is 'extraversion_reverse'):1259 extraversion_reverse = extraversion_reverse + num1260 extraversion_reverse_counter = extraversion_reverse_counter + 11261 elif(m is 'neuroticism'):1262 neuroticism = neuroticism + num1263 neuroticism_counter = neuroticism_counter + 11264 else:1265 neuroticism_reverse = neuroticism_reverse + num1266 neuroticism_reverse_counter = neuroticism_reverse_counter + 11267 q = 'I take time out for others.'1268 num = int(raw_input(q + '\n'))1269 m = dmap[q]1270 if(m is 'agreeableness'):1271 agreeableness = agreeableness + num1272 agreeableness_counter = agreeableness_counter + 11273 elif(m is 'agreeableness_reverse'):1274 agreeableness_reverse = agreeableness_reverse + num1275 agreeableness_reverse_counter = agreeableness_reverse_counter + 11276 elif(m is 'openness'):1277 openness = openness + num1278 openness_counter = openness_counter + 11279 elif(m is 'openness_reverse'):1280 openness_reverse = openness_reverse + num1281 openness_reverse_counter = openness_reverse_counter + 11282 elif(m is 'conscientiousness'):1283 conscientiousness = conscientiousness + num1284 conscientiousness_counter = conscientiousness_counter + 11285 elif(m is 'conscientiousness_reverse'):1286 conscientiousness_reverse = conscientiousness_reverse + num1287 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11288 elif(m is 'extraversion'):1289 extraversion = extraversion + num1290 extraversion_counter = extraversion_counter + 11291 elif(m is 'extraversion_reverse'):1292 extraversion_reverse = extraversion_reverse + num1293 extraversion_reverse_counter = extraversion_reverse_counter + 11294 elif(m is 'neuroticism'):1295 neuroticism = neuroticism + num1296 neuroticism_counter = neuroticism_counter + 11297 else:1298 neuroticism_reverse = neuroticism_reverse + num1299 neuroticism_reverse_counter = neuroticism_reverse_counter + 11300 q = 'I shirk my duties.'1301 num = int(raw_input(q + '\n'))1302 m = dmap[q]1303 if(m is 'agreeableness'):1304 agreeableness = agreeableness + num1305 agreeableness_counter = agreeableness_counter + 11306 elif(m is 'agreeableness_reverse'):1307 agreeableness_reverse = agreeableness_reverse + num1308 agreeableness_reverse_counter = agreeableness_reverse_counter + 11309 elif(m is 'openness'):1310 openness = openness + num1311 openness_counter = openness_counter + 11312 elif(m is 'openness_reverse'):1313 openness_reverse = openness_reverse + num1314 openness_reverse_counter = openness_reverse_counter + 11315 elif(m is 'conscientiousness'):1316 conscientiousness = conscientiousness + num1317 conscientiousness_counter = conscientiousness_counter + 11318 elif(m is 'conscientiousness_reverse'):1319 conscientiousness_reverse = conscientiousness_reverse + num1320 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11321 elif(m is 'extraversion'):1322 extraversion = extraversion + num1323 extraversion_counter = extraversion_counter + 11324 elif(m is 'extraversion_reverse'):1325 extraversion_reverse = extraversion_reverse + num1326 extraversion_reverse_counter = extraversion_reverse_counter + 11327 elif(m is 'neuroticism'):1328 neuroticism = neuroticism + num1329 neuroticism_counter = neuroticism_counter + 11330 else:1331 neuroticism_reverse = neuroticism_reverse + num1332 neuroticism_reverse_counter = neuroticism_reverse_counter + 11333 q = 'I have frequent mood swings.'1334 num = int(raw_input(q + '\n'))1335 m = dmap[q]1336 if(m is 'agreeableness'):1337 agreeableness = agreeableness + num1338 agreeableness_counter = agreeableness_counter + 11339 elif(m is 'agreeableness_reverse'):1340 agreeableness_reverse = agreeableness_reverse + num1341 agreeableness_reverse_counter = agreeableness_reverse_counter + 11342 elif(m is 'openness'):1343 openness = openness + num1344 openness_counter = openness_counter + 11345 elif(m is 'openness_reverse'):1346 openness_reverse = openness_reverse + num1347 openness_reverse_counter = openness_reverse_counter + 11348 elif(m is 'conscientiousness'):1349 conscientiousness = conscientiousness + num1350 conscientiousness_counter = conscientiousness_counter + 11351 elif(m is 'conscientiousness_reverse'):1352 conscientiousness_reverse = conscientiousness_reverse + num1353 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11354 elif(m is 'extraversion'):1355 extraversion = extraversion + num1356 extraversion_counter = extraversion_counter + 11357 elif(m is 'extraversion_reverse'):1358 extraversion_reverse = extraversion_reverse + num1359 extraversion_reverse_counter = extraversion_reverse_counter + 11360 elif(m is 'neuroticism'):1361 neuroticism = neuroticism + num1362 neuroticism_counter = neuroticism_counter + 11363 else:1364 neuroticism_reverse = neuroticism_reverse + num1365 neuroticism_reverse_counter = neuroticism_reverse_counter + 11366 q = 'I use difficult words.'1367 num = int(raw_input(q + '\n'))1368 m = dmap[q]1369 if(m is 'agreeableness'):1370 agreeableness = agreeableness + num1371 agreeableness_counter = agreeableness_counter + 11372 elif(m is 'agreeableness_reverse'):1373 agreeableness_reverse = agreeableness_reverse + num1374 agreeableness_reverse_counter = agreeableness_reverse_counter + 11375 elif(m is 'openness'):1376 openness = openness + num1377 openness_counter = openness_counter + 11378 elif(m is 'openness_reverse'):1379 openness_reverse = openness_reverse + num1380 openness_reverse_counter = openness_reverse_counter + 11381 elif(m is 'conscientiousness'):1382 conscientiousness = conscientiousness + num1383 conscientiousness_counter = conscientiousness_counter + 11384 elif(m is 'conscientiousness_reverse'):1385 conscientiousness_reverse = conscientiousness_reverse + num1386 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11387 elif(m is 'extraversion'):1388 extraversion = extraversion + num1389 extraversion_counter = extraversion_counter + 11390 elif(m is 'extraversion_reverse'):1391 extraversion_reverse = extraversion_reverse + num1392 extraversion_reverse_counter = extraversion_reverse_counter + 11393 elif(m is 'neuroticism'):1394 neuroticism = neuroticism + num1395 neuroticism_counter = neuroticism_counter + 11396 else:1397 neuroticism_reverse = neuroticism_reverse + num1398 neuroticism_reverse_counter = neuroticism_reverse_counter + 11399 q = 'I do not mind being the center of attention.'1400 num = int(raw_input(q + '\n'))1401 m = dmap[q]1402 if(m is 'agreeableness'):1403 agreeableness = agreeableness + num1404 agreeableness_counter = agreeableness_counter + 11405 elif(m is 'agreeableness_reverse'):1406 agreeableness_reverse = agreeableness_reverse + num1407 agreeableness_reverse_counter = agreeableness_reverse_counter + 11408 elif(m is 'openness'):1409 openness = openness + num1410 openness_counter = openness_counter + 11411 elif(m is 'openness_reverse'):1412 openness_reverse = openness_reverse + num1413 openness_reverse_counter = openness_reverse_counter + 11414 elif(m is 'conscientiousness'):1415 conscientiousness = conscientiousness + num1416 conscientiousness_counter = conscientiousness_counter + 11417 elif(m is 'conscientiousness_reverse'):1418 conscientiousness_reverse = conscientiousness_reverse + num1419 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11420 elif(m is 'extraversion'):1421 extraversion = extraversion + num1422 extraversion_counter = extraversion_counter + 11423 elif(m is 'extraversion_reverse'):1424 extraversion_reverse = extraversion_reverse + num1425 extraversion_reverse_counter = extraversion_reverse_counter + 11426 elif(m is 'neuroticism'):1427 neuroticism = neuroticism + num1428 neuroticism_counter = neuroticism_counter + 11429 else:1430 neuroticism_reverse = neuroticism_reverse + num1431 neuroticism_reverse_counter = neuroticism_reverse_counter + 11432 q = 'I feel others emotions.'1433 num = int(raw_input(q + '\n'))1434 m = dmap[q]1435 if(m is 'agreeableness'):1436 agreeableness = agreeableness + num1437 agreeableness_counter = agreeableness_counter + 11438 elif(m is 'agreeableness_reverse'):1439 agreeableness_reverse = agreeableness_reverse + num1440 agreeableness_reverse_counter = agreeableness_reverse_counter + 11441 elif(m is 'openness'):1442 openness = openness + num1443 openness_counter = openness_counter + 11444 elif(m is 'openness_reverse'):1445 openness_reverse = openness_reverse + num1446 openness_reverse_counter = openness_reverse_counter + 11447 elif(m is 'conscientiousness'):1448 conscientiousness = conscientiousness + num1449 conscientiousness_counter = conscientiousness_counter + 11450 elif(m is 'conscientiousness_reverse'):1451 conscientiousness_reverse = conscientiousness_reverse + num1452 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11453 elif(m is 'extraversion'):1454 extraversion = extraversion + num1455 extraversion_counter = extraversion_counter + 11456 elif(m is 'extraversion_reverse'):1457 extraversion_reverse = extraversion_reverse + num1458 extraversion_reverse_counter = extraversion_reverse_counter + 11459 elif(m is 'neuroticism'):1460 neuroticism = neuroticism + num1461 neuroticism_counter = neuroticism_counter + 11462 else:1463 neuroticism_reverse = neuroticism_reverse + num1464 neuroticism_reverse_counter = neuroticism_reverse_counter + 11465 q = 'I follow a schedule.'1466 num = int(raw_input(q + '\n'))1467 m = dmap[q]1468 if(m is 'agreeableness'):1469 agreeableness = agreeableness + num1470 agreeableness_counter = agreeableness_counter + 11471 elif(m is 'agreeableness_reverse'):1472 agreeableness_reverse = agreeableness_reverse + num1473 agreeableness_reverse_counter = agreeableness_reverse_counter + 11474 elif(m is 'openness'):1475 openness = openness + num1476 openness_counter = openness_counter + 11477 elif(m is 'openness_reverse'):1478 openness_reverse = openness_reverse + num1479 openness_reverse_counter = openness_reverse_counter + 11480 elif(m is 'conscientiousness'):1481 conscientiousness = conscientiousness + num1482 conscientiousness_counter = conscientiousness_counter + 11483 elif(m is 'conscientiousness_reverse'):1484 conscientiousness_reverse = conscientiousness_reverse + num1485 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11486 elif(m is 'extraversion'):1487 extraversion = extraversion + num1488 extraversion_counter = extraversion_counter + 11489 elif(m is 'extraversion_reverse'):1490 extraversion_reverse = extraversion_reverse + num1491 extraversion_reverse_counter = extraversion_reverse_counter + 11492 elif(m is 'neuroticism'):1493 neuroticism = neuroticism + num1494 neuroticism_counter = neuroticism_counter + 11495 else:1496 neuroticism_reverse = neuroticism_reverse + num1497 neuroticism_reverse_counter = neuroticism_reverse_counter + 11498 q = 'I get irritated easily.'1499 num = int(raw_input(q + '\n'))1500 m = dmap[q]1501 if(m is 'agreeableness'):1502 agreeableness = agreeableness + num1503 agreeableness_counter = agreeableness_counter + 11504 elif(m is 'agreeableness_reverse'):1505 agreeableness_reverse = agreeableness_reverse + num1506 agreeableness_reverse_counter = agreeableness_reverse_counter + 11507 elif(m is 'openness'):1508 openness = openness + num1509 openness_counter = openness_counter + 11510 elif(m is 'openness_reverse'):1511 openness_reverse = openness_reverse + num1512 openness_reverse_counter = openness_reverse_counter + 11513 elif(m is 'conscientiousness'):1514 conscientiousness = conscientiousness + num1515 conscientiousness_counter = conscientiousness_counter + 11516 elif(m is 'conscientiousness_reverse'):1517 conscientiousness_reverse = conscientiousness_reverse + num1518 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11519 elif(m is 'extraversion'):1520 extraversion = extraversion + num1521 extraversion_counter = extraversion_counter + 11522 elif(m is 'extraversion_reverse'):1523 extraversion_reverse = extraversion_reverse + num1524 extraversion_reverse_counter = extraversion_reverse_counter + 11525 elif(m is 'neuroticism'):1526 neuroticism = neuroticism + num1527 neuroticism_counter = neuroticism_counter + 11528 else:1529 neuroticism_reverse = neuroticism_reverse + num1530 neuroticism_reverse_counter = neuroticism_reverse_counter + 11531 q = 'I spend time reflecting on things.'1532 num = int(raw_input(q + '\n'))1533 m = dmap[q]1534 if(m is 'agreeableness'):1535 agreeableness = agreeableness + num1536 agreeableness_counter = agreeableness_counter + 11537 elif(m is 'agreeableness_reverse'):1538 agreeableness_reverse = agreeableness_reverse + num1539 agreeableness_reverse_counter = agreeableness_reverse_counter + 11540 elif(m is 'openness'):1541 openness = openness + num1542 openness_counter = openness_counter + 11543 elif(m is 'openness_reverse'):1544 openness_reverse = openness_reverse + num1545 openness_reverse_counter = openness_reverse_counter + 11546 elif(m is 'conscientiousness'):1547 conscientiousness = conscientiousness + num1548 conscientiousness_counter = conscientiousness_counter + 11549 elif(m is 'conscientiousness_reverse'):1550 conscientiousness_reverse = conscientiousness_reverse + num1551 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11552 elif(m is 'extraversion'):1553 extraversion = extraversion + num1554 extraversion_counter = extraversion_counter + 11555 elif(m is 'extraversion_reverse'):1556 extraversion_reverse = extraversion_reverse + num1557 extraversion_reverse_counter = extraversion_reverse_counter + 11558 elif(m is 'neuroticism'):1559 neuroticism = neuroticism + num1560 neuroticism_counter = neuroticism_counter + 11561 else:1562 neuroticism_reverse = neuroticism_reverse + num1563 neuroticism_reverse_counter = neuroticism_reverse_counter + 11564 q = 'I am quiet around strangers.'1565 num = int(raw_input(q + '\n'))1566 m = dmap[q]1567 if(m is 'agreeableness'):1568 agreeableness = agreeableness + num1569 agreeableness_counter = agreeableness_counter + 11570 elif(m is 'agreeableness_reverse'):1571 agreeableness_reverse = agreeableness_reverse + num1572 agreeableness_reverse_counter = agreeableness_reverse_counter + 11573 elif(m is 'openness'):1574 openness = openness + num1575 openness_counter = openness_counter + 11576 elif(m is 'openness_reverse'):1577 openness_reverse = openness_reverse + num1578 openness_reverse_counter = openness_reverse_counter + 11579 elif(m is 'conscientiousness'):1580 conscientiousness = conscientiousness + num1581 conscientiousness_counter = conscientiousness_counter + 11582 elif(m is 'conscientiousness_reverse'):1583 conscientiousness_reverse = conscientiousness_reverse + num1584 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11585 elif(m is 'extraversion'):1586 extraversion = extraversion + num1587 extraversion_counter = extraversion_counter + 11588 elif(m is 'extraversion_reverse'):1589 extraversion_reverse = extraversion_reverse + num1590 extraversion_reverse_counter = extraversion_reverse_counter + 11591 elif(m is 'neuroticism'):1592 neuroticism = neuroticism + num1593 neuroticism_counter = neuroticism_counter + 11594 else:1595 neuroticism_reverse = neuroticism_reverse + num1596 neuroticism_reverse_counter = neuroticism_reverse_counter + 11597 q = 'I make people feel at ease.'1598 num = int(raw_input(q + '\n'))1599 m = dmap[q]1600 if(m is 'agreeableness'):1601 agreeableness = agreeableness + num1602 agreeableness_counter = agreeableness_counter + 11603 elif(m is 'agreeableness_reverse'):1604 agreeableness_reverse = agreeableness_reverse + num1605 agreeableness_reverse_counter = agreeableness_reverse_counter + 11606 elif(m is 'openness'):1607 openness = openness + num1608 openness_counter = openness_counter + 11609 elif(m is 'openness_reverse'):1610 openness_reverse = openness_reverse + num1611 openness_reverse_counter = openness_reverse_counter + 11612 elif(m is 'conscientiousness'):1613 conscientiousness = conscientiousness + num1614 conscientiousness_counter = conscientiousness_counter + 11615 elif(m is 'conscientiousness_reverse'):1616 conscientiousness_reverse = conscientiousness_reverse + num1617 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11618 elif(m is 'extraversion'):1619 extraversion = extraversion + num1620 extraversion_counter = extraversion_counter + 11621 elif(m is 'extraversion_reverse'):1622 extraversion_reverse = extraversion_reverse + num1623 extraversion_reverse_counter = extraversion_reverse_counter + 11624 elif(m is 'neuroticism'):1625 neuroticism = neuroticism + num1626 neuroticism_counter = neuroticism_counter + 11627 else:1628 neuroticism_reverse = neuroticism_reverse + num1629 neuroticism_reverse_counter = neuroticism_reverse_counter + 11630 q = 'I am exacting in my work.'1631 num = int(raw_input(q + '\n'))1632 m = dmap[q]1633 if(m is 'agreeableness'):1634 agreeableness = agreeableness + num1635 agreeableness_counter = agreeableness_counter + 11636 elif(m is 'agreeableness_reverse'):1637 agreeableness_reverse = agreeableness_reverse + num1638 agreeableness_reverse_counter = agreeableness_reverse_counter + 11639 elif(m is 'openness'):1640 openness = openness + num1641 openness_counter = openness_counter + 11642 elif(m is 'openness_reverse'):1643 openness_reverse = openness_reverse + num1644 openness_reverse_counter = openness_reverse_counter + 11645 elif(m is 'conscientiousness'):1646 conscientiousness = conscientiousness + num1647 conscientiousness_counter = conscientiousness_counter + 11648 elif(m is 'conscientiousness_reverse'):1649 conscientiousness_reverse = conscientiousness_reverse + num1650 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11651 elif(m is 'extraversion'):1652 extraversion = extraversion + num1653 extraversion_counter = extraversion_counter + 11654 elif(m is 'extraversion_reverse'):1655 extraversion_reverse = extraversion_reverse + num1656 extraversion_reverse_counter = extraversion_reverse_counter + 11657 elif(m is 'neuroticism'):1658 neuroticism = neuroticism + num1659 neuroticism_counter = neuroticism_counter + 11660 else:1661 neuroticism_reverse = neuroticism_reverse + num1662 neuroticism_reverse_counter = neuroticism_reverse_counter + 11663 q = 'I often feel blue.'1664 num = int(raw_input(q + '\n'))1665 m = dmap[q]1666 if(m is 'agreeableness'):1667 agreeableness = agreeableness + num1668 agreeableness_counter = agreeableness_counter + 11669 elif(m is 'agreeableness_reverse'):1670 agreeableness_reverse = agreeableness_reverse + num1671 agreeableness_reverse_counter = agreeableness_reverse_counter + 11672 elif(m is 'openness'):1673 openness = openness + num1674 openness_counter = openness_counter + 11675 elif(m is 'openness_reverse'):1676 openness_reverse = openness_reverse + num1677 openness_reverse_counter = openness_reverse_counter + 11678 elif(m is 'conscientiousness'):1679 conscientiousness = conscientiousness + num1680 conscientiousness_counter = conscientiousness_counter + 11681 elif(m is 'conscientiousness_reverse'):1682 conscientiousness_reverse = conscientiousness_reverse + num1683 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11684 elif(m is 'extraversion'):1685 extraversion = extraversion + num1686 extraversion_counter = extraversion_counter + 11687 elif(m is 'extraversion_reverse'):1688 extraversion_reverse = extraversion_reverse + num1689 extraversion_reverse_counter = extraversion_reverse_counter + 11690 elif(m is 'neuroticism'):1691 neuroticism = neuroticism + num1692 neuroticism_counter = neuroticism_counter + 11693 else:1694 neuroticism_reverse = neuroticism_reverse + num1695 neuroticism_reverse_counter = neuroticism_reverse_counter + 11696 q = 'I am full of ideas.'1697 num = int(raw_input(q + '\n'))1698 m = dmap[q]1699 if(m is 'agreeableness'):1700 agreeableness = agreeableness + num1701 agreeableness_counter = agreeableness_counter + 11702 elif(m is 'agreeableness_reverse'):1703 agreeableness_reverse = agreeableness_reverse + num1704 agreeableness_reverse_counter = agreeableness_reverse_counter + 11705 elif(m is 'openness'):1706 openness = openness + num1707 openness_counter = openness_counter + 11708 elif(m is 'openness_reverse'):1709 openness_reverse = openness_reverse + num1710 openness_reverse_counter = openness_reverse_counter + 11711 elif(m is 'conscientiousness'):1712 conscientiousness = conscientiousness + num1713 conscientiousness_counter = conscientiousness_counter + 11714 elif(m is 'conscientiousness_reverse'):1715 conscientiousness_reverse = conscientiousness_reverse + num1716 conscientiousness_reverse_counter = conscientiousness_reverse_counter + 11717 elif(m is 'extraversion'):1718 extraversion = extraversion + num1719 extraversion_counter = extraversion_counter + 11720 elif(m is 'extraversion_reverse'):1721 extraversion_reverse = extraversion_reverse + num1722 extraversion_reverse_counter = extraversion_reverse_counter + 11723 elif(m is 'neuroticism'):1724 neuroticism = neuroticism + num1725 neuroticism_counter = neuroticism_counter + 11726 else:1727 neuroticism_reverse = neuroticism_reverse + num1728 neuroticism_reverse_counter = neuroticism_reverse_counter + 11729 final_agreeableness = float(agreeableness)/agreeableness_counter1730 final_openness = float(openness)/openness_counter1731 final_conscientiousness = float(conscientiousness)/conscientiousness_counter1732 final_extraversion = float(extraversion)/extraversion_counter1733 final_neuroticism = float(neuroticism)/neuroticism_counter1734 final_agreeableness_reverse = float(agreeableness_reverse)/agreeableness_reverse_counter1735 final_openness_reverse = float(openness_reverse)/openness_reverse_counter1736 final_conscientiousness_reverse = float(conscientiousness_reverse)/conscientiousness_reverse_counter1737 final_extraversion_reverse = float(extraversion_reverse)/extraversion_reverse_counter1738 final_neuroticism_reverse = float(neuroticism_reverse)/neuroticism_reverse_counter1739 agreeableness_final = 3 + (final_agreeableness - final_agreeableness_reverse)/21740 openness_final = 3 + (final_openness - final_openness_reverse)/21741 conscientiousness_final = 3 + (final_conscientiousness - final_conscientiousness_reverse)/21742 extraversion_final = 3 + (final_extraversion - final_extraversion_reverse)/21743 neuroticism_final = 3 + (final_neuroticism - final_neuroticism_reverse)/21744 name = 'profile_' + name1745 f = open('%s.csv' %name, 'wb')1746 csvwriter = csv.writer(f)1747 #csvwriter.writerow(['name' + ',' + name])1748 csvwriter.writerow([agreeableness_final])1749 csvwriter.writerow([openness_final])1750 csvwriter.writerow([conscientiousness_final])1751 csvwriter.writerow([extraversion_final])1752 csvwriter.writerow([neuroticism_final])1753 f.close()1754 csvwriter1.writerow([name + '.csv'])1755 inp = raw_input('Do you wish to continue? y or n\n')1756 if(inp == 'n'):1757 break1758record.close()...
neuralnetworkmodel.py
Source:neuralnetworkmodel.py
1from collections import defaultdict2import pickle3import numpy as np4import time5import xlsxwriter6from sklearn.neural_network import MLPRegressor7from sklearn.svm import SVR8from VideoProcessing.featureextraction import FeatureExtraction9from VideoProcessing.frameextraction import FrameExtraction10from matplotlib import pyplot as plt11class NeuralNetworkModel:12 def __init__(self, featuresDictTrain=None):13 self.featuresDictTrain = featuresDictTrain14 def find_best_params(self, featureDictTrain, featureDictTest):15 opennessModel = MLPRegressor(hidden_layer_sizes=(15, 15, 15,), activation='tanh', solver='adam',16 learning_rate='adaptive')17 print("Fitting the model")18 opennessModel.fit(featureDictTrain['face']['hist'], featureDictTrain['face']['openness'])19 print("Getting the prediction")20 prediction = opennessModel.predict(featureDictTest['face']['hist'])21 plt.scatter(featureDictTest['face']['openness'], prediction)22 plt.xlabel('TrueValues')23 plt.ylabel('Predictions')24 plt.show()25 print("Score: {}".format(26 opennessModel.score(featureDictTest['face']['hist'], featureDictTest['face']['openness'])))27 def generate(self, params):28 neuroticismModelRightEye = MLPRegressor().set_params(**params)29 neuroticismModelLeftEye = MLPRegressor().set_params(**params)30 neuroticismModelFace = MLPRegressor().set_params(**params)31 neuroticismModelSmile = MLPRegressor().set_params(**params)32 extraversionModelRightEye = MLPRegressor().set_params(**params)33 extraversionModelLeftEye = MLPRegressor().set_params(**params)34 extraversionModelFace = MLPRegressor().set_params(**params)35 extraversionModelSmile = MLPRegressor().set_params(**params)36 conscientiousnessModelRightEye = MLPRegressor().set_params(**params)37 conscientiousnessModelLeftEye = MLPRegressor().set_params(**params)38 conscientiousnessModelFace = MLPRegressor().set_params(**params)39 conscientiousnessModelSmile = MLPRegressor().set_params(**params)40 agreeablenessModelRightEye = MLPRegressor().set_params(**params)41 agreeablenessModelLeftEye = MLPRegressor().set_params(**params)42 agreeablenessModelFace = MLPRegressor().set_params(**params)43 agreeablenessModelSmile = MLPRegressor().set_params(**params)44 opennessModelRightEye = MLPRegressor().set_params(**params)45 opennessModelLeftEye = MLPRegressor().set_params(**params)46 opennessModelFace = MLPRegressor().set_params(**params)47 opennessModelSmile = MLPRegressor().set_params(**params)48 print("Training started")49 neuroticismModelRightEye.fit(self.featuresDictTrain['righteye']['hist'],50 self.featuresDictTrain['righteye']['neuroticism'])51 neuroticismModelLeftEye.fit(self.featuresDictTrain['lefteye']['hist'],52 self.featuresDictTrain['lefteye']['neuroticism'])53 neuroticismModelFace.fit(self.featuresDictTrain['face']['hist'], self.featuresDictTrain['face']['neuroticism'])54 neuroticismModelSmile.fit(self.featuresDictTrain['smile']['hist'],55 self.featuresDictTrain['smile']['neuroticism'])56 opennessModelRightEye.fit(self.featuresDictTrain['righteye']['hist'],57 self.featuresDictTrain['righteye']['openness'])58 opennessModelLeftEye.fit(self.featuresDictTrain['lefteye']['hist'],59 self.featuresDictTrain['lefteye']['openness'])60 opennessModelFace.fit(self.featuresDictTrain['face']['hist'], self.featuresDictTrain['face']['openness'])61 opennessModelSmile.fit(self.featuresDictTrain['smile']['hist'], self.featuresDictTrain['smile']['openness'])62 agreeablenessModelRightEye.fit(self.featuresDictTrain['righteye']['hist'],63 self.featuresDictTrain['righteye']['agreeableness'])64 agreeablenessModelLeftEye.fit(self.featuresDictTrain['lefteye']['hist'],65 self.featuresDictTrain['lefteye']['agreeableness'])66 agreeablenessModelFace.fit(self.featuresDictTrain['face']['hist'],67 self.featuresDictTrain['face']['agreeableness'])68 agreeablenessModelSmile.fit(self.featuresDictTrain['smile']['hist'],69 self.featuresDictTrain['smile']['agreeableness'])70 extraversionModelRightEye.fit(self.featuresDictTrain['righteye']['hist'],71 self.featuresDictTrain['righteye']['extraversion'])72 extraversionModelLeftEye.fit(self.featuresDictTrain['lefteye']['hist'],73 self.featuresDictTrain['lefteye']['extraversion'])74 extraversionModelFace.fit(self.featuresDictTrain['face']['hist'],75 self.featuresDictTrain['face']['extraversion'])76 extraversionModelSmile.fit(self.featuresDictTrain['smile']['hist'],77 self.featuresDictTrain['smile']['extraversion'])78 conscientiousnessModelRightEye.fit(self.featuresDictTrain['righteye']['hist'],79 self.featuresDictTrain['righteye']['conscientiousness'])80 conscientiousnessModelLeftEye.fit(self.featuresDictTrain['lefteye']['hist'],81 self.featuresDictTrain['lefteye']['conscientiousness'])82 conscientiousnessModelFace.fit(self.featuresDictTrain['face']['hist'],83 self.featuresDictTrain['face']['conscientiousness'])84 conscientiousnessModelSmile.fit(self.featuresDictTrain['smile']['hist'],85 self.featuresDictTrain['smile']['conscientiousness'])86 print("Training done")87 NNModelDict = defaultdict(dict)88 NNModelDict['face']['openness'] = opennessModelFace89 NNModelDict['face']['agreeableness'] = agreeablenessModelFace90 NNModelDict['face']['extraversion'] = extraversionModelFace91 NNModelDict['face']['conscientiousness'] = conscientiousnessModelFace92 NNModelDict['face']['neuroticism'] = neuroticismModelFace93 NNModelDict['smile']['openness'] = opennessModelSmile94 NNModelDict['smile']['agreeableness'] = agreeablenessModelSmile95 NNModelDict['smile']['extraversion'] = extraversionModelSmile96 NNModelDict['smile']['conscientiousness'] = conscientiousnessModelSmile97 NNModelDict['smile']['neuroticism'] = neuroticismModelSmile98 NNModelDict['righteye']['openness'] = opennessModelRightEye99 NNModelDict['righteye']['agreeableness'] = agreeablenessModelRightEye100 NNModelDict['righteye']['extraversion'] = extraversionModelRightEye101 NNModelDict['righteye']['conscientiousness'] = conscientiousnessModelRightEye102 NNModelDict['righteye']['neuroticism'] = neuroticismModelRightEye103 NNModelDict['lefteye']['openness'] = opennessModelLeftEye104 NNModelDict['lefteye']['agreeableness'] = agreeablenessModelLeftEye105 NNModelDict['lefteye']['extraversion'] = extraversionModelLeftEye106 NNModelDict['lefteye']['conscientiousness'] = conscientiousnessModelLeftEye107 NNModelDict['lefteye']['neuroticism'] = neuroticismModelLeftEye108 self.modelDict = NNModelDict109 return NNModelDict110 def test(self, facesHist, smileHist, leftEyeHist, rightEyeHist, filename, model=None, videoCount=1000):111 if model:112 self.modelDict = model113 workbook = xlsxwriter.Workbook(filename, {'nan_inf_to_errors': True})114 worksheet = workbook.add_worksheet()115 bold = workbook.add_format({'bold': True})116 worksheet.write('A1', 'Openness (Expected)', bold)117 worksheet.write('B1', 'Openness (Actual)', bold)118 worksheet.write('C1', 'Openness (Error)', bold)119 worksheet.write('D1', 'Extraversion (Expected)', bold)120 worksheet.write('E1', 'Extraversion (Actual)', bold)121 worksheet.write('F1', 'Extraversion (Error)', bold)122 worksheet.write('G1', 'Neuroticism (Expected)', bold)123 worksheet.write('H1', 'Neuroticism (Actual)', bold)124 worksheet.write('I1', 'Neuroticism (Error)', bold)125 worksheet.write('J1', 'Agreeableness (Expected)', bold)126 worksheet.write('K1', 'Agreeableness (Actual)', bold)127 worksheet.write('L1', 'Agreeableness (Error)', bold)128 worksheet.write('M1', 'Conscientiousness (Expected)', bold)129 worksheet.write('N1', 'Conscientiousness (Actual)', bold)130 worksheet.write('O1', 'Conscientiousness (Error)', bold)131 videosDataFile = open("AnnotationFiles/annotation_test.pkl", "rb")132 print('Loading data from pickle file.')133 videosData = pickle.load(videosDataFile, encoding='latin1')134 print('Getting names of all the video files.')135 videoNames = list(videosData['extraversion'].keys())136 videosFilePath = 'TestVideos/'137 opennessMSE = []138 extraversionMSE = []139 neuroticismMSE = []140 conscientiousnessMSE = []141 agreeablenessMSE = []142 for i, videoName in enumerate(videoNames):143 opennessListFace = []144 opennessListLeftEye = []145 opennessListRightEye = []146 opennessListSmile = []147 extraversionListFace = []148 extraversionListLeftEye = []149 extraversionListRightEye = []150 extraversionListSmile = []151 neuroticismListFace = []152 neuroticismListLeftEye = []153 neuroticismListRightEye = []154 neuroticismListSmile = []155 agreeablenessListFace = []156 agreeablenessListLeftEye = []157 agreeablenessListRightEye = []158 agreeablenessListSmile = []159 conscientiousnessListFace = []160 conscientiousnessListLeftEye = []161 conscientiousnessListRightEye = []162 conscientiousnessListSmile = []163 print("Video number: {}".format(i + 1))164 if facesHist[videoName]:165 opennessListFace = self.modelDict['face']['openness'].predict(facesHist[videoName])166 extraversionListFace = self.modelDict['face']['extraversion'].predict(facesHist[videoName])167 neuroticismListFace = self.modelDict['face']['neuroticism'].predict(facesHist[videoName])168 agreeablenessListFace = self.modelDict['face']['agreeableness'].predict(facesHist[videoName])169 conscientiousnessListFace = self.modelDict['face']['conscientiousness'].predict(facesHist[videoName])170 if rightEyeHist[videoName]:171 opennessListRightEye = self.modelDict['righteye']['openness'].predict(rightEyeHist[videoName])172 extraversionListRightEye = self.modelDict['righteye']['extraversion'].predict(rightEyeHist[videoName])173 neuroticismListRightEye = self.modelDict['righteye']['neuroticism'].predict(rightEyeHist[videoName])174 agreeablenessListRightEye = self.modelDict['righteye']['agreeableness'].predict(rightEyeHist[videoName])175 conscientiousnessListRightEye = self.modelDict['righteye']['conscientiousness'].predict(176 rightEyeHist[videoName])177 if leftEyeHist[videoName]:178 opennessListLeftEye = self.modelDict['lefteye']['openness'].predict(leftEyeHist[videoName])179 extraversionListLeftEye = self.modelDict['lefteye']['extraversion'].predict(leftEyeHist[videoName])180 neuroticismListLeftEye = self.modelDict['lefteye']['neuroticism'].predict(leftEyeHist[videoName])181 agreeablenessListLeftEye = self.modelDict['lefteye']['agreeableness'].predict(leftEyeHist[videoName])182 conscientiousnessListLeftEye = self.modelDict['lefteye']['conscientiousness'].predict(183 leftEyeHist[videoName])184 if smileHist[videoName]:185 opennessListSmile = self.modelDict['smile']['openness'].predict(smileHist[videoName])186 extraversionListSmile = self.modelDict['smile']['extraversion'].predict(smileHist[videoName])187 neuroticismListSmile = self.modelDict['smile']['neuroticism'].predict(smileHist[videoName])188 agreeablenessListSmile = self.modelDict['smile']['agreeableness'].predict(smileHist[videoName])189 conscientiousnessListSmile = self.modelDict['smile']['conscientiousness'].predict(smileHist[videoName])190 tempList = np.concatenate((opennessListFace, opennessListLeftEye, opennessListRightEye, opennessListSmile))191 worksheet.write(i + 1, 0, videosData['openness'][videoName])192 # worksheet.write(i + 1, 1, sum(opennessListFace) / len(opennessListFace))193 # worksheet.write(i + 1, 2, sum(opennessListLeftEye) / len(opennessListLeftEye))194 # worksheet.write(i + 1, 3, sum(opennessListRightEye) / len(opennessListRightEye))195 # worksheet.write(i + 1, 4, sum(opennessListSmile) / len(opennessListSmile))196 if len(tempList) is not 0:197 worksheet.write(i + 1, 1, np.average(tempList))198 worksheet.write(i + 1, 2, np.square(videosData['openness'][videoName] - np.average(tempList)))199 opennessMSE.append(np.square(videosData['openness'][videoName] - np.average(tempList)))200 tempList = np.concatenate(201 (extraversionListFace, extraversionListLeftEye, extraversionListRightEye, extraversionListSmile))202 worksheet.write(i + 1, 3, videosData['extraversion'][videoName])203 # worksheet.write(i + 1, 7, sum(extraversionListFace) / len(extraversionListFace))204 # worksheet.write(i + 1, 8, sum(extraversionListLeftEye) / len(extraversionListLeftEye))205 # worksheet.write(i + 1, 9, sum(extraversionListRightEye) / len(extraversionListRightEye))206 # worksheet.write(i + 1, 10, sum(extraversionListSmile) / len(extraversionListSmile))207 if len(tempList) is not 0:208 worksheet.write(i + 1, 4, np.max(tempList))209 worksheet.write(i + 1, 5, np.square(videosData['extraversion'][videoName] - np.average(tempList)))210 extraversionMSE.append(np.square(videosData['extraversion'][videoName] - np.average(tempList)))211 tempList = np.concatenate(212 (neuroticismListFace, neuroticismListLeftEye, neuroticismListRightEye, neuroticismListSmile))213 worksheet.write(i + 1, 6, videosData['neuroticism'][videoName])214 # worksheet.write(i + 1, 13, sum(neuroticismListFace) / len(neuroticismListFace))215 # worksheet.write(i + 1, 14, sum(neuroticismListLeftEye) / len(neuroticismListLeftEye))216 # worksheet.write(i + 1, 15, sum(neuroticismListRightEye) / len(neuroticismListRightEye))217 # worksheet.write(i + 1, 16, sum(neuroticismListSmile) / len(neuroticismListSmile))218 if len(tempList) is not 0:219 worksheet.write(i + 1, 7, np.max(tempList))220 worksheet.write(i + 1, 8, np.square(videosData['neuroticism'][videoName] - np.average(tempList)))221 neuroticismMSE.append(np.square(videosData['neuroticism'][videoName] - np.average(tempList)))222 tempList = np.concatenate(223 (agreeablenessListFace, agreeablenessListLeftEye, agreeablenessListRightEye, agreeablenessListSmile))224 worksheet.write(i + 1, 9, videosData['agreeableness'][videoName])225 # worksheet.write(i + 1, 19, sum(agreeablenessListFace) / len(agreeablenessListFace))226 # worksheet.write(i + 1, 20, sum(agreeablenessListLeftEye) / len(agreeablenessListLeftEye))227 # worksheet.write(i + 1, 21, sum(agreeablenessListRightEye) / len(agreeablenessListRightEye))228 # worksheet.write(i + 1, 22, sum(agreeablenessListSmile) / len(agreeablenessListSmile))229 if len(tempList) is not 0:230 worksheet.write(i + 1, 10, np.max(tempList))231 worksheet.write(i + 1, 11, np.square(videosData['agreeableness'][videoName] - np.average(tempList)))232 agreeablenessMSE.append(np.square(videosData['agreeableness'][videoName] - np.average(tempList)))233 tempList = np.concatenate((conscientiousnessListFace, conscientiousnessListLeftEye,234 conscientiousnessListRightEye, conscientiousnessListSmile))235 worksheet.write(i + 1, 12, videosData['conscientiousness'][videoName])236 # worksheet.write(i + 1, 25, sum(conscientiousnessListFace) / len(conscientiousnessListFace))237 # worksheet.write(i + 1, 26, sum(conscientiousnessListLeftEye) / len(conscientiousnessListLeftEye))238 # worksheet.write(i + 1, 27, sum(conscientiousnessListRightEye) / len(conscientiousnessListRightEye))239 # worksheet.write(i + 1, 28, sum(conscientiousnessListSmile) / len(conscientiousnessListSmile))240 if len(tempList) is not 0:241 worksheet.write(i + 1, 13, np.max(tempList))242 worksheet.write(i + 1, 14, np.square(videosData['conscientiousness'][videoName] - np.average(tempList)))243 conscientiousnessMSE.append(np.square(videosData['conscientiousness'][videoName] - np.average(tempList)))244 workbook.close()245 ErrorDict = defaultdict(float)246 ErrorDict['openness'] = np.sqrt(np.average(opennessMSE))247 ErrorDict['agreeableness'] = np.sqrt(np.average(agreeablenessMSE))248 ErrorDict['neuroticism'] = np.sqrt(np.average(neuroticismMSE))249 ErrorDict['conscientiousness'] = np.sqrt(np.average(conscientiousnessMSE))250 ErrorDict['extraversion'] = np.sqrt(np.average(extraversionMSE))251 return ErrorDict252 def predict_single_frame(self, frame, model=None):253 if model is not None:254 self.modelDict = model255 print("Trying to predict a single frame value")256 neuroticismListFace = []257 neuroticismListLeftEye = []258 neuroticismListRightEye = []259 agreeablenessListFace = []260 agreeablenessListLeftEye = []261 neuroticismListSmile = []262 agreeablenessListSmile = []263 agreeablenessListRightEye = []264 conscientiousnessListFace = []265 conscientiousnessListLeftEye = []266 conscientiousnessListRightEye = []267 conscientiousnessListSmile = []268 extraversionListFace = []269 extraversionListLeftEye = []270 extraversionListRightEye = []271 extraversionListSmile = []272 opennessListFace = []273 opennessListLeftEye = []274 opennessListRightEye = []275 opennessListSmile = []276 extractor = FrameExtraction()277 features = FeatureExtraction(24, 8)278 croppedFace, smileFrame, leftEyeFrame, rightEyeFrame = extractor.single_frame(frame)279 featuresDict = features.extract_single_frame(croppedFace, smileFrame, leftEyeFrame, rightEyeFrame)280 if featuresDict['face']:281 opennessListFace = self.modelDict['face']['openness'].predict(featuresDict['face'])282 extraversionListFace = self.modelDict['face']['extraversion'].predict(featuresDict['face'])283 neuroticismListFace = self.modelDict['face']['neuroticism'].predict(featuresDict['face'])284 agreeablenessListFace = self.modelDict['face']['agreeableness'].predict(featuresDict['face'])285 conscientiousnessListFace = self.modelDict['face']['conscientiousness'].predict(featuresDict['face'])286 if featuresDict['righteye']:287 opennessListRightEye = self.modelDict['righteye']['openness'].predict(featuresDict['righteye'])288 extraversionListRightEye = self.modelDict['righteye']['extraversion'].predict(featuresDict['righteye'])289 neuroticismListRightEye = self.modelDict['righteye']['neuroticism'].predict(featuresDict['righteye'])290 agreeablenessListRightEye = self.modelDict['righteye']['agreeableness'].predict(291 featuresDict['righteye'])292 conscientiousnessListRightEye = self.modelDict['righteye']['conscientiousness'].predict(293 featuresDict['righteye'])294 if featuresDict['lefteye']:295 opennessListLeftEye = self.modelDict['lefteye']['openness'].predict(featuresDict['lefteye'])296 extraversionListLeftEye = self.modelDict['lefteye']['extraversion'].predict(featuresDict['lefteye'])297 neuroticismListLeftEye = self.modelDict['lefteye']['neuroticism'].predict(featuresDict['lefteye'])298 agreeablenessListLeftEye = self.modelDict['lefteye']['agreeableness'].predict(featuresDict['lefteye'])299 conscientiousnessListLeftEye = self.modelDict['lefteye']['conscientiousness'].predict(300 featuresDict['lefteye'])301 if featuresDict['smile']:302 opennessListSmile = self.modelDict['smile']['openness'].predict(featuresDict['smile'])303 extraversionListSmile = self.modelDict['smile']['extraversion'].predict(featuresDict['smile'])304 neuroticismListSmile = self.modelDict['smile']['neuroticism'].predict(featuresDict['smile'])305 agreeablenessListSmile = self.modelDict['smile']['agreeableness'].predict(featuresDict['smile'])306 conscientiousnessListSmile = self.modelDict['smile']['conscientiousness'].predict(featuresDict['smile'])307 openness = defaultdict(float)308 extraversion = defaultdict(float)309 neuroticism = defaultdict(float)310 conscientiousness = defaultdict(float)311 agreeableness = defaultdict(float)312 openness["average"] = -1313 extraversion["average"] = -1314 neuroticism["average"] = -1315 conscientiousness["average"] = -1316 agreeableness["average"] = -1317 opennessList = None318 agreeablenessList = None319 conscientiousnessList = None320 extraversionList = None321 neuroticismList = None322 if opennessListFace or opennessListRightEye or opennessListLeftEye or opennessListSmile:323 opennessList = np.concatenate(324 (opennessListFace, opennessListLeftEye, opennessListRightEye, opennessListSmile))325 openness["average"] = np.average(opennessList)326 openness["min"] = np.min(opennessList)327 openness["max"] = np.max(opennessList)328 if extraversionListFace or extraversionListLeftEye or extraversionListRightEye or extraversionListSmile:329 extraversionList = np.concatenate(330 (extraversionListFace, extraversionListLeftEye, extraversionListRightEye, extraversionListSmile))331 extraversion["average"] = np.average(extraversionList)332 extraversion["min"] = np.min(extraversionList)333 extraversion["max"] = np.max(extraversionList)334 if neuroticismListFace or neuroticismListLeftEye or neuroticismListRightEye or neuroticismListSmile:335 neuroticismList = np.concatenate(336 (neuroticismListFace, neuroticismListLeftEye, neuroticismListRightEye, neuroticismListSmile))337 neuroticism["average"] = np.average(neuroticismList)338 neuroticism["min"] = np.min(neuroticismList)339 neuroticism["max"] = np.max(neuroticismList)340 if agreeablenessListFace or agreeablenessListLeftEye or agreeablenessListRightEye or agreeablenessListLeftEye or agreeablenessListSmile:341 agreeablenessList = np.concatenate(342 (agreeablenessListFace, agreeablenessListLeftEye, agreeablenessListRightEye, agreeablenessListSmile))343 agreeableness["average"] = np.average(agreeablenessList)344 agreeableness["min"] = np.min(agreeablenessList)345 agreeableness["max"] = np.max(agreeablenessList)346 if conscientiousnessListFace or conscientiousnessListLeftEye or conscientiousnessListRightEye or conscientiousnessListSmile:347 conscientiousnessList = np.concatenate((conscientiousnessListFace, conscientiousnessListLeftEye,348 conscientiousnessListRightEye, conscientiousnessListSmile))349 conscientiousness["average"] = np.average(conscientiousnessList)350 conscientiousness["min"] = np.min(conscientiousnessList)351 conscientiousness["max"] = np.max(conscientiousnessList)...
Analyzer.py
Source:Analyzer.py
1__author__ = 'chintanpanchamia'2import csv3f = open('record.csv','rb')4profile_counter = 05openness = 06conscientiousness = 07extraversion = 08agreeableness = 09neuroticism = 010for i in f:11 profile_counter = profile_counter + 112 array = []13 i = i.strip()14 f1 = open(i,'rb')15 csvreader = csv.reader(f1)16 for row in csvreader:17 array.append(float(row[0]))18 agreeableness = agreeableness + array[0]19 openness = openness + array[1]20 conscientiousness = conscientiousness + array[2]21 extraversion = extraversion + array[3]22 neuroticism = neuroticism + array[4]23i = 024compute = [0,0,0,0,0]25compute[0] = float(agreeableness)/profile_counter26compute[1] = float(openness)/profile_counter27compute[2] = float(conscientiousness)/profile_counter28compute[3] = float(extraversion)/profile_counter29compute[4] = float(neuroticism)/profile_counter30compute[0] = (compute[0]/5)*10031agreeableness = compute[0]32compute[1] = (compute[1]/5)*10033openness = compute[1]34compute[2] = (compute[2]/5)*10035conscientiousness = compute[2]36compute[3] = (compute[3]/5)*10037extraversion = compute[3]38compute[4] = (compute[4]/5)*10039neuroticism = compute[4]40m = max(compute)41pointer = 042for i in compute:43 if m == i:44 pointer = compute.index(i)45dominant = ''46if pointer == 0:47 dominant = 'agreeableness'48elif pointer == 1:49 dominant = 'openness'50elif pointer == 2:51 dominant = 'conscientiousness'52elif pointer == 3:53 dominant = 'extraversion'54else:55 dominant = 'neuroticism'56compute1 = compute57i = 058compute1.remove(m)59m2 = max(compute1)60for i in compute:61 if m2 == i:62 pointer = compute.index(i)63dominant2 = ''64if pointer == 0:65 dominant2 = 'agreeableness'66elif pointer == 1:67 dominant2 = 'openness'68elif pointer == 2:69 dominant2 = 'conscientiousness'70elif pointer == 3:71 dominant2 = 'extraversion'72else:73 dominant2 = 'neuroticism'74i = 075compute1.remove(m2)76m3 = max(compute1)77for i in compute:78 if m3 == i:79 pointer = compute.index(i)80dominant3 = ''81if pointer == 0:82 dominant3 = 'agreeableness'83elif pointer == 1:84 dominant3 = 'openness'85elif pointer == 2:86 dominant3 = 'conscientiousness'87elif pointer == 3:88 dominant3 = 'extraversion'89else:90 dominant3 = 'neuroticism'91print 'Detailed Social Comfort Levels of the room at the moment:\n'92print 'Openness to Experiences: ' + str(openness)93print 'Conscientiousness: ' + str(conscientiousness)94print 'Extraversion: ' + str(extraversion)95print 'Agreeableness: ' + str(agreeableness)96print 'Neuroticism: ' + str(neuroticism)97result = ''98if(dominant is 'openness'):99 if(dominant2 is 'conscientiousness'):100 if(dominant3 is 'extraversion'):101 result = 'Routine'102 else:103 result = 'Ambient'104 if(dominant2 is 'extraversion'):105 if(dominant3 is 'conscientiousness'):106 result = 'Loud'107 elif(dominant3 is 'agreeableness'):108 result = 'Routine'109 else:110 result = 'Ambient'111 if(dominant2 is 'agreeableness'):112 if(dominant3 is 'conscientiousness'):113 result = 'Routine'114 elif(dominant3 is 'extraversion'):115 result = 'Loud'116 else:117 result = 'Ambient'118 else:119 if(dominant3 is 'agreeableness'):120 result = 'Quiet'121 elif(dominant3 is 'conscientiousness' or 'extraversion'):122 result = 'Routine'123elif(dominant is 'conscientiousness'):124 if(dominant2 is 'openness'):125 if(dominant3 is 'neuroticism' or 'agreeableness'):126 result = 'Ambient'127 else:128 result = 'Routine'129 if(dominant2 is 'extraversion'):130 if(dominant3 is 'openness' or 'agreeableness'):131 result = 'Loud'132 else:133 result = 'Routine'134 if(dominant2 is 'agreeableness'):135 if(dominant3 is 'openness' or 'extraversion'):136 result = 'Routine'137 else:138 result = 'Ambient'139 if(dominant2 is 'neuroticism'):140 if(dominant3 is 'agreeableness' or 'openness'):141 result = 'Ambient'142 else:143 result = 'Routine'144elif(dominant is 'extraversion'):145 if(dominant2 is 'openness'):146 if(dominant3 is 'agreeableness' or 'conscientiousness'):147 result = 'Loud'148 else:149 result = 'Routine'150 if(dominant2 is 'conscientiousness'):151 if(dominant3 is 'openness'):152 result = 'Loud'153 elif(dominant3 is 'agreeableness'):154 result = 'Routine'155 else:156 result = 'Ambient'157 if(dominant2 is 'agreeableness'):158 if(dominant3 is 'openness'):159 result = 'Loud'160 elif(dominant3 is 'conscientiousness'):161 result = 'Routine'162 else:163 result = 'Ambient'164 if(dominant2 is 'neuroticism'):165 if(dominant3 is 'openness' or 'conscientiousness'):166 result = 'Routine'167 else:168 result = 'Ambient'169elif(dominant is 'agreeableness'):170 if(dominant2 is 'openness' or 'extraversion'):171 if(dominant3 is 'conscientiousness'):172 result = 'Loud'173 else:174 result = 'Ambient'175 if(dominant2 is 'conscientiousness'):176 if(dominant3 is 'openness' or 'extraversion'):177 result = 'Routine'178 else:179 result = 'Ambient'180 if(dominant2 is 'neuroticism'):181 if(dominant3 is 'openness'):182 result = 'Quiet'183 else:184 result = 'Ambient'185else:186 if(dominant2 is 'openness' or 'agreeableness'):187 if(dominant3 is 'conscientiousness'):188 result = 'Quiet'189 else:190 result = 'Ambient'191 if(dominant2 is 'conscientiousness'):192 if(dominant3 is 'openness' or 'extraversion'):193 result = 'Routine'194 else:195 result = 'Ambient'196 if(dominant2 is 'extraversion'):197 if(dominant3 is 'Agreeableness'):198 result = 'Ambient'199 else:200 result = 'Routine'...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!