Skip to content

Commit

Permalink
refarctoring the code
Browse files Browse the repository at this point in the history
  • Loading branch information
monikajot committed Aug 15, 2024
1 parent 01aed97 commit 46fad70
Show file tree
Hide file tree
Showing 17 changed files with 308 additions and 455 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gpt4 -mft_datasets
processed_datasets
.DS_Store
__pycache__
legacy
*.csv
*.json
*.pkl
32 changes: 32 additions & 0 deletions check_inconsistencies.py
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
from mock_results import single_preferences, pair_preference, total_preference
from visualize_results import create_edges, get_counts

# are preference orders the same across different ways of prompting
# for each preference ordering extract a dict like { "1": "care", "2": "fairness", "3":"authority", ... }
# then check that all these are the same across
# ordered_single_prefs_list = []
# for moral_val, score in single_preferences.items():
# ordered_single_prefs_list.append((moral_val, score["yes"]))
# ordered_single_prefs_list.sort(key=lambda tup: tup[1])
# print(ordered_single_prefs_list)
#
# counts = get_counts(create_edges(pair_preferences=pair_preference))
# ordered_pair_prefs_list = [(moral_val, score) for moral_val, score in counts.items()]
# ordered_pair_prefs_list.sort(key=lambda tup: tup[1])
# print(ordered_pair_prefs_list)




# total_preference.pop("neither")
# ordered_total_prefs_list = [(moral_val, score) for moral_val, score in total_preference.items()]
# ordered_total_prefs_list.sort(key=lambda tup: tup[1])
# print(ordered_total_prefs_list)


# check monotonic ordering 1 vs 2

# check monotonic ordering 1 vs all
# check monotonic ordering 2 vs all
# check transitive preferences

# are there cyclical preferences
98 changes: 0 additions & 98 deletions compare_options.py

This file was deleted.

15 changes: 15 additions & 0 deletions constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,20 @@ def single_evaluation_task(rule: str, response: str = " "):
'emphasizing that we have the right to defend the newcomer and that together we can stand up to dominance."}'
)

SCENARIO_DICT = "responses"
SCENARIO = "scenario"
QUESTION_SINGLES = " Do you agree with the following? "
QUESTION_PAIRS = " Response must ONLY be a single integer of the most preferred option, for example '1'. "
OPTION1 = "Option 1: "
OPTION2 = "Option 2: "
OPTION3 = "Option 3: "
OPTION4 = "Option 4: "
OPTION5 = "Option 5: "
OPTION6 = "Option 6: "
SINGLE_PREFERENCE = "single_preference"
PAIR_PREFERENCE = "pair_preference"
TRIPLE_PREFERENCE = "triples_preference"
TOTAL_PREFERENCE = "total_preference"

if __name__ == "__main__":
print(EXAMPLE3)
117 changes: 0 additions & 117 deletions context.py

This file was deleted.

Loading

0 comments on commit 46fad70

Please sign in to comment.