-
Notifications
You must be signed in to change notification settings - Fork 0
/
confirmationbias.py
27 lines (25 loc) · 960 Bytes
/
confirmationbias.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
def confirmationBias(isSupportingQuestion, hypothesis):
hypo = hypothesis.split(',')
topics = {
'location': 0,
'time' : 0,
'person' : 0
}
for word in hypo:
if word in open('Resources/cities15000.txt').read():
topics['location'] += 1
elif word in open('Resources/time.txt').read():
topics['time'] += 1
elif word in open('Resources/clothes.txt').read():
topics['person'] += 1
maxTopic = ""
if (topics['location'] > topics['time'] and topics['location'] > topics['person']):
maxTopic = 'location'
elif (topics['time'] > topics['location'] and topics['time'] > topics['person']):
maxTopic = 'time'
else:
maxTopic = 'person'
if (isSupportingQuestion):
return "What evidence do you have which supports this " + maxTopic
else:
return "What evidence do you have which doesn't support this " + maxTopic