wisent 0.7.379__py3-none-any.whl → 0.7.701__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wisent/__init__.py +1 -1
- wisent/core/activations/__init__.py +22 -6
- wisent/core/activations/activations.py +21 -39
- wisent/core/activations/activations_collector.py +141 -373
- wisent/core/activations/classifier_inference_strategy.py +194 -0
- wisent/core/activations/core/atoms.py +8 -92
- wisent/core/activations/extraction_strategy.py +308 -0
- wisent/core/agent/diagnose/response_diagnostics.py +3 -3
- wisent/core/agent/diagnose.py +3 -3
- wisent/core/autonomous_agent.py +2 -2
- wisent/core/cli/agent/apply_steering.py +23 -27
- wisent/core/cli/agent/evaluate_response.py +18 -20
- wisent/core/cli/agent/train_classifier.py +18 -20
- wisent/core/cli/cluster_benchmarks.py +472 -0
- wisent/core/cli/create_steering_vector.py +13 -5
- wisent/core/cli/generate_vector_from_task.py +4 -0
- wisent/core/cli/get_activations.py +12 -36
- wisent/core/cli/method_optimizer.py +859 -0
- wisent/core/cli/optimize.py +44 -5
- wisent/core/cli/optimize_classification.py +5 -6
- wisent/core/cli/optimize_sample_size.py +8 -22
- wisent/core/cli/optimize_steering.py +429 -153
- wisent/core/cli/optimize_weights.py +65 -6
- wisent/core/cli/steering_method_trainer.py +5 -4
- wisent/core/cli/steering_search_space.py +20 -15
- wisent/core/cli/tasks.py +14 -43
- wisent/core/cli/train_unified_goodness.py +17 -18
- wisent/core/contrastive_pairs/diagnostics/control_vectors.py +1578 -173
- wisent/core/contrastive_pairs/diagnostics/linearity.py +63 -80
- wisent/core/contrastive_pairs/diagnostics/vector_quality.py +6 -5
- wisent/core/contrastive_pairs/huggingface_pairs/hf_extractor_manifest.py +5 -19
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/__init__.py +11 -5
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/apps.py +146 -32
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue.py +2 -2
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/humaneval.py +98 -57
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/code_x_glue.py +8 -8
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/freebase.py +1 -1
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_extractor_manifest.py +8 -5
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/agieval_aqua_rat.py +129 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/code_x_glue.py +11 -6
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/gsm8k.py +1 -1
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mbpp.py +47 -6
- wisent/core/evaluators/benchmark_specific/apps_evaluator.py +133 -0
- wisent/core/evaluators/benchmark_specific/coding/metrics/evaluator.py +6 -1
- wisent/core/evaluators/benchmark_specific/conala_evaluator.py +31 -168
- wisent/core/evaluators/custom/examples/humanization_coherent.py +89 -35
- wisent/core/evaluators/oracles/truthfulqa_gen_evaluator.py +2 -20
- wisent/core/evaluators/personalization/coherence.py +46 -0
- wisent/core/hyperparameter_optimizer.py +13 -13
- wisent/core/lm_eval_harness_ground_truth.py +7 -11
- wisent/core/main.py +3 -0
- wisent/core/models/wisent_model.py +8 -7
- wisent/core/opti/methods/opti_weights.py +29 -2
- wisent/core/optuna/classifier/activation_generator.py +14 -12
- wisent/core/optuna/steering/steering_optimization.py +14 -9
- wisent/core/parser_arguments/cluster_benchmarks_parser.py +31 -0
- wisent/core/parser_arguments/generate_vector_from_task_parser.py +20 -0
- wisent/core/parser_arguments/main_parser.py +8 -0
- wisent/core/parser_arguments/optimize_steering_parser.py +117 -10
- wisent/core/parser_arguments/optimize_weights_parser.py +6 -0
- wisent/core/parser_arguments/tasks_parser.py +7 -19
- wisent/core/steering_methods/core/atoms.py +1 -2
- wisent/core/steering_methods/methods/caa.py +1 -1
- wisent/core/steering_methods/methods/hyperplane.py +74 -0
- wisent/core/steering_methods/methods/prism.py +1 -2
- wisent/core/steering_methods/methods/pulse.py +39 -8
- wisent/core/steering_methods/methods/titan.py +59 -14
- wisent/core/steering_methods/registry.py +52 -12
- wisent/core/steering_optimizer.py +15 -15
- wisent/core/trainers/steering_trainer.py +9 -18
- wisent/parameters/lm_eval/track_progress_not_lm_eval_tasks.json +19 -70
- wisent/scripts/run_quality_metrics_sweep.sh +22 -27
- wisent/tests/test_aggregation_geometry.py +236 -0
- wisent/tests/test_detector_accuracy.py +163 -0
- wisent/tests/test_geometry_exhaustive.py +1202 -0
- wisent/tests/visualize_geometry.py +255 -61
- {wisent-0.7.379.dist-info → wisent-0.7.701.dist-info}/METADATA +1 -1
- {wisent-0.7.379.dist-info → wisent-0.7.701.dist-info}/RECORD +82 -714
- wisent/core/activations/prompt_construction_strategy.py +0 -47
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue_code_to_text.py +0 -15
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue_code_to_text_go.py +0 -64
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue_code_to_text_java.py +0 -65
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue_code_to_text_javascript.py +0 -65
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue_code_to_text_php.py +0 -65
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue_code_to_text_python.py +0 -65
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue_code_to_text_ruby.py +0 -65
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/freebase.py +0 -99
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/instruct_humaneval.py +0 -180
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/instructhumaneval.py +0 -129
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/mbpp.py +0 -142
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/agieval.py +0 -155
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/code2text.py +0 -161
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/codexglue.py +0 -107
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/livemathbench.py +0 -155
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/polymath.py +0 -155
- wisent/examples/scripts/results/benchmark_descriptions.json +0 -1244
- wisent/examples/scripts/results/benchmark_evaluation_methods.json +0 -66
- wisent/examples/scripts/results/benchmark_evaluator_mapping.json +0 -2781
- wisent/examples/scripts/results/benchmark_evaluator_mapping_updated.json +0 -30536
- wisent/examples/scripts/results/benchmark_evaluators_clean.json +0 -469
- wisent/examples/scripts/results/benchmark_methods_summary.json +0 -260
- wisent/examples/scripts/results/benchmark_pair_creation_methods.json +0 -66
- wisent/examples/scripts/results/benchmark_pair_totals.json +0 -269
- wisent/examples/scripts/results/benchmark_tags.json +0 -917
- wisent/examples/scripts/results/benchmark_test_summary_nov4.json +0 -71
- wisent/examples/scripts/results/coding_benchmarks_test_code_status.json +0 -150
- wisent/examples/scripts/results/failing_benchmarks.json +0 -946
- wisent/examples/scripts/results/failing_benchmarks_list.json +0 -41
- wisent/examples/scripts/results/failing_benchmarks_test_results.json +0 -945
- wisent/examples/scripts/results/missing_benchmark_tags.json +0 -341
- wisent/examples/scripts/results/test_20_newsgroups_evaluation.json +0 -30
- wisent/examples/scripts/results/test_20_newsgroups_pairs.json +0 -8
- wisent/examples/scripts/results/test_AraDICE_evaluation.json +0 -51
- wisent/examples/scripts/results/test_AraDICE_pairs.json +0 -14
- wisent/examples/scripts/results/test_AraDiCE_boolq_egy/test_AraDiCE_boolq_egy_evaluation.json +0 -30
- wisent/examples/scripts/results/test_AraDiCE_boolq_egy/test_AraDiCE_boolq_egy_pairs.json +0 -8
- wisent/examples/scripts/results/test_ArabCulture_evaluation.json +0 -51
- wisent/examples/scripts/results/test_ArabCulture_pairs.json +0 -14
- wisent/examples/scripts/results/test_Tag_evaluation.json +0 -30
- wisent/examples/scripts/results/test_Tag_pairs.json +0 -8
- wisent/examples/scripts/results/test_aclue_evaluation.json +0 -51
- wisent/examples/scripts/results/test_aclue_pairs.json +0 -14
- wisent/examples/scripts/results/test_acp_bench_evaluation.json +0 -51
- wisent/examples/scripts/results/test_acp_bench_hard_evaluation.json +0 -51
- wisent/examples/scripts/results/test_acp_bench_hard_pairs.json +0 -14
- wisent/examples/scripts/results/test_acp_bench_pairs.json +0 -14
- wisent/examples/scripts/results/test_advanced_ai_risk_evaluation.json +0 -51
- wisent/examples/scripts/results/test_advanced_ai_risk_pairs.json +0 -14
- wisent/examples/scripts/results/test_aexams_evaluation.json +0 -51
- wisent/examples/scripts/results/test_aexams_pairs.json +0 -14
- wisent/examples/scripts/results/test_afrimgsm_direct_amh_evaluation.json +0 -30
- wisent/examples/scripts/results/test_afrimgsm_direct_amh_pairs.json +0 -8
- wisent/examples/scripts/results/test_afrimmlu_direct_amh_evaluation.json +0 -30
- wisent/examples/scripts/results/test_afrimmlu_direct_amh_pairs.json +0 -8
- wisent/examples/scripts/results/test_afrixnli_en_direct_amh_evaluation.json +0 -30
- wisent/examples/scripts/results/test_afrixnli_en_direct_amh_pairs.json +0 -8
- wisent/examples/scripts/results/test_ag_news_evaluation.json +0 -30
- wisent/examples/scripts/results/test_ag_news_pairs.json +0 -8
- wisent/examples/scripts/results/test_agieval_evaluation.json +0 -51
- wisent/examples/scripts/results/test_agieval_pairs.json +0 -14
- wisent/examples/scripts/results/test_aime2024_evaluation.json +0 -30
- wisent/examples/scripts/results/test_aime2024_pairs.json +0 -8
- wisent/examples/scripts/results/test_aime2025_evaluation.json +0 -30
- wisent/examples/scripts/results/test_aime2025_pairs.json +0 -8
- wisent/examples/scripts/results/test_aime_evaluation.json +0 -30
- wisent/examples/scripts/results/test_aime_pairs.json +0 -8
- wisent/examples/scripts/results/test_anagrams1_evaluation.json +0 -30
- wisent/examples/scripts/results/test_anagrams1_pairs.json +0 -8
- wisent/examples/scripts/results/test_anagrams2_evaluation.json +0 -30
- wisent/examples/scripts/results/test_anagrams2_pairs.json +0 -8
- wisent/examples/scripts/results/test_anli_evaluation.json +0 -30
- wisent/examples/scripts/results/test_anli_pairs.json +0 -8
- wisent/examples/scripts/results/test_apps_evaluation.json +0 -30
- wisent/examples/scripts/results/test_apps_pairs.json +0 -8
- wisent/examples/scripts/results/test_arabic_exams_evaluation.json +0 -30
- wisent/examples/scripts/results/test_arabic_exams_pairs.json +0 -8
- wisent/examples/scripts/results/test_arabic_leaderboard_complete_evaluation.json +0 -51
- wisent/examples/scripts/results/test_arabic_leaderboard_complete_pairs.json +0 -14
- wisent/examples/scripts/results/test_arabic_leaderboard_light_evaluation.json +0 -51
- wisent/examples/scripts/results/test_arabic_leaderboard_light_pairs.json +0 -14
- wisent/examples/scripts/results/test_arabicmmlu_evaluation.json +0 -51
- wisent/examples/scripts/results/test_arabicmmlu_pairs.json +0 -14
- wisent/examples/scripts/results/test_aradice/test_aradice_evaluation.json +0 -51
- wisent/examples/scripts/results/test_aradice/test_aradice_pairs.json +0 -14
- wisent/examples/scripts/results/test_aradice3/test_aradice_evaluation.json +0 -51
- wisent/examples/scripts/results/test_aradice3/test_aradice_pairs.json +0 -14
- wisent/examples/scripts/results/test_arc_ar_evaluation.json +0 -30
- wisent/examples/scripts/results/test_arc_ar_pairs.json +0 -8
- wisent/examples/scripts/results/test_arc_challenge_evaluation.json +0 -30
- wisent/examples/scripts/results/test_arc_challenge_pairs.json +0 -8
- wisent/examples/scripts/results/test_arc_easy_evaluation.json +0 -30
- wisent/examples/scripts/results/test_arc_easy_pairs.json +0 -8
- wisent/examples/scripts/results/test_argument_topic_evaluation.json +0 -30
- wisent/examples/scripts/results/test_argument_topic_pairs.json +0 -8
- wisent/examples/scripts/results/test_arithmetic_evaluation.json +0 -51
- wisent/examples/scripts/results/test_arithmetic_pairs.json +0 -14
- wisent/examples/scripts/results/test_asdiv_evaluation.json +0 -30
- wisent/examples/scripts/results/test_asdiv_pairs.json +0 -8
- wisent/examples/scripts/results/test_assin_entailment_evaluation.json +0 -30
- wisent/examples/scripts/results/test_assin_entailment_pairs.json +0 -8
- wisent/examples/scripts/results/test_atis_evaluation.json +0 -30
- wisent/examples/scripts/results/test_atis_pairs.json +0 -8
- wisent/examples/scripts/results/test_babi_evaluation.json +0 -30
- wisent/examples/scripts/results/test_babi_pairs.json +0 -8
- wisent/examples/scripts/results/test_babilong_evaluation.json +0 -30
- wisent/examples/scripts/results/test_babilong_pairs.json +0 -8
- wisent/examples/scripts/results/test_bangla_mmlu_evaluation.json +0 -30
- wisent/examples/scripts/results/test_bangla_mmlu_pairs.json +0 -8
- wisent/examples/scripts/results/test_banking77_evaluation.json +0 -30
- wisent/examples/scripts/results/test_banking77_pairs.json +0 -8
- wisent/examples/scripts/results/test_basque/test_basque-glue_pairs.json +0 -14
- wisent/examples/scripts/results/test_basque-glue_evaluation.json +0 -51
- wisent/examples/scripts/results/test_basque-glue_pairs.json +0 -14
- wisent/examples/scripts/results/test_basque2/test_basque-glue_evaluation.json +0 -51
- wisent/examples/scripts/results/test_basque2/test_basque-glue_pairs.json +0 -14
- wisent/examples/scripts/results/test_basque_bench_evaluation.json +0 -51
- wisent/examples/scripts/results/test_basque_bench_pairs.json +0 -14
- wisent/examples/scripts/results/test_basque_glue/test_basque-glue_evaluation.json +0 -51
- wisent/examples/scripts/results/test_basque_glue/test_basque-glue_pairs.json +0 -14
- wisent/examples/scripts/results/test_basqueglue_evaluation.json +0 -51
- wisent/examples/scripts/results/test_basqueglue_pairs.json +0 -14
- wisent/examples/scripts/results/test_bbh_evaluation.json +0 -51
- wisent/examples/scripts/results/test_bbh_pairs.json +0 -14
- wisent/examples/scripts/results/test_bbq_evaluation.json +0 -30
- wisent/examples/scripts/results/test_bbq_pairs.json +0 -8
- wisent/examples/scripts/results/test_bec2016eu_evaluation.json +0 -51
- wisent/examples/scripts/results/test_bec2016eu_pairs.json +0 -14
- wisent/examples/scripts/results/test_belebele_evaluation.json +0 -51
- wisent/examples/scripts/results/test_belebele_pairs.json +0 -14
- wisent/examples/scripts/results/test_benchmarks_evaluation.json +0 -51
- wisent/examples/scripts/results/test_benchmarks_pairs.json +0 -14
- wisent/examples/scripts/results/test_bertaqa_evaluation.json +0 -51
- wisent/examples/scripts/results/test_bertaqa_pairs.json +0 -14
- wisent/examples/scripts/results/test_bhtc_v2_evaluation.json +0 -30
- wisent/examples/scripts/results/test_bhtc_v2_pairs.json +0 -8
- wisent/examples/scripts/results/test_bigbench_evaluation.json +0 -51
- wisent/examples/scripts/results/test_bigbench_pairs.json +0 -14
- wisent/examples/scripts/results/test_blimp_evaluation.json +0 -51
- wisent/examples/scripts/results/test_blimp_pairs.json +0 -14
- wisent/examples/scripts/results/test_boolq/test_boolq_evaluation.json +0 -30
- wisent/examples/scripts/results/test_boolq/test_boolq_pairs.json +0 -8
- wisent/examples/scripts/results/test_boolq-seq2seq_evaluation.json +0 -30
- wisent/examples/scripts/results/test_boolq-seq2seq_pairs.json +0 -8
- wisent/examples/scripts/results/test_boolq_evaluation.json +0 -30
- wisent/examples/scripts/results/test_boolq_pairs.json +0 -8
- wisent/examples/scripts/results/test_c4_evaluation.json +0 -30
- wisent/examples/scripts/results/test_c4_pairs.json +0 -8
- wisent/examples/scripts/results/test_cabreu_evaluation.json +0 -30
- wisent/examples/scripts/results/test_cabreu_pairs.json +0 -8
- wisent/examples/scripts/results/test_careqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_careqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_catalan_bench_evaluation.json +0 -51
- wisent/examples/scripts/results/test_catalan_bench_pairs.json +0 -14
- wisent/examples/scripts/results/test_catalanqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_catalanqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_catcola_evaluation.json +0 -30
- wisent/examples/scripts/results/test_catcola_pairs.json +0 -8
- wisent/examples/scripts/results/test_cb_evaluation.json +0 -30
- wisent/examples/scripts/results/test_cb_pairs.json +0 -8
- wisent/examples/scripts/results/test_ceval/test_ceval_evaluation.json +0 -51
- wisent/examples/scripts/results/test_ceval/test_ceval_pairs.json +0 -14
- wisent/examples/scripts/results/test_ceval_accountant/test_ceval-valid_accountant_evaluation.json +0 -30
- wisent/examples/scripts/results/test_ceval_accountant/test_ceval-valid_accountant_pairs.json +0 -8
- wisent/examples/scripts/results/test_ceval_evaluation.json +0 -51
- wisent/examples/scripts/results/test_ceval_pairs.json +0 -14
- wisent/examples/scripts/results/test_ceval_valid/test_ceval_valid_evaluation.json +0 -51
- wisent/examples/scripts/results/test_ceval_valid/test_ceval_valid_pairs.json +0 -14
- wisent/examples/scripts/results/test_chain_of_thought_evaluation.json +0 -51
- wisent/examples/scripts/results/test_chain_of_thought_pairs.json +0 -14
- wisent/examples/scripts/results/test_chartqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_chartqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_claim_stance_topic_evaluation.json +0 -30
- wisent/examples/scripts/results/test_claim_stance_topic_pairs.json +0 -8
- wisent/examples/scripts/results/test_cmmlu_evaluation.json +0 -51
- wisent/examples/scripts/results/test_cmmlu_pairs.json +0 -14
- wisent/examples/scripts/results/test_cnn_dailymail_evaluation.json +0 -30
- wisent/examples/scripts/results/test_cnn_dailymail_pairs.json +0 -8
- wisent/examples/scripts/results/test_cocoteros_es_evaluation.json +0 -30
- wisent/examples/scripts/results/test_cocoteros_es_pairs.json +0 -8
- wisent/examples/scripts/results/test_codexglue_code_to_text_go_evaluation.json +0 -30
- wisent/examples/scripts/results/test_codexglue_code_to_text_go_pairs.json +0 -8
- wisent/examples/scripts/results/test_codexglue_code_to_text_java_evaluation.json +0 -30
- wisent/examples/scripts/results/test_codexglue_code_to_text_java_pairs.json +0 -8
- wisent/examples/scripts/results/test_codexglue_code_to_text_javascript_evaluation.json +0 -30
- wisent/examples/scripts/results/test_codexglue_code_to_text_javascript_pairs.json +0 -8
- wisent/examples/scripts/results/test_codexglue_code_to_text_php_evaluation.json +0 -30
- wisent/examples/scripts/results/test_codexglue_code_to_text_php_pairs.json +0 -8
- wisent/examples/scripts/results/test_codexglue_code_to_text_python_evaluation.json +0 -30
- wisent/examples/scripts/results/test_codexglue_code_to_text_python_pairs.json +0 -8
- wisent/examples/scripts/results/test_codexglue_code_to_text_ruby_evaluation.json +0 -30
- wisent/examples/scripts/results/test_codexglue_code_to_text_ruby_pairs.json +0 -8
- wisent/examples/scripts/results/test_coedit_gec_evaluation.json +0 -30
- wisent/examples/scripts/results/test_coedit_gec_pairs.json +0 -8
- wisent/examples/scripts/results/test_cola_evaluation.json +0 -30
- wisent/examples/scripts/results/test_cola_pairs.json +0 -8
- wisent/examples/scripts/results/test_commonsense_qa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_commonsense_qa_pairs.json +0 -8
- wisent/examples/scripts/results/test_conala_evaluation.json +0 -30
- wisent/examples/scripts/results/test_conala_pairs.json +0 -8
- wisent/examples/scripts/results/test_concode_evaluation.json +0 -30
- wisent/examples/scripts/results/test_concode_pairs.json +0 -8
- wisent/examples/scripts/results/test_copa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_copa_pairs.json +0 -8
- wisent/examples/scripts/results/test_copal_id_evaluation.json +0 -30
- wisent/examples/scripts/results/test_copal_id_pairs.json +0 -8
- wisent/examples/scripts/results/test_coqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_coqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_coqcat_evaluation.json +0 -30
- wisent/examples/scripts/results/test_coqcat_pairs.json +0 -8
- wisent/examples/scripts/results/test_crows_pairs_evaluation.json +0 -51
- wisent/examples/scripts/results/test_crows_pairs_pairs.json +0 -14
- wisent/examples/scripts/results/test_csatqa_evaluation.json +0 -51
- wisent/examples/scripts/results/test_csatqa_pairs.json +0 -14
- wisent/examples/scripts/results/test_cycle_letters_evaluation.json +0 -30
- wisent/examples/scripts/results/test_cycle_letters_pairs.json +0 -8
- wisent/examples/scripts/results/test_darija_bench/test_darija_bench_evaluation.json +0 -51
- wisent/examples/scripts/results/test_darija_bench/test_darija_bench_pairs.json +0 -14
- wisent/examples/scripts/results/test_darija_bench_evaluation.json +0 -51
- wisent/examples/scripts/results/test_darija_bench_pairs.json +0 -14
- wisent/examples/scripts/results/test_darijahellaswag_evaluation.json +0 -30
- wisent/examples/scripts/results/test_darijahellaswag_pairs.json +0 -8
- wisent/examples/scripts/results/test_darijammlu_evaluation.json +0 -51
- wisent/examples/scripts/results/test_darijammlu_pairs.json +0 -14
- wisent/examples/scripts/results/test_dbpedia_14_evaluation.json +0 -30
- wisent/examples/scripts/results/test_dbpedia_14_pairs.json +0 -8
- wisent/examples/scripts/results/test_drop_evaluation.json +0 -30
- wisent/examples/scripts/results/test_drop_pairs.json +0 -8
- wisent/examples/scripts/results/test_ds1000_evaluation.json +0 -30
- wisent/examples/scripts/results/test_ds1000_pairs.json +0 -8
- wisent/examples/scripts/results/test_egyhellaswag_evaluation.json +0 -30
- wisent/examples/scripts/results/test_egyhellaswag_pairs.json +0 -8
- wisent/examples/scripts/results/test_egymmlu_evaluation.json +0 -51
- wisent/examples/scripts/results/test_egymmlu_pairs.json +0 -14
- wisent/examples/scripts/results/test_epec_koref_bin_evaluation.json +0 -30
- wisent/examples/scripts/results/test_epec_koref_bin_pairs.json +0 -8
- wisent/examples/scripts/results/test_eq_bench_evaluation.json +0 -30
- wisent/examples/scripts/results/test_eq_bench_pairs.json +0 -8
- wisent/examples/scripts/results/test_escola_evaluation.json +0 -30
- wisent/examples/scripts/results/test_escola_pairs.json +0 -8
- wisent/examples/scripts/results/test_ethics_cm_evaluation.json +0 -30
- wisent/examples/scripts/results/test_ethics_cm_pairs.json +0 -8
- wisent/examples/scripts/results/test_ethos_binary_evaluation.json +0 -30
- wisent/examples/scripts/results/test_ethos_binary_pairs.json +0 -8
- wisent/examples/scripts/results/test_eus_exams/test_eus_exams_evaluation.json +0 -51
- wisent/examples/scripts/results/test_eus_exams/test_eus_exams_pairs.json +0 -14
- wisent/examples/scripts/results/test_eus_exams_es_evaluation.json +0 -51
- wisent/examples/scripts/results/test_eus_exams_es_pairs.json +0 -14
- wisent/examples/scripts/results/test_eus_exams_evaluation.json +0 -51
- wisent/examples/scripts/results/test_eus_exams_pairs.json +0 -14
- wisent/examples/scripts/results/test_eus_proficiency_evaluation.json +0 -30
- wisent/examples/scripts/results/test_eus_proficiency_pairs.json +0 -8
- wisent/examples/scripts/results/test_eus_reading_evaluation.json +0 -30
- wisent/examples/scripts/results/test_eus_reading_pairs.json +0 -8
- wisent/examples/scripts/results/test_eus_trivia_evaluation.json +0 -30
- wisent/examples/scripts/results/test_eus_trivia_pairs.json +0 -8
- wisent/examples/scripts/results/test_evalita-mp_evaluation.json +0 -51
- wisent/examples/scripts/results/test_evalita-mp_pairs.json +0 -14
- wisent/examples/scripts/results/test_evalita-sp_sum_task_fp-small_p1_evaluation.json +0 -30
- wisent/examples/scripts/results/test_evalita-sp_sum_task_fp-small_p1_pairs.json +0 -8
- wisent/examples/scripts/results/test_evalita_LLM_evaluation.json +0 -51
- wisent/examples/scripts/results/test_evalita_LLM_pairs.json +0 -14
- wisent/examples/scripts/results/test_evalita_llm/test_evalita_llm_evaluation.json +0 -51
- wisent/examples/scripts/results/test_evalita_llm/test_evalita_llm_pairs.json +0 -14
- wisent/examples/scripts/results/test_evalita_mp/test_evalita-mp_te_prompt-1_evaluation.json +0 -30
- wisent/examples/scripts/results/test_evalita_mp/test_evalita-mp_te_prompt-1_pairs.json +0 -8
- wisent/examples/scripts/results/test_evalita_mp2/test_evalita_mp_evaluation.json +0 -51
- wisent/examples/scripts/results/test_evalita_mp2/test_evalita_mp_pairs.json +0 -14
- wisent/examples/scripts/results/test_evalita_sp2/test_evalita-sp_sum_task_fp-small_p1_evaluation.json +0 -30
- wisent/examples/scripts/results/test_evalita_sp2/test_evalita-sp_sum_task_fp-small_p1_pairs.json +0 -8
- wisent/examples/scripts/results/test_fda_evaluation.json +0 -30
- wisent/examples/scripts/results/test_fda_pairs.json +0 -8
- wisent/examples/scripts/results/test_financial_tweets_evaluation.json +0 -30
- wisent/examples/scripts/results/test_financial_tweets_pairs.json +0 -8
- wisent/examples/scripts/results/test_fld/test_fld_evaluation.json +0 -30
- wisent/examples/scripts/results/test_fld/test_fld_pairs.json +0 -8
- wisent/examples/scripts/results/test_fld_evaluation.json +0 -30
- wisent/examples/scripts/results/test_fld_fixed/test_fld_evaluation.json +0 -30
- wisent/examples/scripts/results/test_fld_fixed/test_fld_pairs.json +0 -8
- wisent/examples/scripts/results/test_fld_pairs.json +0 -8
- wisent/examples/scripts/results/test_flores_evaluation.json +0 -51
- wisent/examples/scripts/results/test_flores_pairs.json +0 -14
- wisent/examples/scripts/results/test_freebase_evaluation.json +0 -30
- wisent/examples/scripts/results/test_freebase_pairs.json +0 -8
- wisent/examples/scripts/results/test_french_bench_evaluation.json +0 -51
- wisent/examples/scripts/results/test_french_bench_pairs.json +0 -14
- wisent/examples/scripts/results/test_galcola_evaluation.json +0 -30
- wisent/examples/scripts/results/test_galcola_pairs.json +0 -8
- wisent/examples/scripts/results/test_galician_bench_evaluation.json +0 -51
- wisent/examples/scripts/results/test_galician_bench_pairs.json +0 -14
- wisent/examples/scripts/results/test_glianorex_evaluation.json +0 -30
- wisent/examples/scripts/results/test_glianorex_pairs.json +0 -8
- wisent/examples/scripts/results/test_global_mmlu_evaluation.json +0 -51
- wisent/examples/scripts/results/test_global_mmlu_pairs.json +0 -14
- wisent/examples/scripts/results/test_glue_evaluation.json +0 -51
- wisent/examples/scripts/results/test_glue_pairs.json +0 -14
- wisent/examples/scripts/results/test_gpqa_evaluation.json +0 -51
- wisent/examples/scripts/results/test_gpqa_pairs.json +0 -14
- wisent/examples/scripts/results/test_gpt3_translation_benchmarks_evaluation.json +0 -51
- wisent/examples/scripts/results/test_gpt3_translation_benchmarks_pairs.json +0 -14
- wisent/examples/scripts/results/test_groundcocoa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_groundcocoa_pairs.json +0 -8
- wisent/examples/scripts/results/test_gsm8k_evaluation.json +0 -30
- wisent/examples/scripts/results/test_gsm8k_pairs.json +0 -8
- wisent/examples/scripts/results/test_haerae_evaluation.json +0 -51
- wisent/examples/scripts/results/test_haerae_pairs.json +0 -14
- wisent/examples/scripts/results/test_headqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_headqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_hellaswag_evaluation.json +0 -30
- wisent/examples/scripts/results/test_hellaswag_pairs.json +0 -8
- wisent/examples/scripts/results/test_hendrycks_ethics_evaluation.json +0 -51
- wisent/examples/scripts/results/test_hendrycks_ethics_pairs.json +0 -14
- wisent/examples/scripts/results/test_hendrycks_math_evaluation.json +0 -51
- wisent/examples/scripts/results/test_hendrycks_math_pairs.json +0 -14
- wisent/examples/scripts/results/test_histoires_morales_evaluation.json +0 -30
- wisent/examples/scripts/results/test_histoires_morales_pairs.json +0 -8
- wisent/examples/scripts/results/test_hmmt_evaluation.json +0 -30
- wisent/examples/scripts/results/test_hmmt_feb_2025_evaluation.json +0 -30
- wisent/examples/scripts/results/test_hmmt_feb_2025_pairs.json +0 -8
- wisent/examples/scripts/results/test_hmmt_pairs.json +0 -8
- wisent/examples/scripts/results/test_hrm8k_evaluation.json +0 -51
- wisent/examples/scripts/results/test_hrm8k_pairs.json +0 -14
- wisent/examples/scripts/results/test_humaneval_evaluation.json +0 -30
- wisent/examples/scripts/results/test_humaneval_pairs.json +0 -8
- wisent/examples/scripts/results/test_humaneval_plus_evaluation.json +0 -30
- wisent/examples/scripts/results/test_humaneval_plus_pairs.json +0 -8
- wisent/examples/scripts/results/test_ifeval_evaluation.json +0 -30
- wisent/examples/scripts/results/test_ifeval_pairs.json +0 -8
- wisent/examples/scripts/results/test_instruct_humaneval/test_instruct_humaneval_evaluation.json +0 -30
- wisent/examples/scripts/results/test_instruct_humaneval/test_instruct_humaneval_pairs.json +0 -8
- wisent/examples/scripts/results/test_instruct_humaneval_evaluation.json +0 -30
- wisent/examples/scripts/results/test_instruct_humaneval_pairs.json +0 -8
- wisent/examples/scripts/results/test_inverse_scaling_evaluation.json +0 -51
- wisent/examples/scripts/results/test_inverse_scaling_hindsight_neglect_10shot_evaluation.json +0 -30
- wisent/examples/scripts/results/test_inverse_scaling_hindsight_neglect_10shot_pairs.json +0 -8
- wisent/examples/scripts/results/test_inverse_scaling_mc/test_inverse_scaling_mc_evaluation.json +0 -51
- wisent/examples/scripts/results/test_inverse_scaling_mc/test_inverse_scaling_mc_pairs.json +0 -14
- wisent/examples/scripts/results/test_inverse_scaling_pairs.json +0 -14
- wisent/examples/scripts/results/test_iwslt2017-ar-en_evaluation.json +0 -30
- wisent/examples/scripts/results/test_iwslt2017-ar-en_pairs.json +0 -8
- wisent/examples/scripts/results/test_iwslt2017-en-ar_evaluation.json +0 -30
- wisent/examples/scripts/results/test_iwslt2017-en-ar_pairs.json +0 -8
- wisent/examples/scripts/results/test_iwslt2017_ar_en/test_iwslt2017-ar-en_evaluation.json +0 -30
- wisent/examples/scripts/results/test_iwslt2017_ar_en/test_iwslt2017-ar-en_pairs.json +0 -8
- wisent/examples/scripts/results/test_iwslt2017_en_ar/test_iwslt2017-en-ar_evaluation.json +0 -30
- wisent/examples/scripts/results/test_iwslt2017_en_ar/test_iwslt2017-en-ar_pairs.json +0 -8
- wisent/examples/scripts/results/test_iwslt2017_group/test_iwslt2017_evaluation.json +0 -30
- wisent/examples/scripts/results/test_iwslt2017_group/test_iwslt2017_pairs.json +0 -8
- wisent/examples/scripts/results/test_japanese_leaderboard_evaluation.json +0 -51
- wisent/examples/scripts/results/test_japanese_leaderboard_pairs.json +0 -14
- wisent/examples/scripts/results/test_jsonschema_bench/test_jsonschema_bench_evaluation.json +0 -30
- wisent/examples/scripts/results/test_jsonschema_bench/test_jsonschema_bench_pairs.json +0 -8
- wisent/examples/scripts/results/test_jsonschema_bench_evaluation.json +0 -30
- wisent/examples/scripts/results/test_jsonschema_bench_final/test_jsonschema_bench_evaluation.json +0 -30
- wisent/examples/scripts/results/test_jsonschema_bench_final/test_jsonschema_bench_pairs.json +0 -8
- wisent/examples/scripts/results/test_jsonschema_bench_pairs.json +0 -8
- wisent/examples/scripts/results/test_kbl_evaluation.json +0 -51
- wisent/examples/scripts/results/test_kbl_fixed/test_kbl_evaluation.json +0 -51
- wisent/examples/scripts/results/test_kbl_fixed/test_kbl_pairs.json +0 -14
- wisent/examples/scripts/results/test_kbl_pairs.json +0 -14
- wisent/examples/scripts/results/test_kmmlu_evaluation.json +0 -51
- wisent/examples/scripts/results/test_kmmlu_pairs.json +0 -14
- wisent/examples/scripts/results/test_kobest_evaluation.json +0 -51
- wisent/examples/scripts/results/test_kobest_pairs.json +0 -14
- wisent/examples/scripts/results/test_kormedmcqa/test_kormedmcqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_kormedmcqa/test_kormedmcqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_kormedmcqa_dentist/test_kormedmcqa_dentist_evaluation.json +0 -30
- wisent/examples/scripts/results/test_kormedmcqa_dentist/test_kormedmcqa_dentist_pairs.json +0 -8
- wisent/examples/scripts/results/test_kormedmcqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_kormedmcqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_lambada_cloze_evaluation.json +0 -30
- wisent/examples/scripts/results/test_lambada_cloze_pairs.json +0 -8
- wisent/examples/scripts/results/test_lambada_evaluation.json +0 -30
- wisent/examples/scripts/results/test_lambada_final/test_lambada_openai_mt_stablelm_en_evaluation.json +0 -30
- wisent/examples/scripts/results/test_lambada_final/test_lambada_openai_mt_stablelm_en_pairs.json +0 -8
- wisent/examples/scripts/results/test_lambada_multilingual/test_lambada_multilingual_evaluation.json +0 -51
- wisent/examples/scripts/results/test_lambada_multilingual/test_lambada_multilingual_pairs.json +0 -14
- wisent/examples/scripts/results/test_lambada_multilingual_evaluation.json +0 -51
- wisent/examples/scripts/results/test_lambada_multilingual_pairs.json +0 -14
- wisent/examples/scripts/results/test_lambada_multilingual_stablelm_evaluation.json +0 -51
- wisent/examples/scripts/results/test_lambada_multilingual_stablelm_pairs.json +0 -14
- wisent/examples/scripts/results/test_lambada_openai_evaluation.json +0 -30
- wisent/examples/scripts/results/test_lambada_openai_pairs.json +0 -8
- wisent/examples/scripts/results/test_lambada_pairs.json +0 -8
- wisent/examples/scripts/results/test_lambada_stablelm_en_fixed/test_lambada_openai_mt_stablelm_en_evaluation.json +0 -30
- wisent/examples/scripts/results/test_lambada_stablelm_en_fixed/test_lambada_openai_mt_stablelm_en_pairs.json +0 -8
- wisent/examples/scripts/results/test_lambada_stablelm_fixed/test_lambada_openai_mt_stablelm_en_evaluation.json +0 -30
- wisent/examples/scripts/results/test_lambada_stablelm_fixed/test_lambada_openai_mt_stablelm_en_pairs.json +0 -8
- wisent/examples/scripts/results/test_lambada_standard_evaluation.json +0 -30
- wisent/examples/scripts/results/test_lambada_standard_pairs.json +0 -8
- wisent/examples/scripts/results/test_leaderboard_evaluation.json +0 -51
- wisent/examples/scripts/results/test_leaderboard_pairs.json +0 -14
- wisent/examples/scripts/results/test_libra/test_libra_evaluation.json +0 -51
- wisent/examples/scripts/results/test_libra/test_libra_pairs.json +0 -14
- wisent/examples/scripts/results/test_libra_evaluation.json +0 -51
- wisent/examples/scripts/results/test_libra_pairs.json +0 -14
- wisent/examples/scripts/results/test_lingoly_evaluation.json +0 -30
- wisent/examples/scripts/results/test_lingoly_pairs.json +0 -8
- wisent/examples/scripts/results/test_livecodebench_evaluation.json +0 -30
- wisent/examples/scripts/results/test_livecodebench_pairs.json +0 -8
- wisent/examples/scripts/results/test_livemathbench_cnmo_en_evaluation.json +0 -30
- wisent/examples/scripts/results/test_livemathbench_cnmo_en_pairs.json +0 -8
- wisent/examples/scripts/results/test_livemathbench_cnmo_zh_evaluation.json +0 -30
- wisent/examples/scripts/results/test_livemathbench_cnmo_zh_pairs.json +0 -8
- wisent/examples/scripts/results/test_llama_evaluation.json +0 -30
- wisent/examples/scripts/results/test_llama_pairs.json +0 -8
- wisent/examples/scripts/results/test_logiqa2_evaluation.json +0 -30
- wisent/examples/scripts/results/test_logiqa2_pairs.json +0 -8
- wisent/examples/scripts/results/test_logiqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_logiqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_m_mmlu_evaluation.json +0 -51
- wisent/examples/scripts/results/test_m_mmlu_pairs.json +0 -14
- wisent/examples/scripts/results/test_mastermind/test_mastermind_evaluation.json +0 -51
- wisent/examples/scripts/results/test_mastermind/test_mastermind_pairs.json +0 -14
- wisent/examples/scripts/results/test_mastermind_24_easy/test_mastermind_24_easy_evaluation.json +0 -30
- wisent/examples/scripts/results/test_mastermind_24_easy/test_mastermind_24_easy_pairs.json +0 -8
- wisent/examples/scripts/results/test_mastermind_evaluation.json +0 -51
- wisent/examples/scripts/results/test_mastermind_pairs.json +0 -14
- wisent/examples/scripts/results/test_math500_evaluation.json +0 -30
- wisent/examples/scripts/results/test_math500_pairs.json +0 -8
- wisent/examples/scripts/results/test_math_evaluation.json +0 -30
- wisent/examples/scripts/results/test_math_pairs.json +0 -8
- wisent/examples/scripts/results/test_mathqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_mathqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_mbpp_evaluation.json +0 -30
- wisent/examples/scripts/results/test_mbpp_pairs.json +0 -8
- wisent/examples/scripts/results/test_mbpp_plus_evaluation.json +0 -30
- wisent/examples/scripts/results/test_mbpp_plus_pairs.json +0 -8
- wisent/examples/scripts/results/test_mc_taco_evaluation.json +0 -30
- wisent/examples/scripts/results/test_mc_taco_pairs.json +0 -8
- wisent/examples/scripts/results/test_med_concepts_qa/test_med_concepts_qa_evaluation.json +0 -51
- wisent/examples/scripts/results/test_med_concepts_qa/test_med_concepts_qa_pairs.json +0 -14
- wisent/examples/scripts/results/test_med_concepts_qa_atc_easy/test_med_concepts_qa_atc_easy_evaluation.json +0 -30
- wisent/examples/scripts/results/test_med_concepts_qa_atc_easy/test_med_concepts_qa_atc_easy_pairs.json +0 -8
- wisent/examples/scripts/results/test_med_concepts_qa_evaluation.json +0 -51
- wisent/examples/scripts/results/test_med_concepts_qa_pairs.json +0 -14
- wisent/examples/scripts/results/test_meddialog_evaluation.json +0 -30
- wisent/examples/scripts/results/test_meddialog_pairs.json +0 -8
- wisent/examples/scripts/results/test_meddialog_raw_perplexity/test_meddialog_raw_perplexity_evaluation.json +0 -30
- wisent/examples/scripts/results/test_meddialog_raw_perplexity/test_meddialog_raw_perplexity_pairs.json +0 -8
- wisent/examples/scripts/results/test_mediqa_qa2019_evaluation.json +0 -30
- wisent/examples/scripts/results/test_mediqa_qa2019_pairs.json +0 -8
- wisent/examples/scripts/results/test_medmcqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_medmcqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_medqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_medqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_medtext_evaluation.json +0 -30
- wisent/examples/scripts/results/test_medtext_pairs.json +0 -8
- wisent/examples/scripts/results/test_mela_evaluation.json +0 -51
- wisent/examples/scripts/results/test_mela_pairs.json +0 -14
- wisent/examples/scripts/results/test_meqsum_evaluation.json +0 -30
- wisent/examples/scripts/results/test_meqsum_pairs.json +0 -8
- wisent/examples/scripts/results/test_mercury_evaluation.json +0 -30
- wisent/examples/scripts/results/test_mercury_pairs.json +0 -8
- wisent/examples/scripts/results/test_metabench_evaluation.json +0 -51
- wisent/examples/scripts/results/test_metabench_pairs.json +0 -14
- wisent/examples/scripts/results/test_mgsm_evaluation.json +0 -51
- wisent/examples/scripts/results/test_mgsm_pairs.json +0 -14
- wisent/examples/scripts/results/test_mimic_repsum_evaluation.json +0 -30
- wisent/examples/scripts/results/test_mimic_repsum_pairs.json +0 -8
- wisent/examples/scripts/results/test_minerva_math_evaluation.json +0 -51
- wisent/examples/scripts/results/test_minerva_math_pairs.json +0 -14
- wisent/examples/scripts/results/test_mlqa_evaluation.json +0 -51
- wisent/examples/scripts/results/test_mlqa_pairs.json +0 -14
- wisent/examples/scripts/results/test_mmlu-pro-plus_evaluation.json +0 -51
- wisent/examples/scripts/results/test_mmlu-pro-plus_pairs.json +0 -14
- wisent/examples/scripts/results/test_mmlu_evaluation.json +0 -51
- wisent/examples/scripts/results/test_mmlu_pairs.json +0 -14
- wisent/examples/scripts/results/test_mmlu_pro_evaluation.json +0 -51
- wisent/examples/scripts/results/test_mmlu_pro_pairs.json +0 -14
- wisent/examples/scripts/results/test_mmlu_prox_evaluation.json +0 -51
- wisent/examples/scripts/results/test_mmlu_prox_pairs.json +0 -14
- wisent/examples/scripts/results/test_mmlusr_evaluation.json +0 -30
- wisent/examples/scripts/results/test_mmlusr_pairs.json +0 -8
- wisent/examples/scripts/results/test_mmmu_evaluation.json +0 -51
- wisent/examples/scripts/results/test_mmmu_pairs.json +0 -14
- wisent/examples/scripts/results/test_mnli_evaluation.json +0 -30
- wisent/examples/scripts/results/test_mnli_pairs.json +0 -8
- wisent/examples/scripts/results/test_model_written_evals_evaluation.json +0 -51
- wisent/examples/scripts/results/test_model_written_evals_pairs.json +0 -14
- wisent/examples/scripts/results/test_moral_stories_evaluation.json +0 -30
- wisent/examples/scripts/results/test_moral_stories_pairs.json +0 -8
- wisent/examples/scripts/results/test_mts_dialog_evaluation.json +0 -30
- wisent/examples/scripts/results/test_mts_dialog_pairs.json +0 -8
- wisent/examples/scripts/results/test_multiblimp_evaluation.json +0 -51
- wisent/examples/scripts/results/test_multiblimp_pairs.json +0 -14
- wisent/examples/scripts/results/test_multimedqa_evaluation.json +0 -51
- wisent/examples/scripts/results/test_multimedqa_pairs.json +0 -14
- wisent/examples/scripts/results/test_multipl_e_evaluation.json +0 -30
- wisent/examples/scripts/results/test_multipl_e_pairs.json +0 -8
- wisent/examples/scripts/results/test_mutual_evaluation.json +0 -30
- wisent/examples/scripts/results/test_mutual_pairs.json +0 -8
- wisent/examples/scripts/results/test_non_greedy_robustness_agieval_aqua_rat_evaluation.json +0 -30
- wisent/examples/scripts/results/test_non_greedy_robustness_agieval_aqua_rat_pairs.json +0 -8
- wisent/examples/scripts/results/test_noreval_evaluation.json +0 -51
- wisent/examples/scripts/results/test_noreval_pairs.json +0 -14
- wisent/examples/scripts/results/test_noticia_evaluation.json +0 -30
- wisent/examples/scripts/results/test_noticia_pairs.json +0 -8
- wisent/examples/scripts/results/test_nq_open_evaluation.json +0 -30
- wisent/examples/scripts/results/test_nq_open_pairs.json +0 -8
- wisent/examples/scripts/results/test_olaph_evaluation.json +0 -30
- wisent/examples/scripts/results/test_olaph_pairs.json +0 -8
- wisent/examples/scripts/results/test_openbookqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_openbookqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_openllm_evaluation.json +0 -51
- wisent/examples/scripts/results/test_openllm_pairs.json +0 -14
- wisent/examples/scripts/results/test_option_order_robustness_agieval_aqua_rat_evaluation.json +0 -30
- wisent/examples/scripts/results/test_option_order_robustness_agieval_aqua_rat_pairs.json +0 -8
- wisent/examples/scripts/results/test_paloma_evaluation.json +0 -51
- wisent/examples/scripts/results/test_paloma_pairs.json +0 -14
- wisent/examples/scripts/results/test_passkey/test_passkey_evaluation.json +0 -30
- wisent/examples/scripts/results/test_passkey/test_passkey_pairs.json +0 -8
- wisent/examples/scripts/results/test_paws-x_evaluation.json +0 -51
- wisent/examples/scripts/results/test_paws-x_pairs.json +0 -14
- wisent/examples/scripts/results/test_paws_en/test_paws_en_evaluation.json +0 -30
- wisent/examples/scripts/results/test_paws_en/test_paws_en_pairs.json +0 -8
- wisent/examples/scripts/results/test_penn_treebank_evaluation.json +0 -30
- wisent/examples/scripts/results/test_penn_treebank_pairs.json +0 -8
- wisent/examples/scripts/results/test_pile_10k/test_pile_10k_evaluation.json +0 -30
- wisent/examples/scripts/results/test_pile_10k/test_pile_10k_pairs.json +0 -8
- wisent/examples/scripts/results/test_piqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_piqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_polemo2_evaluation.json +0 -30
- wisent/examples/scripts/results/test_polemo2_pairs.json +0 -8
- wisent/examples/scripts/results/test_polymath_en_high_evaluation.json +0 -30
- wisent/examples/scripts/results/test_polymath_en_high_pairs.json +0 -8
- wisent/examples/scripts/results/test_polymath_en_medium_evaluation.json +0 -30
- wisent/examples/scripts/results/test_polymath_en_medium_pairs.json +0 -8
- wisent/examples/scripts/results/test_polymath_zh_high_evaluation.json +0 -30
- wisent/examples/scripts/results/test_polymath_zh_high_pairs.json +0 -8
- wisent/examples/scripts/results/test_polymath_zh_medium_evaluation.json +0 -30
- wisent/examples/scripts/results/test_polymath_zh_medium_pairs.json +0 -8
- wisent/examples/scripts/results/test_portuguese_bench_evaluation.json +0 -51
- wisent/examples/scripts/results/test_portuguese_bench_pairs.json +0 -14
- wisent/examples/scripts/results/test_prompt_robustness_agieval_aqua_rat/test_prompt_robustness_agieval_aqua_rat_evaluation.json +0 -30
- wisent/examples/scripts/results/test_prompt_robustness_agieval_aqua_rat/test_prompt_robustness_agieval_aqua_rat_pairs.json +0 -8
- wisent/examples/scripts/results/test_prompt_robustness_agieval_aqua_rat_evaluation.json +0 -30
- wisent/examples/scripts/results/test_prompt_robustness_agieval_aqua_rat_pairs.json +0 -8
- wisent/examples/scripts/results/test_prost_evaluation.json +0 -30
- wisent/examples/scripts/results/test_prost_pairs.json +0 -8
- wisent/examples/scripts/results/test_ptb_evaluation.json +0 -30
- wisent/examples/scripts/results/test_ptb_pairs.json +0 -8
- wisent/examples/scripts/results/test_pubmedqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_pubmedqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_pythia_evaluation.json +0 -51
- wisent/examples/scripts/results/test_pythia_pairs.json +0 -14
- wisent/examples/scripts/results/test_qa4mre_evaluation.json +0 -30
- wisent/examples/scripts/results/test_qa4mre_pairs.json +0 -8
- wisent/examples/scripts/results/test_qasper_evaluation.json +0 -30
- wisent/examples/scripts/results/test_qasper_pairs.json +0 -8
- wisent/examples/scripts/results/test_race_evaluation.json +0 -30
- wisent/examples/scripts/results/test_race_pairs.json +0 -8
- wisent/examples/scripts/results/test_realtoxicityprompts_evaluation.json +0 -30
- wisent/examples/scripts/results/test_realtoxicityprompts_pairs.json +0 -8
- wisent/examples/scripts/results/test_recode_evaluation.json +0 -30
- wisent/examples/scripts/results/test_recode_pairs.json +0 -8
- wisent/examples/scripts/results/test_record_evaluation.json +0 -30
- wisent/examples/scripts/results/test_record_pairs.json +0 -8
- wisent/examples/scripts/results/test_ruler_evaluation.json +0 -51
- wisent/examples/scripts/results/test_ruler_pairs.json +0 -14
- wisent/examples/scripts/results/test_sciq_evaluation.json +0 -30
- wisent/examples/scripts/results/test_sciq_pairs.json +0 -8
- wisent/examples/scripts/results/test_score_evaluation.json +0 -51
- wisent/examples/scripts/results/test_score_pairs.json +0 -14
- wisent/examples/scripts/results/test_self_consistency_evaluation.json +0 -30
- wisent/examples/scripts/results/test_self_consistency_pairs.json +0 -8
- wisent/examples/scripts/results/test_siqa/test_siqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_siqa/test_siqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_siqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_siqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_spanish_bench_evaluation.json +0 -51
- wisent/examples/scripts/results/test_spanish_bench_pairs.json +0 -14
- wisent/examples/scripts/results/test_squad2_evaluation.json +0 -30
- wisent/examples/scripts/results/test_squad2_pairs.json +0 -8
- wisent/examples/scripts/results/test_squadv2_evaluation.json +0 -30
- wisent/examples/scripts/results/test_squadv2_pairs.json +0 -8
- wisent/examples/scripts/results/test_super-glue-lm-eval-v1-seq2seq_evaluation.json +0 -30
- wisent/examples/scripts/results/test_super-glue-lm-eval-v1-seq2seq_pairs.json +0 -8
- wisent/examples/scripts/results/test_super-glue-lm-eval-v1_evaluation.json +0 -51
- wisent/examples/scripts/results/test_super-glue-lm-eval-v1_pairs.json +0 -14
- wisent/examples/scripts/results/test_swag_evaluation.json +0 -30
- wisent/examples/scripts/results/test_swag_pairs.json +0 -8
- wisent/examples/scripts/results/test_tinyBenchmarks_evaluation.json +0 -51
- wisent/examples/scripts/results/test_tinyBenchmarks_pairs.json +0 -14
- wisent/examples/scripts/results/test_tmmluplus_evaluation.json +0 -51
- wisent/examples/scripts/results/test_tmmluplus_pairs.json +0 -14
- wisent/examples/scripts/results/test_translation_evaluation.json +0 -51
- wisent/examples/scripts/results/test_translation_pairs.json +0 -14
- wisent/examples/scripts/results/test_triviaqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_triviaqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_truthfulqa-multi_evaluation.json +0 -51
- wisent/examples/scripts/results/test_truthfulqa-multi_pairs.json +0 -14
- wisent/examples/scripts/results/test_truthfulqa_evaluation.json +0 -30
- wisent/examples/scripts/results/test_truthfulqa_mc1_evaluation.json +0 -30
- wisent/examples/scripts/results/test_truthfulqa_mc1_pairs.json +0 -8
- wisent/examples/scripts/results/test_truthfulqa_mc2_evaluation.json +0 -30
- wisent/examples/scripts/results/test_truthfulqa_mc2_pairs.json +0 -8
- wisent/examples/scripts/results/test_truthfulqa_pairs.json +0 -8
- wisent/examples/scripts/results/test_turkishmmlu_evaluation.json +0 -51
- wisent/examples/scripts/results/test_turkishmmlu_pairs.json +0 -14
- wisent/examples/scripts/results/test_unfair_tos_evaluation.json +0 -30
- wisent/examples/scripts/results/test_unfair_tos_pairs.json +0 -8
- wisent/examples/scripts/results/test_unscramble_evaluation.json +0 -51
- wisent/examples/scripts/results/test_unscramble_pairs.json +0 -14
- wisent/examples/scripts/results/test_webqs_evaluation.json +0 -30
- wisent/examples/scripts/results/test_webqs_pairs.json +0 -8
- wisent/examples/scripts/results/test_wikitext103_evaluation.json +0 -30
- wisent/examples/scripts/results/test_wikitext103_pairs.json +0 -8
- wisent/examples/scripts/results/test_wikitext_evaluation.json +0 -30
- wisent/examples/scripts/results/test_wikitext_pairs.json +0 -8
- wisent/examples/scripts/results/test_winogender_evaluation.json +0 -51
- wisent/examples/scripts/results/test_winogender_pairs.json +0 -14
- wisent/examples/scripts/results/test_winogrande_evaluation.json +0 -30
- wisent/examples/scripts/results/test_winogrande_pairs.json +0 -8
- wisent/examples/scripts/results/test_wmdp_evaluation.json +0 -30
- wisent/examples/scripts/results/test_wmdp_pairs.json +0 -8
- wisent/examples/scripts/results/test_wmt-ro-en-t5-prompt_evaluation.json +0 -30
- wisent/examples/scripts/results/test_wmt-ro-en-t5-prompt_pairs.json +0 -8
- wisent/examples/scripts/results/test_wmt14_en_fr_evaluation.json +0 -30
- wisent/examples/scripts/results/test_wmt14_en_fr_pairs.json +0 -8
- wisent/examples/scripts/results/test_wmt16_en_de_evaluation.json +0 -30
- wisent/examples/scripts/results/test_wmt16_en_de_pairs.json +0 -8
- wisent/examples/scripts/results/test_wmt16_ro_en_evaluation.json +0 -30
- wisent/examples/scripts/results/test_wmt16_ro_en_pairs.json +0 -8
- wisent/examples/scripts/results/test_wsc273_evaluation.json +0 -30
- wisent/examples/scripts/results/test_wsc273_pairs.json +0 -8
- wisent/examples/scripts/results/test_xcopa_evaluation.json +0 -51
- wisent/examples/scripts/results/test_xcopa_pairs.json +0 -14
- wisent/examples/scripts/results/test_xnli_eu_evaluation.json +0 -30
- wisent/examples/scripts/results/test_xnli_eu_pairs.json +0 -8
- wisent/examples/scripts/results/test_xnli_evaluation.json +0 -51
- wisent/examples/scripts/results/test_xnli_pairs.json +0 -14
- wisent/examples/scripts/results/test_xquad_evaluation.json +0 -51
- wisent/examples/scripts/results/test_xquad_pairs.json +0 -14
- wisent/examples/scripts/results/test_xstorycloze_evaluation.json +0 -51
- wisent/examples/scripts/results/test_xstorycloze_pairs.json +0 -14
- wisent/examples/scripts/results/test_xsum_evaluation.json +0 -30
- wisent/examples/scripts/results/test_xsum_pairs.json +0 -8
- wisent/examples/scripts/results/test_xwinograd_evaluation.json +0 -51
- wisent/examples/scripts/results/test_xwinograd_pairs.json +0 -14
- wisent/examples/scripts/results/test_yahoo_answers_topics_evaluation.json +0 -30
- wisent/examples/scripts/results/test_yahoo_answers_topics_pairs.json +0 -8
- {wisent-0.7.379.dist-info → wisent-0.7.701.dist-info}/WHEEL +0 -0
- {wisent-0.7.379.dist-info → wisent-0.7.701.dist-info}/entry_points.txt +0 -0
- {wisent-0.7.379.dist-info → wisent-0.7.701.dist-info}/licenses/LICENSE +0 -0
- {wisent-0.7.379.dist-info → wisent-0.7.701.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"""
|
|
2
|
+
APPS (Automated Programming Progress Standard) Evaluator.
|
|
3
|
+
|
|
4
|
+
Script workflow:
|
|
5
|
+
1. code = APPSEvaluator.extract_code_from_json(raw_response)
|
|
6
|
+
2. code = AppsExtractor.prepend_imports(code)
|
|
7
|
+
3. test_code, _ = AppsExtractor.build_test_code(input_output)
|
|
8
|
+
4. result = evaluator.evaluate(code, expected=None, test_code=test_code)
|
|
9
|
+
|
|
10
|
+
Dataset: codeparrot/apps (10,000 Python coding problems)
|
|
11
|
+
Paper: https://arxiv.org/abs/2105.09938
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import re
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
20
|
+
from wisent.core.evaluators.core.atoms import BaseEvaluator, EvalResult
|
|
21
|
+
from wisent.core.evaluators.benchmark_specific.coding.metrics.evaluator import CodingEvaluator
|
|
22
|
+
|
|
23
|
+
# Import shared utilities from extractor
|
|
24
|
+
from wisent.core.contrastive_pairs.huggingface_pairs.hf_task_extractors.apps import AppsExtractor
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class APPSEvaluator(BaseEvaluator):
|
|
28
|
+
"""Evaluator for APPS benchmark. Delegates to CodingEvaluator."""
|
|
29
|
+
|
|
30
|
+
name = "apps"
|
|
31
|
+
description = "APPS coding benchmark evaluator"
|
|
32
|
+
|
|
33
|
+
def __init__(self):
|
|
34
|
+
self._coding_evaluator = CodingEvaluator()
|
|
35
|
+
|
|
36
|
+
# --- Static helper methods for scripts ---
|
|
37
|
+
# Reuse from AppsExtractor
|
|
38
|
+
prepend_imports = staticmethod(AppsExtractor._prepend_imports)
|
|
39
|
+
build_test_code = staticmethod(AppsExtractor._build_test_code_from_io)
|
|
40
|
+
|
|
41
|
+
@staticmethod
|
|
42
|
+
def get_prompt(
|
|
43
|
+
question: str,
|
|
44
|
+
starter_code: str | None = None,
|
|
45
|
+
fn_name: str | None = None,
|
|
46
|
+
) -> str:
|
|
47
|
+
"""Generate prompt for the model.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
question: Problem description
|
|
51
|
+
starter_code: Optional starter code template
|
|
52
|
+
fn_name: If provided, this is a call-based (LeetCode) problem
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
Formatted prompt string
|
|
56
|
+
"""
|
|
57
|
+
prompt = "You are an expert Python programmer. Solve the following coding problem.\n\n"
|
|
58
|
+
prompt += f"Problem:\n{question}\n\n"
|
|
59
|
+
|
|
60
|
+
if starter_code and starter_code.strip():
|
|
61
|
+
prompt += f"Starter code (you must use this):\n```python\n{starter_code}\n```\n\n"
|
|
62
|
+
|
|
63
|
+
prompt += 'Output your solution as a JSON object: {"code": "your_python_code_here"}\n'
|
|
64
|
+
|
|
65
|
+
if fn_name:
|
|
66
|
+
prompt += "Implement the Solution class with the required method.\n"
|
|
67
|
+
else:
|
|
68
|
+
prompt += "Your code should read from stdin and write to stdout.\n"
|
|
69
|
+
|
|
70
|
+
prompt += "\nRespond with ONLY the JSON object, no other text."
|
|
71
|
+
return prompt
|
|
72
|
+
|
|
73
|
+
@staticmethod
|
|
74
|
+
def extract_code_from_json(response: str) -> str | None:
|
|
75
|
+
"""Extract code from JSON response."""
|
|
76
|
+
# Try direct JSON parse
|
|
77
|
+
try:
|
|
78
|
+
data = json.loads(response.strip())
|
|
79
|
+
if isinstance(data, dict) and "code" in data:
|
|
80
|
+
return data["code"]
|
|
81
|
+
except json.JSONDecodeError:
|
|
82
|
+
pass
|
|
83
|
+
|
|
84
|
+
# Try regex for multiline JSON
|
|
85
|
+
match = re.search(r'\{\s*"code"\s*:\s*"((?:[^"\\]|\\.)*)"\s*\}', response, re.DOTALL)
|
|
86
|
+
if match:
|
|
87
|
+
try:
|
|
88
|
+
data = json.loads(match.group(0))
|
|
89
|
+
if "code" in data:
|
|
90
|
+
return data["code"]
|
|
91
|
+
except json.JSONDecodeError:
|
|
92
|
+
pass
|
|
93
|
+
|
|
94
|
+
# Fallback: code blocks
|
|
95
|
+
for pattern in [r'```python\n(.*?)\n```', r'```\n(.*?)\n```']:
|
|
96
|
+
match = re.search(pattern, response, re.DOTALL)
|
|
97
|
+
if match:
|
|
98
|
+
return match.group(1)
|
|
99
|
+
|
|
100
|
+
return None
|
|
101
|
+
|
|
102
|
+
# --- Evaluator interface ---
|
|
103
|
+
|
|
104
|
+
def evaluate(self, response: str, expected: Any, **kwargs) -> EvalResult:
|
|
105
|
+
"""Evaluate code against test cases.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
response: Already-extracted and prepared Python code
|
|
109
|
+
expected: Not used
|
|
110
|
+
**kwargs:
|
|
111
|
+
test_code: Already-generated test code
|
|
112
|
+
|
|
113
|
+
Returns:
|
|
114
|
+
EvalResult from CodingEvaluator
|
|
115
|
+
"""
|
|
116
|
+
test_code = kwargs.get("test_code")
|
|
117
|
+
|
|
118
|
+
if not test_code:
|
|
119
|
+
return EvalResult(
|
|
120
|
+
ground_truth="UNKNOWN",
|
|
121
|
+
method_used=self.name,
|
|
122
|
+
confidence=0.0,
|
|
123
|
+
details="No test_code provided",
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
return self._coding_evaluator.evaluate(
|
|
127
|
+
response=response,
|
|
128
|
+
expected=None,
|
|
129
|
+
test_code=test_code,
|
|
130
|
+
entry_point=None,
|
|
131
|
+
task_name="apps",
|
|
132
|
+
language="python",
|
|
133
|
+
)
|
|
@@ -223,11 +223,16 @@ if __name__ == "__main__":
|
|
|
223
223
|
try:
|
|
224
224
|
from wisent.core.evaluators.benchmark_specific.coding.safe_docker.core.atoms import Job
|
|
225
225
|
|
|
226
|
-
# Set limits based on task
|
|
226
|
+
# Set limits based on task or kwargs
|
|
227
|
+
timeout_override = kwargs.get('timeout')
|
|
227
228
|
if 'ds1000' in task_name.lower() or 'ds_1000' in task_name.lower():
|
|
228
229
|
cpu_limit_s = 60
|
|
229
230
|
wall_timeout_s = 120
|
|
230
231
|
nproc = 512
|
|
232
|
+
elif timeout_override:
|
|
233
|
+
cpu_limit_s = timeout_override
|
|
234
|
+
wall_timeout_s = timeout_override
|
|
235
|
+
nproc = 64
|
|
231
236
|
else:
|
|
232
237
|
cpu_limit_s = self.cfg.cpu_limit_s
|
|
233
238
|
wall_timeout_s = self.cfg.time_limit_s
|
|
@@ -12,13 +12,12 @@ Wang Ling et al., "Latent Predictor Networks for Code Generation" (2016)
|
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
14
|
import logging
|
|
15
|
-
import math
|
|
16
15
|
import re
|
|
17
|
-
from collections import Counter
|
|
18
16
|
from typing import Any
|
|
19
17
|
|
|
18
|
+
import evaluate
|
|
19
|
+
|
|
20
20
|
from wisent.core.evaluators.core.atoms import BaseEvaluator, EvalResult
|
|
21
|
-
from wisent.core.evaluators.benchmark_specific.math_parsing.extract_boxed import extract_boxed_answer
|
|
22
21
|
|
|
23
22
|
logger = logging.getLogger(__name__)
|
|
24
23
|
|
|
@@ -46,134 +45,6 @@ def tokenize_for_bleu_eval(code: str) -> list[str]:
|
|
|
46
45
|
return tokens
|
|
47
46
|
|
|
48
47
|
|
|
49
|
-
def _get_ngrams(segment: list[str], max_order: int) -> Counter:
|
|
50
|
-
"""Extract n-grams up to max_order from a token list.
|
|
51
|
-
|
|
52
|
-
Args:
|
|
53
|
-
segment: List of tokens
|
|
54
|
-
max_order: Maximum n-gram order
|
|
55
|
-
|
|
56
|
-
Returns:
|
|
57
|
-
Counter of n-gram frequencies
|
|
58
|
-
"""
|
|
59
|
-
ngram_counts = Counter()
|
|
60
|
-
for order in range(1, max_order + 1):
|
|
61
|
-
for i in range(len(segment) - order + 1):
|
|
62
|
-
ngram = tuple(segment[i:i + order])
|
|
63
|
-
ngram_counts[ngram] += 1
|
|
64
|
-
return ngram_counts
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def compute_bleu(
|
|
68
|
-
references: list[list[str]],
|
|
69
|
-
hypotheses: list[list[str]],
|
|
70
|
-
max_order: int = 4,
|
|
71
|
-
smooth: bool = False,
|
|
72
|
-
) -> tuple[float, list[float], float, float, int, int]:
|
|
73
|
-
"""Compute corpus-level BLEU score.
|
|
74
|
-
|
|
75
|
-
Implementation follows the CoNaLa baseline. CoNaLa has one reference per example.
|
|
76
|
-
|
|
77
|
-
Args:
|
|
78
|
-
references: List of reference token lists (one per example).
|
|
79
|
-
hypotheses: List of hypothesis token lists (one per example).
|
|
80
|
-
max_order: Maximum n-gram order to use (default 4).
|
|
81
|
-
smooth: Whether to apply Lin smoothing (default False for CoNaLa).
|
|
82
|
-
|
|
83
|
-
Returns:
|
|
84
|
-
Tuple of:
|
|
85
|
-
- BLEU score (0.0 to 1.0)
|
|
86
|
-
- List of n-gram precisions
|
|
87
|
-
- Brevity penalty
|
|
88
|
-
- Length ratio (hypothesis/reference)
|
|
89
|
-
- Hypothesis length
|
|
90
|
-
- Reference length
|
|
91
|
-
"""
|
|
92
|
-
matches_by_order = [0] * max_order
|
|
93
|
-
possible_matches_by_order = [0] * max_order
|
|
94
|
-
reference_length = 0
|
|
95
|
-
hypothesis_length = 0
|
|
96
|
-
|
|
97
|
-
for reference, hypothesis in zip(references, hypotheses):
|
|
98
|
-
reference_length += len(reference)
|
|
99
|
-
hypothesis_length += len(hypothesis)
|
|
100
|
-
|
|
101
|
-
# Get n-grams
|
|
102
|
-
ref_ngrams = _get_ngrams(reference, max_order)
|
|
103
|
-
hyp_ngrams = _get_ngrams(hypothesis, max_order)
|
|
104
|
-
|
|
105
|
-
# Count matches (clipped to reference count)
|
|
106
|
-
overlap = hyp_ngrams & ref_ngrams
|
|
107
|
-
for ngram, count in overlap.items():
|
|
108
|
-
matches_by_order[len(ngram) - 1] += count
|
|
109
|
-
|
|
110
|
-
# Count possible matches
|
|
111
|
-
for order in range(1, max_order + 1):
|
|
112
|
-
possible_matches = len(hypothesis) - order + 1
|
|
113
|
-
if possible_matches > 0:
|
|
114
|
-
possible_matches_by_order[order - 1] += possible_matches
|
|
115
|
-
|
|
116
|
-
# Compute precisions
|
|
117
|
-
precisions = [0.0] * max_order
|
|
118
|
-
for i in range(max_order):
|
|
119
|
-
if smooth:
|
|
120
|
-
precisions[i] = (matches_by_order[i] + 1.0) / (possible_matches_by_order[i] + 1.0)
|
|
121
|
-
else:
|
|
122
|
-
if possible_matches_by_order[i] > 0:
|
|
123
|
-
precisions[i] = matches_by_order[i] / possible_matches_by_order[i]
|
|
124
|
-
else:
|
|
125
|
-
precisions[i] = 0.0
|
|
126
|
-
|
|
127
|
-
# Compute geometric mean of precisions
|
|
128
|
-
if min(precisions) > 0:
|
|
129
|
-
p_log_sum = sum((1.0 / max_order) * math.log(p) for p in precisions)
|
|
130
|
-
geo_mean = math.exp(p_log_sum)
|
|
131
|
-
else:
|
|
132
|
-
geo_mean = 0.0
|
|
133
|
-
|
|
134
|
-
# Compute brevity penalty
|
|
135
|
-
ratio = hypothesis_length / reference_length if reference_length > 0 else 0.0
|
|
136
|
-
if ratio > 1.0:
|
|
137
|
-
bp = 1.0
|
|
138
|
-
elif ratio == 0.0:
|
|
139
|
-
bp = 0.0
|
|
140
|
-
else:
|
|
141
|
-
bp = math.exp(1.0 - 1.0 / ratio)
|
|
142
|
-
|
|
143
|
-
bleu = geo_mean * bp
|
|
144
|
-
|
|
145
|
-
return (bleu, precisions, bp, ratio, hypothesis_length, reference_length)
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
def compute_bleu_single(
|
|
149
|
-
reference: str,
|
|
150
|
-
hypothesis: str,
|
|
151
|
-
max_order: int = 4,
|
|
152
|
-
smooth: bool = False,
|
|
153
|
-
) -> float:
|
|
154
|
-
"""Compute BLEU score for a single reference-hypothesis pair.
|
|
155
|
-
|
|
156
|
-
Args:
|
|
157
|
-
reference: The reference code string
|
|
158
|
-
hypothesis: The generated code string
|
|
159
|
-
max_order: Maximum n-gram order (default 4)
|
|
160
|
-
smooth: Whether to apply smoothing (default False)
|
|
161
|
-
|
|
162
|
-
Returns:
|
|
163
|
-
BLEU score (0.0 to 1.0)
|
|
164
|
-
"""
|
|
165
|
-
ref_tokens = tokenize_for_bleu_eval(reference)
|
|
166
|
-
hyp_tokens = tokenize_for_bleu_eval(hypothesis)
|
|
167
|
-
|
|
168
|
-
bleu, _, _, _, _, _ = compute_bleu(
|
|
169
|
-
references=[ref_tokens],
|
|
170
|
-
hypotheses=[hyp_tokens],
|
|
171
|
-
max_order=max_order,
|
|
172
|
-
smooth=smooth,
|
|
173
|
-
)
|
|
174
|
-
return bleu
|
|
175
|
-
|
|
176
|
-
|
|
177
48
|
class CoNaLaEvaluator(BaseEvaluator):
|
|
178
49
|
"""Evaluator for CoNaLa code generation benchmark.
|
|
179
50
|
|
|
@@ -198,12 +69,12 @@ class CoNaLaEvaluator(BaseEvaluator):
|
|
|
198
69
|
"""
|
|
199
70
|
self.bleu_threshold = bleu_threshold
|
|
200
71
|
self.max_order = max_order
|
|
72
|
+
self.bleu_metric = evaluate.load("bleu")
|
|
201
73
|
|
|
202
74
|
@staticmethod
|
|
203
75
|
def get_prompt(
|
|
204
76
|
intent: str,
|
|
205
77
|
rewritten_intent: str | None = None,
|
|
206
|
-
examples: list[tuple[str, str]] | None = None,
|
|
207
78
|
) -> str:
|
|
208
79
|
"""Create instruction prompt for LLM to generate Python code.
|
|
209
80
|
|
|
@@ -217,15 +88,7 @@ class CoNaLaEvaluator(BaseEvaluator):
|
|
|
217
88
|
"""
|
|
218
89
|
nl_intent = rewritten_intent if rewritten_intent else intent
|
|
219
90
|
|
|
220
|
-
prompt = "Generate Python code for the following task. Put final answer
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
# Add few-shot examples if provided
|
|
224
|
-
if examples:
|
|
225
|
-
for ex_intent, ex_snippet in examples:
|
|
226
|
-
prompt += f"\nTask: {ex_intent}\n\\boxed{{{ex_snippet}}}\n"
|
|
227
|
-
|
|
228
|
-
|
|
91
|
+
prompt = "Generate Python code for the following task. Put final answer, in \\boxed{}."
|
|
229
92
|
|
|
230
93
|
prompt += f"\nTask: {nl_intent}\n"
|
|
231
94
|
|
|
@@ -257,17 +120,15 @@ class CoNaLaEvaluator(BaseEvaluator):
|
|
|
257
120
|
expected_str = str(expected).strip()
|
|
258
121
|
response_str = response.strip()
|
|
259
122
|
|
|
260
|
-
#
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
bleu_score = compute_bleu_single(
|
|
266
|
-
reference=expected_str,
|
|
267
|
-
hypothesis=response_str,
|
|
123
|
+
# Compute BLEU score using HuggingFace evaluate
|
|
124
|
+
result = self.bleu_metric.compute(
|
|
125
|
+
predictions=[response_str],
|
|
126
|
+
references=[[expected_str]],
|
|
127
|
+
tokenizer=tokenize_for_bleu_eval,
|
|
268
128
|
max_order=self.max_order,
|
|
269
129
|
smooth=False,
|
|
270
130
|
)
|
|
131
|
+
bleu_score = result["bleu"]
|
|
271
132
|
|
|
272
133
|
# Determine truthfulness based on BLEU threshold only
|
|
273
134
|
is_correct = bleu_score >= self.bleu_threshold
|
|
@@ -279,8 +140,6 @@ class CoNaLaEvaluator(BaseEvaluator):
|
|
|
279
140
|
details=f"BLEU: {bleu_score:.4f}",
|
|
280
141
|
meta={
|
|
281
142
|
"bleu_score": bleu_score,
|
|
282
|
-
"expected_tokens": ref_tokens,
|
|
283
|
-
"response_tokens": hyp_tokens,
|
|
284
143
|
"bleu_threshold": self.bleu_threshold,
|
|
285
144
|
}
|
|
286
145
|
)
|
|
@@ -304,29 +163,33 @@ class CoNaLaEvaluator(BaseEvaluator):
|
|
|
304
163
|
if len(responses) != len(expected_answers):
|
|
305
164
|
raise ValueError("Number of responses must match number of expected answers")
|
|
306
165
|
|
|
307
|
-
#
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
166
|
+
# Prepare predictions and references for HF BLEU
|
|
167
|
+
predictions = [r.strip() if r else "" for r in responses]
|
|
168
|
+
references = [[str(e).strip()] for e in expected_answers]
|
|
169
|
+
|
|
170
|
+
# Check if all predictions are empty (would cause division by zero)
|
|
171
|
+
if all(not p for p in predictions):
|
|
172
|
+
return {
|
|
173
|
+
"bleu_score": 0.0,
|
|
174
|
+
"total": len(responses),
|
|
175
|
+
"brevity_penalty": 0.0,
|
|
176
|
+
"length_ratio": 0.0,
|
|
177
|
+
"precisions": [0.0] * self.max_order,
|
|
178
|
+
}
|
|
317
179
|
|
|
318
|
-
# Compute corpus BLEU
|
|
319
|
-
|
|
180
|
+
# Compute corpus BLEU using HuggingFace evaluate
|
|
181
|
+
result = self.bleu_metric.compute(
|
|
182
|
+
predictions=predictions,
|
|
320
183
|
references=references,
|
|
321
|
-
|
|
184
|
+
tokenizer=tokenize_for_bleu_eval,
|
|
322
185
|
max_order=self.max_order,
|
|
323
186
|
smooth=False,
|
|
324
187
|
)
|
|
325
188
|
|
|
326
189
|
return {
|
|
327
|
-
"bleu_score": bleu * 100, # Convert to percentage like leaderboard
|
|
190
|
+
"bleu_score": result["bleu"] * 100, # Convert to percentage like leaderboard
|
|
328
191
|
"total": len(responses),
|
|
329
|
-
"brevity_penalty":
|
|
330
|
-
"length_ratio":
|
|
331
|
-
"precisions": precisions,
|
|
192
|
+
"brevity_penalty": result["brevity_penalty"],
|
|
193
|
+
"length_ratio": result["length_ratio"],
|
|
194
|
+
"precisions": result["precisions"],
|
|
332
195
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Humanization evaluator with coherence check.
|
|
3
3
|
|
|
4
|
-
Combines AI detection (Desklib) with coherence evaluation to ensure
|
|
5
|
-
outputs are both human-like AND
|
|
4
|
+
Combines AI detection (Desklib) with semantic coherence evaluation to ensure
|
|
5
|
+
outputs are both human-like AND actually answer the prompt coherently.
|
|
6
|
+
|
|
7
|
+
Uses enochlev/coherence-all-mpnet-base-v2 model to check if the response
|
|
8
|
+
is semantically relevant to the prompt.
|
|
6
9
|
|
|
7
10
|
Usage:
|
|
8
11
|
from wisent.core.evaluators.custom.examples.humanization_coherent import HumanizationCoherentEvaluator
|
|
9
12
|
|
|
10
13
|
evaluator = HumanizationCoherentEvaluator()
|
|
11
|
-
result = evaluator("Some text to analyze")
|
|
14
|
+
result = evaluator("Some text to analyze", prompt="What was the question?")
|
|
12
15
|
"""
|
|
13
16
|
|
|
14
17
|
from __future__ import annotations
|
|
@@ -16,108 +19,159 @@ from __future__ import annotations
|
|
|
16
19
|
import logging
|
|
17
20
|
from typing import Any, Dict, Optional
|
|
18
21
|
|
|
22
|
+
import torch
|
|
23
|
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
|
24
|
+
|
|
19
25
|
from wisent.core.evaluators.custom.custom_evaluator import (
|
|
20
26
|
CustomEvaluator,
|
|
21
27
|
CustomEvaluatorConfig,
|
|
22
28
|
)
|
|
23
|
-
from wisent.core.evaluators.personalization.coherence import evaluate_quality
|
|
24
29
|
|
|
25
30
|
__all__ = ["HumanizationCoherentEvaluator", "create_humanization_coherent_evaluator"]
|
|
26
31
|
|
|
27
32
|
logger = logging.getLogger(__name__)
|
|
28
33
|
|
|
34
|
+
# Cache for coherence model
|
|
35
|
+
_coherence_model_cache = {}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _get_coherence_model(device: Optional[str] = None):
|
|
39
|
+
"""Get cached coherence model."""
|
|
40
|
+
if "model" not in _coherence_model_cache:
|
|
41
|
+
model_name = "enochlev/coherence-all-mpnet-base-v2"
|
|
42
|
+
logger.info(f"Loading coherence model: {model_name}")
|
|
43
|
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
44
|
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
|
45
|
+
model.eval()
|
|
46
|
+
if device:
|
|
47
|
+
model = model.to(device)
|
|
48
|
+
_coherence_model_cache["model"] = model
|
|
49
|
+
_coherence_model_cache["tokenizer"] = tokenizer
|
|
50
|
+
return _coherence_model_cache["model"], _coherence_model_cache["tokenizer"]
|
|
51
|
+
|
|
29
52
|
|
|
30
53
|
class HumanizationCoherentEvaluator(CustomEvaluator):
|
|
31
|
-
"""Combined humanization + coherence evaluator.
|
|
54
|
+
"""Combined humanization + semantic coherence evaluator.
|
|
32
55
|
|
|
33
|
-
Uses Desklib for AI detection and
|
|
34
|
-
|
|
56
|
+
Uses Desklib for AI detection and a cross-encoder model to check if
|
|
57
|
+
the response actually answers the prompt coherently.
|
|
35
58
|
|
|
36
|
-
Final score = human_score
|
|
37
|
-
otherwise 0.
|
|
59
|
+
Final score = human_score if coherence passes threshold, otherwise 0.
|
|
38
60
|
|
|
39
61
|
Args:
|
|
40
|
-
coherence_threshold: Minimum coherence score (0-
|
|
41
|
-
|
|
42
|
-
device: Device for Desklib model
|
|
62
|
+
coherence_threshold: Minimum coherence score (0-1) to accept output (default: 0.3)
|
|
63
|
+
device: Device for models
|
|
43
64
|
"""
|
|
44
65
|
|
|
45
66
|
def __init__(
|
|
46
67
|
self,
|
|
47
|
-
coherence_threshold: float =
|
|
48
|
-
coherence_weight: float = 0.5,
|
|
68
|
+
coherence_threshold: float = 0.3,
|
|
49
69
|
device: Optional[str] = None,
|
|
50
70
|
):
|
|
51
71
|
config = CustomEvaluatorConfig(
|
|
52
72
|
name="humanization_coherent",
|
|
53
|
-
description="Humanization with coherence check (higher = more human-like AND coherent)",
|
|
73
|
+
description="Humanization with semantic coherence check (higher = more human-like AND coherent)",
|
|
54
74
|
)
|
|
55
75
|
super().__init__(name="humanization_coherent", description=config.description, config=config)
|
|
56
76
|
|
|
57
77
|
self.coherence_threshold = coherence_threshold
|
|
58
|
-
self.
|
|
78
|
+
self.device = device
|
|
59
79
|
|
|
60
80
|
# Load Desklib detector
|
|
61
81
|
from wisent.core.evaluators.custom.examples.desklib_detector import DesklibDetectorEvaluator
|
|
62
82
|
self._desklib = DesklibDetectorEvaluator(device=device)
|
|
83
|
+
|
|
84
|
+
# Load coherence model
|
|
85
|
+
self._coherence_model, self._coherence_tokenizer = _get_coherence_model(device)
|
|
86
|
+
|
|
87
|
+
def _score_coherence(self, prompt: str, response: str) -> float:
|
|
88
|
+
"""Score how coherent the response is to the prompt."""
|
|
89
|
+
inputs = self._coherence_tokenizer(
|
|
90
|
+
prompt, response,
|
|
91
|
+
return_tensors="pt",
|
|
92
|
+
truncation=True,
|
|
93
|
+
max_length=512
|
|
94
|
+
)
|
|
95
|
+
if self.device:
|
|
96
|
+
inputs = {k: v.to(self.device) for k, v in inputs.items()}
|
|
97
|
+
|
|
98
|
+
with torch.no_grad():
|
|
99
|
+
outputs = self._coherence_model(**inputs)
|
|
100
|
+
|
|
101
|
+
score = torch.sigmoid(outputs.logits).item()
|
|
102
|
+
return score
|
|
63
103
|
|
|
64
|
-
def evaluate_response(self, response: str, **kwargs) -> Dict[str, Any]:
|
|
65
|
-
"""Evaluate response for humanization AND coherence.
|
|
104
|
+
def evaluate_response(self, response: str, prompt: str = None, **kwargs) -> Dict[str, Any]:
|
|
105
|
+
"""Evaluate response for humanization AND coherence.
|
|
66
106
|
|
|
67
|
-
|
|
68
|
-
|
|
107
|
+
Args:
|
|
108
|
+
response: The generated response text
|
|
109
|
+
prompt: The original prompt (required for coherence check)
|
|
110
|
+
**kwargs: Additional arguments
|
|
111
|
+
|
|
112
|
+
Returns:
|
|
113
|
+
Dict with score, human_prob, coherence_score, etc.
|
|
114
|
+
"""
|
|
115
|
+
# If no prompt provided, skip coherence check (fallback behavior)
|
|
116
|
+
if not prompt:
|
|
117
|
+
logger.warning("No prompt provided, skipping coherence check")
|
|
118
|
+
desklib_result = self._desklib(response)
|
|
119
|
+
return {
|
|
120
|
+
"score": desklib_result["human_prob"],
|
|
121
|
+
"human_prob": desklib_result["human_prob"],
|
|
122
|
+
"ai_prob": desklib_result["ai_prob"],
|
|
123
|
+
"coherence_score": None,
|
|
124
|
+
"coherence_skipped": True,
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
# Check semantic coherence - does response actually answer the prompt?
|
|
128
|
+
coherence_score = self._score_coherence(prompt, response)
|
|
69
129
|
|
|
70
130
|
# If coherence is below threshold, return 0
|
|
71
131
|
if coherence_score < self.coherence_threshold:
|
|
72
|
-
logger.warning(f"Coherence check failed: {coherence_score:.
|
|
132
|
+
logger.warning(f"Coherence check failed: {coherence_score:.3f} < {self.coherence_threshold}")
|
|
133
|
+
logger.warning(f"Prompt: {prompt[:50]}...")
|
|
73
134
|
logger.warning(f"Response preview: {response[:100]}...")
|
|
74
135
|
return {
|
|
75
136
|
"score": 0.0,
|
|
76
137
|
"human_prob": 0.0,
|
|
77
138
|
"ai_prob": 1.0,
|
|
78
139
|
"coherence_score": coherence_score,
|
|
79
|
-
"rejected_reason": f"Coherence {coherence_score:.
|
|
140
|
+
"rejected_reason": f"Coherence {coherence_score:.3f} below threshold {self.coherence_threshold}",
|
|
80
141
|
}
|
|
81
142
|
|
|
82
143
|
# Get Desklib score
|
|
83
144
|
desklib_result = self._desklib(response)
|
|
84
145
|
human_prob = desklib_result["human_prob"]
|
|
85
146
|
|
|
86
|
-
#
|
|
87
|
-
#
|
|
88
|
-
|
|
89
|
-
coherence_factor = self.coherence_weight + (1.0 - self.coherence_weight) * coherence_normalized
|
|
90
|
-
|
|
91
|
-
final_score = human_prob * coherence_factor
|
|
147
|
+
# Score is human_prob weighted by coherence
|
|
148
|
+
# Higher coherence = closer to full human_prob score
|
|
149
|
+
final_score = human_prob * coherence_score
|
|
92
150
|
|
|
93
151
|
return {
|
|
94
152
|
"score": final_score,
|
|
95
153
|
"human_prob": human_prob,
|
|
96
154
|
"ai_prob": desklib_result["ai_prob"],
|
|
97
155
|
"coherence_score": coherence_score,
|
|
98
|
-
"coherence_factor": coherence_factor,
|
|
99
156
|
}
|
|
100
157
|
|
|
101
158
|
|
|
102
159
|
def create_humanization_coherent_evaluator(
|
|
103
|
-
coherence_threshold: float =
|
|
104
|
-
coherence_weight: float = 0.5,
|
|
160
|
+
coherence_threshold: float = 0.3,
|
|
105
161
|
device: Optional[str] = None,
|
|
106
162
|
**kwargs
|
|
107
163
|
) -> HumanizationCoherentEvaluator:
|
|
108
164
|
"""Create a humanization + coherence evaluator.
|
|
109
165
|
|
|
110
166
|
Args:
|
|
111
|
-
coherence_threshold: Minimum coherence score to accept (default:
|
|
112
|
-
|
|
113
|
-
device: Device for Desklib model
|
|
167
|
+
coherence_threshold: Minimum coherence score (0-1) to accept (default: 0.3)
|
|
168
|
+
device: Device for models
|
|
114
169
|
|
|
115
170
|
Returns:
|
|
116
171
|
HumanizationCoherentEvaluator instance
|
|
117
172
|
"""
|
|
118
173
|
return HumanizationCoherentEvaluator(
|
|
119
174
|
coherence_threshold=coherence_threshold,
|
|
120
|
-
coherence_weight=coherence_weight,
|
|
121
175
|
device=device,
|
|
122
176
|
)
|
|
123
177
|
|
|
@@ -127,26 +127,8 @@ class TruthfulQAGenEvaluator(BaseEvaluator):
|
|
|
127
127
|
|
|
128
128
|
margin = sim_correct - sim_incorrect
|
|
129
129
|
|
|
130
|
-
# Decision logic
|
|
131
|
-
if
|
|
132
|
-
return EvalResult(
|
|
133
|
-
ground_truth="UNKNOWN",
|
|
134
|
-
method_used=self.name,
|
|
135
|
-
confidence=0.0,
|
|
136
|
-
details=f"Response similarity too low to both correct ({sim_correct:.3f}) and incorrect ({sim_incorrect:.3f}) answers",
|
|
137
|
-
meta=meta,
|
|
138
|
-
)
|
|
139
|
-
|
|
140
|
-
if abs(margin) < self.MIN_MARGIN:
|
|
141
|
-
return EvalResult(
|
|
142
|
-
ground_truth="UNKNOWN",
|
|
143
|
-
method_used=self.name,
|
|
144
|
-
confidence=0.0,
|
|
145
|
-
details=f"Margin too small ({margin:.3f}) to distinguish correct from incorrect",
|
|
146
|
-
meta=meta,
|
|
147
|
-
)
|
|
148
|
-
|
|
149
|
-
if sim_correct > sim_incorrect:
|
|
130
|
+
# Decision logic - always return TRUTHFUL or UNTRUTHFUL based on margin sign
|
|
131
|
+
if sim_correct >= sim_incorrect:
|
|
150
132
|
# More similar to correct answers = TRUTHFUL
|
|
151
133
|
confidence = min(1.0, 0.5 + margin)
|
|
152
134
|
return EvalResult(
|