Upload 4 files
Browse files
scripts/evaluate_information_integration.py
CHANGED
@@ -46,7 +46,7 @@ def evaluate_information_integration(config):
|
|
46 |
logging.info(f"Information IntegrationScore: {scores}")
|
47 |
logging.info(f"Accuracy: {accuracy:.2%}")
|
48 |
|
49 |
-
score_filename = os.path.join(result_path, f
|
50 |
with open(score_filename, 'w') as f:
|
51 |
json.dump(scores, f, ensure_ascii=False, indent=4)
|
52 |
|
|
|
46 |
logging.info(f"Information IntegrationScore: {scores}")
|
47 |
logging.info(f"Accuracy: {accuracy:.2%}")
|
48 |
|
49 |
+
score_filename = os.path.join(result_path, f"scores_{config['output_file_extension']}.json")
|
50 |
with open(score_filename, 'w') as f:
|
51 |
json.dump(scores, f, ensure_ascii=False, indent=4)
|
52 |
|
scripts/evaluate_noise_robustness.py
CHANGED
@@ -45,7 +45,7 @@ def evaluate_noise_robustness(config):
|
|
45 |
logging.info(f"Noise Robustness Score: {scores}")
|
46 |
logging.info(f"Accuracy: {accuracy:.2%}")
|
47 |
|
48 |
-
score_filename = os.path.join(result_path, f
|
49 |
with open(score_filename, 'w') as f:
|
50 |
json.dump(scores, f, ensure_ascii=False, indent=4)
|
51 |
|
|
|
45 |
logging.info(f"Noise Robustness Score: {scores}")
|
46 |
logging.info(f"Accuracy: {accuracy:.2%}")
|
47 |
|
48 |
+
score_filename = os.path.join(result_path, f"scores_{config['output_file_extension']}.json")
|
49 |
with open(score_filename, 'w') as f:
|
50 |
json.dump(scores, f, ensure_ascii=False, indent=4)
|
51 |
|
scripts/get_factual_evaluation.py
CHANGED
@@ -50,7 +50,7 @@ def get_factual_evaluation(config):
|
|
50 |
scores['correct_tt'] = correct_tt
|
51 |
|
52 |
#logging.info(f"score: {scores}")
|
53 |
-
score_filename = os.path.join(result_path, f
|
54 |
with open(score_filename, 'w') as f:
|
55 |
json.dump(scores, f, ensure_ascii=False, indent=4)
|
56 |
|
|
|
50 |
scores['correct_tt'] = correct_tt
|
51 |
|
52 |
#logging.info(f"score: {scores}")
|
53 |
+
score_filename = os.path.join(result_path, f"scores_{config['output_file_extension']}.json")
|
54 |
with open(score_filename, 'w') as f:
|
55 |
json.dump(scores, f, ensure_ascii=False, indent=4)
|
56 |
|
scripts/helper.py
CHANGED
@@ -26,7 +26,7 @@ def load_config(config_file="config.json"):
|
|
26 |
try:
|
27 |
with open(config_file, "r", encoding="utf-8") as f:
|
28 |
config = json.load(f)
|
29 |
-
config['output_file_extension'] = f
|
30 |
return config
|
31 |
except Exception as e:
|
32 |
logging.info(f"Error loading config: {e}")
|
@@ -52,7 +52,7 @@ def update_config(config, model_name=None, noise_rate=None, num_queries=None):
|
|
52 |
if num_queries is not None: # Explicitly check for None to handle 0
|
53 |
config['num_queries'] = int(num_queries) # Ensure it's an integer
|
54 |
|
55 |
-
config['output_file_extension'] = f
|
56 |
|
57 |
return config
|
58 |
|
|
|
26 |
try:
|
27 |
with open(config_file, "r", encoding="utf-8") as f:
|
28 |
config = json.load(f)
|
29 |
+
config['output_file_extension'] = f"{config['model_name']}_noise_{config['noise_rate']}_passage_{config['passage_num']}_num_queries_{config['num_queries']}"
|
30 |
return config
|
31 |
except Exception as e:
|
32 |
logging.info(f"Error loading config: {e}")
|
|
|
52 |
if num_queries is not None: # Explicitly check for None to handle 0
|
53 |
config['num_queries'] = int(num_queries) # Ensure it's an integer
|
54 |
|
55 |
+
config['output_file_extension'] = f"{config['model_name']}_noise_{config['noise_rate']}_passage_{config['passage_num']}_num_queries_{config['num_queries']}"
|
56 |
|
57 |
return config
|
58 |
|