MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / eval_experiment

Function eval_experiment

utils/src/experiment/evals.py:198–232  ·  view source on GitHub ↗
(
    setting: str,
    general_eval: bool = False,
    feature_eval: bool = False,
    ppt_eval: bool = False,
)

Source from the content-addressed store, hash-verified

196
197# ppt eval
198def eval_experiment(
199 setting: str,
200 general_eval: bool = False,
201 feature_eval: bool = False,
202 ppt_eval: bool = False,
203):
204 assert setting != "*"
205 llms.language_model, llms.vision_model, judge_name = judges[0]
206 print(f"evaluating {setting} under {judge_name}")
207 print(
208 "eval config :",
209 f"general_eval: {general_eval}, feature_eval: {feature_eval}, ppt_eval: {ppt_eval}",
210 )
211 eval_file = f"data/evals/{setting}_{judge_name}.json"
212 eval_stats = defaultdict(dict)
213 if pexists(eval_file):
214 eval_stats |= json.load(open(eval_file))
215 config = Config("/tmp")
216 prs_files = glob(f"data/*/pptx/*/{setting}/*/final.pptx")
217 # filename dimension score
218 print("start evaluation")
219 if general_eval or feature_eval:
220 presentations = [Presentation.from_file(i, config) for i in prs_files]
221 if general_eval:
222 eval_general(presentations, eval_stats)
223
224 if feature_eval:
225 eval_feature(presentations, eval_stats, setting)
226
227 if ppt_eval:
228 slide_image_folders = glob(f"data/*/pptx/*/final_images/{setting}/*")
229 for presentation in prs_files:
230 pres_score(presentation)
231 eval_stats = merge_evals(slide_image_folders, eval_stats)
232 json.dump(eval_stats, open(eval_file, "w"), indent=4)
233
234
235def eval_baseline(

Callers

nothing calls this directly

Calls 7

ConfigClass · 0.90
eval_generalFunction · 0.70
eval_featureFunction · 0.70
pres_scoreFunction · 0.70
merge_evalsFunction · 0.70
loadMethod · 0.45
from_fileMethod · 0.45

Tested by

no test coverage detected