-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevaluation.py
1015 lines (991 loc) · 18 KB
/
evaluation.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import os
import openai
import pandas as pd
import time
FULL_KEYWORDS_SET = set([
'Ab-grund',
'Akademia (Plato)',
'Amazon',
'America',
'American Civil War',
'American Declaration of Independence',
'American Revolution',
'Apple',
'Arab Spring',
'Arendtian principles',
'Austro-Hungarian Empire',
'Bible',
'Big Bang',
'Binding of Isaac',
'Brexit',
'Buddhism',
'COVID-19 pandemic',
'Catholicism versus Protestantism',
'Chile',
'China',
'Christianity',
'Citizens United v. Federal Election Commission',
'Cold War',
'Constitution of the United States of America',
'Copernican Revolution',
'Critique of Judgment (Kant)',
'Critique of Pure Reason (Kant)',
'Cuba',
'Cuban Missile Crisis',
'Drake equation',
'Dyson sphere',
'Easter Island',
'Egypt',
'Eichmann controversy',
'English Revolution',
'Europe',
'European Union',
'Euthyphro problem',
'Facebook',
'Fall of the Berlin Wall',
'Fermi paradox',
'French Revolution',
'GOFAI',
'Gaia hypothesis',
'Game of Life',
'Gerechtigkeit',
'God',
'Golden Rule',
'Google',
'Greece',
'Gödel’s incompleteness theorem',
'Habeas corpus',
'Haitian Revolution',
'Hellenistic philosophy',
'Hinduism',
'Hollywood',
'Hungarian Revolution',
'Inquisition',
'Internet',
'Iraq War',
'Islam',
'Islamism',
'Israeli-Palestinian conflict',
'Jesuits',
'Judaism',
'Lamarckian inheritance',
'Mach’s principle',
'Maoism',
'Maya',
'Me Too movement',
'Middle Ages',
'Milgram experiment',
'Moore’s law',
'Moore’s paradox',
'Nazism',
'Negro',
'Newcomb’s paradox',
'Nuremberg trials',
'Occident',
'Oedipus',
'Pascal’s wager',
'Poker',
'Presocratics',
'Pyrrhonism',
'Pythagoreanism',
'Reformation',
'Renaissance',
'Republic (Plato)',
'Roe v. Wade',
'Romanticism',
'Rome',
'Rorschach test',
'Russell’s paradox',
'Russia',
'Russian Revolution',
'Rwandan genocide',
'Régimen Militar (Chile)',
'SETI',
'Second World War',
'Semantic Web',
'Sendero Luminoso',
'Shoah',
'Sisyphos',
'Sittlichkeit',
'Soviet Union',
'Spanish Civil War',
'Stalinism',
'Star Trek',
'Star Wars',
'Stoicism',
'Switzerland',
'Tea Party',
'Third World',
'Trinity',
'Trojan War',
'Twitter',
'United Nations',
'United States Congress',
'United States of America',
'University of Oxford',
'Venezuela',
'Vienna',
'Vienna Circle',
'Vietnam War',
'Voynich manuscript',
'War in Afghanistan',
'War on Drugs',
'War on Terror',
'Warsaw Ghetto Uprising',
'What the Tortoise Said to Achilles (Carroll)',
'WikiLeaks',
'Yugoslav Wars',
'Zettelkasten',
'Zionism',
'abortion',
'absolute space',
'absolutism',
'academic freedom',
'action',
'active/passive',
'actually existing socialism',
'adoption',
'advertising',
'aestheticism',
'affirmative action',
'agon',
'agriculture',
'akrasia',
'alchemy',
'alcohol',
'algorithm',
'alienation',
'altermondialisme',
'alternative economy',
'altruism',
'amor fati',
'amor mundi',
'analog/digital',
'analytic/synthetic',
'anarchy',
'ancient ethics',
'animal husbandry',
'animal rights',
'anthropic principle',
'anti-consumerism',
'antiquity',
'antisemitism',
'ants',
'anything goes',
'aporia',
'archive',
'argos logos',
'argument from design',
'arrow of time',
'art',
'art of distinction',
'artificial intelligence',
'artificial life',
'artificial neural network',
'artistic creation',
'asceticism',
'assurance game',
'asylum',
'atheism',
'atom',
'authenticity',
'authority',
'autism',
'autonomous weapons',
'autonomy',
'avant-garde',
'ballistic missile submarine',
'ban',
'bare life',
'base and superstructure',
'basic income',
'beauty',
'bees',
'behaviorism',
'being',
'being and appearance',
'being and becoming',
'being and consciousness',
'being and thinking',
'bioethics',
'biopolitics',
'birds',
'birth control',
'black hole',
'body',
'bodybuilding',
'bourgeois/citizen',
'bureaucracy',
'camp',
'campaign finance reform',
'canon',
'capacity to do otherwise',
'capital punishment',
'capitalism',
'causa sui',
'causality',
'celibacy',
'centralization',
'chance',
'chaos',
'character',
'chastity',
'chess',
'chicken-and-egg problem',
'child sexual abuse',
'childbirth',
'children',
'chimpanzees',
'church',
'citizenship',
'city',
'civil rights',
'civil rights movement',
'civilian control of the military',
'civilization',
'class',
'class consciousness',
'class struggle',
'classless society',
'climate change',
'cloning',
'college',
'colonialism',
'comedy',
'common good',
'common sense',
'communism',
'communitarianism',
'compatibilism',
'computer',
'computer games',
'computer virus',
'concepts',
'conditional',
'conscience',
'consciousness',
'consensus',
'consent',
'consequentialism',
'conspiracy theory',
'constitution',
'constructivism',
'consumer society',
'contingency',
'continuum',
'copyright',
'corporation',
'corruption',
'cosmological argument',
'cosmopolitanism',
'council system',
'counterrevolution',
'courage',
'creatio ex nihilo',
'crime against humanity',
'critique',
'cryonics',
'cubism',
'culture',
'curiosity',
'cybernetics',
'cyberweapons',
'cyborg',
'cyclical versus linear conception of history',
'dance',
'death',
'death of God',
'debt',
'decision',
'deliberation',
'deliberative democracy',
'deliberative polling',
'democracy',
'deontology',
'depth and surface',
'desert',
'desire',
'determinism',
'development aid',
'dialectic',
'dialogue form',
'dictatorship',
'difference',
'différance',
'dignity',
'disability',
'disarmament',
'discipline',
'discourse ethics',
'disenchantment',
'division of labor',
'dolphins',
'domestic violence',
'domination',
'dream',
'drugs',
'dualism',
'duty',
'déconstruction',
'economic crisis',
'education',
'ego id super-ego',
'election by lot',
'elite',
'emancipation',
'emergence',
'empiricism',
'empiricism versus rationalism',
'empty slate',
'encryption',
'end of history',
'end of traditions',
'enemy',
'enlightenment',
'entailment',
'entertainment',
'envy',
'epistemology',
'epoché',
'equality',
'erweiterte Denkungsart',
'esotericism',
'essence',
'eternal recurrence',
'ethical naturalism',
'ethics',
'ethics of care',
'ethics of greatness',
'eudaimonia',
'eugenics',
'euthanasia',
'evangelicalism',
'event',
'evil',
'evil as a defect',
'evolution',
'evolution of cognition',
'evolution of death',
'evolution of humans',
'evolution of language',
'evolution of morality',
'evolution of religion',
'evolution of sexual reproduction',
'evolution of sleep',
'evolution of sociality',
'evolution of technology',
'evolutionarily stable strategy',
'evolutionary developmental biology',
'example',
'exception and rule',
'exclusion/inclusion',
'existentialism',
'experiment',
'expert',
'exploitation',
'expressionism',
'extinction',
'extra/ordinary',
'extraterrestrial life',
'fabrication',
'fact and fiction',
'facts and norms',
'failure',
'faith',
'fake news',
'false consciousness',
'family',
'fanaticism',
'fascism',
'fasting',
'fate',
'fear',
'federation',
'feelings',
'feminism',
'fetish',
'film',
'fine-tuning of the universe',
'first contact',
'fitness',
'football',
'foreign policy',
'forgiveness',
'form of government',
'formal logic',
'foundation',
'foundation myths',
'freaks',
'free market',
'freedom',
'freedom as absence of impediment',
'freedom of speech',
'freedom of the will',
'freedom of the will and natural causality as points of view',
'freedom of thought',
'freedom versus security',
'friendship',
'future',
'gambling',
'game',
'game theory',
'gene',
'genius',
'genocide',
'genre',
'geometric method',
'gift',
'globalization',
'goal',
'good and evil',
'grace',
'gravitation',
'greed',
'group selection',
'gun control',
'habit',
'hallucination',
'happiness',
'hate',
'health care reform',
'heaven and hell',
'hedonism',
'hermeneutic circle',
'hermeneutics',
'highest good',
'historical materialism',
'historical necessity',
'historicism',
'historiography',
'history',
'holiday',
'homeland',
'homelessness',
'homosexuality',
'hospitality',
'human being',
'human being and machine',
'human being as creator',
'human being as crown of creation',
'human being as inherently good or evil',
'human being as ruler over nature',
'human being versus animal',
'human enhancement',
'human rights',
'humaneness',
'humanism',
'humanitarian intervention',
'humanities',
'hylomorphism',
'hypocrisy',
'hysteria',
'ideal speech situation',
'ideal type',
'idealism',
'identity',
'identity of indiscernibles',
'identity politics',
'ideology',
'image',
'immanence/transcendence',
'immortality',
'immortality of the soul',
'immortality through fame',
'impartiality',
'imperialism',
'incest',
'incompatibilism',
'indexicals',
'induction',
'industrialization',
'inertia',
'inflation (cosmology)',
'informal logic',
'information',
'initiation rite',
'insects',
'intellect',
'intellectuals',
'interest',
'international law',
'intuition',
'jihad',
'joke',
'judging',
'just war',
'kairos',
'know-how/know-that',
'knowledge',
'labor',
'labor movement',
'language',
'large language models',
'laughter',
'law',
'law of nature',
'leader',
'learning',
'left/right',
'legitimacy',
'leisure',
'lex',
'liar paradox',
'liberalism',
'libertarianism (free will)',
'libertarianism (politics)',
'liberty and equality',
'life',
'life as a work of art',
'limits of formal logic',
'linguistic turn',
'literature',
'logic',
'logon didonai',
'logos',
'loneliness',
'lookism',
'love',
'lying',
'machine learning',
'magic',
'majority rule',
'manque à être',
'many-worlds interpretation',
'marriage',
'mask',
'mass',
'master and disciple',
'masturbation',
'materialism',
'mathematics',
'matter',
'matter life mind',
'meaning',
'meaning of life',
'means and end',
'medicine',
'medieval philosophy',
'meme',
'memory',
'men',
'mental illness',
'messianism',
'metaphor',
'metaphysics',
'military-industrial complex',
'mimesis',
'mind and body',
'mind uploading',
'miracle',
'mob',
'modern era',
'modernity',
'modesty',
'money',
'monism',
'moral sentiments',
'morality',
'motherhood',
'mountaineering',
'multiverse',
'music',
'mutually assured destruction',
'mysticism',
'myth',
'natality',
'nation state',
'nationalism',
'natural right',
'naturalism',
'nature',
'nature versus culture',
'nature versus nurture',
'necessity',
'necessity of the life process',
'negation',
'negative theology',
'neo-Aristotelianism',
'neo-Kantianism',
'neoliberalism',
'nihilism',
'nomos',
'non-conceptual content',
'non-governmental organizations',
'nonviolent resistance',
'nothingness',
'novel',
'nuclear weapons',
'objectivity',
'old age',
'ontological argument',
'ontology',
'open source',
'opera',
'opinion',
'origin',
'origin of life',
'original and copy',
'original sin',
'overdetermination',
'overpopulation',
'pacemaker',
'pacifism',
'pantheism',
'paradigm',
'paradox',
'paranoia',
'parenthood',
'particularism',
'parts and whole',
'party',
'passion for distinction',
'past',
'paternalism',
'patriarchy',
'pedophilia',
'penis envy',
'people',
'perfectionism',
'performative self-contradiction',
'performative speech acts',
'permanent revolution',
'person',
'personal identity',
'petroleum',
'pharmaceutical industry',
'phenomenology',
'philosophy',
'philosophy as a system',
'philosophy versus science',
'photography',
'physicalism',
'physics',
'pity',
'placebo effect',
'plagiarism',
'pleasure and pain',
'plebiscite',
'plurality of human beings',
'poetry',
'police',
'polis',
'political economy',
'political philosophy',
'political representation',
'politics',
'popular sovereignty',
'pornography',
'possibility',
'possible world',
'posthumanism',
'postmodernity',
'potentiality and actuality',
'poverty',
'power',
'practical reason',
'practice',
'prayer',
'precedent',
'presence/absence',
'preventive war',
'primitive peoples',
'principle of double negation',
'principle of non-contradiction',
'principle of publicity',
'principle of sufficient reason',
'principles',
'prison',
'prisoner’s dilemma',
'private military company',
'probability theory',
'problem of complexity',
'problem of evil',
'problem of foundation',
'problem of pluralism',
'problem of scale',
'problem of universals',
'proceduralism',
'process',
'professional revolutionary',
'progress',
'project',
'promise',
'proof of an external world',
'proof of the existence of God',
'proper name',
'property',
'proposition',
'prostitution',
'protection of the environment',
'protests of 1968',
'psychoanalysis',
'psychosis',
'psychotherapy',
'public happiness',
'public opinion',
'public reason',
'public sphere',
'public transport',
'public/private',
'punctuated equilibrium',
'punishment',
'pure versus applied science',
'quantum computer',
'quantum mechanics',
'racism',
'radical evil',
'rape',
'rational choice theory',
'rave',
'reactionary',
'reading',
'realism (arts)',
'realism (politics)',
'rearing of children by the state',
'reason',
'reason versus faith',
'reason versus intellect',
'reason versus passion',
'reason versus sense perception',
'recycling',
'reductio ad absurdum',
'reform or revolution',
'refugee',
'regulative idea',
'reification',
'relation',
'relationship between politics and economy',
'relativism',
'religion',
'renewable energy',
'repetition',
'representation',
'representative democracy',
'repression',
'republic',
'research',
'resistance',
'respect',
'responsibility',
'retroactivity',
'revenge',
'revolution',
'rhetoric',
'right',
'right of the strongest',
'risk society',
'rule-following',
'sacrifice',
'scapegoat',
'schizophrenia',
'school',
'science',
'science fiction',
'science versus religion',
'scientific revolution',
'secessio plebis',
'second law of thermodynamics',
'secret police',
'secret service',
'sects',
'secularization',
'self-consciousness',
'self-driving cars',
'self-help',
'self-preservation',
'self-reference',
'self-respect',
'selflessness',
'sense',
'sense perception',
'separation of church and state',
'separation of powers',
'serial killer',
'sexual difference',
'sexuality',
'shame',
'signifier',
'simulation hypothesis',
'singularity',
'skepticism',
'slavery',
'sleep',
'smartphone',
'social contract',
'socialism',
'socialist realism',
'society',
'society as body',
'solidarity',
'solipsism',
'sophistry',
'soul',
'sovereignty',
'space',
'space travel',
'spacetime',
'species',
'spirit of the revolution',
'splitting',
'state',
'state of nature',
'statelessness',
'story',
'strike',
'string theory',
'structuralism',
'struggle between the sexes',
'struggle for recognition',
'subject',
'sublimation',
'substance',
'suicide',
'superhero',
'superintelligence',
'supervenience',
'surfing',
'surrealism',
'surrogacy',
'surveillance state',
'systems theory',
'taste',
'technology',
'teleology',
'territory',
'terror',
'terrorism',
'thaumazein',
'the absolute',
'the absolutely other',
'the absurd',
'the death of Man',
'the good',
'the infinite',
'the lesser evil',
'the new',
'the present',
'the real',
'the self',
'the unconscious',
'the unspeakable',
'theater',
'theory and practice',
'theory of everything',
'theory of relativity',
'thinking',
'time',
'time travel',
'tobacco',
'tolerance',
'torture',
'totalitarianism',
'trade union',
'tradition',
'tragedy',
'transcendental',
'transhumanism',
'translation',
'trust',
'truth',
'truth as coherence',
'truth as correspondence',
'truth as disclosure',
'truth as what works',
'twins',
'tyranny',
'tyranny of the majority',
'uncertainty principle',
'understanding',
'unemployment',
'unidentified flying object',
'unity',
'unity of science',
'universal suffrage',
'universalism',
'university',
'use and exchange value',
'usury',
'utilitarianism',
'utopia',
'vacuum',
'vagueness',
'value',
'vampire',
'vegetarianism',
'verse',
'vertigo',
'violence',
'virtual',
'virtual reality',
'virtue',
'virtue ethics',
'vitalism',
'von Neumann probe',
'war',
'war crime',
'wealth',
'welfare state',
'whales',
'will',
'wireheading',
'witch hunt',
'witches',
'women',
'world',
'world state',
'worldlessness',
'writing',
'xenophobia',
'youth',
'zoo hypothesis',
])
def main():
"""Main function to process queries."""
df = pd.read_csv("queries.csv")
df["LLM vs Human"] = ""
df["Small Context Keywords Eval"] = ""
df["Big Context Keywords Eval"] = ""
for index, row in df.iterrows():
print(f"Processing row {index}...")
# read notion_1, notion_2,..,notion_8 from the dataframe into a set of strings
notion_1 = row["notion_1"]
notion_2 = row["notion_2"]
notion_3 = row["notion_3"]
notion_4 = row["notion_4"]
notion_5 = row["notion_5"]
notion_6 = row["notion_6"]
notion_7 = row["notion_7"]
notion_8 = row["notion_8"]
# Filter out 'nan' and None values before creating the set
human_assigned_keywords = set([notion for notion in [notion_1, notion_2, notion_3, notion_4, notion_5, notion_6, notion_7, notion_8] if notion is not None and str(notion).lower() != 'nan'])
# remove nan from the set
human_assigned_keywords.discard("")
llm_assigned_keywords = set(row["Assigned Keywords"].split(", "))
big_context_keywords = set(row["Big Context Keywords"].split(", "))
print(f"Human assigned keywords: {human_assigned_keywords}")
print(f"LLM assigned keywords: {llm_assigned_keywords}")
# check if the two sets are equal
if human_assigned_keywords == llm_assigned_keywords:
df.at[index, "LLM vs Human"] = "EQUAL"
elif human_assigned_keywords.issubset(llm_assigned_keywords):
df.at[index, "LLM vs Human"] = "LLM IS A SUPERSET"
elif llm_assigned_keywords.issubset(human_assigned_keywords):
df.at[index, "LLM vs Human"] = "HUMAN IS A SUPERSET"
else:
only_in_human = human_assigned_keywords.difference(llm_assigned_keywords)
only_in_llm = llm_assigned_keywords.difference(human_assigned_keywords)
df.at[index, "LLM vs Human"] = f"ONLY IN HUMAN: {only_in_human}, ONLY IN LLM: {only_in_llm}"
# check if llm_assigned_keywords is a subset of FULL_KEYWORDS_SET
if llm_assigned_keywords.issubset(FULL_KEYWORDS_SET):
df.at[index, "Small Context Keywords Eval"] = "Grounded"
else:
df.at[index, "Small Context Keywords Eval"] = "Not Grounded"
# check if big_context_keywords is a subset of FULL_KEYWORDS_SET