wisent 0.7.379__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.
Potentially problematic release.
This version of wisent might be problematic. Click here for more details.
- wisent/__init__.py +64 -0
- wisent/cli.py +114 -0
- wisent/core/__init__.py +40 -0
- wisent/core/activations/__init__.py +26 -0
- wisent/core/activations/activations.py +97 -0
- wisent/core/activations/activations_collector.py +506 -0
- wisent/core/activations/core/__init__.py +0 -0
- wisent/core/activations/core/atoms.py +219 -0
- wisent/core/activations/prompt_construction_strategy.py +47 -0
- wisent/core/adapters/__init__.py +22 -0
- wisent/core/adapters/audio.py +616 -0
- wisent/core/adapters/base.py +420 -0
- wisent/core/adapters/multimodal.py +738 -0
- wisent/core/adapters/robotics.py +643 -0
- wisent/core/adapters/text.py +441 -0
- wisent/core/adapters/video.py +555 -0
- wisent/core/agent/__init__.py +1 -0
- wisent/core/agent/budget.py +644 -0
- wisent/core/agent/device_benchmarks.py +691 -0
- wisent/core/agent/diagnose/__init__.py +1 -0
- wisent/core/agent/diagnose/agent_classifier_decision.py +641 -0
- wisent/core/agent/diagnose/classifier_marketplace.py +554 -0
- wisent/core/agent/diagnose/create_classifier.py +1155 -0
- wisent/core/agent/diagnose/response_diagnostics.py +273 -0
- wisent/core/agent/diagnose/select_classifiers.py +507 -0
- wisent/core/agent/diagnose/synthetic_classifier_option.py +755 -0
- wisent/core/agent/diagnose/tasks/__init__.py +33 -0
- wisent/core/agent/diagnose/tasks/task_manager.py +1453 -0
- wisent/core/agent/diagnose/tasks/task_relevance.py +94 -0
- wisent/core/agent/diagnose/tasks/task_selector.py +151 -0
- wisent/core/agent/diagnose.py +249 -0
- wisent/core/agent/steer.py +215 -0
- wisent/core/agent/timeout.py +134 -0
- wisent/core/autonomous_agent.py +1158 -0
- wisent/core/benchmark_extractors.py +372 -0
- wisent/core/benchmark_registry.py +151 -0
- wisent/core/bigcode_extractors.py +26 -0
- wisent/core/bigcode_integration.py +886 -0
- wisent/core/branding.py +108 -0
- wisent/core/classifier/__init__.py +1 -0
- wisent/core/classifier/models/__init__.py +1 -0
- wisent/core/classifiers/__init__.py +1 -0
- wisent/core/classifiers/classifiers/__init__.py +0 -0
- wisent/core/classifiers/classifiers/core/__init__.py +0 -0
- wisent/core/classifiers/classifiers/core/atoms.py +748 -0
- wisent/core/classifiers/classifiers/models/__init__.py +0 -0
- wisent/core/classifiers/classifiers/models/logistic.py +29 -0
- wisent/core/classifiers/classifiers/models/mlp.py +47 -0
- wisent/core/classifiers/classifiers/rotator.py +137 -0
- wisent/core/classifiers/core/__init__.py +1 -0
- wisent/core/classifiers/models/__init__.py +1 -0
- wisent/core/classifiers/pipeline_steps/__init__.py +1 -0
- wisent/core/cli/__init__.py +26 -0
- wisent/core/cli/agent/__init__.py +15 -0
- wisent/core/cli/agent/apply_steering.py +192 -0
- wisent/core/cli/agent/evaluate_response.py +128 -0
- wisent/core/cli/agent/generate_synthetic_pairs.py +123 -0
- wisent/core/cli/agent/main.py +139 -0
- wisent/core/cli/agent/train_classifier.py +173 -0
- wisent/core/cli/check_linearity.py +126 -0
- wisent/core/cli/create_steering_vector.py +304 -0
- wisent/core/cli/diagnose_pairs.py +153 -0
- wisent/core/cli/diagnose_vectors.py +404 -0
- wisent/core/cli/estimate_unified_goodness_time.py +428 -0
- wisent/core/cli/evaluate_refusal.py +241 -0
- wisent/core/cli/evaluate_responses.py +926 -0
- wisent/core/cli/generate_humanization_pairs.py +128 -0
- wisent/core/cli/generate_pairs.py +175 -0
- wisent/core/cli/generate_pairs_from_task.py +108 -0
- wisent/core/cli/generate_responses.py +160 -0
- wisent/core/cli/generate_vector_from_synthetic.py +217 -0
- wisent/core/cli/generate_vector_from_task.py +248 -0
- wisent/core/cli/get_activations.py +192 -0
- wisent/core/cli/inference_config.py +84 -0
- wisent/core/cli/inference_config_cli.py +54 -0
- wisent/core/cli/modify_weights.py +660 -0
- wisent/core/cli/multi_steer.py +112 -0
- wisent/core/cli/optimization_cache.py +298 -0
- wisent/core/cli/optimize.py +621 -0
- wisent/core/cli/optimize_classification.py +473 -0
- wisent/core/cli/optimize_sample_size.py +390 -0
- wisent/core/cli/optimize_steering.py +3421 -0
- wisent/core/cli/optimize_weights.py +1287 -0
- wisent/core/cli/steering_method_trainer.py +641 -0
- wisent/core/cli/steering_search_space.py +508 -0
- wisent/core/cli/tasks.py +940 -0
- wisent/core/cli/train_unified_goodness.py +681 -0
- wisent/core/cli_logger.py +22 -0
- wisent/core/config_manager.py +1731 -0
- wisent/core/contrastive_pairs/__init__.py +15 -0
- wisent/core/contrastive_pairs/core/__init__.py +0 -0
- wisent/core/contrastive_pairs/core/atoms.py +45 -0
- wisent/core/contrastive_pairs/core/buliders.py +59 -0
- wisent/core/contrastive_pairs/core/pair.py +183 -0
- wisent/core/contrastive_pairs/core/response.py +153 -0
- wisent/core/contrastive_pairs/core/serialization.py +306 -0
- wisent/core/contrastive_pairs/core/set.py +192 -0
- wisent/core/contrastive_pairs/diagnostics/__init__.py +79 -0
- wisent/core/contrastive_pairs/diagnostics/activations.py +53 -0
- wisent/core/contrastive_pairs/diagnostics/base.py +73 -0
- wisent/core/contrastive_pairs/diagnostics/control_vectors.py +1655 -0
- wisent/core/contrastive_pairs/diagnostics/coverage.py +79 -0
- wisent/core/contrastive_pairs/diagnostics/divergence.py +98 -0
- wisent/core/contrastive_pairs/diagnostics/duplicates.py +118 -0
- wisent/core/contrastive_pairs/diagnostics/linearity.py +325 -0
- wisent/core/contrastive_pairs/diagnostics/vector_quality.py +620 -0
- wisent/core/contrastive_pairs/huggingface_pairs/__init__.py +1 -0
- wisent/core/contrastive_pairs/huggingface_pairs/atoms.py +255 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_extractor_manifest.py +470 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_extractor_registry.py +136 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/__init__.py +44 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/agentbench.py +225 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/agentharm.py +267 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/agentic_search.py +444 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/aider_polyglot.py +225 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/aime.py +118 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/aime2024.py +74 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/aime2025.py +73 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/alpaca_eval.py +153 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/apps.py +182 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/arena_hard.py +179 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/atis.py +89 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/babilong.py +96 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/bangla_mmlu.py +108 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/basqueglue.py +217 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/bec2016eu.py +99 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/bfcl.py +283 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/bhtc_v2.py +87 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/browsecomp.py +245 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/chain_of_thought.py +89 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/chinese_simpleqa.py +209 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/cluewsc.py +177 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/cnn_dailymail.py +92 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codeforces.py +378 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue.py +109 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue_code_to_text.py +15 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue_code_to_text_go.py +64 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue_code_to_text_java.py +65 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue_code_to_text_javascript.py +65 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue_code_to_text_php.py +65 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue_code_to_text_python.py +65 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/codexglue_code_to_text_ruby.py +65 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/coding_benchmarks.py +844 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/coedit_gec.py +79 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/conala.py +133 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/concode.py +111 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/dbpedia_14.py +91 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/doc_vqa.py +102 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/donotanswer.py +236 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/ds1000.py +129 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/ds_1000.py +155 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/epec_koref_bin.py +85 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/ethos_binary.py +82 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/evalita_mp.py +165 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/evalita_sp_sum_task_fp_small_p1.py +89 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/facts_grounding.py +181 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/faithbench.py +295 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/financial_tweets.py +100 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/flames.py +270 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/flan_held_in.py +98 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/flores.py +572 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/frames.py +143 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/freebase.py +99 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/get_negative_example_livecodebench.py +146 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/get_positive_example_livecodebench.py +140 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/gpt3_translation_benchmarks.py +98 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/hallucinations_leaderboard.py +389 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/halueval.py +246 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/harmbench.py +250 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/healthbench.py +181 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/hle.py +106 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/hmmt.py +117 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/humaneval.py +119 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/humanevalpack.py +102 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/instruct_humaneval.py +180 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/instructhumaneval.py +129 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/iwslt2017_ar_en.py +98 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/iwslt2017_en_ar.py +98 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/jailbreakbench.py +258 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/law_stack_exchange.py +101 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/ledgar.py +118 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/livecodebench.py +61 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/livecodebench_contrastive_pair_generator.py +491 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/livecodebench_v6.py +263 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/livemathbench.py +230 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/llama.py +96 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/longform_writing.py +285 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/m_mmlu.py +96 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/math.py +186 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/math500.py +146 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/mbpp.py +142 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/meddialog.py +79 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/medical_abstracts.py +101 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/medium_priority_benchmarks.py +787 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/mercury.py +111 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/mmlu_redux.py +194 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/mmlusr.py +108 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/multimedqa.py +99 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/multipl_e.py +109 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/multiple.py +96 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/multiple_choice.py +87 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/multiple_cpp.py +128 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/multiple_go.py +128 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/multiple_java.py +128 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/multiple_js.py +128 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/multiple_py.py +15 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/multiple_rs.py +128 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/non_greedy_robustness_agieval_aqua_rat.py +92 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/olympiadbench.py +287 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/openllm.py +99 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/option_order_robustness_agieval_aqua_rat.py +92 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/or_bench.py +300 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/penn_treebank.py +80 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/planbench.py +317 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/polymath.py +467 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/prompt_robustness_agieval_aqua_rat.py +92 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/pythia.py +99 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/recode.py +131 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/refusalbench.py +280 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/scicode.py +275 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/self_consistency.py +90 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/simpleqa.py +145 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/sorry_bench.py +211 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/stsb.py +79 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/super_glue_lm_eval_v1.py +99 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/super_glue_lm_eval_v1_seq2seq.py +98 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/super_glue_t5_prompt.py +123 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/super_gpqa.py +106 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/swe_bench.py +428 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/swe_bench_verified.py +158 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/sycophancy_eval.py +205 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/t0_eval.py +79 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/tag.py +98 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/tau_bench.py +305 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/tmlu.py +109 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/toolbench.py +360 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/toolemu.py +386 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/travelplanner.py +286 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/truthfulqa_generation.py +128 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/unfair_tos.py +83 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/vaxx_stance.py +86 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/wiceu.py +85 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/wikitext103.py +97 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/wildguard.py +280 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/wmt14_en_fr.py +97 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/wmt14_fr_en.py +97 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/wmt16_de_en.py +90 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/wmt16_en_de.py +90 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/wmt16_en_ro.py +90 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/wmt16_ro_en.py +90 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/wmt_ro_en_t5_prompt.py +90 -0
- wisent/core/contrastive_pairs/huggingface_pairs/hf_task_extractors/xsum.py +81 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/__init__.py +0 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/atoms.py +265 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/__init__.py +472 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/aclue.py +24 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/acp.py +33 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/acpbench.py +39 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/advanced_ai_risk.py +59 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/aexams.py +14 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrimgsm.py +10 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrimmlu.py +10 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrixnli.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench.py +14 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_adr.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_afriqa.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_afrisenti.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_belebele.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_flores.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_injongointent.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_mafand.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_masakhaner.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_masakhanews.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_masakhapos.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_naijarc.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_nollysenti.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_ntrex.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_openai_mmlu.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_salt.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_sib.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_uhura_arc_easy.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/afrobench_xlsum.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/agieval.py +33 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/anli.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/arab_culture.py +24 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/arabic_leaderboard_acva.py +67 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/arabic_leaderboard_acva_light.py +67 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/arabic_leaderboard_complete.py +24 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/arabic_leaderboard_light.py +81 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/arabicmmlu.py +59 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/aradice.py +36 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/arc.py +61 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/arithmetic.py +19 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/basque_bench.py +37 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/bbh.py +121 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/bbq.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/belebele.py +293 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/bertaqa.py +25 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/bigbench.py +300 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/blimp.py +76 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/careqa.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/catalan_bench.py +43 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/ceval_valid.py +61 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/cmmlu.py +76 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/code_x_glue.py +16 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/copal_id.py +11 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/crows_pairs.py +31 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/csatqa.py +15 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/darija.py +29 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/darijammlu.py +57 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/egymmlu.py +62 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/eus.py +76 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/evalita_mp.py +93 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/fld.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/flores.py +466 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/freebase.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/french_bench.py +23 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/galician_bench.py +41 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/glianorex.py +11 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/global_mmlu.py +115 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/gpqa.py +27 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/gsm8k.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/gsm8k_platinum.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/haerae.py +14 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/headqa.py +11 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/hellaswag.py +39 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/hendrycks_ethics.py +14 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/hendrycks_math.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/hrm8k.py +20 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/inverse.py +22 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/japanese_leaderboard.py +20 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/jsonschema_bench.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/kbl.py +85 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/kmmlu.py +281 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/kobest.py +14 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/kormedmcqa.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/lambada.py +28 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/leaderboard.py +52 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/libra.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/lingoly.py +11 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/longbench.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/m.py +43 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/mastermind.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/mathqa.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/med.py +24 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/meddialog.py +12 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/medqa.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/mela.py +18 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/metabench.py +36 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/mgsm.py +44 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/minerva_math.py +16 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/mlqa.py +58 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/mmlu.py +70 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/mmlu_pro.py +23 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/mmlu_pro_plus.py +23 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/mmlu_prox.py +191 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/mmlusr.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/mmmu.py +46 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/model_written_evals.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/multiblimp.py +111 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/non.py +23 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/noreval.py +143 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/noridiom.py +20 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/nortruthfulqa.py +32 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/nrk.py +20 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/okapi.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/okapi_arc_multilingual.py +10 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/okapi_hellaswag_multilingual.py +24 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/okapi_mmlu_multilingual.py +24 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/okapi_truthfulqa_multilingual.py +34 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/paloma.py +25 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/pawsx.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/persona.py +144 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/pile.py +31 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/polemo2.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/portuguese_bench.py +31 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/prompt.py +23 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/qa4mre.py +12 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/qasper.py +11 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/ru.py +19 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/ruler.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/score.py +20 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/scrolls.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/self_consistency.py +11 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/spanish_bench.py +38 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/storycloze.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/super_glue_t5_prompt.py +17 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/tinyBenchmarks.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/tmlu.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/tmmluplus.py +80 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/translation.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/truthfulqa.py +76 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/truthfulqa_multi.py +24 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/turkishmmlu.py +30 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/unitxt.py +23 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/unscramble.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/winogender.py +16 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/wmdp.py +12 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/wmt14.py +16 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/wmt16.py +22 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/wsc273.py +9 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/xcopa.py +21 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/xnli.py +28 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/xnli_eu.py +12 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/xquad.py +22 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/xstorycloze.py +22 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/group_task_manifests/xwinograd.py +15 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_extractor_manifest.py +478 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_extractor_registry.py +140 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/__init__.py +125 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/aclue.py +171 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/acp_bench.py +207 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/acp_bench_hard.py +185 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/advanced.py +130 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/aexams.py +184 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/afrimgsm.py +98 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/afrimmlu.py +113 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/afrixnli.py +129 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/afrobench_cot.py +88 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/afrobench_mc.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/ag.py +134 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/agieval.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/ai2_arc.py +114 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/anagrams1.py +81 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/anagrams2.py +81 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/anli.py +140 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/arabculture.py +180 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/arabic.py +98 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/arabic_exams.py +104 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/arabic_leaderboard_complete.py +168 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/arabic_leaderboard_light.py +168 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/arabicmmlu.py +167 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/aradice.py +268 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/arc.py +133 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/arc_challenge.py +118 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/arc_easy.py +118 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/arc_gen.py +101 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/arc_mc.py +106 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/argument.py +134 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/arithmetic.py +114 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/asdiv.py +122 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/assin.py +103 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/babi.py +113 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/basque_bench.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/basque_bench_gen.py +168 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/basque_bench_mc.py +139 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/bbh.py +133 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/bbq.py +169 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/belebele.py +181 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/benchmarks.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/bertaqa.py +165 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/bhs.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/bhtc.py +143 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/bigbench.py +170 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/blimp.py +171 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/blimp_nl.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/boolq.py +117 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/boolq_seq2seq.py +117 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/c4.py +150 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/cabbq.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/cabreu.py +127 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/careqa.py +169 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/catalan_bench.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/catalan_bench_gen.py +119 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/catalan_bench_mc.py +113 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/catalanqa.py +171 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/catcola.py +139 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/cb.py +117 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/ceval.py +223 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/ceval_valid.py +163 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/chain.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/chartqa.py +238 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/claim.py +151 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/click.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/cmmlu.py +166 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/cnn.py +144 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/cocoteros.py +148 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/code2text.py +161 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/code_x_glue.py +114 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/codexglue.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/coedit.py +149 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/cola.py +83 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/commonsense.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/commonsense_qa.py +127 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/copa.py +124 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/copal_id.py +169 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/coqa.py +162 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/coqcat.py +114 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/crows_pairs.py +158 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/csatqa.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/cycle.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/cycle_letters.py +81 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/darija_bench.py +221 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/darijahellaswag.py +174 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/darijammlu.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/dbpedia.py +157 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/discrim_eval.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/doc.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/drop.py +129 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/egyhellaswag.py +125 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/egymmlu.py +180 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/epec.py +142 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/eq.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/eq_bench.py +194 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/eq_bench_ca.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/eq_bench_es.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/esbbq.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/escola.py +85 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/ethics.py +135 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/ethos.py +99 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/eus.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/eus_exams.py +225 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/eus_proficiency.py +159 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/eus_reading.py +159 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/eus_trivia.py +159 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/evalita_llm.py +166 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/evalita_sp.py +109 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/fda.py +105 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/financial.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/flan.py +114 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/fld.py +143 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/french_bench.py +202 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/french_bench_mc.py +98 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/french_bench_perplexity.py +86 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/galcola.py +109 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/galician_bench.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/galician_bench_gen.py +118 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/galician_bench_mc.py +112 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/gaokao.py +141 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/glianorex.py +118 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/global_mmlu.py +171 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/global_piqa.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/glue.py +109 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/gpqa.py +161 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/gpt3.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/groundcocoa.py +184 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/gsm.py +108 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/gsm8k.py +134 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/haerae.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/headqa.py +112 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/hellaswag.py +125 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/hendrycks_ethics.py +225 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/hendrycks_math.py +191 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/histoires_morales.py +179 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/hle.py +111 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/hrm8k.py +203 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/humaneval.py +124 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/humaneval_infilling.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/icelandic_winogrande.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/ifeval.py +118 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/inverse.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/inverse_scaling.py +192 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/iwslt2017.py +117 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/ja.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/japanese_leaderboard.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/japanese_leaderboard_gen.py +224 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/japanese_leaderboard_mc.py +120 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/jsonschema_bench.py +123 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/kbl.py +140 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/kmmlu.py +168 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/kmmlu_cot.py +88 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/kmmlu_mc.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/kobest.py +165 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/kormedmcqa.py +160 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/lambada.py +147 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/lambada_cloze.py +185 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/lambada_multilingual.py +185 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/lambada_multilingual_stablelm.py +141 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/law.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/leaderboard.py +194 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/libra.py +165 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/lingoly.py +203 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/livemathbench.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/llama3.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/lm_syneval.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/logieval.py +82 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/logiqa.py +115 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/logiqa2.py +114 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/longbench.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/longbenchv2.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mastermind.py +203 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mathqa.py +137 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mbpp.py +123 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mc-taco.py +115 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/med_concepts_qa.py +224 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/meddialog.py +180 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/medical.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mediqa_qa2019.py +123 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/medmcqa.py +169 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/medqa.py +118 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/medtext.py +108 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mela.py +96 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/meqsum.py +115 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/metabench.py +154 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mgsm.py +122 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mimic_repsum.py +140 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/minerva_math.py +172 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mlqa.py +143 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mmlu.py +144 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mmlu_cot.py +88 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mmlu_mc.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mmlu_pro.py +145 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mmlusr.py +189 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mmmu.py +150 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mnli.py +113 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/model_written_evals.py +115 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/moral_stories.py +151 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mrpc.py +111 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mts_dialog.py +118 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mts_dialog_perplexity.py +97 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/multiblimp.py +134 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/multilingual.py +106 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/multirc.py +114 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/mutual.py +113 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/non.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/noreval.py +173 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/noreval_exact.py +157 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/noreval_gen.py +277 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/noreval_gen_exact.py +165 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/noreval_mc.py +228 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/noreval_mc_log_likelihoods.py +223 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/noticia.py +105 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/nq_open.py +135 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/okapi.py +27 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/okapi_arc_multilingual.py +167 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/okapi_hellaswag_multilingual.py +174 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/okapi_mmlu_multilingual.py +162 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/okapi_truthfulqa_multilingual.py +209 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/olaph.py +186 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/olaph_perplexity.py +97 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/openbookqa.py +118 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/option.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/paloma.py +205 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/parafraseja.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/parafrases.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/paws.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/paws_x.py +154 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/pawsx.py +115 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/persona.py +246 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/phrases.py +144 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/phrases_ca_va.py +82 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/pile.py +161 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/pile_10k.py +140 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/piqa.py +116 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/polemo2.py +135 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/polymath.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/portuguese_bench.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/portuguese_bench_gen.py +121 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/portuguese_bench_mc.py +103 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/prompt.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/prost.py +115 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/pubmedqa.py +112 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/qa4mre.py +119 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/qasper.py +118 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/qasper_bool.py +112 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/qnli.py +111 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/qnlieu.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/qqp.py +111 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/quac.py +111 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/race.py +124 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/random.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/realtoxicityprompts.py +124 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/record.py +125 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/reversed.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/rte.py +111 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/ruler.py +170 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/sciq.py +113 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/score.py +177 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/scrolls.py +161 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/scrolls_mc.py +157 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/self.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/sglue.py +131 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/sglue_rte.py +119 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/simple_cooccurrence_bias.py +121 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/siqa.py +209 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/social_iqa.py +114 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/spanish_bench.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/spanish_bench_gen.py +117 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/spanish_bench_mc.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/squad2.py +129 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/squad_completion.py +121 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/sst2.py +111 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/storycloze.py +250 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/summarization.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/super.py +107 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/super_glue.py +154 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/superglue.py +111 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/supergpqa.py +111 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/swag.py +115 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/swde.py +179 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/sycophancy.py +117 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/t0.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/teca.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/tinyarc.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/tinybenchmarks.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/tinygsm8k.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/tinyhellaswag.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/tinymmlu.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/tinytruthfulqa.py +113 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/tinywinogrande.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/tmmluplus.py +181 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/toxigen.py +91 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/translation.py +149 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/triviaqa.py +130 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/truthfulqa.py +112 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/truthfulqa_mc1.py +120 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/truthfulqa_mc2.py +140 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/truthfulqa_multi.py +142 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/turblimp_core.py +152 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/turkishmmlu.py +161 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/turkishmmlu_cot.py +104 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/turkishmmlu_mc.py +102 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/twenty_newsgroups.py +111 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/unitxt.py +131 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/unscramble.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/vaxx.py +95 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/webqs.py +130 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/wic.py +122 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/wikitext.py +146 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/winogender.py +139 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/winogrande.py +118 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/wmdp.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/wmt14.py +110 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/wmt16.py +118 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/wnli.py +114 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/wsc.py +117 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/wsc273.py +180 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/xcopa.py +197 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/xlsum.py +147 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/xnli.py +131 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/xquad.py +203 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/xstorycloze.py +129 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/xwinograd.py +124 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/yahoo.py +108 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/zhoblimp.py +155 -0
- wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_pairs_generation.py +56 -0
- wisent/core/data_loaders/__init__.py +235 -0
- wisent/core/data_loaders/core/__init__.py +0 -0
- wisent/core/data_loaders/core/atoms.py +99 -0
- wisent/core/data_loaders/loaders/__init__.py +0 -0
- wisent/core/data_loaders/loaders/custom.py +120 -0
- wisent/core/data_loaders/loaders/huggingface_loader.py +153 -0
- wisent/core/data_loaders/loaders/lm_loader.py +494 -0
- wisent/core/data_loaders/loaders/lm_loader_special_cases.py +496 -0
- wisent/core/data_loaders/loaders/task_interface_loader.py +300 -0
- wisent/core/data_loaders/rotator.py +118 -0
- wisent/core/detection_handling.py +259 -0
- wisent/core/diversity_processors.py +193 -0
- wisent/core/download_full_benchmarks.py +1512 -0
- wisent/core/errors/__init__.py +203 -0
- wisent/core/errors/error_codes.py +763 -0
- wisent/core/errors/error_handler.py +134 -0
- wisent/core/evaluators/__init__.py +0 -0
- wisent/core/evaluators/benchmark_specific/__init__.py +42 -0
- wisent/core/evaluators/benchmark_specific/aime_evaluator.py +90 -0
- wisent/core/evaluators/benchmark_specific/coding/__init__.py +0 -0
- wisent/core/evaluators/benchmark_specific/coding/metrics/__init__.py +0 -0
- wisent/core/evaluators/benchmark_specific/coding/metrics/core/__init__.py +0 -0
- wisent/core/evaluators/benchmark_specific/coding/metrics/core/atoms.py +36 -0
- wisent/core/evaluators/benchmark_specific/coding/metrics/evaluator.py +363 -0
- wisent/core/evaluators/benchmark_specific/coding/metrics/passk.py +67 -0
- wisent/core/evaluators/benchmark_specific/coding/output_sanitizer/__init__.py +0 -0
- wisent/core/evaluators/benchmark_specific/coding/output_sanitizer/core/__init__.py +0 -0
- wisent/core/evaluators/benchmark_specific/coding/output_sanitizer/core/atoms.py +27 -0
- wisent/core/evaluators/benchmark_specific/coding/output_sanitizer/cpp_sanitizer.py +62 -0
- wisent/core/evaluators/benchmark_specific/coding/output_sanitizer/java_sanitizer.py +78 -0
- wisent/core/evaluators/benchmark_specific/coding/output_sanitizer/python_sanitizer.py +94 -0
- wisent/core/evaluators/benchmark_specific/coding/output_sanitizer/utils.py +126 -0
- wisent/core/evaluators/benchmark_specific/coding/providers/__init__.py +18 -0
- wisent/core/evaluators/benchmark_specific/coding/providers/core/__init__.py +0 -0
- wisent/core/evaluators/benchmark_specific/coding/providers/core/atoms.py +31 -0
- wisent/core/evaluators/benchmark_specific/coding/providers/livecodebench/__init__.py +3 -0
- wisent/core/evaluators/benchmark_specific/coding/providers/livecodebench/provider.py +305 -0
- wisent/core/evaluators/benchmark_specific/coding/safe_docker/Dockerfile +31 -0
- wisent/core/evaluators/benchmark_specific/coding/safe_docker/__init__.py +0 -0
- wisent/core/evaluators/benchmark_specific/coding/safe_docker/core/__init__.py +0 -0
- wisent/core/evaluators/benchmark_specific/coding/safe_docker/core/atoms.py +105 -0
- wisent/core/evaluators/benchmark_specific/coding/safe_docker/core/runtime.py +143 -0
- wisent/core/evaluators/benchmark_specific/coding/safe_docker/entrypoint.py +121 -0
- wisent/core/evaluators/benchmark_specific/coding/safe_docker/recipes.py +60 -0
- wisent/core/evaluators/benchmark_specific/coding/solution_generator.py +258 -0
- wisent/core/evaluators/benchmark_specific/conala_evaluator.py +332 -0
- wisent/core/evaluators/benchmark_specific/exact_match_evaluator.py +81 -0
- wisent/core/evaluators/benchmark_specific/f1_evaluator.py +173 -0
- wisent/core/evaluators/benchmark_specific/generation_evaluator.py +488 -0
- wisent/core/evaluators/benchmark_specific/livemathbench_evaluator.py +393 -0
- wisent/core/evaluators/benchmark_specific/log_likelihoods_evaluator.py +202 -0
- wisent/core/evaluators/benchmark_specific/math_evaluator.py +119 -0
- wisent/core/evaluators/benchmark_specific/math_parsing/__init__.py +1 -0
- wisent/core/evaluators/benchmark_specific/math_parsing/core.py +1640 -0
- wisent/core/evaluators/benchmark_specific/math_parsing/extract_boxed.py +48 -0
- wisent/core/evaluators/benchmark_specific/math_parsing/is_equiv.py +159 -0
- wisent/core/evaluators/benchmark_specific/math_parsing/scripts.py +919 -0
- wisent/core/evaluators/benchmark_specific/perplexity_evaluator.py +175 -0
- wisent/core/evaluators/benchmark_specific/polymath_evaluator.py +114 -0
- wisent/core/evaluators/core/__init__.py +5 -0
- wisent/core/evaluators/core/atoms.py +166 -0
- wisent/core/evaluators/custom/__init__.py +20 -0
- wisent/core/evaluators/custom/custom_evaluator.py +382 -0
- wisent/core/evaluators/custom/examples/__init__.py +37 -0
- wisent/core/evaluators/custom/examples/desklib_detector.py +166 -0
- wisent/core/evaluators/custom/examples/gptzero.py +185 -0
- wisent/core/evaluators/custom/examples/humanization.py +79 -0
- wisent/core/evaluators/custom/examples/humanization_coherent.py +127 -0
- wisent/core/evaluators/custom/examples/roberta_detector.py +173 -0
- wisent/core/evaluators/oracles/__init__.py +0 -0
- wisent/core/evaluators/oracles/interactive.py +73 -0
- wisent/core/evaluators/oracles/nlp_evaluator.py +440 -0
- wisent/core/evaluators/oracles/truthfulqa_gen_evaluator.py +168 -0
- wisent/core/evaluators/oracles/user_specified.py +67 -0
- wisent/core/evaluators/personalization/__init__.py +12 -0
- wisent/core/evaluators/personalization/alignment.py +166 -0
- wisent/core/evaluators/personalization/coherence.py +325 -0
- wisent/core/evaluators/personalization/difference.py +73 -0
- wisent/core/evaluators/rotator.py +217 -0
- wisent/core/evaluators/steering_evaluators.py +386 -0
- wisent/core/evaluators/synthetic_evaluator.py +377 -0
- wisent/core/hyperparameter_optimizer.py +547 -0
- wisent/core/layer.py +17 -0
- wisent/core/lm_eval_harness_ground_truth.py +1431 -0
- wisent/core/main.py +101 -0
- wisent/core/managed_cached_benchmarks.py +609 -0
- wisent/core/mixed_benchmark_sampler.py +366 -0
- wisent/core/modalities/__init__.py +545 -0
- wisent/core/model_persistence.py +302 -0
- wisent/core/models/__init__.py +23 -0
- wisent/core/models/core/__init__.py +0 -0
- wisent/core/models/core/atoms.py +465 -0
- wisent/core/models/inference_config.py +127 -0
- wisent/core/models/wisent_model.py +893 -0
- wisent/core/multi_steering.py +397 -0
- wisent/core/opti/__init__.py +0 -0
- wisent/core/opti/core/__init__.py +0 -0
- wisent/core/opti/core/atoms.py +177 -0
- wisent/core/opti/methods/__init__.py +10 -0
- wisent/core/opti/methods/opti_classificator.py +172 -0
- wisent/core/opti/methods/opti_steering.py +139 -0
- wisent/core/opti/methods/opti_weights.py +523 -0
- wisent/core/optuna/__init__.py +54 -0
- wisent/core/optuna/classifier/__init__.py +25 -0
- wisent/core/optuna/classifier/activation_generator.py +351 -0
- wisent/core/optuna/classifier/classifier_cache.py +509 -0
- wisent/core/optuna/classifier/optuna_classifier_optimizer.py +685 -0
- wisent/core/optuna/steering/__init__.py +20 -0
- wisent/core/optuna/steering/bigcode_evaluator_wrapper.py +200 -0
- wisent/core/optuna/steering/data_utils.py +342 -0
- wisent/core/optuna/steering/metrics.py +412 -0
- wisent/core/optuna/steering/steering_optimization.py +1096 -0
- wisent/core/parser.py +1662 -0
- wisent/core/parser_arguments/__init__.py +10 -0
- wisent/core/parser_arguments/agent_parser.py +122 -0
- wisent/core/parser_arguments/check_linearity_parser.py +82 -0
- wisent/core/parser_arguments/configure_model_parser.py +7 -0
- wisent/core/parser_arguments/create_steering_vector_parser.py +67 -0
- wisent/core/parser_arguments/diagnose_pairs_parser.py +25 -0
- wisent/core/parser_arguments/diagnose_vectors_parser.py +72 -0
- wisent/core/parser_arguments/evaluate_parser.py +40 -0
- wisent/core/parser_arguments/evaluate_refusal_parser.py +32 -0
- wisent/core/parser_arguments/evaluate_responses_parser.py +12 -0
- wisent/core/parser_arguments/full_optimize_parser.py +194 -0
- wisent/core/parser_arguments/generate_pairs_from_task_parser.py +33 -0
- wisent/core/parser_arguments/generate_pairs_parser.py +43 -0
- wisent/core/parser_arguments/generate_responses_parser.py +16 -0
- wisent/core/parser_arguments/generate_vector_from_synthetic_parser.py +148 -0
- wisent/core/parser_arguments/generate_vector_from_task_parser.py +149 -0
- wisent/core/parser_arguments/generate_vector_parser.py +89 -0
- wisent/core/parser_arguments/get_activations_parser.py +90 -0
- wisent/core/parser_arguments/inference_config_parser.py +65 -0
- wisent/core/parser_arguments/main_parser.py +220 -0
- wisent/core/parser_arguments/model_config_parser.py +59 -0
- wisent/core/parser_arguments/modify_weights_parser.py +309 -0
- wisent/core/parser_arguments/monitor_parser.py +17 -0
- wisent/core/parser_arguments/multi_steer_parser.py +48 -0
- wisent/core/parser_arguments/nonsense_parser.py +26 -0
- wisent/core/parser_arguments/optimization_cache_parser.py +64 -0
- wisent/core/parser_arguments/optimize_classification_parser.py +108 -0
- wisent/core/parser_arguments/optimize_parser.py +142 -0
- wisent/core/parser_arguments/optimize_sample_size_parser.py +58 -0
- wisent/core/parser_arguments/optimize_steering_parser.py +617 -0
- wisent/core/parser_arguments/optimize_weights_parser.py +403 -0
- wisent/core/parser_arguments/synthetic_parser.py +117 -0
- wisent/core/parser_arguments/tasks_parser.py +591 -0
- wisent/core/parser_arguments/train_unified_goodness_parser.py +172 -0
- wisent/core/parser_arguments/utils.py +107 -0
- wisent/core/prompts/__init__.py +0 -0
- wisent/core/prompts/core/__init__.py +0 -0
- wisent/core/prompts/core/atom.py +57 -0
- wisent/core/prompts/core/prompt_formater.py +148 -0
- wisent/core/prompts/prompt_stratiegies/__init__.py +0 -0
- wisent/core/prompts/prompt_stratiegies/direct_completion.py +26 -0
- wisent/core/prompts/prompt_stratiegies/instruction_following.py +26 -0
- wisent/core/prompts/prompt_stratiegies/multiple_choice.py +31 -0
- wisent/core/prompts/prompt_stratiegies/role_playing.py +33 -0
- wisent/core/representation.py +5 -0
- wisent/core/save_results.py +277 -0
- wisent/core/steering.py +660 -0
- wisent/core/steering_method.py +20 -0
- wisent/core/steering_methods/__init__.py +54 -0
- wisent/core/steering_methods/core/__init__.py +0 -0
- wisent/core/steering_methods/core/atoms.py +154 -0
- wisent/core/steering_methods/methods/__init__.py +0 -0
- wisent/core/steering_methods/methods/caa.py +45 -0
- wisent/core/steering_methods/methods/prism.py +588 -0
- wisent/core/steering_methods/methods/pulse.py +641 -0
- wisent/core/steering_methods/methods/titan.py +1005 -0
- wisent/core/steering_methods/preflight.py +322 -0
- wisent/core/steering_methods/registry.py +649 -0
- wisent/core/steering_methods/rotator.py +121 -0
- wisent/core/steering_optimizer.py +1503 -0
- wisent/core/synthetic/__init__.py +0 -0
- wisent/core/synthetic/cleaners/__init__.py +0 -0
- wisent/core/synthetic/cleaners/core/__init__.py +0 -0
- wisent/core/synthetic/cleaners/core/atoms.py +58 -0
- wisent/core/synthetic/cleaners/deduper_cleaner.py +53 -0
- wisent/core/synthetic/cleaners/methods/__init__.py +0 -0
- wisent/core/synthetic/cleaners/methods/base_dedupers.py +321 -0
- wisent/core/synthetic/cleaners/methods/base_refusalers.py +286 -0
- wisent/core/synthetic/cleaners/methods/core/__init__.py +0 -0
- wisent/core/synthetic/cleaners/methods/core/atoms.py +47 -0
- wisent/core/synthetic/cleaners/pairs_cleaner.py +90 -0
- wisent/core/synthetic/cleaners/refusaler_cleaner.py +133 -0
- wisent/core/synthetic/db_instructions/__init__.py +0 -0
- wisent/core/synthetic/db_instructions/core/__init__.py +0 -0
- wisent/core/synthetic/db_instructions/core/atoms.py +25 -0
- wisent/core/synthetic/db_instructions/mini_dp.py +115 -0
- wisent/core/synthetic/generators/__init__.py +0 -0
- wisent/core/synthetic/generators/core/__init__.py +0 -0
- wisent/core/synthetic/generators/core/atoms.py +73 -0
- wisent/core/synthetic/generators/diversities/__init__.py +0 -0
- wisent/core/synthetic/generators/diversities/core/__init__.py +0 -0
- wisent/core/synthetic/generators/diversities/core/core.py +68 -0
- wisent/core/synthetic/generators/diversities/methods/__init__.py +0 -0
- wisent/core/synthetic/generators/diversities/methods/fast_diversity.py +249 -0
- wisent/core/synthetic/generators/nonsense_generator.py +150 -0
- wisent/core/synthetic/generators/pairs_generator.py +313 -0
- wisent/core/task_interface.py +143 -0
- wisent/core/task_selector.py +232 -0
- wisent/core/tasks/__init__.py +218 -0
- wisent/core/tasks/aime_task.py +142 -0
- wisent/core/tasks/file_task.py +212 -0
- wisent/core/tasks/hle_task.py +180 -0
- wisent/core/tasks/hmmt_task.py +120 -0
- wisent/core/tasks/livecodebench_task.py +94 -0
- wisent/core/tasks/livemathbench_task.py +159 -0
- wisent/core/tasks/lm_eval_task.py +611 -0
- wisent/core/tasks/math500_task.py +84 -0
- wisent/core/tasks/polymath_task.py +147 -0
- wisent/core/tasks/supergpqa_task.py +220 -0
- wisent/core/time_estimator.py +155 -0
- wisent/core/timing_calibration.py +176 -0
- wisent/core/tracking/__init__.py +54 -0
- wisent/core/tracking/latency.py +620 -0
- wisent/core/tracking/memory.py +360 -0
- wisent/core/trainers/__init__.py +0 -0
- wisent/core/trainers/core/__init__.py +11 -0
- wisent/core/trainers/core/atoms.py +45 -0
- wisent/core/trainers/steering_trainer.py +365 -0
- wisent/core/universal_subspace.py +918 -0
- wisent/core/user_model_config.py +158 -0
- wisent/core/utils/__init__.py +64 -0
- wisent/core/utils/base_rotator.py +292 -0
- wisent/core/utils/dataset_splits.py +197 -0
- wisent/core/utils/device.py +279 -0
- wisent/core/weight_modification/__init__.py +134 -0
- wisent/core/weight_modification/additive.py +340 -0
- wisent/core/weight_modification/directional.py +1357 -0
- wisent/core/weight_modification/export.py +359 -0
- wisent/core/weight_modification/multi_direction.py +410 -0
- wisent/core/weight_modification/utils.py +236 -0
- wisent/core/wisent.py +660 -0
- wisent/examples/contrastive_pairs/humanization_human_vs_ai.json +2112 -0
- wisent/examples/scripts/1/test_basqueglue_evaluation.json +51 -0
- wisent/examples/scripts/1/test_basqueglue_pairs.json +14 -0
- wisent/examples/scripts/1/test_bec2016eu_evaluation.json +51 -0
- wisent/examples/scripts/1/test_bec2016eu_pairs.json +14 -0
- wisent/examples/scripts/1/test_belebele_evaluation.json +51 -0
- wisent/examples/scripts/1/test_belebele_pairs.json +14 -0
- wisent/examples/scripts/1/test_benchmarks_evaluation.json +51 -0
- wisent/examples/scripts/1/test_benchmarks_pairs.json +14 -0
- wisent/examples/scripts/1/test_bertaqa_evaluation.json +51 -0
- wisent/examples/scripts/1/test_bertaqa_pairs.json +14 -0
- wisent/examples/scripts/1/test_bhtc_v2_evaluation.json +30 -0
- wisent/examples/scripts/1/test_bhtc_v2_pairs.json +8 -0
- wisent/examples/scripts/1/test_boolq-seq2seq_evaluation.json +30 -0
- wisent/examples/scripts/1/test_boolq-seq2seq_pairs.json +8 -0
- wisent/examples/scripts/1/test_cabreu_evaluation.json +30 -0
- wisent/examples/scripts/1/test_cabreu_pairs.json +8 -0
- wisent/examples/scripts/1/test_careqa_en_evaluation.json +30 -0
- wisent/examples/scripts/1/test_careqa_en_pairs.json +8 -0
- wisent/examples/scripts/1/test_careqa_evaluation.json +30 -0
- wisent/examples/scripts/1/test_careqa_pairs.json +8 -0
- wisent/examples/scripts/1/test_catalanqa_evaluation.json +30 -0
- wisent/examples/scripts/1/test_catalanqa_pairs.json +8 -0
- wisent/examples/scripts/1/test_catcola_evaluation.json +30 -0
- wisent/examples/scripts/1/test_catcola_pairs.json +8 -0
- wisent/examples/scripts/1/test_chartqa_evaluation.json +30 -0
- wisent/examples/scripts/1/test_chartqa_pairs.json +8 -0
- wisent/examples/scripts/1/test_claim_stance_topic_evaluation.json +30 -0
- wisent/examples/scripts/1/test_claim_stance_topic_pairs.json +8 -0
- wisent/examples/scripts/1/test_cnn_dailymail_evaluation.json +30 -0
- wisent/examples/scripts/1/test_cnn_dailymail_pairs.json +8 -0
- wisent/examples/scripts/1/test_cocoteros_es_evaluation.json +30 -0
- wisent/examples/scripts/1/test_cocoteros_es_pairs.json +8 -0
- wisent/examples/scripts/1/test_coedit_gec_evaluation.json +30 -0
- wisent/examples/scripts/1/test_coedit_gec_pairs.json +8 -0
- wisent/examples/scripts/1/test_cola_evaluation.json +30 -0
- wisent/examples/scripts/1/test_cola_pairs.json +8 -0
- wisent/examples/scripts/1/test_coqcat_evaluation.json +30 -0
- wisent/examples/scripts/1/test_coqcat_pairs.json +8 -0
- wisent/examples/scripts/1/test_dbpedia_14_evaluation.json +30 -0
- wisent/examples/scripts/1/test_dbpedia_14_pairs.json +8 -0
- wisent/examples/scripts/1/test_epec_koref_bin_evaluation.json +30 -0
- wisent/examples/scripts/1/test_epec_koref_bin_pairs.json +8 -0
- wisent/examples/scripts/1/test_ethos_binary_evaluation.json +30 -0
- wisent/examples/scripts/1/test_ethos_binary_pairs.json +8 -0
- wisent/examples/scripts/2/test_afrimgsm_direct_amh_evaluation.json +30 -0
- wisent/examples/scripts/2/test_afrimgsm_direct_amh_pairs.json +8 -0
- wisent/examples/scripts/2/test_afrimmlu_direct_amh_evaluation.json +30 -0
- wisent/examples/scripts/2/test_afrimmlu_direct_amh_pairs.json +8 -0
- wisent/examples/scripts/2/test_afrixnli_en_direct_amh_evaluation.json +30 -0
- wisent/examples/scripts/2/test_afrixnli_en_direct_amh_pairs.json +8 -0
- wisent/examples/scripts/2/test_arc_ar_evaluation.json +30 -0
- wisent/examples/scripts/2/test_arc_ar_pairs.json +8 -0
- wisent/examples/scripts/2/test_atis_evaluation.json +30 -0
- wisent/examples/scripts/2/test_atis_pairs.json +8 -0
- wisent/examples/scripts/2/test_babi_evaluation.json +30 -0
- wisent/examples/scripts/2/test_babi_pairs.json +8 -0
- wisent/examples/scripts/2/test_babilong_evaluation.json +30 -0
- wisent/examples/scripts/2/test_babilong_pairs.json +8 -0
- wisent/examples/scripts/2/test_bangla_mmlu_evaluation.json +30 -0
- wisent/examples/scripts/2/test_bangla_mmlu_pairs.json +8 -0
- wisent/examples/scripts/2/test_basque-glue_pairs.json +14 -0
- wisent/examples/scripts/benchmark_tags.json +2140 -0
- wisent/examples/scripts/lm_eval_readme.json +4 -0
- wisent/examples/scripts/results/benchmark_descriptions.json +1244 -0
- wisent/examples/scripts/results/benchmark_evaluation_methods.json +66 -0
- wisent/examples/scripts/results/benchmark_evaluator_mapping.json +2781 -0
- wisent/examples/scripts/results/benchmark_evaluator_mapping_updated.json +30536 -0
- wisent/examples/scripts/results/benchmark_evaluators_clean.json +469 -0
- wisent/examples/scripts/results/benchmark_methods_summary.json +260 -0
- wisent/examples/scripts/results/benchmark_pair_creation_methods.json +66 -0
- wisent/examples/scripts/results/benchmark_pair_totals.json +269 -0
- wisent/examples/scripts/results/benchmark_tags.json +917 -0
- wisent/examples/scripts/results/benchmark_test_summary_nov4.json +71 -0
- wisent/examples/scripts/results/coding_benchmarks_test_code_status.json +150 -0
- wisent/examples/scripts/results/failing_benchmarks.json +946 -0
- wisent/examples/scripts/results/failing_benchmarks_list.json +41 -0
- wisent/examples/scripts/results/failing_benchmarks_test_results.json +945 -0
- wisent/examples/scripts/results/missing_benchmark_tags.json +341 -0
- wisent/examples/scripts/results/test_20_newsgroups_evaluation.json +30 -0
- wisent/examples/scripts/results/test_20_newsgroups_pairs.json +8 -0
- wisent/examples/scripts/results/test_AraDICE_evaluation.json +51 -0
- wisent/examples/scripts/results/test_AraDICE_pairs.json +14 -0
- wisent/examples/scripts/results/test_AraDiCE_boolq_egy/test_AraDiCE_boolq_egy_evaluation.json +30 -0
- wisent/examples/scripts/results/test_AraDiCE_boolq_egy/test_AraDiCE_boolq_egy_pairs.json +8 -0
- wisent/examples/scripts/results/test_ArabCulture_evaluation.json +51 -0
- wisent/examples/scripts/results/test_ArabCulture_pairs.json +14 -0
- wisent/examples/scripts/results/test_Tag_evaluation.json +30 -0
- wisent/examples/scripts/results/test_Tag_pairs.json +8 -0
- wisent/examples/scripts/results/test_aclue_evaluation.json +51 -0
- wisent/examples/scripts/results/test_aclue_pairs.json +14 -0
- wisent/examples/scripts/results/test_acp_bench_evaluation.json +51 -0
- wisent/examples/scripts/results/test_acp_bench_hard_evaluation.json +51 -0
- wisent/examples/scripts/results/test_acp_bench_hard_pairs.json +14 -0
- wisent/examples/scripts/results/test_acp_bench_pairs.json +14 -0
- wisent/examples/scripts/results/test_advanced_ai_risk_evaluation.json +51 -0
- wisent/examples/scripts/results/test_advanced_ai_risk_pairs.json +14 -0
- wisent/examples/scripts/results/test_aexams_evaluation.json +51 -0
- wisent/examples/scripts/results/test_aexams_pairs.json +14 -0
- wisent/examples/scripts/results/test_afrimgsm_direct_amh_evaluation.json +30 -0
- wisent/examples/scripts/results/test_afrimgsm_direct_amh_pairs.json +8 -0
- wisent/examples/scripts/results/test_afrimmlu_direct_amh_evaluation.json +30 -0
- wisent/examples/scripts/results/test_afrimmlu_direct_amh_pairs.json +8 -0
- wisent/examples/scripts/results/test_afrixnli_en_direct_amh_evaluation.json +30 -0
- wisent/examples/scripts/results/test_afrixnli_en_direct_amh_pairs.json +8 -0
- wisent/examples/scripts/results/test_ag_news_evaluation.json +30 -0
- wisent/examples/scripts/results/test_ag_news_pairs.json +8 -0
- wisent/examples/scripts/results/test_agieval_evaluation.json +51 -0
- wisent/examples/scripts/results/test_agieval_pairs.json +14 -0
- wisent/examples/scripts/results/test_aime2024_evaluation.json +30 -0
- wisent/examples/scripts/results/test_aime2024_pairs.json +8 -0
- wisent/examples/scripts/results/test_aime2025_evaluation.json +30 -0
- wisent/examples/scripts/results/test_aime2025_pairs.json +8 -0
- wisent/examples/scripts/results/test_aime_evaluation.json +30 -0
- wisent/examples/scripts/results/test_aime_pairs.json +8 -0
- wisent/examples/scripts/results/test_anagrams1_evaluation.json +30 -0
- wisent/examples/scripts/results/test_anagrams1_pairs.json +8 -0
- wisent/examples/scripts/results/test_anagrams2_evaluation.json +30 -0
- wisent/examples/scripts/results/test_anagrams2_pairs.json +8 -0
- wisent/examples/scripts/results/test_anli_evaluation.json +30 -0
- wisent/examples/scripts/results/test_anli_pairs.json +8 -0
- wisent/examples/scripts/results/test_apps_evaluation.json +30 -0
- wisent/examples/scripts/results/test_apps_pairs.json +8 -0
- wisent/examples/scripts/results/test_arabic_exams_evaluation.json +30 -0
- wisent/examples/scripts/results/test_arabic_exams_pairs.json +8 -0
- wisent/examples/scripts/results/test_arabic_leaderboard_complete_evaluation.json +51 -0
- wisent/examples/scripts/results/test_arabic_leaderboard_complete_pairs.json +14 -0
- wisent/examples/scripts/results/test_arabic_leaderboard_light_evaluation.json +51 -0
- wisent/examples/scripts/results/test_arabic_leaderboard_light_pairs.json +14 -0
- wisent/examples/scripts/results/test_arabicmmlu_evaluation.json +51 -0
- wisent/examples/scripts/results/test_arabicmmlu_pairs.json +14 -0
- wisent/examples/scripts/results/test_aradice/test_aradice_evaluation.json +51 -0
- wisent/examples/scripts/results/test_aradice/test_aradice_pairs.json +14 -0
- wisent/examples/scripts/results/test_aradice3/test_aradice_evaluation.json +51 -0
- wisent/examples/scripts/results/test_aradice3/test_aradice_pairs.json +14 -0
- wisent/examples/scripts/results/test_arc_ar_evaluation.json +30 -0
- wisent/examples/scripts/results/test_arc_ar_pairs.json +8 -0
- wisent/examples/scripts/results/test_arc_challenge_evaluation.json +30 -0
- wisent/examples/scripts/results/test_arc_challenge_pairs.json +8 -0
- wisent/examples/scripts/results/test_arc_easy_evaluation.json +30 -0
- wisent/examples/scripts/results/test_arc_easy_pairs.json +8 -0
- wisent/examples/scripts/results/test_argument_topic_evaluation.json +30 -0
- wisent/examples/scripts/results/test_argument_topic_pairs.json +8 -0
- wisent/examples/scripts/results/test_arithmetic_evaluation.json +51 -0
- wisent/examples/scripts/results/test_arithmetic_pairs.json +14 -0
- wisent/examples/scripts/results/test_asdiv_evaluation.json +30 -0
- wisent/examples/scripts/results/test_asdiv_pairs.json +8 -0
- wisent/examples/scripts/results/test_assin_entailment_evaluation.json +30 -0
- wisent/examples/scripts/results/test_assin_entailment_pairs.json +8 -0
- wisent/examples/scripts/results/test_atis_evaluation.json +30 -0
- wisent/examples/scripts/results/test_atis_pairs.json +8 -0
- wisent/examples/scripts/results/test_babi_evaluation.json +30 -0
- wisent/examples/scripts/results/test_babi_pairs.json +8 -0
- wisent/examples/scripts/results/test_babilong_evaluation.json +30 -0
- wisent/examples/scripts/results/test_babilong_pairs.json +8 -0
- wisent/examples/scripts/results/test_bangla_mmlu_evaluation.json +30 -0
- wisent/examples/scripts/results/test_bangla_mmlu_pairs.json +8 -0
- wisent/examples/scripts/results/test_banking77_evaluation.json +30 -0
- wisent/examples/scripts/results/test_banking77_pairs.json +8 -0
- wisent/examples/scripts/results/test_basque/test_basque-glue_pairs.json +14 -0
- wisent/examples/scripts/results/test_basque-glue_evaluation.json +51 -0
- wisent/examples/scripts/results/test_basque-glue_pairs.json +14 -0
- wisent/examples/scripts/results/test_basque2/test_basque-glue_evaluation.json +51 -0
- wisent/examples/scripts/results/test_basque2/test_basque-glue_pairs.json +14 -0
- wisent/examples/scripts/results/test_basque_bench_evaluation.json +51 -0
- wisent/examples/scripts/results/test_basque_bench_pairs.json +14 -0
- wisent/examples/scripts/results/test_basque_glue/test_basque-glue_evaluation.json +51 -0
- wisent/examples/scripts/results/test_basque_glue/test_basque-glue_pairs.json +14 -0
- wisent/examples/scripts/results/test_basqueglue_evaluation.json +51 -0
- wisent/examples/scripts/results/test_basqueglue_pairs.json +14 -0
- wisent/examples/scripts/results/test_bbh_evaluation.json +51 -0
- wisent/examples/scripts/results/test_bbh_pairs.json +14 -0
- wisent/examples/scripts/results/test_bbq_evaluation.json +30 -0
- wisent/examples/scripts/results/test_bbq_pairs.json +8 -0
- wisent/examples/scripts/results/test_bec2016eu_evaluation.json +51 -0
- wisent/examples/scripts/results/test_bec2016eu_pairs.json +14 -0
- wisent/examples/scripts/results/test_belebele_evaluation.json +51 -0
- wisent/examples/scripts/results/test_belebele_pairs.json +14 -0
- wisent/examples/scripts/results/test_benchmarks_evaluation.json +51 -0
- wisent/examples/scripts/results/test_benchmarks_pairs.json +14 -0
- wisent/examples/scripts/results/test_bertaqa_evaluation.json +51 -0
- wisent/examples/scripts/results/test_bertaqa_pairs.json +14 -0
- wisent/examples/scripts/results/test_bhtc_v2_evaluation.json +30 -0
- wisent/examples/scripts/results/test_bhtc_v2_pairs.json +8 -0
- wisent/examples/scripts/results/test_bigbench_evaluation.json +51 -0
- wisent/examples/scripts/results/test_bigbench_pairs.json +14 -0
- wisent/examples/scripts/results/test_blimp_evaluation.json +51 -0
- wisent/examples/scripts/results/test_blimp_pairs.json +14 -0
- wisent/examples/scripts/results/test_boolq/test_boolq_evaluation.json +30 -0
- wisent/examples/scripts/results/test_boolq/test_boolq_pairs.json +8 -0
- wisent/examples/scripts/results/test_boolq-seq2seq_evaluation.json +30 -0
- wisent/examples/scripts/results/test_boolq-seq2seq_pairs.json +8 -0
- wisent/examples/scripts/results/test_boolq_evaluation.json +30 -0
- wisent/examples/scripts/results/test_boolq_pairs.json +8 -0
- wisent/examples/scripts/results/test_c4_evaluation.json +30 -0
- wisent/examples/scripts/results/test_c4_pairs.json +8 -0
- wisent/examples/scripts/results/test_cabreu_evaluation.json +30 -0
- wisent/examples/scripts/results/test_cabreu_pairs.json +8 -0
- wisent/examples/scripts/results/test_careqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_careqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_catalan_bench_evaluation.json +51 -0
- wisent/examples/scripts/results/test_catalan_bench_pairs.json +14 -0
- wisent/examples/scripts/results/test_catalanqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_catalanqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_catcola_evaluation.json +30 -0
- wisent/examples/scripts/results/test_catcola_pairs.json +8 -0
- wisent/examples/scripts/results/test_cb_evaluation.json +30 -0
- wisent/examples/scripts/results/test_cb_pairs.json +8 -0
- wisent/examples/scripts/results/test_ceval/test_ceval_evaluation.json +51 -0
- wisent/examples/scripts/results/test_ceval/test_ceval_pairs.json +14 -0
- wisent/examples/scripts/results/test_ceval_accountant/test_ceval-valid_accountant_evaluation.json +30 -0
- wisent/examples/scripts/results/test_ceval_accountant/test_ceval-valid_accountant_pairs.json +8 -0
- wisent/examples/scripts/results/test_ceval_evaluation.json +51 -0
- wisent/examples/scripts/results/test_ceval_pairs.json +14 -0
- wisent/examples/scripts/results/test_ceval_valid/test_ceval_valid_evaluation.json +51 -0
- wisent/examples/scripts/results/test_ceval_valid/test_ceval_valid_pairs.json +14 -0
- wisent/examples/scripts/results/test_chain_of_thought_evaluation.json +51 -0
- wisent/examples/scripts/results/test_chain_of_thought_pairs.json +14 -0
- wisent/examples/scripts/results/test_chartqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_chartqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_claim_stance_topic_evaluation.json +30 -0
- wisent/examples/scripts/results/test_claim_stance_topic_pairs.json +8 -0
- wisent/examples/scripts/results/test_cmmlu_evaluation.json +51 -0
- wisent/examples/scripts/results/test_cmmlu_pairs.json +14 -0
- wisent/examples/scripts/results/test_cnn_dailymail_evaluation.json +30 -0
- wisent/examples/scripts/results/test_cnn_dailymail_pairs.json +8 -0
- wisent/examples/scripts/results/test_cocoteros_es_evaluation.json +30 -0
- wisent/examples/scripts/results/test_cocoteros_es_pairs.json +8 -0
- wisent/examples/scripts/results/test_codexglue_code_to_text_go_evaluation.json +30 -0
- wisent/examples/scripts/results/test_codexglue_code_to_text_go_pairs.json +8 -0
- wisent/examples/scripts/results/test_codexglue_code_to_text_java_evaluation.json +30 -0
- wisent/examples/scripts/results/test_codexglue_code_to_text_java_pairs.json +8 -0
- wisent/examples/scripts/results/test_codexglue_code_to_text_javascript_evaluation.json +30 -0
- wisent/examples/scripts/results/test_codexglue_code_to_text_javascript_pairs.json +8 -0
- wisent/examples/scripts/results/test_codexglue_code_to_text_php_evaluation.json +30 -0
- wisent/examples/scripts/results/test_codexglue_code_to_text_php_pairs.json +8 -0
- wisent/examples/scripts/results/test_codexglue_code_to_text_python_evaluation.json +30 -0
- wisent/examples/scripts/results/test_codexglue_code_to_text_python_pairs.json +8 -0
- wisent/examples/scripts/results/test_codexglue_code_to_text_ruby_evaluation.json +30 -0
- wisent/examples/scripts/results/test_codexglue_code_to_text_ruby_pairs.json +8 -0
- wisent/examples/scripts/results/test_coedit_gec_evaluation.json +30 -0
- wisent/examples/scripts/results/test_coedit_gec_pairs.json +8 -0
- wisent/examples/scripts/results/test_cola_evaluation.json +30 -0
- wisent/examples/scripts/results/test_cola_pairs.json +8 -0
- wisent/examples/scripts/results/test_commonsense_qa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_commonsense_qa_pairs.json +8 -0
- wisent/examples/scripts/results/test_conala_evaluation.json +30 -0
- wisent/examples/scripts/results/test_conala_pairs.json +8 -0
- wisent/examples/scripts/results/test_concode_evaluation.json +30 -0
- wisent/examples/scripts/results/test_concode_pairs.json +8 -0
- wisent/examples/scripts/results/test_copa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_copa_pairs.json +8 -0
- wisent/examples/scripts/results/test_copal_id_evaluation.json +30 -0
- wisent/examples/scripts/results/test_copal_id_pairs.json +8 -0
- wisent/examples/scripts/results/test_coqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_coqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_coqcat_evaluation.json +30 -0
- wisent/examples/scripts/results/test_coqcat_pairs.json +8 -0
- wisent/examples/scripts/results/test_crows_pairs_evaluation.json +51 -0
- wisent/examples/scripts/results/test_crows_pairs_pairs.json +14 -0
- wisent/examples/scripts/results/test_csatqa_evaluation.json +51 -0
- wisent/examples/scripts/results/test_csatqa_pairs.json +14 -0
- wisent/examples/scripts/results/test_cycle_letters_evaluation.json +30 -0
- wisent/examples/scripts/results/test_cycle_letters_pairs.json +8 -0
- wisent/examples/scripts/results/test_darija_bench/test_darija_bench_evaluation.json +51 -0
- wisent/examples/scripts/results/test_darija_bench/test_darija_bench_pairs.json +14 -0
- wisent/examples/scripts/results/test_darija_bench_evaluation.json +51 -0
- wisent/examples/scripts/results/test_darija_bench_pairs.json +14 -0
- wisent/examples/scripts/results/test_darijahellaswag_evaluation.json +30 -0
- wisent/examples/scripts/results/test_darijahellaswag_pairs.json +8 -0
- wisent/examples/scripts/results/test_darijammlu_evaluation.json +51 -0
- wisent/examples/scripts/results/test_darijammlu_pairs.json +14 -0
- wisent/examples/scripts/results/test_dbpedia_14_evaluation.json +30 -0
- wisent/examples/scripts/results/test_dbpedia_14_pairs.json +8 -0
- wisent/examples/scripts/results/test_drop_evaluation.json +30 -0
- wisent/examples/scripts/results/test_drop_pairs.json +8 -0
- wisent/examples/scripts/results/test_ds1000_evaluation.json +30 -0
- wisent/examples/scripts/results/test_ds1000_pairs.json +8 -0
- wisent/examples/scripts/results/test_egyhellaswag_evaluation.json +30 -0
- wisent/examples/scripts/results/test_egyhellaswag_pairs.json +8 -0
- wisent/examples/scripts/results/test_egymmlu_evaluation.json +51 -0
- wisent/examples/scripts/results/test_egymmlu_pairs.json +14 -0
- wisent/examples/scripts/results/test_epec_koref_bin_evaluation.json +30 -0
- wisent/examples/scripts/results/test_epec_koref_bin_pairs.json +8 -0
- wisent/examples/scripts/results/test_eq_bench_evaluation.json +30 -0
- wisent/examples/scripts/results/test_eq_bench_pairs.json +8 -0
- wisent/examples/scripts/results/test_escola_evaluation.json +30 -0
- wisent/examples/scripts/results/test_escola_pairs.json +8 -0
- wisent/examples/scripts/results/test_ethics_cm_evaluation.json +30 -0
- wisent/examples/scripts/results/test_ethics_cm_pairs.json +8 -0
- wisent/examples/scripts/results/test_ethos_binary_evaluation.json +30 -0
- wisent/examples/scripts/results/test_ethos_binary_pairs.json +8 -0
- wisent/examples/scripts/results/test_eus_exams/test_eus_exams_evaluation.json +51 -0
- wisent/examples/scripts/results/test_eus_exams/test_eus_exams_pairs.json +14 -0
- wisent/examples/scripts/results/test_eus_exams_es_evaluation.json +51 -0
- wisent/examples/scripts/results/test_eus_exams_es_pairs.json +14 -0
- wisent/examples/scripts/results/test_eus_exams_evaluation.json +51 -0
- wisent/examples/scripts/results/test_eus_exams_pairs.json +14 -0
- wisent/examples/scripts/results/test_eus_proficiency_evaluation.json +30 -0
- wisent/examples/scripts/results/test_eus_proficiency_pairs.json +8 -0
- wisent/examples/scripts/results/test_eus_reading_evaluation.json +30 -0
- wisent/examples/scripts/results/test_eus_reading_pairs.json +8 -0
- wisent/examples/scripts/results/test_eus_trivia_evaluation.json +30 -0
- wisent/examples/scripts/results/test_eus_trivia_pairs.json +8 -0
- wisent/examples/scripts/results/test_evalita-mp_evaluation.json +51 -0
- wisent/examples/scripts/results/test_evalita-mp_pairs.json +14 -0
- wisent/examples/scripts/results/test_evalita-sp_sum_task_fp-small_p1_evaluation.json +30 -0
- wisent/examples/scripts/results/test_evalita-sp_sum_task_fp-small_p1_pairs.json +8 -0
- wisent/examples/scripts/results/test_evalita_LLM_evaluation.json +51 -0
- wisent/examples/scripts/results/test_evalita_LLM_pairs.json +14 -0
- wisent/examples/scripts/results/test_evalita_llm/test_evalita_llm_evaluation.json +51 -0
- wisent/examples/scripts/results/test_evalita_llm/test_evalita_llm_pairs.json +14 -0
- wisent/examples/scripts/results/test_evalita_mp/test_evalita-mp_te_prompt-1_evaluation.json +30 -0
- wisent/examples/scripts/results/test_evalita_mp/test_evalita-mp_te_prompt-1_pairs.json +8 -0
- wisent/examples/scripts/results/test_evalita_mp2/test_evalita_mp_evaluation.json +51 -0
- wisent/examples/scripts/results/test_evalita_mp2/test_evalita_mp_pairs.json +14 -0
- wisent/examples/scripts/results/test_evalita_sp2/test_evalita-sp_sum_task_fp-small_p1_evaluation.json +30 -0
- wisent/examples/scripts/results/test_evalita_sp2/test_evalita-sp_sum_task_fp-small_p1_pairs.json +8 -0
- wisent/examples/scripts/results/test_fda_evaluation.json +30 -0
- wisent/examples/scripts/results/test_fda_pairs.json +8 -0
- wisent/examples/scripts/results/test_financial_tweets_evaluation.json +30 -0
- wisent/examples/scripts/results/test_financial_tweets_pairs.json +8 -0
- wisent/examples/scripts/results/test_fld/test_fld_evaluation.json +30 -0
- wisent/examples/scripts/results/test_fld/test_fld_pairs.json +8 -0
- wisent/examples/scripts/results/test_fld_evaluation.json +30 -0
- wisent/examples/scripts/results/test_fld_fixed/test_fld_evaluation.json +30 -0
- wisent/examples/scripts/results/test_fld_fixed/test_fld_pairs.json +8 -0
- wisent/examples/scripts/results/test_fld_pairs.json +8 -0
- wisent/examples/scripts/results/test_flores_evaluation.json +51 -0
- wisent/examples/scripts/results/test_flores_pairs.json +14 -0
- wisent/examples/scripts/results/test_freebase_evaluation.json +30 -0
- wisent/examples/scripts/results/test_freebase_pairs.json +8 -0
- wisent/examples/scripts/results/test_french_bench_evaluation.json +51 -0
- wisent/examples/scripts/results/test_french_bench_pairs.json +14 -0
- wisent/examples/scripts/results/test_galcola_evaluation.json +30 -0
- wisent/examples/scripts/results/test_galcola_pairs.json +8 -0
- wisent/examples/scripts/results/test_galician_bench_evaluation.json +51 -0
- wisent/examples/scripts/results/test_galician_bench_pairs.json +14 -0
- wisent/examples/scripts/results/test_glianorex_evaluation.json +30 -0
- wisent/examples/scripts/results/test_glianorex_pairs.json +8 -0
- wisent/examples/scripts/results/test_global_mmlu_evaluation.json +51 -0
- wisent/examples/scripts/results/test_global_mmlu_pairs.json +14 -0
- wisent/examples/scripts/results/test_glue_evaluation.json +51 -0
- wisent/examples/scripts/results/test_glue_pairs.json +14 -0
- wisent/examples/scripts/results/test_gpqa_evaluation.json +51 -0
- wisent/examples/scripts/results/test_gpqa_pairs.json +14 -0
- wisent/examples/scripts/results/test_gpt3_translation_benchmarks_evaluation.json +51 -0
- wisent/examples/scripts/results/test_gpt3_translation_benchmarks_pairs.json +14 -0
- wisent/examples/scripts/results/test_groundcocoa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_groundcocoa_pairs.json +8 -0
- wisent/examples/scripts/results/test_gsm8k_evaluation.json +30 -0
- wisent/examples/scripts/results/test_gsm8k_pairs.json +8 -0
- wisent/examples/scripts/results/test_haerae_evaluation.json +51 -0
- wisent/examples/scripts/results/test_haerae_pairs.json +14 -0
- wisent/examples/scripts/results/test_headqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_headqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_hellaswag_evaluation.json +30 -0
- wisent/examples/scripts/results/test_hellaswag_pairs.json +8 -0
- wisent/examples/scripts/results/test_hendrycks_ethics_evaluation.json +51 -0
- wisent/examples/scripts/results/test_hendrycks_ethics_pairs.json +14 -0
- wisent/examples/scripts/results/test_hendrycks_math_evaluation.json +51 -0
- wisent/examples/scripts/results/test_hendrycks_math_pairs.json +14 -0
- wisent/examples/scripts/results/test_histoires_morales_evaluation.json +30 -0
- wisent/examples/scripts/results/test_histoires_morales_pairs.json +8 -0
- wisent/examples/scripts/results/test_hmmt_evaluation.json +30 -0
- wisent/examples/scripts/results/test_hmmt_feb_2025_evaluation.json +30 -0
- wisent/examples/scripts/results/test_hmmt_feb_2025_pairs.json +8 -0
- wisent/examples/scripts/results/test_hmmt_pairs.json +8 -0
- wisent/examples/scripts/results/test_hrm8k_evaluation.json +51 -0
- wisent/examples/scripts/results/test_hrm8k_pairs.json +14 -0
- wisent/examples/scripts/results/test_humaneval_evaluation.json +30 -0
- wisent/examples/scripts/results/test_humaneval_pairs.json +8 -0
- wisent/examples/scripts/results/test_humaneval_plus_evaluation.json +30 -0
- wisent/examples/scripts/results/test_humaneval_plus_pairs.json +8 -0
- wisent/examples/scripts/results/test_ifeval_evaluation.json +30 -0
- wisent/examples/scripts/results/test_ifeval_pairs.json +8 -0
- wisent/examples/scripts/results/test_instruct_humaneval/test_instruct_humaneval_evaluation.json +30 -0
- wisent/examples/scripts/results/test_instruct_humaneval/test_instruct_humaneval_pairs.json +8 -0
- wisent/examples/scripts/results/test_instruct_humaneval_evaluation.json +30 -0
- wisent/examples/scripts/results/test_instruct_humaneval_pairs.json +8 -0
- wisent/examples/scripts/results/test_inverse_scaling_evaluation.json +51 -0
- wisent/examples/scripts/results/test_inverse_scaling_hindsight_neglect_10shot_evaluation.json +30 -0
- wisent/examples/scripts/results/test_inverse_scaling_hindsight_neglect_10shot_pairs.json +8 -0
- wisent/examples/scripts/results/test_inverse_scaling_mc/test_inverse_scaling_mc_evaluation.json +51 -0
- wisent/examples/scripts/results/test_inverse_scaling_mc/test_inverse_scaling_mc_pairs.json +14 -0
- wisent/examples/scripts/results/test_inverse_scaling_pairs.json +14 -0
- wisent/examples/scripts/results/test_iwslt2017-ar-en_evaluation.json +30 -0
- wisent/examples/scripts/results/test_iwslt2017-ar-en_pairs.json +8 -0
- wisent/examples/scripts/results/test_iwslt2017-en-ar_evaluation.json +30 -0
- wisent/examples/scripts/results/test_iwslt2017-en-ar_pairs.json +8 -0
- wisent/examples/scripts/results/test_iwslt2017_ar_en/test_iwslt2017-ar-en_evaluation.json +30 -0
- wisent/examples/scripts/results/test_iwslt2017_ar_en/test_iwslt2017-ar-en_pairs.json +8 -0
- wisent/examples/scripts/results/test_iwslt2017_en_ar/test_iwslt2017-en-ar_evaluation.json +30 -0
- wisent/examples/scripts/results/test_iwslt2017_en_ar/test_iwslt2017-en-ar_pairs.json +8 -0
- wisent/examples/scripts/results/test_iwslt2017_group/test_iwslt2017_evaluation.json +30 -0
- wisent/examples/scripts/results/test_iwslt2017_group/test_iwslt2017_pairs.json +8 -0
- wisent/examples/scripts/results/test_japanese_leaderboard_evaluation.json +51 -0
- wisent/examples/scripts/results/test_japanese_leaderboard_pairs.json +14 -0
- wisent/examples/scripts/results/test_jsonschema_bench/test_jsonschema_bench_evaluation.json +30 -0
- wisent/examples/scripts/results/test_jsonschema_bench/test_jsonschema_bench_pairs.json +8 -0
- wisent/examples/scripts/results/test_jsonschema_bench_evaluation.json +30 -0
- wisent/examples/scripts/results/test_jsonschema_bench_final/test_jsonschema_bench_evaluation.json +30 -0
- wisent/examples/scripts/results/test_jsonschema_bench_final/test_jsonschema_bench_pairs.json +8 -0
- wisent/examples/scripts/results/test_jsonschema_bench_pairs.json +8 -0
- wisent/examples/scripts/results/test_kbl_evaluation.json +51 -0
- wisent/examples/scripts/results/test_kbl_fixed/test_kbl_evaluation.json +51 -0
- wisent/examples/scripts/results/test_kbl_fixed/test_kbl_pairs.json +14 -0
- wisent/examples/scripts/results/test_kbl_pairs.json +14 -0
- wisent/examples/scripts/results/test_kmmlu_evaluation.json +51 -0
- wisent/examples/scripts/results/test_kmmlu_pairs.json +14 -0
- wisent/examples/scripts/results/test_kobest_evaluation.json +51 -0
- wisent/examples/scripts/results/test_kobest_pairs.json +14 -0
- wisent/examples/scripts/results/test_kormedmcqa/test_kormedmcqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_kormedmcqa/test_kormedmcqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_kormedmcqa_dentist/test_kormedmcqa_dentist_evaluation.json +30 -0
- wisent/examples/scripts/results/test_kormedmcqa_dentist/test_kormedmcqa_dentist_pairs.json +8 -0
- wisent/examples/scripts/results/test_kormedmcqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_kormedmcqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_lambada_cloze_evaluation.json +30 -0
- wisent/examples/scripts/results/test_lambada_cloze_pairs.json +8 -0
- wisent/examples/scripts/results/test_lambada_evaluation.json +30 -0
- wisent/examples/scripts/results/test_lambada_final/test_lambada_openai_mt_stablelm_en_evaluation.json +30 -0
- wisent/examples/scripts/results/test_lambada_final/test_lambada_openai_mt_stablelm_en_pairs.json +8 -0
- wisent/examples/scripts/results/test_lambada_multilingual/test_lambada_multilingual_evaluation.json +51 -0
- wisent/examples/scripts/results/test_lambada_multilingual/test_lambada_multilingual_pairs.json +14 -0
- wisent/examples/scripts/results/test_lambada_multilingual_evaluation.json +51 -0
- wisent/examples/scripts/results/test_lambada_multilingual_pairs.json +14 -0
- wisent/examples/scripts/results/test_lambada_multilingual_stablelm_evaluation.json +51 -0
- wisent/examples/scripts/results/test_lambada_multilingual_stablelm_pairs.json +14 -0
- wisent/examples/scripts/results/test_lambada_openai_evaluation.json +30 -0
- wisent/examples/scripts/results/test_lambada_openai_pairs.json +8 -0
- wisent/examples/scripts/results/test_lambada_pairs.json +8 -0
- wisent/examples/scripts/results/test_lambada_stablelm_en_fixed/test_lambada_openai_mt_stablelm_en_evaluation.json +30 -0
- wisent/examples/scripts/results/test_lambada_stablelm_en_fixed/test_lambada_openai_mt_stablelm_en_pairs.json +8 -0
- wisent/examples/scripts/results/test_lambada_stablelm_fixed/test_lambada_openai_mt_stablelm_en_evaluation.json +30 -0
- wisent/examples/scripts/results/test_lambada_stablelm_fixed/test_lambada_openai_mt_stablelm_en_pairs.json +8 -0
- wisent/examples/scripts/results/test_lambada_standard_evaluation.json +30 -0
- wisent/examples/scripts/results/test_lambada_standard_pairs.json +8 -0
- wisent/examples/scripts/results/test_leaderboard_evaluation.json +51 -0
- wisent/examples/scripts/results/test_leaderboard_pairs.json +14 -0
- wisent/examples/scripts/results/test_libra/test_libra_evaluation.json +51 -0
- wisent/examples/scripts/results/test_libra/test_libra_pairs.json +14 -0
- wisent/examples/scripts/results/test_libra_evaluation.json +51 -0
- wisent/examples/scripts/results/test_libra_pairs.json +14 -0
- wisent/examples/scripts/results/test_lingoly_evaluation.json +30 -0
- wisent/examples/scripts/results/test_lingoly_pairs.json +8 -0
- wisent/examples/scripts/results/test_livecodebench_evaluation.json +30 -0
- wisent/examples/scripts/results/test_livecodebench_pairs.json +8 -0
- wisent/examples/scripts/results/test_livemathbench_cnmo_en_evaluation.json +30 -0
- wisent/examples/scripts/results/test_livemathbench_cnmo_en_pairs.json +8 -0
- wisent/examples/scripts/results/test_livemathbench_cnmo_zh_evaluation.json +30 -0
- wisent/examples/scripts/results/test_livemathbench_cnmo_zh_pairs.json +8 -0
- wisent/examples/scripts/results/test_llama_evaluation.json +30 -0
- wisent/examples/scripts/results/test_llama_pairs.json +8 -0
- wisent/examples/scripts/results/test_logiqa2_evaluation.json +30 -0
- wisent/examples/scripts/results/test_logiqa2_pairs.json +8 -0
- wisent/examples/scripts/results/test_logiqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_logiqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_m_mmlu_evaluation.json +51 -0
- wisent/examples/scripts/results/test_m_mmlu_pairs.json +14 -0
- wisent/examples/scripts/results/test_mastermind/test_mastermind_evaluation.json +51 -0
- wisent/examples/scripts/results/test_mastermind/test_mastermind_pairs.json +14 -0
- wisent/examples/scripts/results/test_mastermind_24_easy/test_mastermind_24_easy_evaluation.json +30 -0
- wisent/examples/scripts/results/test_mastermind_24_easy/test_mastermind_24_easy_pairs.json +8 -0
- wisent/examples/scripts/results/test_mastermind_evaluation.json +51 -0
- wisent/examples/scripts/results/test_mastermind_pairs.json +14 -0
- wisent/examples/scripts/results/test_math500_evaluation.json +30 -0
- wisent/examples/scripts/results/test_math500_pairs.json +8 -0
- wisent/examples/scripts/results/test_math_evaluation.json +30 -0
- wisent/examples/scripts/results/test_math_pairs.json +8 -0
- wisent/examples/scripts/results/test_mathqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_mathqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_mbpp_evaluation.json +30 -0
- wisent/examples/scripts/results/test_mbpp_pairs.json +8 -0
- wisent/examples/scripts/results/test_mbpp_plus_evaluation.json +30 -0
- wisent/examples/scripts/results/test_mbpp_plus_pairs.json +8 -0
- wisent/examples/scripts/results/test_mc_taco_evaluation.json +30 -0
- wisent/examples/scripts/results/test_mc_taco_pairs.json +8 -0
- wisent/examples/scripts/results/test_med_concepts_qa/test_med_concepts_qa_evaluation.json +51 -0
- wisent/examples/scripts/results/test_med_concepts_qa/test_med_concepts_qa_pairs.json +14 -0
- wisent/examples/scripts/results/test_med_concepts_qa_atc_easy/test_med_concepts_qa_atc_easy_evaluation.json +30 -0
- wisent/examples/scripts/results/test_med_concepts_qa_atc_easy/test_med_concepts_qa_atc_easy_pairs.json +8 -0
- wisent/examples/scripts/results/test_med_concepts_qa_evaluation.json +51 -0
- wisent/examples/scripts/results/test_med_concepts_qa_pairs.json +14 -0
- wisent/examples/scripts/results/test_meddialog_evaluation.json +30 -0
- wisent/examples/scripts/results/test_meddialog_pairs.json +8 -0
- wisent/examples/scripts/results/test_meddialog_raw_perplexity/test_meddialog_raw_perplexity_evaluation.json +30 -0
- wisent/examples/scripts/results/test_meddialog_raw_perplexity/test_meddialog_raw_perplexity_pairs.json +8 -0
- wisent/examples/scripts/results/test_mediqa_qa2019_evaluation.json +30 -0
- wisent/examples/scripts/results/test_mediqa_qa2019_pairs.json +8 -0
- wisent/examples/scripts/results/test_medmcqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_medmcqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_medqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_medqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_medtext_evaluation.json +30 -0
- wisent/examples/scripts/results/test_medtext_pairs.json +8 -0
- wisent/examples/scripts/results/test_mela_evaluation.json +51 -0
- wisent/examples/scripts/results/test_mela_pairs.json +14 -0
- wisent/examples/scripts/results/test_meqsum_evaluation.json +30 -0
- wisent/examples/scripts/results/test_meqsum_pairs.json +8 -0
- wisent/examples/scripts/results/test_mercury_evaluation.json +30 -0
- wisent/examples/scripts/results/test_mercury_pairs.json +8 -0
- wisent/examples/scripts/results/test_metabench_evaluation.json +51 -0
- wisent/examples/scripts/results/test_metabench_pairs.json +14 -0
- wisent/examples/scripts/results/test_mgsm_evaluation.json +51 -0
- wisent/examples/scripts/results/test_mgsm_pairs.json +14 -0
- wisent/examples/scripts/results/test_mimic_repsum_evaluation.json +30 -0
- wisent/examples/scripts/results/test_mimic_repsum_pairs.json +8 -0
- wisent/examples/scripts/results/test_minerva_math_evaluation.json +51 -0
- wisent/examples/scripts/results/test_minerva_math_pairs.json +14 -0
- wisent/examples/scripts/results/test_mlqa_evaluation.json +51 -0
- wisent/examples/scripts/results/test_mlqa_pairs.json +14 -0
- wisent/examples/scripts/results/test_mmlu-pro-plus_evaluation.json +51 -0
- wisent/examples/scripts/results/test_mmlu-pro-plus_pairs.json +14 -0
- wisent/examples/scripts/results/test_mmlu_evaluation.json +51 -0
- wisent/examples/scripts/results/test_mmlu_pairs.json +14 -0
- wisent/examples/scripts/results/test_mmlu_pro_evaluation.json +51 -0
- wisent/examples/scripts/results/test_mmlu_pro_pairs.json +14 -0
- wisent/examples/scripts/results/test_mmlu_prox_evaluation.json +51 -0
- wisent/examples/scripts/results/test_mmlu_prox_pairs.json +14 -0
- wisent/examples/scripts/results/test_mmlusr_evaluation.json +30 -0
- wisent/examples/scripts/results/test_mmlusr_pairs.json +8 -0
- wisent/examples/scripts/results/test_mmmu_evaluation.json +51 -0
- wisent/examples/scripts/results/test_mmmu_pairs.json +14 -0
- wisent/examples/scripts/results/test_mnli_evaluation.json +30 -0
- wisent/examples/scripts/results/test_mnli_pairs.json +8 -0
- wisent/examples/scripts/results/test_model_written_evals_evaluation.json +51 -0
- wisent/examples/scripts/results/test_model_written_evals_pairs.json +14 -0
- wisent/examples/scripts/results/test_moral_stories_evaluation.json +30 -0
- wisent/examples/scripts/results/test_moral_stories_pairs.json +8 -0
- wisent/examples/scripts/results/test_mts_dialog_evaluation.json +30 -0
- wisent/examples/scripts/results/test_mts_dialog_pairs.json +8 -0
- wisent/examples/scripts/results/test_multiblimp_evaluation.json +51 -0
- wisent/examples/scripts/results/test_multiblimp_pairs.json +14 -0
- wisent/examples/scripts/results/test_multimedqa_evaluation.json +51 -0
- wisent/examples/scripts/results/test_multimedqa_pairs.json +14 -0
- wisent/examples/scripts/results/test_multipl_e_evaluation.json +30 -0
- wisent/examples/scripts/results/test_multipl_e_pairs.json +8 -0
- wisent/examples/scripts/results/test_mutual_evaluation.json +30 -0
- wisent/examples/scripts/results/test_mutual_pairs.json +8 -0
- wisent/examples/scripts/results/test_non_greedy_robustness_agieval_aqua_rat_evaluation.json +30 -0
- wisent/examples/scripts/results/test_non_greedy_robustness_agieval_aqua_rat_pairs.json +8 -0
- wisent/examples/scripts/results/test_noreval_evaluation.json +51 -0
- wisent/examples/scripts/results/test_noreval_pairs.json +14 -0
- wisent/examples/scripts/results/test_noticia_evaluation.json +30 -0
- wisent/examples/scripts/results/test_noticia_pairs.json +8 -0
- wisent/examples/scripts/results/test_nq_open_evaluation.json +30 -0
- wisent/examples/scripts/results/test_nq_open_pairs.json +8 -0
- wisent/examples/scripts/results/test_olaph_evaluation.json +30 -0
- wisent/examples/scripts/results/test_olaph_pairs.json +8 -0
- wisent/examples/scripts/results/test_openbookqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_openbookqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_openllm_evaluation.json +51 -0
- wisent/examples/scripts/results/test_openllm_pairs.json +14 -0
- wisent/examples/scripts/results/test_option_order_robustness_agieval_aqua_rat_evaluation.json +30 -0
- wisent/examples/scripts/results/test_option_order_robustness_agieval_aqua_rat_pairs.json +8 -0
- wisent/examples/scripts/results/test_paloma_evaluation.json +51 -0
- wisent/examples/scripts/results/test_paloma_pairs.json +14 -0
- wisent/examples/scripts/results/test_passkey/test_passkey_evaluation.json +30 -0
- wisent/examples/scripts/results/test_passkey/test_passkey_pairs.json +8 -0
- wisent/examples/scripts/results/test_paws-x_evaluation.json +51 -0
- wisent/examples/scripts/results/test_paws-x_pairs.json +14 -0
- wisent/examples/scripts/results/test_paws_en/test_paws_en_evaluation.json +30 -0
- wisent/examples/scripts/results/test_paws_en/test_paws_en_pairs.json +8 -0
- wisent/examples/scripts/results/test_penn_treebank_evaluation.json +30 -0
- wisent/examples/scripts/results/test_penn_treebank_pairs.json +8 -0
- wisent/examples/scripts/results/test_pile_10k/test_pile_10k_evaluation.json +30 -0
- wisent/examples/scripts/results/test_pile_10k/test_pile_10k_pairs.json +8 -0
- wisent/examples/scripts/results/test_piqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_piqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_polemo2_evaluation.json +30 -0
- wisent/examples/scripts/results/test_polemo2_pairs.json +8 -0
- wisent/examples/scripts/results/test_polymath_en_high_evaluation.json +30 -0
- wisent/examples/scripts/results/test_polymath_en_high_pairs.json +8 -0
- wisent/examples/scripts/results/test_polymath_en_medium_evaluation.json +30 -0
- wisent/examples/scripts/results/test_polymath_en_medium_pairs.json +8 -0
- wisent/examples/scripts/results/test_polymath_zh_high_evaluation.json +30 -0
- wisent/examples/scripts/results/test_polymath_zh_high_pairs.json +8 -0
- wisent/examples/scripts/results/test_polymath_zh_medium_evaluation.json +30 -0
- wisent/examples/scripts/results/test_polymath_zh_medium_pairs.json +8 -0
- wisent/examples/scripts/results/test_portuguese_bench_evaluation.json +51 -0
- wisent/examples/scripts/results/test_portuguese_bench_pairs.json +14 -0
- wisent/examples/scripts/results/test_prompt_robustness_agieval_aqua_rat/test_prompt_robustness_agieval_aqua_rat_evaluation.json +30 -0
- wisent/examples/scripts/results/test_prompt_robustness_agieval_aqua_rat/test_prompt_robustness_agieval_aqua_rat_pairs.json +8 -0
- wisent/examples/scripts/results/test_prompt_robustness_agieval_aqua_rat_evaluation.json +30 -0
- wisent/examples/scripts/results/test_prompt_robustness_agieval_aqua_rat_pairs.json +8 -0
- wisent/examples/scripts/results/test_prost_evaluation.json +30 -0
- wisent/examples/scripts/results/test_prost_pairs.json +8 -0
- wisent/examples/scripts/results/test_ptb_evaluation.json +30 -0
- wisent/examples/scripts/results/test_ptb_pairs.json +8 -0
- wisent/examples/scripts/results/test_pubmedqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_pubmedqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_pythia_evaluation.json +51 -0
- wisent/examples/scripts/results/test_pythia_pairs.json +14 -0
- wisent/examples/scripts/results/test_qa4mre_evaluation.json +30 -0
- wisent/examples/scripts/results/test_qa4mre_pairs.json +8 -0
- wisent/examples/scripts/results/test_qasper_evaluation.json +30 -0
- wisent/examples/scripts/results/test_qasper_pairs.json +8 -0
- wisent/examples/scripts/results/test_race_evaluation.json +30 -0
- wisent/examples/scripts/results/test_race_pairs.json +8 -0
- wisent/examples/scripts/results/test_realtoxicityprompts_evaluation.json +30 -0
- wisent/examples/scripts/results/test_realtoxicityprompts_pairs.json +8 -0
- wisent/examples/scripts/results/test_recode_evaluation.json +30 -0
- wisent/examples/scripts/results/test_recode_pairs.json +8 -0
- wisent/examples/scripts/results/test_record_evaluation.json +30 -0
- wisent/examples/scripts/results/test_record_pairs.json +8 -0
- wisent/examples/scripts/results/test_ruler_evaluation.json +51 -0
- wisent/examples/scripts/results/test_ruler_pairs.json +14 -0
- wisent/examples/scripts/results/test_sciq_evaluation.json +30 -0
- wisent/examples/scripts/results/test_sciq_pairs.json +8 -0
- wisent/examples/scripts/results/test_score_evaluation.json +51 -0
- wisent/examples/scripts/results/test_score_pairs.json +14 -0
- wisent/examples/scripts/results/test_self_consistency_evaluation.json +30 -0
- wisent/examples/scripts/results/test_self_consistency_pairs.json +8 -0
- wisent/examples/scripts/results/test_siqa/test_siqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_siqa/test_siqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_siqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_siqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_spanish_bench_evaluation.json +51 -0
- wisent/examples/scripts/results/test_spanish_bench_pairs.json +14 -0
- wisent/examples/scripts/results/test_squad2_evaluation.json +30 -0
- wisent/examples/scripts/results/test_squad2_pairs.json +8 -0
- wisent/examples/scripts/results/test_squadv2_evaluation.json +30 -0
- wisent/examples/scripts/results/test_squadv2_pairs.json +8 -0
- wisent/examples/scripts/results/test_super-glue-lm-eval-v1-seq2seq_evaluation.json +30 -0
- wisent/examples/scripts/results/test_super-glue-lm-eval-v1-seq2seq_pairs.json +8 -0
- wisent/examples/scripts/results/test_super-glue-lm-eval-v1_evaluation.json +51 -0
- wisent/examples/scripts/results/test_super-glue-lm-eval-v1_pairs.json +14 -0
- wisent/examples/scripts/results/test_swag_evaluation.json +30 -0
- wisent/examples/scripts/results/test_swag_pairs.json +8 -0
- wisent/examples/scripts/results/test_tinyBenchmarks_evaluation.json +51 -0
- wisent/examples/scripts/results/test_tinyBenchmarks_pairs.json +14 -0
- wisent/examples/scripts/results/test_tmmluplus_evaluation.json +51 -0
- wisent/examples/scripts/results/test_tmmluplus_pairs.json +14 -0
- wisent/examples/scripts/results/test_translation_evaluation.json +51 -0
- wisent/examples/scripts/results/test_translation_pairs.json +14 -0
- wisent/examples/scripts/results/test_triviaqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_triviaqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_truthfulqa-multi_evaluation.json +51 -0
- wisent/examples/scripts/results/test_truthfulqa-multi_pairs.json +14 -0
- wisent/examples/scripts/results/test_truthfulqa_evaluation.json +30 -0
- wisent/examples/scripts/results/test_truthfulqa_mc1_evaluation.json +30 -0
- wisent/examples/scripts/results/test_truthfulqa_mc1_pairs.json +8 -0
- wisent/examples/scripts/results/test_truthfulqa_mc2_evaluation.json +30 -0
- wisent/examples/scripts/results/test_truthfulqa_mc2_pairs.json +8 -0
- wisent/examples/scripts/results/test_truthfulqa_pairs.json +8 -0
- wisent/examples/scripts/results/test_turkishmmlu_evaluation.json +51 -0
- wisent/examples/scripts/results/test_turkishmmlu_pairs.json +14 -0
- wisent/examples/scripts/results/test_unfair_tos_evaluation.json +30 -0
- wisent/examples/scripts/results/test_unfair_tos_pairs.json +8 -0
- wisent/examples/scripts/results/test_unscramble_evaluation.json +51 -0
- wisent/examples/scripts/results/test_unscramble_pairs.json +14 -0
- wisent/examples/scripts/results/test_webqs_evaluation.json +30 -0
- wisent/examples/scripts/results/test_webqs_pairs.json +8 -0
- wisent/examples/scripts/results/test_wikitext103_evaluation.json +30 -0
- wisent/examples/scripts/results/test_wikitext103_pairs.json +8 -0
- wisent/examples/scripts/results/test_wikitext_evaluation.json +30 -0
- wisent/examples/scripts/results/test_wikitext_pairs.json +8 -0
- wisent/examples/scripts/results/test_winogender_evaluation.json +51 -0
- wisent/examples/scripts/results/test_winogender_pairs.json +14 -0
- wisent/examples/scripts/results/test_winogrande_evaluation.json +30 -0
- wisent/examples/scripts/results/test_winogrande_pairs.json +8 -0
- wisent/examples/scripts/results/test_wmdp_evaluation.json +30 -0
- wisent/examples/scripts/results/test_wmdp_pairs.json +8 -0
- wisent/examples/scripts/results/test_wmt-ro-en-t5-prompt_evaluation.json +30 -0
- wisent/examples/scripts/results/test_wmt-ro-en-t5-prompt_pairs.json +8 -0
- wisent/examples/scripts/results/test_wmt14_en_fr_evaluation.json +30 -0
- wisent/examples/scripts/results/test_wmt14_en_fr_pairs.json +8 -0
- wisent/examples/scripts/results/test_wmt16_en_de_evaluation.json +30 -0
- wisent/examples/scripts/results/test_wmt16_en_de_pairs.json +8 -0
- wisent/examples/scripts/results/test_wmt16_ro_en_evaluation.json +30 -0
- wisent/examples/scripts/results/test_wmt16_ro_en_pairs.json +8 -0
- wisent/examples/scripts/results/test_wsc273_evaluation.json +30 -0
- wisent/examples/scripts/results/test_wsc273_pairs.json +8 -0
- wisent/examples/scripts/results/test_xcopa_evaluation.json +51 -0
- wisent/examples/scripts/results/test_xcopa_pairs.json +14 -0
- wisent/examples/scripts/results/test_xnli_eu_evaluation.json +30 -0
- wisent/examples/scripts/results/test_xnli_eu_pairs.json +8 -0
- wisent/examples/scripts/results/test_xnli_evaluation.json +51 -0
- wisent/examples/scripts/results/test_xnli_pairs.json +14 -0
- wisent/examples/scripts/results/test_xquad_evaluation.json +51 -0
- wisent/examples/scripts/results/test_xquad_pairs.json +14 -0
- wisent/examples/scripts/results/test_xstorycloze_evaluation.json +51 -0
- wisent/examples/scripts/results/test_xstorycloze_pairs.json +14 -0
- wisent/examples/scripts/results/test_xsum_evaluation.json +30 -0
- wisent/examples/scripts/results/test_xsum_pairs.json +8 -0
- wisent/examples/scripts/results/test_xwinograd_evaluation.json +51 -0
- wisent/examples/scripts/results/test_xwinograd_pairs.json +14 -0
- wisent/examples/scripts/results/test_yahoo_answers_topics_evaluation.json +30 -0
- wisent/examples/scripts/results/test_yahoo_answers_topics_pairs.json +8 -0
- wisent/parameters/__init__.py +1 -0
- wisent/parameters/lm_eval/all_lm_eval_task_families.json +169 -0
- wisent/parameters/lm_eval/broken_in_lm_eval.json +10 -0
- wisent/parameters/lm_eval/evaluations_not_lm_eval_tasks.json +0 -0
- wisent/parameters/lm_eval/evaluator_check.json +3476 -0
- wisent/parameters/lm_eval/final_verification.json +24782 -0
- wisent/parameters/lm_eval/group_task_evaluators.json +1833 -0
- wisent/parameters/lm_eval/group_tasks.json +150 -0
- wisent/parameters/lm_eval/individual_tasks.json +402 -0
- wisent/parameters/lm_eval/no_readmes.json +1 -0
- wisent/parameters/lm_eval/not_lm_eval_tasks.json +110 -0
- wisent/parameters/lm_eval/read_tasks.json +208 -0
- wisent/parameters/lm_eval/readme_files.json +208 -0
- wisent/parameters/lm_eval/track_progress_not_lm_eval_tasks.json +128 -0
- wisent/parameters/tasks/missing_task_families.json +2963 -0
- wisent/parameters/tasks/remaining_tasks_to_implement.json +199 -0
- wisent/parameters/tasks/risks.json +10 -0
- wisent/parameters/tasks/skills.json +14 -0
- wisent/parameters/tasks/tasks.json +56031 -0
- wisent/scripts/run_quality_metrics_sweep.sh +315 -0
- wisent/tests/__init__.py +0 -0
- wisent/tests/examples/__init__.py +0 -0
- wisent/tests/examples/cli/__init__.py +0 -0
- wisent/tests/examples/cli/activations/__init__.py +0 -0
- wisent/tests/examples/cli/activations/test_get_activations.py +127 -0
- wisent/tests/examples/cli/classifier/__init__.py +0 -0
- wisent/tests/examples/cli/classifier/test_classifier_examples.py +141 -0
- wisent/tests/examples/cli/contrastive_pairs/__init__.py +0 -0
- wisent/tests/examples/cli/contrastive_pairs/test_generate_pairs.py +89 -0
- wisent/tests/examples/cli/evaluation/__init__.py +0 -0
- wisent/tests/examples/cli/evaluation/test_evaluation_examples.py +117 -0
- wisent/tests/examples/cli/generate/__init__.py +0 -0
- wisent/tests/examples/cli/generate/test_generate_with_classifier.py +146 -0
- wisent/tests/examples/cli/generate/test_generate_with_steering.py +149 -0
- wisent/tests/examples/cli/generate/test_only_generate.py +110 -0
- wisent/tests/examples/cli/multi_steering/__init__.py +0 -0
- wisent/tests/examples/cli/multi_steering/test_multi_steer_from_trained_vectors.py +210 -0
- wisent/tests/examples/cli/multi_steering/test_multi_steer_with_different_parameters.py +205 -0
- wisent/tests/examples/cli/multi_steering/test_train_and_multi_steer.py +174 -0
- wisent/tests/examples/cli/optimizer/__init__.py +0 -0
- wisent/tests/examples/cli/optimizer/test_optimize_sample_size.py +102 -0
- wisent/tests/examples/cli/optimizer/test_optimizer_examples.py +59 -0
- wisent/tests/examples/cli/steering/__init__.py +0 -0
- wisent/tests/examples/cli/steering/test_create_steering_vectors.py +135 -0
- wisent/tests/examples/cli/synthetic/__init__.py +0 -0
- wisent/tests/examples/cli/synthetic/test_synthetic_pairs.py +45 -0
- wisent/tests/nosense/__init__.py +6 -0
- wisent/tests/nosense/base_nosense.py +81 -0
- wisent/tests/nosense/math500_nosense.py +72 -0
- wisent/tests/nosense/test_robustness.py +336 -0
- wisent/tests/test_all_cli_commands.py +674 -0
- wisent/tests/test_geometry_comprehensive.py +327 -0
- wisent/tests/test_titan_geometry.py +257 -0
- wisent/tests/visualize_geometry.py +148 -0
- wisent-0.7.379.dist-info/METADATA +64 -0
- wisent-0.7.379.dist-info/RECORD +1720 -0
- wisent-0.7.379.dist-info/WHEEL +5 -0
- wisent-0.7.379.dist-info/entry_points.txt +2 -0
- wisent-0.7.379.dist-info/licenses/LICENSE +21 -0
- wisent-0.7.379.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1640 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import re as regex
|
|
3
|
+
import signal
|
|
4
|
+
import threading
|
|
5
|
+
import warnings
|
|
6
|
+
from collections import Counter
|
|
7
|
+
from concurrent.futures import TimeoutError
|
|
8
|
+
from datetime import datetime
|
|
9
|
+
from math import isclose
|
|
10
|
+
from typing import Any, Callable, List, Match, Optional, Sequence, Set
|
|
11
|
+
from typing import Counter as T_Counter
|
|
12
|
+
from typing import Dict as T_Dict
|
|
13
|
+
from typing import Tuple as T_Tuple
|
|
14
|
+
from typing import Union as T_Union
|
|
15
|
+
|
|
16
|
+
from pebble import ProcessPool, ThreadPool
|
|
17
|
+
from wisent.core.errors import InvalidDataFormatError, InvalidValueError
|
|
18
|
+
|
|
19
|
+
# Useful for `eval` despite not appearing in the code
|
|
20
|
+
from sympy import *
|
|
21
|
+
from sympy.parsing.latex import parse_latex
|
|
22
|
+
from sympy.parsing.latex.errors import LaTeXParsingError
|
|
23
|
+
from sympy.parsing.sympy_parser import parse_expr
|
|
24
|
+
from sympy.utilities.exceptions import SymPyDeprecationWarning
|
|
25
|
+
from tqdm import tqdm
|
|
26
|
+
|
|
27
|
+
warnings.filterwarnings("ignore", category=SymPyDeprecationWarning)
|
|
28
|
+
|
|
29
|
+
STRIP_STRS: List[str] = [
|
|
30
|
+
":",
|
|
31
|
+
# ".",
|
|
32
|
+
"/",
|
|
33
|
+
",",
|
|
34
|
+
"#",
|
|
35
|
+
"?",
|
|
36
|
+
"$",
|
|
37
|
+
'"',
|
|
38
|
+
"'",
|
|
39
|
+
# "ки" is the delimeter for Math-Shepherd
|
|
40
|
+
"к",
|
|
41
|
+
"и",
|
|
42
|
+
# LaTeX
|
|
43
|
+
"\\(",
|
|
44
|
+
"\\)",
|
|
45
|
+
"\\[",
|
|
46
|
+
"\\]",
|
|
47
|
+
]
|
|
48
|
+
NO_TRAILING_STRS: List[str] = ["(", "[", "{", "\\", "."] + STRIP_STRS
|
|
49
|
+
NO_PRECEDING_PUNCS: List[str] = ["!", ")", "]", "}", "\\\\", "boxed"] + STRIP_STRS
|
|
50
|
+
# Answer prefixes
|
|
51
|
+
PRM800K_ANS_PRRFIX = "# Answer"
|
|
52
|
+
GSM8K_ANS_PREFIX = "####"
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# %% ../nbs/00_core.ipynb 0
|
|
56
|
+
def extract_boxed(resp: str) -> str:
|
|
57
|
+
ans: str = resp.split("oxed")[-1]
|
|
58
|
+
a: str
|
|
59
|
+
if len(ans) == 0:
|
|
60
|
+
return ""
|
|
61
|
+
elif ans[0] == "{":
|
|
62
|
+
stack = 1
|
|
63
|
+
a = ""
|
|
64
|
+
for i_pre, c in enumerate(ans[1:]):
|
|
65
|
+
if ans[i_pre] == "\\":
|
|
66
|
+
a += c
|
|
67
|
+
continue
|
|
68
|
+
if c == "{":
|
|
69
|
+
stack += 1
|
|
70
|
+
a += c
|
|
71
|
+
elif c == "}":
|
|
72
|
+
stack -= 1
|
|
73
|
+
if stack == 0:
|
|
74
|
+
break
|
|
75
|
+
a += c
|
|
76
|
+
else:
|
|
77
|
+
a += c
|
|
78
|
+
else:
|
|
79
|
+
a = ans.split("$")[0].strip()
|
|
80
|
+
return a
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def norm_str2bool(s: str) -> Optional[bool]:
|
|
84
|
+
"""Converts a string representation of a boolean value to its corresponding boolean value."""
|
|
85
|
+
s = str(s).lower().strip().replace("noindent", "")
|
|
86
|
+
if any(pos in s for pos in ["yes", "true"]):
|
|
87
|
+
return True
|
|
88
|
+
elif any(neg in s for neg in ["no", "false"]):
|
|
89
|
+
return False
|
|
90
|
+
else:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class EvaluatorBase:
|
|
95
|
+
"""Base class for evaluators.
|
|
96
|
+
|
|
97
|
+
Parameters
|
|
98
|
+
----------
|
|
99
|
+
ans_extract_mode: str, default: "boxed"
|
|
100
|
+
Options:
|
|
101
|
+
- "boxed": Extract answer from the boxed expression.
|
|
102
|
+
- "explicit": Extract answer from the explicit answer segment.
|
|
103
|
+
- "speculate": Speculate the answer from the last number or latex formula.
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
def __init__(
|
|
107
|
+
self,
|
|
108
|
+
ans_extract_mode: str = "boxed",
|
|
109
|
+
):
|
|
110
|
+
self.ans_extract_mode: str = ans_extract_mode
|
|
111
|
+
|
|
112
|
+
def eq(self, ref_ans: str, pred: str) -> bool:
|
|
113
|
+
"""Check if reference answer and prediction answer are **literally** equal."""
|
|
114
|
+
return ref_ans == pred
|
|
115
|
+
|
|
116
|
+
def extract_ans(self, resp_str: str) -> str:
|
|
117
|
+
"""Extract answer segment from complete `resp`."""
|
|
118
|
+
if self.ans_extract_mode == "boxed":
|
|
119
|
+
if "oxed{" in resp_str:
|
|
120
|
+
return extract_boxed(resp_str)
|
|
121
|
+
else:
|
|
122
|
+
return ""
|
|
123
|
+
|
|
124
|
+
if self.ans_extract_mode == "explicit":
|
|
125
|
+
ans: Optional[str] = self.extract_explicit_ans(resp_str)
|
|
126
|
+
if ans is not None:
|
|
127
|
+
return ans
|
|
128
|
+
if self.ans_extract_mode == "speculate":
|
|
129
|
+
# Speculate with the last latex formula
|
|
130
|
+
matches: List[str] = regex.findall(
|
|
131
|
+
r"(?:\$|\\\(|\\\[)([^\$]+)(?:\$|\\\(|\\\[)", resp_str, regex.DOTALL
|
|
132
|
+
)
|
|
133
|
+
if len(matches) > 0:
|
|
134
|
+
return matches[-1]
|
|
135
|
+
# Speculate with the last number
|
|
136
|
+
matches = regex.findall(r"-?\d*\.?\d+", resp_str.replace(",", ""))
|
|
137
|
+
if len(matches) > 0:
|
|
138
|
+
return matches[-1]
|
|
139
|
+
|
|
140
|
+
return "" # Empty str if no answer is found
|
|
141
|
+
|
|
142
|
+
def extract_explicit_ans(self, resp_str: str) -> Optional[str]:
|
|
143
|
+
resp_str = self.clean_trailing(resp_str)
|
|
144
|
+
# might be answer only
|
|
145
|
+
if "<|start_answer|>" in resp_str and "<|end_answer|>" in resp_str:
|
|
146
|
+
return (
|
|
147
|
+
resp_str.split("<|start_answer|>")[1].split("<|end_answer|>")[0].strip()
|
|
148
|
+
)
|
|
149
|
+
if GSM8K_ANS_PREFIX in resp_str:
|
|
150
|
+
resp_str = resp_str.split(GSM8K_ANS_PREFIX)[-1].strip()
|
|
151
|
+
if PRM800K_ANS_PRRFIX in resp_str:
|
|
152
|
+
resp_str = resp_str.split(PRM800K_ANS_PRRFIX)[-1].strip()
|
|
153
|
+
|
|
154
|
+
resp: str
|
|
155
|
+
if "oxed{" in resp_str:
|
|
156
|
+
resp = extract_boxed(resp_str)
|
|
157
|
+
else:
|
|
158
|
+
resp = resp_str
|
|
159
|
+
|
|
160
|
+
# should be answer only
|
|
161
|
+
if "is the ans" in resp:
|
|
162
|
+
resp = regex.split(
|
|
163
|
+
r"(,|\.|\!\|?)", resp.split("is the ans")[-2].strip()
|
|
164
|
+
)[-1].strip()
|
|
165
|
+
elif "is our ans" in resp:
|
|
166
|
+
resp = regex.split(
|
|
167
|
+
r"(,|\.|\!\|?)", resp.split("is our ans")[-2].strip()
|
|
168
|
+
)[-1].strip()
|
|
169
|
+
elif "answer is" in resp:
|
|
170
|
+
resp = resp.split("answer is")[-1].strip()
|
|
171
|
+
elif "answer:" in resp:
|
|
172
|
+
resp = resp.split("answer:")[-1].strip()
|
|
173
|
+
elif "answer :" in resp:
|
|
174
|
+
resp = resp.split("answer :")[-1].strip()
|
|
175
|
+
elif "statement" in resp:
|
|
176
|
+
bool_resp: Optional[bool] = norm_str2bool(resp.split("is ")[-1].strip())
|
|
177
|
+
if bool_resp is not None:
|
|
178
|
+
return str(bool_resp)
|
|
179
|
+
else:
|
|
180
|
+
return None
|
|
181
|
+
|
|
182
|
+
if resp.startswith("$") and resp.endswith("$"):
|
|
183
|
+
resp = resp[1:-1]
|
|
184
|
+
|
|
185
|
+
return resp
|
|
186
|
+
|
|
187
|
+
def clean(self, ans: str) -> str:
|
|
188
|
+
"""Clean the extracted answer."""
|
|
189
|
+
|
|
190
|
+
ans = ans.strip()
|
|
191
|
+
ans = self.clean_preceding(ans)
|
|
192
|
+
ans = self.clean_trailing(ans)
|
|
193
|
+
|
|
194
|
+
return ans
|
|
195
|
+
|
|
196
|
+
def clean_preceding(
|
|
197
|
+
self,
|
|
198
|
+
s: str, # The input string.
|
|
199
|
+
) -> str: # The cleaned string with preceding punctuation marks removed.
|
|
200
|
+
"""Removes preceding punctuation marks from a string."""
|
|
201
|
+
s = str(s).strip()
|
|
202
|
+
while s != "" and s[0] in NO_PRECEDING_PUNCS:
|
|
203
|
+
s = s[1:].strip()
|
|
204
|
+
|
|
205
|
+
return s
|
|
206
|
+
|
|
207
|
+
def clean_trailing(
|
|
208
|
+
self,
|
|
209
|
+
s: str, # The input string.
|
|
210
|
+
) -> str: # The cleaned string with trailing punctuation marks removed.
|
|
211
|
+
"""Removes trailing punctuation marks from a string."""
|
|
212
|
+
s = str(s).strip()
|
|
213
|
+
while s != "" and s[-1] in NO_TRAILING_STRS:
|
|
214
|
+
s = s[:-1].strip()
|
|
215
|
+
return s
|
|
216
|
+
|
|
217
|
+
def get_maj_answers(self, answers: List[str]) -> List[str]:
|
|
218
|
+
"""Get the majority answers."""
|
|
219
|
+
maj_answers: List[str] = []
|
|
220
|
+
|
|
221
|
+
ans_vote: T_Counter[str] = Counter()
|
|
222
|
+
# Normalize all the answers
|
|
223
|
+
for answer in answers:
|
|
224
|
+
for exist_ans in ans_vote:
|
|
225
|
+
correct: bool
|
|
226
|
+
try:
|
|
227
|
+
correct = self.eq(answer, exist_ans)
|
|
228
|
+
except Exception:
|
|
229
|
+
correct = False
|
|
230
|
+
if correct:
|
|
231
|
+
ans_vote[exist_ans] += 1
|
|
232
|
+
break
|
|
233
|
+
else:
|
|
234
|
+
ans_vote[answer] += 1
|
|
235
|
+
maj_ans = self.get_maj_ans_from_votes(ans_vote)
|
|
236
|
+
maj_answers.append(maj_ans)
|
|
237
|
+
|
|
238
|
+
return maj_answers
|
|
239
|
+
|
|
240
|
+
def get_maj_ans_from_votes(
|
|
241
|
+
self, ans_vote: T_Union[T_Counter[str], T_Dict[str, int]]
|
|
242
|
+
) -> str:
|
|
243
|
+
if isinstance(ans_vote, dict):
|
|
244
|
+
ans_vote = Counter(ans_vote)
|
|
245
|
+
maj_ans = ans_vote.most_common(1)[0][0]
|
|
246
|
+
if maj_ans == "" and len(ans_vote) > 1:
|
|
247
|
+
maj_ans = ans_vote.most_common(2)[1][0]
|
|
248
|
+
return maj_ans
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
DEF_TIMEOUT: int = 5
|
|
252
|
+
DEF_N_PROC: int = os.cpu_count() // 2
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def batch_exec(
|
|
256
|
+
func: Callable[..., Any],
|
|
257
|
+
kwargs_list: List[T_Dict[str, Any]],
|
|
258
|
+
n_procs: int = DEF_N_PROC,
|
|
259
|
+
timeout: int = DEF_TIMEOUT,
|
|
260
|
+
use_tqdm: bool = True,
|
|
261
|
+
desc: str = "Processing",
|
|
262
|
+
def_val: Any = None,
|
|
263
|
+
max_tasks_per_proc: int = 1024,
|
|
264
|
+
) -> List[Any]:
|
|
265
|
+
"""Execute a function in batch using `ProcessPool` with efficient per-task timeout."""
|
|
266
|
+
n_samples: int = len(kwargs_list)
|
|
267
|
+
n_procs = min(n_procs, n_samples)
|
|
268
|
+
|
|
269
|
+
results: List[Any] = [def_val] * n_samples
|
|
270
|
+
with ProcessPool(max_workers=n_procs, max_tasks=max_tasks_per_proc) as pool:
|
|
271
|
+
future = pool.map(
|
|
272
|
+
task_wrapper, [func] * len(kwargs_list), kwargs_list, timeout=timeout
|
|
273
|
+
)
|
|
274
|
+
iterator = future.result()
|
|
275
|
+
# NOTE: This keeps the order
|
|
276
|
+
|
|
277
|
+
pbar: Optional[tqdm] = tqdm(total=n_samples, desc=desc) if use_tqdm else None
|
|
278
|
+
|
|
279
|
+
idx: int = 0
|
|
280
|
+
while idx < n_samples:
|
|
281
|
+
try:
|
|
282
|
+
result: Any = next(iterator)
|
|
283
|
+
results[idx] = result
|
|
284
|
+
except StopIteration:
|
|
285
|
+
break
|
|
286
|
+
except Exception:
|
|
287
|
+
pass
|
|
288
|
+
if pbar is not None:
|
|
289
|
+
pbar.update(1)
|
|
290
|
+
idx += 1
|
|
291
|
+
|
|
292
|
+
if pbar:
|
|
293
|
+
pbar.close()
|
|
294
|
+
|
|
295
|
+
return results
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
def task_wrapper(func: Callable[..., Any], kwargs: T_Dict[str, Any]) -> Any:
|
|
299
|
+
return func(**kwargs)
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
def run_with_timeout(
|
|
303
|
+
func: Callable[..., Any], kwargs: T_Dict[str, Any], timeout: int
|
|
304
|
+
) -> Any:
|
|
305
|
+
"""This seems slow."""
|
|
306
|
+
if os.name == "posix": # For Unix-based systems
|
|
307
|
+
|
|
308
|
+
def timeout_handler(signum: int, frame: Any) -> None:
|
|
309
|
+
raise TimeoutError()
|
|
310
|
+
|
|
311
|
+
signal.signal(signal.SIGALRM, timeout_handler)
|
|
312
|
+
signal.alarm(timeout)
|
|
313
|
+
try:
|
|
314
|
+
result: Any = func(**kwargs)
|
|
315
|
+
signal.alarm(0) # Cancel the alarm
|
|
316
|
+
return result
|
|
317
|
+
except TimeoutError:
|
|
318
|
+
raise
|
|
319
|
+
except Exception:
|
|
320
|
+
raise
|
|
321
|
+
else: # For Windows and other systems
|
|
322
|
+
results: List[Any] = [None]
|
|
323
|
+
|
|
324
|
+
def target() -> None:
|
|
325
|
+
try:
|
|
326
|
+
results[0] = func(**kwargs)
|
|
327
|
+
except Exception as e:
|
|
328
|
+
results[0] = e
|
|
329
|
+
|
|
330
|
+
thread: threading.Thread = threading.Thread(target=target)
|
|
331
|
+
thread.start()
|
|
332
|
+
thread.join(timeout)
|
|
333
|
+
if thread.is_alive():
|
|
334
|
+
raise TimeoutError()
|
|
335
|
+
if isinstance(results[0], Exception):
|
|
336
|
+
raise results[0]
|
|
337
|
+
return results[0]
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
def latex2sympy_fix(s: str) -> Expr:
|
|
341
|
+
sp_symbol: Expr = parse_latex(s)
|
|
342
|
+
|
|
343
|
+
if "," in s:
|
|
344
|
+
first_term = None
|
|
345
|
+
try:
|
|
346
|
+
first_term = parse_latex(s.split(",")[0])
|
|
347
|
+
except Exception:
|
|
348
|
+
pass
|
|
349
|
+
if sp_symbol == first_term:
|
|
350
|
+
raise LaTeXParsingError(f"{s} != {first_term}")
|
|
351
|
+
|
|
352
|
+
return sp_symbol
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
def latex2sympy_interval(
|
|
356
|
+
s: str,
|
|
357
|
+
) -> T_Union[
|
|
358
|
+
FiniteSet,
|
|
359
|
+
Union,
|
|
360
|
+
Intersection,
|
|
361
|
+
Complement,
|
|
362
|
+
Interval,
|
|
363
|
+
]:
|
|
364
|
+
"""Parse LaTeX expression like (-\\infty,0] as SymPy Interval object."""
|
|
365
|
+
s = s.replace(" ", "")
|
|
366
|
+
|
|
367
|
+
if "\\cup" in s:
|
|
368
|
+
exps = s.split("\\cup")
|
|
369
|
+
intervals = [latex2sympy_interval(exp) for exp in exps]
|
|
370
|
+
return Union(*intervals)
|
|
371
|
+
|
|
372
|
+
if "\\cap" in s:
|
|
373
|
+
exps = s.split("\\cap")
|
|
374
|
+
intervals = [latex2sympy_interval(exp) for exp in exps]
|
|
375
|
+
return Intersection(*intervals)
|
|
376
|
+
|
|
377
|
+
if s.startswith("\\{") and s.endswith("\\}"):
|
|
378
|
+
return FiniteSet(simplify(latex2sympy_fix(s[2:-2])))
|
|
379
|
+
elif s.startswith("{") and s.endswith("}"):
|
|
380
|
+
return FiniteSet(simplify(latex2sympy_fix(s[1:-1])))
|
|
381
|
+
|
|
382
|
+
if s.startswith("("):
|
|
383
|
+
left_open = True
|
|
384
|
+
s = s[1:]
|
|
385
|
+
elif s.startswith("\\("):
|
|
386
|
+
left_open = True
|
|
387
|
+
s = s[2:]
|
|
388
|
+
elif s.startswith("["):
|
|
389
|
+
left_open = False
|
|
390
|
+
s = s[1:]
|
|
391
|
+
elif s.startswith("\\["):
|
|
392
|
+
left_open = False
|
|
393
|
+
s = s[2:]
|
|
394
|
+
else:
|
|
395
|
+
raise InvalidDataFormatError(reason=f"Invalid interval start: {s}")
|
|
396
|
+
|
|
397
|
+
if s.endswith(")"):
|
|
398
|
+
right_open = True
|
|
399
|
+
s = s[:-1]
|
|
400
|
+
elif s.endswith("\\)"):
|
|
401
|
+
right_open = True
|
|
402
|
+
s = s[:-2]
|
|
403
|
+
elif s.endswith("]"):
|
|
404
|
+
right_open = False
|
|
405
|
+
s = s[:-1]
|
|
406
|
+
elif s.endswith("\\]"):
|
|
407
|
+
right_open = False
|
|
408
|
+
s = s[:-2]
|
|
409
|
+
else:
|
|
410
|
+
raise InvalidDataFormatError(reason=f"Invalid interval end: {s}")
|
|
411
|
+
|
|
412
|
+
left: Expr
|
|
413
|
+
right: Expr
|
|
414
|
+
left, right = (simplify(latex2sympy_fix(side)) for side in s.split(","))
|
|
415
|
+
if left.is_comparable and right.is_comparable and left >= right:
|
|
416
|
+
raise InvalidDataFormatError(reason=f"Invalid interval bounds: {left}, {right}")
|
|
417
|
+
interval = Interval(left, right, left_open, right_open)
|
|
418
|
+
|
|
419
|
+
return interval
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
PAREN_MAP: T_Dict[str, str] = {
|
|
423
|
+
r"\(": r"\)",
|
|
424
|
+
r"\[": r"\]",
|
|
425
|
+
r"\{": r"\}",
|
|
426
|
+
"(": ")",
|
|
427
|
+
"[": "]",
|
|
428
|
+
"{": "}",
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
DATETIME_FMTS: List[str] = [
|
|
432
|
+
# Date formats
|
|
433
|
+
"%Y-%m-%d",
|
|
434
|
+
"%d/%m/%Y",
|
|
435
|
+
"%m/%d/%Y",
|
|
436
|
+
"%Y/%m/%d",
|
|
437
|
+
# Date and time formats
|
|
438
|
+
"%Y-%m-%d %H:%M:%S",
|
|
439
|
+
"%d/%m/%Y %H:%M:%S",
|
|
440
|
+
"%m/%d/%Y %H:%M:%S",
|
|
441
|
+
"%Y/%m/%d %H:%M:%S",
|
|
442
|
+
"%Y-%m-%d %H:%M",
|
|
443
|
+
"%d/%m/%Y %H:%M",
|
|
444
|
+
"%m/%d/%Y %H:%M",
|
|
445
|
+
"%Y/%m/%d %H:%M",
|
|
446
|
+
# Time formats only
|
|
447
|
+
"%H:%M:%S",
|
|
448
|
+
"%H:%M",
|
|
449
|
+
"%I:%M:%S %p",
|
|
450
|
+
"%I:%M %p", # 24-hour and 12-hour formats
|
|
451
|
+
]
|
|
452
|
+
|
|
453
|
+
BASIC_FN_NAMES: List[str] = (
|
|
454
|
+
"sin|cos|tan|cot|sec|csc|sinh|cosh|tanh|coth|sech|csch|log|ln|exp"
|
|
455
|
+
).split("|")
|
|
456
|
+
|
|
457
|
+
UNITS: List[str] = [
|
|
458
|
+
"hour",
|
|
459
|
+
"minute",
|
|
460
|
+
"min",
|
|
461
|
+
"sec",
|
|
462
|
+
"second",
|
|
463
|
+
"day",
|
|
464
|
+
"week",
|
|
465
|
+
"month",
|
|
466
|
+
"year",
|
|
467
|
+
"meter",
|
|
468
|
+
"mile",
|
|
469
|
+
"kg",
|
|
470
|
+
"mg",
|
|
471
|
+
"g",
|
|
472
|
+
"t",
|
|
473
|
+
"ton",
|
|
474
|
+
"nm",
|
|
475
|
+
"pm",
|
|
476
|
+
"um",
|
|
477
|
+
"μm",
|
|
478
|
+
"m",
|
|
479
|
+
"cm",
|
|
480
|
+
"mm",
|
|
481
|
+
"dm",
|
|
482
|
+
"km",
|
|
483
|
+
"kilometer",
|
|
484
|
+
"inch",
|
|
485
|
+
"feet",
|
|
486
|
+
"piece",
|
|
487
|
+
"bit",
|
|
488
|
+
"hz",
|
|
489
|
+
"Hz",
|
|
490
|
+
"m/s",
|
|
491
|
+
"km/s",
|
|
492
|
+
"m/(min^2)",
|
|
493
|
+
"billion",
|
|
494
|
+
"eV",
|
|
495
|
+
"V",
|
|
496
|
+
"C",
|
|
497
|
+
"s",
|
|
498
|
+
"degree",
|
|
499
|
+
r"a\.?m\.?",
|
|
500
|
+
r"(?<!\\)p\.?m\.?", # 1\pm\sqrt{5}
|
|
501
|
+
]
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
DEF_REL_TOL = 1e-9 # Following `is_close`
|
|
505
|
+
# Highest precision: `sys.float_info.epsilon == 2.220446049250313e-16`
|
|
506
|
+
DEF_ABS_TOL = 1e-8 # Following OlympiadBench
|
|
507
|
+
# https://github.com/OpenBMB/OlympiadBench/blob/1289b12c1067dfe01210f7153bd9ffaaddd42ed5/inference/code/math_judger.py#L33
|
|
508
|
+
DEF_PERCENT_REL_TOL = 1e-3
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
def has_non_ascii(s: str) -> bool:
|
|
512
|
+
for char in s:
|
|
513
|
+
if ord(char) > 127:
|
|
514
|
+
return True
|
|
515
|
+
return False
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
def is_querying4set(query: str) -> bool:
|
|
519
|
+
return "ind the" in query or ("all" in query and "separate" in query)
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
NDAYS_PER_WEEK = 7
|
|
523
|
+
WEEKDAY_ABBRS: List[str] = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]
|
|
524
|
+
WEEKDAY_FULLS: List[str] = [
|
|
525
|
+
"monday",
|
|
526
|
+
"tuesday",
|
|
527
|
+
"wednesday",
|
|
528
|
+
"thursday",
|
|
529
|
+
"friday",
|
|
530
|
+
"saturday",
|
|
531
|
+
"sunday",
|
|
532
|
+
]
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
def norm_str2weekday(s: str) -> Optional[str]:
|
|
536
|
+
"""Converts a string representation of a weekday to its normalized form. Returns `None` if the input is not a valid weekday"""
|
|
537
|
+
s = str(s).lower().strip()
|
|
538
|
+
if " " in s: # not a word
|
|
539
|
+
return None
|
|
540
|
+
|
|
541
|
+
for i_day in range(NDAYS_PER_WEEK):
|
|
542
|
+
if s.startswith(WEEKDAY_ABBRS[i_day]):
|
|
543
|
+
return WEEKDAY_FULLS[i_day].capitalize()
|
|
544
|
+
return None
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
def parse(
|
|
548
|
+
parser: Callable, s_to_parse: str, parse_errs: List[Exception]
|
|
549
|
+
) -> Optional[Any]:
|
|
550
|
+
try:
|
|
551
|
+
return parser(s_to_parse)
|
|
552
|
+
except Exception as e:
|
|
553
|
+
parse_errs.append(e)
|
|
554
|
+
return None
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
def norm_deg(s: str) -> str:
|
|
558
|
+
"""Normalize expressions including degrees, except independent <num>\\circ"""
|
|
559
|
+
s = s.replace("rad", "")
|
|
560
|
+
s = regex.sub(r"^(\d+) ?\^?\\?circ$", r"\1", s)
|
|
561
|
+
s = regex.sub(r"(\d+) ?\^?\\?circ", r"{\1*\\frac{\\pi}{180}}", s)
|
|
562
|
+
|
|
563
|
+
return s
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
def is_set(s: str) -> bool:
|
|
567
|
+
return (
|
|
568
|
+
regex.search(r"[^a-z]or(x|[^a-z])", s) is not None
|
|
569
|
+
or (s.startswith("{") and s.endswith("}"))
|
|
570
|
+
or (s.startswith("\\{") and s.endswith("\\}"))
|
|
571
|
+
)
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
def fix_sqrt(
|
|
575
|
+
s: str,
|
|
576
|
+
) -> str:
|
|
577
|
+
"""Fixes the formatting of square root expressions in a given string."""
|
|
578
|
+
_s = regex.sub(r"\\?sqrt[\(\{\[](\w+)[\)\}\]]", r"\\sqrt{\1}", s)
|
|
579
|
+
_s = regex.sub(r"\\?sqrt\s*(\d+)", r"\\sqrt{\1}", _s)
|
|
580
|
+
return _s
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
def fix_fracs(s: str) -> str:
|
|
584
|
+
"""Fixes the formatting of fractions in a given string."""
|
|
585
|
+
substrs = s.split("\\frac")
|
|
586
|
+
_s = substrs[0]
|
|
587
|
+
if len(substrs) > 1:
|
|
588
|
+
substrs = substrs[1:]
|
|
589
|
+
for substr in substrs:
|
|
590
|
+
_s += "\\frac"
|
|
591
|
+
if len(substr) > 0 and substr[0] == "{":
|
|
592
|
+
_s += substr
|
|
593
|
+
else:
|
|
594
|
+
try:
|
|
595
|
+
assert len(substr) >= 2
|
|
596
|
+
except Exception:
|
|
597
|
+
return s
|
|
598
|
+
a = substr[0]
|
|
599
|
+
b = substr[1]
|
|
600
|
+
if b != "{":
|
|
601
|
+
if len(substr) > 2:
|
|
602
|
+
post_substr = substr[2:]
|
|
603
|
+
_s += "{" + a + "}{" + b + "}" + post_substr
|
|
604
|
+
else:
|
|
605
|
+
_s += "{" + a + "}{" + b + "}"
|
|
606
|
+
else:
|
|
607
|
+
if len(substr) > 2:
|
|
608
|
+
post_substr = substr[2:]
|
|
609
|
+
_s += "{" + a + "}" + b + post_substr
|
|
610
|
+
else:
|
|
611
|
+
_s += "{" + a + "}" + b
|
|
612
|
+
return _s
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
def fix_a_slash_b(s: str) -> str:
|
|
616
|
+
"""
|
|
617
|
+
Fixes the formatting of fractions in a given string using regular expressions.
|
|
618
|
+
"""
|
|
619
|
+
# Define a regular expression to match fractions. Here we match two parts: the numerator (a) and the denominator (b).
|
|
620
|
+
# The numerator and denominator can be numbers (\d+) or expressions containing sqrt (sqrt\(.*?\)).
|
|
621
|
+
fraction_pattern = r"(\b\d+|sqrt\(.*?\))\/(\d+|sqrt\(.*?\)\b)"
|
|
622
|
+
|
|
623
|
+
# Use `regex.sub` to replace the matched fractions with properly formatted fractions.
|
|
624
|
+
result = regex.sub(
|
|
625
|
+
fraction_pattern, lambda m: f"\\frac{{{m.group(1)}}}{{{m.group(2)}}}", s
|
|
626
|
+
)
|
|
627
|
+
|
|
628
|
+
return result
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
STR2NUM = {
|
|
632
|
+
"zero": 0,
|
|
633
|
+
"one": 1,
|
|
634
|
+
"two": 2,
|
|
635
|
+
"three": 3,
|
|
636
|
+
"four": 4,
|
|
637
|
+
"five": 5,
|
|
638
|
+
"six": 6,
|
|
639
|
+
"seven": 7,
|
|
640
|
+
"eight": 8,
|
|
641
|
+
"nine": 9,
|
|
642
|
+
"ten": 10,
|
|
643
|
+
"eleven": 11,
|
|
644
|
+
"twelve": 12,
|
|
645
|
+
"thirteen": 13,
|
|
646
|
+
"fourteen": 14,
|
|
647
|
+
"fifteen": 15,
|
|
648
|
+
"sixteen": 16,
|
|
649
|
+
"seventeen": 17,
|
|
650
|
+
"eighteen": 18,
|
|
651
|
+
"nineteen": 19,
|
|
652
|
+
"twenty": 20,
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
def rm_latex_env(s: str, env: str) -> str:
|
|
657
|
+
"""Remove LaTeX environment from a string.
|
|
658
|
+
|
|
659
|
+
Parameters
|
|
660
|
+
----------
|
|
661
|
+
s : str
|
|
662
|
+
The input string.
|
|
663
|
+
env : str
|
|
664
|
+
The LaTeX environment name to remove.
|
|
665
|
+
|
|
666
|
+
Returns
|
|
667
|
+
-------
|
|
668
|
+
str
|
|
669
|
+
The string with the specified LaTeX environment removed.
|
|
670
|
+
"""
|
|
671
|
+
s = s.replace(f"\\begin{{{env}}}", "")
|
|
672
|
+
s = s.replace(f"\\end{{{env}}}", "")
|
|
673
|
+
return s
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
LATEX_CMDS: List[str] = [
|
|
677
|
+
"\\textbf",
|
|
678
|
+
"\\textit",
|
|
679
|
+
"\\textsl",
|
|
680
|
+
"\\texttt",
|
|
681
|
+
"\\textsc",
|
|
682
|
+
"\\textsf",
|
|
683
|
+
"\\textrm",
|
|
684
|
+
"\\mathrm",
|
|
685
|
+
"\\mathbf",
|
|
686
|
+
"\\mathit",
|
|
687
|
+
"\\mathsf",
|
|
688
|
+
"\\mathtt",
|
|
689
|
+
"\\mathbb",
|
|
690
|
+
"\\mathcal",
|
|
691
|
+
"\\mathscr",
|
|
692
|
+
"\\mathfrak",
|
|
693
|
+
"\\bm",
|
|
694
|
+
"\\em",
|
|
695
|
+
"\\emph",
|
|
696
|
+
"\\underline",
|
|
697
|
+
"\\overline",
|
|
698
|
+
"\\tiny",
|
|
699
|
+
"\\scriptsize",
|
|
700
|
+
"\\footnotesize",
|
|
701
|
+
"\\small",
|
|
702
|
+
"\\normalsize",
|
|
703
|
+
"\\large",
|
|
704
|
+
"\\Large",
|
|
705
|
+
"\\LARGE",
|
|
706
|
+
"\\huge",
|
|
707
|
+
"\\Huge",
|
|
708
|
+
"\\newline",
|
|
709
|
+
"\\par",
|
|
710
|
+
"\\noindent",
|
|
711
|
+
"\\indent",
|
|
712
|
+
"\\footnote",
|
|
713
|
+
"\\cite",
|
|
714
|
+
"\\ref",
|
|
715
|
+
"\\label",
|
|
716
|
+
"\\textsuperscript",
|
|
717
|
+
"\\textsubscript",
|
|
718
|
+
"\\text",
|
|
719
|
+
"\\mbox",
|
|
720
|
+
"\\renewcommand{\\arraystretch}",
|
|
721
|
+
]
|
|
722
|
+
|
|
723
|
+
LATEX_FMT_ENVS: List[str] = [
|
|
724
|
+
# Align
|
|
725
|
+
"align",
|
|
726
|
+
"align*",
|
|
727
|
+
"center",
|
|
728
|
+
"flushleft",
|
|
729
|
+
"flushright",
|
|
730
|
+
]
|
|
731
|
+
LATEX_LIST_ENVS: List[str] = [
|
|
732
|
+
"itemize",
|
|
733
|
+
"enumerate",
|
|
734
|
+
"description",
|
|
735
|
+
]
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
SIMPLE_RM_STRS: List[str] = [
|
|
739
|
+
"\n",
|
|
740
|
+
"\t",
|
|
741
|
+
"approximately",
|
|
742
|
+
"'",
|
|
743
|
+
'"',
|
|
744
|
+
"\\$",
|
|
745
|
+
"$",
|
|
746
|
+
"¥",
|
|
747
|
+
"£",
|
|
748
|
+
"€",
|
|
749
|
+
"{,}",
|
|
750
|
+
"\\!",
|
|
751
|
+
"\\,",
|
|
752
|
+
"\\:",
|
|
753
|
+
"\\;",
|
|
754
|
+
"\\quad",
|
|
755
|
+
"\\qquad",
|
|
756
|
+
"\\space",
|
|
757
|
+
"\\thinspace",
|
|
758
|
+
"\\medspace",
|
|
759
|
+
"\\thickspace",
|
|
760
|
+
"~,",
|
|
761
|
+
"\\ ",
|
|
762
|
+
# Note the order
|
|
763
|
+
"\\\\%",
|
|
764
|
+
"\\%",
|
|
765
|
+
"%",
|
|
766
|
+
"\\left",
|
|
767
|
+
"\\right",
|
|
768
|
+
"^{\\circ}",
|
|
769
|
+
"^\\circ",
|
|
770
|
+
]
|
|
771
|
+
|
|
772
|
+
SIMPLE_REPLACE_MAP = {
|
|
773
|
+
"∪": "\\cup",
|
|
774
|
+
"π": "\\pi",
|
|
775
|
+
"∞": "\\infty",
|
|
776
|
+
"∈": "\\in",
|
|
777
|
+
"∩": "\\cap",
|
|
778
|
+
"−": "-",
|
|
779
|
+
"\\item": ",",
|
|
780
|
+
"and": ",",
|
|
781
|
+
";": ",",
|
|
782
|
+
"infinity": "\\infty",
|
|
783
|
+
"+\\infty": "\\infty",
|
|
784
|
+
"tfrac": "frac",
|
|
785
|
+
"dfrac": "frac",
|
|
786
|
+
"\\approx": "=",
|
|
787
|
+
"\\times": "*",
|
|
788
|
+
"\\cdot": "*",
|
|
789
|
+
"{.": "{0.", # "{0." equivalent to "{."
|
|
790
|
+
" .": " 0.", # " 0." equivalent to " ."
|
|
791
|
+
":": "/", # Ratio like 3:2
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
class EvaluatorMath(EvaluatorBase):
|
|
796
|
+
"""Evaluator for math problems, capable of extracting answer segment from complex resp and processing various mathematical objects
|
|
797
|
+
(e.g. fractions, symbolic expressions, matrices, vectors) and special text (e.g. bool values).
|
|
798
|
+
|
|
799
|
+
Parameters
|
|
800
|
+
----------
|
|
801
|
+
ans_extract_mode: str, default: "boxed"
|
|
802
|
+
Options:
|
|
803
|
+
- "boxed": Extract answer from the boxed expression.
|
|
804
|
+
- "explicit": Extract answer from the explicit answer segment.
|
|
805
|
+
- "speculate": Speculate the answer from the last number or latex formula.
|
|
806
|
+
include_percentage : bool, default: True
|
|
807
|
+
Whether to include percentage comparisons.
|
|
808
|
+
rel_tol : float, default: DEF_REL_TOL
|
|
809
|
+
The relative tolerance for numerical comparisons.
|
|
810
|
+
abs_tol : float, default: DEF_ABS_TOL
|
|
811
|
+
The absolute tolerance for numerical comparisons. Necessary for precision issues.
|
|
812
|
+
percent_rel_tol : float, default: DEF_PERCENT_REL_TOL
|
|
813
|
+
The relative tolerance for percentage comparisons. Relative for different surface forms (e.g. 99% v.s. 0.99).
|
|
814
|
+
ascii_only : bool, default: True
|
|
815
|
+
Only allowing ASCII characters
|
|
816
|
+
"""
|
|
817
|
+
|
|
818
|
+
def __init__(
|
|
819
|
+
self,
|
|
820
|
+
ans_extract_mode: str = "boxed",
|
|
821
|
+
include_percentage: bool = True,
|
|
822
|
+
rel_tol: float = DEF_REL_TOL,
|
|
823
|
+
abs_tol: float = DEF_ABS_TOL,
|
|
824
|
+
percent_rel_tol: float = DEF_PERCENT_REL_TOL,
|
|
825
|
+
ascii_only: bool = True,
|
|
826
|
+
):
|
|
827
|
+
EvaluatorBase.__init__(self)
|
|
828
|
+
self.ans_extract_mode: str = ans_extract_mode
|
|
829
|
+
self.include_percentage: bool = include_percentage
|
|
830
|
+
self.rel_tol: float = rel_tol
|
|
831
|
+
self.abs_tol = abs_tol
|
|
832
|
+
self.percent_rel_tol: float = percent_rel_tol
|
|
833
|
+
self.ascii_only: bool = ascii_only
|
|
834
|
+
|
|
835
|
+
def extract_ans(self, resp_str: str) -> str:
|
|
836
|
+
raw_ans: str = EvaluatorBase().extract_ans(resp_str)
|
|
837
|
+
math_ans: str = self.norm_ans_str(raw_ans)
|
|
838
|
+
return math_ans
|
|
839
|
+
|
|
840
|
+
def eq(
|
|
841
|
+
self,
|
|
842
|
+
ref_ans: T_Union[str, T_Tuple[str, float]], # The reference answer value.
|
|
843
|
+
pred: str, # The predicted answer value.
|
|
844
|
+
compare_sets: bool = False, # Whether to compare sets of values.
|
|
845
|
+
) -> bool: # True if the values are mathematically equal, False otherwise.
|
|
846
|
+
"""
|
|
847
|
+
Check if two values are mathematically equal.
|
|
848
|
+
Return `False` by default.
|
|
849
|
+
Notes:
|
|
850
|
+
- The function checks for three types of equality: literal equality, numerical equality, and symbolic equality.
|
|
851
|
+
- If the reference value is a list of two elements, the second element is treated as the numerical reference value.
|
|
852
|
+
- The function normalizes the input strings before performing comparisons.
|
|
853
|
+
- If compare_sets is True, the function compares sets of values instead of individual values.
|
|
854
|
+
- If timeout is True, the function uses a timeout for symbolic comparisons.
|
|
855
|
+
"""
|
|
856
|
+
ref: str
|
|
857
|
+
ref_num: Optional[float]
|
|
858
|
+
if isinstance(ref_ans, (list, tuple)) and len(ref_ans) == 2:
|
|
859
|
+
ref, ref_num = ref_ans
|
|
860
|
+
else:
|
|
861
|
+
ref = ref_ans
|
|
862
|
+
ref_num = None
|
|
863
|
+
|
|
864
|
+
if ref is None:
|
|
865
|
+
return None
|
|
866
|
+
|
|
867
|
+
if pred is None:
|
|
868
|
+
return False
|
|
869
|
+
|
|
870
|
+
# datetime
|
|
871
|
+
pred_datetime: Optional[str] = self.norm_str2date_time(pred)
|
|
872
|
+
ref_datetime: Optional[str] = self.norm_str2date_time(ref)
|
|
873
|
+
if (
|
|
874
|
+
pred_datetime is not None
|
|
875
|
+
and ref_datetime is not None
|
|
876
|
+
and pred_datetime == ref_datetime
|
|
877
|
+
):
|
|
878
|
+
return True # Stricter than ratio
|
|
879
|
+
|
|
880
|
+
# 0. Normalize
|
|
881
|
+
pred_str: str = self.norm_ans_str(pred)
|
|
882
|
+
ref_str: str = self.norm_ans_str(ref)
|
|
883
|
+
|
|
884
|
+
if len(pred_str) == 0:
|
|
885
|
+
return False
|
|
886
|
+
|
|
887
|
+
# NOTE: some non-ASCII characters are also allowed for control, they should be removed by the above normalization
|
|
888
|
+
if self.ascii_only and has_non_ascii(pred_str):
|
|
889
|
+
return False
|
|
890
|
+
|
|
891
|
+
# 1. literally equal
|
|
892
|
+
lower_pred: str = pred_str.lower()
|
|
893
|
+
lower_ref: str = ref_str.lower()
|
|
894
|
+
if lower_pred == lower_ref:
|
|
895
|
+
return True
|
|
896
|
+
if compare_sets:
|
|
897
|
+
preds: List[str] = self.extract_set(pred_str)
|
|
898
|
+
refs: List[str] = self.extract_set(ref_str)
|
|
899
|
+
|
|
900
|
+
if len(preds) != len(refs):
|
|
901
|
+
return False
|
|
902
|
+
for pred in preds:
|
|
903
|
+
exist = False
|
|
904
|
+
for ref in refs:
|
|
905
|
+
exist: bool = self.eq(
|
|
906
|
+
pred,
|
|
907
|
+
ref,
|
|
908
|
+
compare_sets=False,
|
|
909
|
+
)
|
|
910
|
+
if exist:
|
|
911
|
+
break
|
|
912
|
+
if not exist:
|
|
913
|
+
return False
|
|
914
|
+
refs.remove(ref)
|
|
915
|
+
return True
|
|
916
|
+
|
|
917
|
+
pred_parse_errs: List[Exception] = []
|
|
918
|
+
ref_parse_errs: List[Exception] = []
|
|
919
|
+
|
|
920
|
+
# 2. Numerically equal
|
|
921
|
+
# no `norm_float_str` for possible mistakes like "123,456"(123 and 456) -> "123456"
|
|
922
|
+
pred_num: Optional[float] = parse(float, pred_str, pred_parse_errs)
|
|
923
|
+
if ref_num is None:
|
|
924
|
+
ref_num = parse(float, ref_str, ref_parse_errs)
|
|
925
|
+
num_eq: Optional[bool] = self.is_num_eq(ref_num, pred_num)
|
|
926
|
+
if num_eq is not None:
|
|
927
|
+
return num_eq
|
|
928
|
+
|
|
929
|
+
# 3. Symbolically equal (w/ SymPy and antlr4)
|
|
930
|
+
# Return `True` if the two expressions can be interpreted as equal in **any** unified form.
|
|
931
|
+
# NOTE: possible ambiguity 1,234 -> (1,234) / 1234 ?
|
|
932
|
+
|
|
933
|
+
# 3.1 Python object
|
|
934
|
+
# NOTE: parse_expr("1,234") == (1, 234)
|
|
935
|
+
pred_obj: Optional[Any] = parse(parse_expr, pred_str, pred_parse_errs)
|
|
936
|
+
ref_obj: Optional[Any] = parse(parse_expr, ref_str, ref_parse_errs)
|
|
937
|
+
# print(pred_obj, ref_obj, symbol_equal(pred_obj, ref_obj)) # debug
|
|
938
|
+
if pred_obj is not None and ref_obj is not None and pred_obj == ref_obj:
|
|
939
|
+
return True
|
|
940
|
+
|
|
941
|
+
# 3.2 SymPy object
|
|
942
|
+
# ImportError: LaTeX parsing requires the antlr4 Python package, provided by pip (antlr4-python3-runtime) or conda (antlr-python-runtime), version 4.11
|
|
943
|
+
pred_spobj: Optional[Expr] = parse(
|
|
944
|
+
latex2sympy_interval, pred_str, pred_parse_errs
|
|
945
|
+
)
|
|
946
|
+
ref_spobj: Optional[Expr] = parse(latex2sympy_interval, ref_str, ref_parse_errs)
|
|
947
|
+
# print(pred_spobj, ref_spobj, symbol_equal(pred_spobj, ref_spobj)) # debug
|
|
948
|
+
if (
|
|
949
|
+
pred_spobj is not None
|
|
950
|
+
and ref_spobj is not None
|
|
951
|
+
and self.is_sym_eq(pred_spobj, ref_spobj)
|
|
952
|
+
):
|
|
953
|
+
return True
|
|
954
|
+
|
|
955
|
+
pred_spobj: Optional[Expr] = parse(self.latex2matrix, pred_str, pred_parse_errs)
|
|
956
|
+
ref_spobj: Optional[Expr] = parse(self.latex2matrix, ref_str, ref_parse_errs)
|
|
957
|
+
# print(pred_spobj, ref_spobj, symbol_equal(pred_spobj, ref_spobj)) # debug
|
|
958
|
+
if (
|
|
959
|
+
pred_spobj is not None
|
|
960
|
+
and ref_spobj is not None
|
|
961
|
+
and self.is_sym_eq(pred_spobj, ref_spobj)
|
|
962
|
+
):
|
|
963
|
+
return True
|
|
964
|
+
|
|
965
|
+
# WARNING: parse_latex("a,b") -> a but parse_latex("1,234") -> 1234, `latex2sympy_fix` fixed the former by raising a `LaTeXParsingError``
|
|
966
|
+
pred_spobj: Optional[Expr] = parse(latex2sympy_fix, pred_str, pred_parse_errs)
|
|
967
|
+
ref_spobj: Optional[Expr] = parse(latex2sympy_fix, ref_str, ref_parse_errs)
|
|
968
|
+
# print(pred_spobj, ref_spobj, symbol_equal(pred_spobj, ref_spobj)) # debug
|
|
969
|
+
if (
|
|
970
|
+
pred_spobj is not None
|
|
971
|
+
and ref_spobj is not None
|
|
972
|
+
and self.is_sym_eq(pred_spobj, ref_spobj)
|
|
973
|
+
):
|
|
974
|
+
return True
|
|
975
|
+
|
|
976
|
+
if (
|
|
977
|
+
pred_spobj is not None
|
|
978
|
+
and ref_obj is not None
|
|
979
|
+
and self.is_sym_eq(pred_spobj, ref_obj)
|
|
980
|
+
):
|
|
981
|
+
return True
|
|
982
|
+
|
|
983
|
+
if (
|
|
984
|
+
pred_obj is not None
|
|
985
|
+
and ref_spobj is not None
|
|
986
|
+
and self.is_sym_eq(pred_obj, ref_spobj)
|
|
987
|
+
):
|
|
988
|
+
return True
|
|
989
|
+
|
|
990
|
+
n_checks = 5
|
|
991
|
+
expr_parse_errs: T_Dict[str, List[Exception]] = {}
|
|
992
|
+
if len(pred_parse_errs) == n_checks:
|
|
993
|
+
expr_parse_errs["pred"] = pred_parse_errs
|
|
994
|
+
if len(ref_parse_errs) == n_checks:
|
|
995
|
+
expr_parse_errs["ref"] = ref_parse_errs
|
|
996
|
+
|
|
997
|
+
# print(expr_parse_errs)
|
|
998
|
+
if len(expr_parse_errs) > 0:
|
|
999
|
+
raise InvalidDataFormatError(reason=str(expr_parse_errs))
|
|
1000
|
+
else:
|
|
1001
|
+
return False
|
|
1002
|
+
|
|
1003
|
+
def could_be_percent(self, v: T_Union[float, str]) -> bool:
|
|
1004
|
+
"""Check if a value could be a percentage."""
|
|
1005
|
+
return 0 < v < 1 or 1 < v < 100
|
|
1006
|
+
|
|
1007
|
+
def is_num_eq(
|
|
1008
|
+
self, ref_num: Optional[float], pred_num: Optional[float]
|
|
1009
|
+
) -> Optional[bool]:
|
|
1010
|
+
"""Compare two numbers with specified feautures:
|
|
1011
|
+
- relative tolerance
|
|
1012
|
+
- flexible percentage surface forms
|
|
1013
|
+
"""
|
|
1014
|
+
if ref_num is None or pred_num is None:
|
|
1015
|
+
return None
|
|
1016
|
+
if isclose(ref_num, pred_num, rel_tol=self.rel_tol, abs_tol=self.abs_tol):
|
|
1017
|
+
return True
|
|
1018
|
+
|
|
1019
|
+
if self.include_percentage and self.could_be_percent(pred_num):
|
|
1020
|
+
percent_ref_nums: List[float] = [
|
|
1021
|
+
num
|
|
1022
|
+
for num in [ref_num / 100, ref_num * 100]
|
|
1023
|
+
if self.could_be_percent(num)
|
|
1024
|
+
]
|
|
1025
|
+
for item in percent_ref_nums:
|
|
1026
|
+
# "For the values to be considered close, the difference between them must be smaller than at least one of the tolerances."
|
|
1027
|
+
if isclose(
|
|
1028
|
+
item, pred_num, rel_tol=self.percent_rel_tol, abs_tol=self.abs_tol
|
|
1029
|
+
):
|
|
1030
|
+
return True
|
|
1031
|
+
return None
|
|
1032
|
+
|
|
1033
|
+
def norm_ans_str(self, ans: str) -> str:
|
|
1034
|
+
"""Normalize answer string for **all kinds** of answers."""
|
|
1035
|
+
ans = str(ans)
|
|
1036
|
+
ans = ans.replace("\n", "") # no answer must need \n
|
|
1037
|
+
ans = ans.strip()
|
|
1038
|
+
|
|
1039
|
+
# remove impropriate trailing punctuations
|
|
1040
|
+
ans = self.clean(ans)
|
|
1041
|
+
|
|
1042
|
+
# cornor cases
|
|
1043
|
+
|
|
1044
|
+
# bool
|
|
1045
|
+
ans_bool = norm_str2bool(ans)
|
|
1046
|
+
if ans_bool is not None:
|
|
1047
|
+
return str(ans_bool)
|
|
1048
|
+
|
|
1049
|
+
# weekdays
|
|
1050
|
+
ans_weekday = norm_str2weekday(ans)
|
|
1051
|
+
if ans_weekday is not None:
|
|
1052
|
+
return ans_weekday
|
|
1053
|
+
|
|
1054
|
+
# math normalize
|
|
1055
|
+
ans = self.norm_math_str(ans)
|
|
1056
|
+
|
|
1057
|
+
return ans
|
|
1058
|
+
|
|
1059
|
+
def latex2matrix(self, latex_mat_str: str) -> Matrix:
|
|
1060
|
+
"""This function convert latex matrix into sympy matrix (always 2)"""
|
|
1061
|
+
if not isinstance(latex_mat_str, str):
|
|
1062
|
+
raise InvalidValueError(param_name="latex_mat_str", actual=type(latex_mat_str).__name__, expected="str")
|
|
1063
|
+
latex_mat_str = latex_mat_str.replace(" ", "")
|
|
1064
|
+
|
|
1065
|
+
pattern = r"(?:\[|\()?\\begin{[a-zA-Z]?(?:matrix|array)}(?:\[lcr\])*?(.*)\\end{[a-zA-Z]?(?:matrix|array)}(?:\]|\))?"
|
|
1066
|
+
data: Optional[Match[str]] = regex.search(pattern, latex_mat_str)
|
|
1067
|
+
python_matrix: List[List[str]] = []
|
|
1068
|
+
if data is not None:
|
|
1069
|
+
# \+ not followed by frac or sqrt
|
|
1070
|
+
rows: List[str] = regex.split(r"\\+(?!frac|sqrt)", data[1])
|
|
1071
|
+
for row in rows:
|
|
1072
|
+
elements_list: List[str] = row.split("&")
|
|
1073
|
+
python_matrix.append(elements_list)
|
|
1074
|
+
else:
|
|
1075
|
+
if "," in latex_mat_str:
|
|
1076
|
+
if is_set(latex_mat_str):
|
|
1077
|
+
# print("set")
|
|
1078
|
+
python_matrix = [self.extract_set(latex_mat_str)]
|
|
1079
|
+
else:
|
|
1080
|
+
python_matrix = [self.remove_out_paren(latex_mat_str).split(",")]
|
|
1081
|
+
else:
|
|
1082
|
+
raise LaTeXParsingError(
|
|
1083
|
+
f"{latex_mat_str} can not be parsed in a `Matrix`!"
|
|
1084
|
+
)
|
|
1085
|
+
|
|
1086
|
+
# print(data)
|
|
1087
|
+
# print(python_matrix)
|
|
1088
|
+
sympy_matrix = []
|
|
1089
|
+
for row in python_matrix:
|
|
1090
|
+
# print(row)
|
|
1091
|
+
sympy_row = [latex2sympy_fix(element) for element in row]
|
|
1092
|
+
sympy_matrix.append(sympy_row)
|
|
1093
|
+
|
|
1094
|
+
matrix = Matrix(sympy_matrix)
|
|
1095
|
+
|
|
1096
|
+
# print(s)
|
|
1097
|
+
# unify one row/col into vector
|
|
1098
|
+
if len(matrix.shape) == 2 and matrix.shape[1] == 1:
|
|
1099
|
+
matrix = matrix.T
|
|
1100
|
+
return matrix
|
|
1101
|
+
|
|
1102
|
+
def remove_latex_cmd(self, s: str, cmd: str) -> str:
|
|
1103
|
+
try:
|
|
1104
|
+
cmd_idx = s.index(cmd)
|
|
1105
|
+
except ValueError:
|
|
1106
|
+
return s
|
|
1107
|
+
|
|
1108
|
+
pfx = s[:cmd_idx].strip()
|
|
1109
|
+
sfx = s[cmd_idx + len(cmd) :].strip()
|
|
1110
|
+
|
|
1111
|
+
if len(sfx) > 0 and sfx[0] == "{": # Common command
|
|
1112
|
+
sfx = self.remove_first_paren_pair(sfx, "{")
|
|
1113
|
+
elif len(pfx) > 0 and pfx[-1] == "{": # Declaration command
|
|
1114
|
+
left_idx_in_sfx = sfx.find("}")
|
|
1115
|
+
if left_idx_in_sfx != -1:
|
|
1116
|
+
pfx = pfx[:-1]
|
|
1117
|
+
sfx = sfx[:left_idx_in_sfx] + sfx[left_idx_in_sfx + 1 :]
|
|
1118
|
+
else: # Indepedent command
|
|
1119
|
+
pass
|
|
1120
|
+
|
|
1121
|
+
return pfx + sfx
|
|
1122
|
+
|
|
1123
|
+
def is_sym_eq(self, a: Any, b: Any) -> Optional[bool]:
|
|
1124
|
+
"""Compare two objects symbolically."""
|
|
1125
|
+
if a is None or b is None:
|
|
1126
|
+
return None
|
|
1127
|
+
|
|
1128
|
+
try:
|
|
1129
|
+
if a == b:
|
|
1130
|
+
return True
|
|
1131
|
+
except Exception:
|
|
1132
|
+
pass
|
|
1133
|
+
|
|
1134
|
+
try:
|
|
1135
|
+
diff = simplify(a - b)
|
|
1136
|
+
# For non-symmetric operations like subtraction between sets
|
|
1137
|
+
diff_rev = simplify(b - a)
|
|
1138
|
+
|
|
1139
|
+
if hasattr(diff, "__iter__") and hasattr(
|
|
1140
|
+
diff_rev, "__iter__"
|
|
1141
|
+
): # If diff is iterable (e.g. Matrix)
|
|
1142
|
+
if all(element == 0 for element in diff) and all(
|
|
1143
|
+
element == 0 for element in diff_rev
|
|
1144
|
+
):
|
|
1145
|
+
return True
|
|
1146
|
+
else:
|
|
1147
|
+
if (
|
|
1148
|
+
not diff and not diff_rev
|
|
1149
|
+
): # use `not` for non-zero values like `sympy.EmptySet`
|
|
1150
|
+
return True
|
|
1151
|
+
except Exception:
|
|
1152
|
+
pass
|
|
1153
|
+
|
|
1154
|
+
try:
|
|
1155
|
+
v_a, v_b = (N(eval(str(v))) for v in [a, b])
|
|
1156
|
+
num_eq = self.is_num_eq(v_a, v_b)
|
|
1157
|
+
if num_eq:
|
|
1158
|
+
return True
|
|
1159
|
+
except Exception:
|
|
1160
|
+
pass
|
|
1161
|
+
|
|
1162
|
+
return None
|
|
1163
|
+
|
|
1164
|
+
def norm_str2date_time(self, string: str) -> Optional[str]:
|
|
1165
|
+
"""Normalize date or time string to a standard and precise format."""
|
|
1166
|
+
|
|
1167
|
+
for fmt in DATETIME_FMTS:
|
|
1168
|
+
try:
|
|
1169
|
+
dt: datetime = datetime.strptime(string, fmt)
|
|
1170
|
+
has_time: bool = ":" in string
|
|
1171
|
+
has_date: bool = "/" in string or "-" in string
|
|
1172
|
+
if has_date and has_time:
|
|
1173
|
+
return dt.strftime("%Y-%m-%d %H:%M:%S")
|
|
1174
|
+
elif has_date:
|
|
1175
|
+
return dt.strftime("%Y-%m-%d")
|
|
1176
|
+
elif has_time:
|
|
1177
|
+
return dt.strftime("%H:%M:%S")
|
|
1178
|
+
else:
|
|
1179
|
+
pass
|
|
1180
|
+
except ValueError:
|
|
1181
|
+
continue
|
|
1182
|
+
return None
|
|
1183
|
+
|
|
1184
|
+
def index_first_paren_pair(self, s: str, l: str) -> T_Tuple[int, int]:
|
|
1185
|
+
r: str = PAREN_MAP[l]
|
|
1186
|
+
try:
|
|
1187
|
+
i_l: int = s.index(l)
|
|
1188
|
+
except ValueError:
|
|
1189
|
+
return -1, -1
|
|
1190
|
+
len_paren: int = len(l)
|
|
1191
|
+
|
|
1192
|
+
depth = 0
|
|
1193
|
+
i_r: int = -1
|
|
1194
|
+
for i_c in range(i_l, len(s)):
|
|
1195
|
+
if s[i_c : i_c + len_paren] == l:
|
|
1196
|
+
depth -= 1
|
|
1197
|
+
elif s[i_c : i_c + len_paren] == r:
|
|
1198
|
+
depth += 1
|
|
1199
|
+
if depth == 0:
|
|
1200
|
+
i_r = i_c
|
|
1201
|
+
break
|
|
1202
|
+
|
|
1203
|
+
return i_l, i_r
|
|
1204
|
+
|
|
1205
|
+
def remove_first_paren_pair(
|
|
1206
|
+
self,
|
|
1207
|
+
s: str,
|
|
1208
|
+
l: str, # Left parenthesis
|
|
1209
|
+
) -> str:
|
|
1210
|
+
i_l: int
|
|
1211
|
+
i_r: int
|
|
1212
|
+
i_l, i_r = self.index_first_paren_pair(s, l)
|
|
1213
|
+
if i_l != -1 and i_r != -1:
|
|
1214
|
+
len_paren: int = len(l)
|
|
1215
|
+
s = s[:i_l] + s[i_l + len_paren : i_r] + s[i_r + len_paren :]
|
|
1216
|
+
|
|
1217
|
+
return s
|
|
1218
|
+
|
|
1219
|
+
def remove_out_paren(self, s: str) -> str:
|
|
1220
|
+
"""Remove until there are no parentheses outside."""
|
|
1221
|
+
done: bool = False
|
|
1222
|
+
while not done:
|
|
1223
|
+
done = True
|
|
1224
|
+
for left, _ in PAREN_MAP.items():
|
|
1225
|
+
len_paren: int = len(left)
|
|
1226
|
+
i_l: int
|
|
1227
|
+
i_r: int
|
|
1228
|
+
i_l, i_r = self.index_first_paren_pair(s, left)
|
|
1229
|
+
if i_l == 0 and i_r == len(s) - len_paren:
|
|
1230
|
+
s = s[len_paren:-len_paren]
|
|
1231
|
+
done = False
|
|
1232
|
+
return s
|
|
1233
|
+
|
|
1234
|
+
def extract_set(self, norm_s: str) -> List[str]:
|
|
1235
|
+
clean_s: str = self.remove_out_paren(norm_s)
|
|
1236
|
+
ele_strs: List[str] = clean_s.replace("or", ",").split(",")
|
|
1237
|
+
ele_strs: List[str] = [s.strip() for s in ele_strs]
|
|
1238
|
+
|
|
1239
|
+
# ele_strs.sort()
|
|
1240
|
+
# return ele_strs
|
|
1241
|
+
|
|
1242
|
+
merged_strs: List[str] = []
|
|
1243
|
+
for i in range(len(ele_strs)):
|
|
1244
|
+
s_i: str = ele_strs[i]
|
|
1245
|
+
existing = False
|
|
1246
|
+
for j in range(i):
|
|
1247
|
+
s_j: str = ele_strs[j]
|
|
1248
|
+
if self.eq(s_i, s_j):
|
|
1249
|
+
existing = True
|
|
1250
|
+
break
|
|
1251
|
+
if not existing:
|
|
1252
|
+
merged_strs.append(s_i)
|
|
1253
|
+
|
|
1254
|
+
merged_strs.sort()
|
|
1255
|
+
|
|
1256
|
+
return merged_strs
|
|
1257
|
+
|
|
1258
|
+
def norm_basic_fn(self, s: str) -> str:
|
|
1259
|
+
"""Avoid potential LaTex errors caused by removing spaces:
|
|
1260
|
+
- \\{fn}[a-z] : followed by some letter without middle spaces
|
|
1261
|
+
- \\{fn}^{pow}{expr}
|
|
1262
|
+
|
|
1263
|
+
Returns
|
|
1264
|
+
-------
|
|
1265
|
+
str
|
|
1266
|
+
Normalized format of basic function expression: \\{fn}^{{pow}}{{expr}}
|
|
1267
|
+
"""
|
|
1268
|
+
# \2 matches \d+ without {} around, if there has been {}, there is no need to normalize
|
|
1269
|
+
# Existing nude power, i.e. ^<pow_d+>
|
|
1270
|
+
s = regex.sub(rf"\\?({'|'.join(BASIC_FN_NAMES)})\^(\d+)", r"\\\1^{\2}", s)
|
|
1271
|
+
# No power
|
|
1272
|
+
s = regex.sub(rf"\\?({'|'.join(BASIC_FN_NAMES)})(?!\^)", r"\\\1^{1}", s)
|
|
1273
|
+
return s
|
|
1274
|
+
|
|
1275
|
+
def norm_pm(self, s: str) -> str:
|
|
1276
|
+
"""Replaces the LaTeX symbols '$1\\pm$2' or '$1\\mp$2' with '$1-$2,$1+$2'."""
|
|
1277
|
+
|
|
1278
|
+
def replace_pm(match: Match[str]) -> str:
|
|
1279
|
+
# Extracts the first and second parts of the match.
|
|
1280
|
+
first_part: str
|
|
1281
|
+
second_part: str
|
|
1282
|
+
first_part, second_part = match.groups()
|
|
1283
|
+
# Creates the replacement string as specified.
|
|
1284
|
+
return f"{first_part}-{second_part},{first_part}+{second_part}"
|
|
1285
|
+
|
|
1286
|
+
_s = self.remove_out_paren(s)
|
|
1287
|
+
# Define the pattern that matches '$1\\pm$2' or '$1\\mp$2'.
|
|
1288
|
+
# We use non-greedy matching (.*?) to capture the parts before and after \pm or \mp.
|
|
1289
|
+
# The pattern is corrected to include the '$' signs and to capture the expressions correctly.
|
|
1290
|
+
pattern = r"([\w\.\\{}\+\-\*\^]+?)(?:\\pm|\\mp)([\w\.\\{}\+\-\*\^]+)"
|
|
1291
|
+
|
|
1292
|
+
if regex.search(pattern, _s):
|
|
1293
|
+
# Use regex.sub to replace all occurrences of the pattern in the input string.
|
|
1294
|
+
return regex.sub(pattern, replace_pm, _s)
|
|
1295
|
+
else:
|
|
1296
|
+
return s
|
|
1297
|
+
|
|
1298
|
+
def norm_math_str(self, string: str) -> str:
|
|
1299
|
+
# delay logics for multi-choice to after extraction from model output
|
|
1300
|
+
# lower_str = string.lower()
|
|
1301
|
+
# for choice in ALL_CHOICES:
|
|
1302
|
+
# choice_lower = choice.lower()
|
|
1303
|
+
# if lower_str == choice_lower or lower_str == f"({choice_lower})":
|
|
1304
|
+
# return choice
|
|
1305
|
+
|
|
1306
|
+
# Replacement-based normalization
|
|
1307
|
+
|
|
1308
|
+
string = str(string).strip()
|
|
1309
|
+
string = self.clean(string)
|
|
1310
|
+
|
|
1311
|
+
# Simple removals
|
|
1312
|
+
for rm_str in SIMPLE_RM_STRS:
|
|
1313
|
+
string = string.replace(rm_str, "")
|
|
1314
|
+
|
|
1315
|
+
# Simple replacements
|
|
1316
|
+
for k, v in SIMPLE_REPLACE_MAP.items():
|
|
1317
|
+
string = string.replace(k, v)
|
|
1318
|
+
if "\\infty" not in string:
|
|
1319
|
+
string = string.replace("inf", "\\infty")
|
|
1320
|
+
|
|
1321
|
+
# Remove spaces after all space-related operations
|
|
1322
|
+
string = string.replace(" ", "")
|
|
1323
|
+
|
|
1324
|
+
for latex_cmd in LATEX_CMDS:
|
|
1325
|
+
string = self.remove_latex_cmd(string, latex_cmd)
|
|
1326
|
+
|
|
1327
|
+
for env in LATEX_FMT_ENVS + LATEX_LIST_ENVS:
|
|
1328
|
+
string = rm_latex_env(string, env)
|
|
1329
|
+
|
|
1330
|
+
# Normalize local expressions
|
|
1331
|
+
string = norm_deg(string) # Normalize degrees
|
|
1332
|
+
string = regex.sub(
|
|
1333
|
+
rf"(?<!\\)(pi\b|{'|'.join(BASIC_FN_NAMES)})", r"\\\1", string
|
|
1334
|
+
) # Fix backslashes
|
|
1335
|
+
string = self.norm_basic_fn(string) # Normalize basic functions
|
|
1336
|
+
|
|
1337
|
+
# Normalize matrix and array
|
|
1338
|
+
string = regex.sub(r"{[a-z]?matrix}", r"{array}", string)
|
|
1339
|
+
string = regex.sub(r"\\begin{array}{[lcr]*}", r"\\begin{array}{}", string)
|
|
1340
|
+
# NOTE: the substituion str should alse obey the regex syntax, like r"\\begin{array}"
|
|
1341
|
+
if "\\begin{array}" not in string:
|
|
1342
|
+
string = string.replace("\\\\", "")
|
|
1343
|
+
|
|
1344
|
+
# i, j
|
|
1345
|
+
if "j" in string and "i" not in string:
|
|
1346
|
+
string = string.replace("j", "i")
|
|
1347
|
+
|
|
1348
|
+
# replace a.000b where b is not number or b is end, with ab, use regex
|
|
1349
|
+
string = regex.sub(r"(\d+)\.0+([^\d])", r"\1\2", string)
|
|
1350
|
+
string = regex.sub(r"(\d+)\.0+$", r"\1", string)
|
|
1351
|
+
|
|
1352
|
+
# remove units
|
|
1353
|
+
for unit in UNITS:
|
|
1354
|
+
string = regex.sub(f"([-\d\.\*\^{{}}]+){unit}e?s?.*", "\\1", string)
|
|
1355
|
+
|
|
1356
|
+
# Check if empty before splitting
|
|
1357
|
+
# if empty, return empty string
|
|
1358
|
+
if len(string) == 0:
|
|
1359
|
+
return string
|
|
1360
|
+
if string[0] == ".":
|
|
1361
|
+
string = "0" + string
|
|
1362
|
+
|
|
1363
|
+
# Splitting-based normalization
|
|
1364
|
+
|
|
1365
|
+
# Process complex expressions without parentheses
|
|
1366
|
+
s_is_set: bool = is_set(string)
|
|
1367
|
+
raw_strings: List[str]
|
|
1368
|
+
if s_is_set:
|
|
1369
|
+
raw_strings = self.extract_set(string)
|
|
1370
|
+
else:
|
|
1371
|
+
raw_strings = [string]
|
|
1372
|
+
|
|
1373
|
+
strings: List[str] = []
|
|
1374
|
+
for string in raw_strings:
|
|
1375
|
+
string = fix_sqrt(string)
|
|
1376
|
+
|
|
1377
|
+
if string.startswith("frac"):
|
|
1378
|
+
string = "\\" + string
|
|
1379
|
+
# \frac1b or \frac12 --> \frac{1}{b} and \frac{1}{2}, etc. Even works with \frac1{72} (but not \frac{72}1). Also does a/b --> \\frac{a}{b}
|
|
1380
|
+
string = fix_fracs(string)
|
|
1381
|
+
|
|
1382
|
+
# NOTE: X/Y changed to \frac{X}{Y} in dataset, but in simple cases fix in case the model output is X/Y
|
|
1383
|
+
string = fix_a_slash_b(string)
|
|
1384
|
+
|
|
1385
|
+
string = regex.sub(r"^[a-z]\\in", "", string)
|
|
1386
|
+
|
|
1387
|
+
if "," not in string:
|
|
1388
|
+
string = self.remove_out_paren(string)
|
|
1389
|
+
|
|
1390
|
+
if "\\begin{array}" not in string:
|
|
1391
|
+
# to consider: get rid of chain of equalities like "a = b = c = d"
|
|
1392
|
+
if len(string.split("=")) > 2:
|
|
1393
|
+
string = string.split("=")[-1]
|
|
1394
|
+
|
|
1395
|
+
# to consider: get rid of e.g. "k = " or "q = " at beginning
|
|
1396
|
+
if len(string.split("=")) == 2:
|
|
1397
|
+
first_part = string.split("=")[0].strip()
|
|
1398
|
+
if (
|
|
1399
|
+
regex.match(
|
|
1400
|
+
r"^([a-z]|[A-Z]{2}|\\?(alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|sin|cos|sec|csc|tan|cot|sinh|cosh|sech|csch|tanh|coth|log|ln|exp))\^?{?-?('|\\prime|\d)*}?(\(-?([\d\.]+|[a-z])?\))?$",
|
|
1401
|
+
first_part,
|
|
1402
|
+
)
|
|
1403
|
+
is not None
|
|
1404
|
+
):
|
|
1405
|
+
string = string.split("=")[1]
|
|
1406
|
+
|
|
1407
|
+
# to consider: get rid of equalities but not equations
|
|
1408
|
+
if len(string.split("=")) == 2:
|
|
1409
|
+
if (
|
|
1410
|
+
len(regex.findall(r"[a-zA-Z]", string.split("=")[0].strip()))
|
|
1411
|
+
== 0
|
|
1412
|
+
):
|
|
1413
|
+
string = string.split("=")[1]
|
|
1414
|
+
# replace \pm with +,-
|
|
1415
|
+
# string = regex.sub(r"(.*?)\\pm(.+?)", r"\1-\2,\1+\2", string)
|
|
1416
|
+
string = self.norm_pm(string) # might add comma ","
|
|
1417
|
+
|
|
1418
|
+
string = regex.sub(r"^0+([1-9])", r"\1", string)
|
|
1419
|
+
|
|
1420
|
+
strings.append(string)
|
|
1421
|
+
string = ",".join(strings)
|
|
1422
|
+
|
|
1423
|
+
if "," not in string:
|
|
1424
|
+
string = self.remove_out_paren(string)
|
|
1425
|
+
|
|
1426
|
+
if STR2NUM.get(string):
|
|
1427
|
+
string = str(STR2NUM[string])
|
|
1428
|
+
|
|
1429
|
+
# add space
|
|
1430
|
+
string = regex.sub(r"\\mid([a-z])", r"\\mid \1", string)
|
|
1431
|
+
string = self.clean(string)
|
|
1432
|
+
|
|
1433
|
+
# If there are multiple same inequality signs and no commas
|
|
1434
|
+
for ineq in ["<", ">"]:
|
|
1435
|
+
if len(regex.findall(f"{ineq}=?", string)) > 1 and not any(
|
|
1436
|
+
delim in string.lower() for delim in [",", "and", "or"]
|
|
1437
|
+
):
|
|
1438
|
+
string = string.replace(ineq, ",")
|
|
1439
|
+
|
|
1440
|
+
return string
|
|
1441
|
+
|
|
1442
|
+
|
|
1443
|
+
class EvaluatorMathBatch(EvaluatorMath):
|
|
1444
|
+
"""Batch evaluator for math problems, capable of extracting answer segment from complex resp and processing various mathematical objects
|
|
1445
|
+
(e.g. fractions, symbolic expressions, matrices, vectors) and special text (e.g. bool values).
|
|
1446
|
+
|
|
1447
|
+
Parameters
|
|
1448
|
+
----------
|
|
1449
|
+
ans_extract_mode: str, default: "boxed"
|
|
1450
|
+
Options:
|
|
1451
|
+
- "boxed": Extract answer from the boxed expression.
|
|
1452
|
+
- "explicit": Extract answer from the explicit answer segment.
|
|
1453
|
+
- "speculate": Speculate the answer from the last number or latex formula.
|
|
1454
|
+
include_percentage : bool, default: True
|
|
1455
|
+
Whether to include percentage comparisons.
|
|
1456
|
+
rel_tol : float, default: DEF_REL_TOL
|
|
1457
|
+
The relative tolerance for numerical comparisons.
|
|
1458
|
+
abs_tol : float, default: DEF_ABS_TOL
|
|
1459
|
+
The absolute tolerance for numerical comparisons. Necessary for precision issues.
|
|
1460
|
+
percent_rel_tol : float, default: DEF_PERCENT_REL_TOL
|
|
1461
|
+
The absolute tolerance for percentage comparisons.
|
|
1462
|
+
ascii_only : bool, default: True
|
|
1463
|
+
Only allowing ASCII characters
|
|
1464
|
+
timeout : int, default: DEF_TIMEOUT:=5
|
|
1465
|
+
The timeout for each evaluation.
|
|
1466
|
+
n_procs: int, default: 2
|
|
1467
|
+
The number of processes to use for multiprocessing.
|
|
1468
|
+
use_tqdm: bool, default: True
|
|
1469
|
+
Whether to use tqdm for progress bar.
|
|
1470
|
+
"""
|
|
1471
|
+
|
|
1472
|
+
def __init__(
|
|
1473
|
+
self,
|
|
1474
|
+
ans_extract_mode: str = "boxed",
|
|
1475
|
+
include_percentage: bool = True,
|
|
1476
|
+
rel_tol: float = DEF_REL_TOL,
|
|
1477
|
+
abs_tol: float = DEF_ABS_TOL,
|
|
1478
|
+
percent_rel_tol: float = DEF_PERCENT_REL_TOL,
|
|
1479
|
+
ascii_only: bool = True,
|
|
1480
|
+
timeout: int = DEF_TIMEOUT,
|
|
1481
|
+
n_procs: int = DEF_N_PROC,
|
|
1482
|
+
use_tqdm: bool = True,
|
|
1483
|
+
):
|
|
1484
|
+
EvaluatorMath.__init__(
|
|
1485
|
+
self,
|
|
1486
|
+
include_percentage=include_percentage,
|
|
1487
|
+
rel_tol=rel_tol,
|
|
1488
|
+
abs_tol=abs_tol,
|
|
1489
|
+
percent_rel_tol=percent_rel_tol,
|
|
1490
|
+
ascii_only=ascii_only,
|
|
1491
|
+
ans_extract_mode=ans_extract_mode,
|
|
1492
|
+
)
|
|
1493
|
+
self.timeout = timeout
|
|
1494
|
+
self.n_procs = n_procs
|
|
1495
|
+
self.use_tqdm = use_tqdm
|
|
1496
|
+
|
|
1497
|
+
def batch_eval(
|
|
1498
|
+
self,
|
|
1499
|
+
ref_answers: List[str],
|
|
1500
|
+
resps: List[str],
|
|
1501
|
+
problems: Optional[List[T_Union[str, bool]]] = None,
|
|
1502
|
+
) -> T_Tuple[List[str], List[bool]]:
|
|
1503
|
+
"""Evaluate a batch of `resps` against `ref_answers`."""
|
|
1504
|
+
pred_answers: List[str] = self.batch_extract_ans(resps)
|
|
1505
|
+
corrects: List[bool] = self.batch_eq(ref_answers, pred_answers, problems)
|
|
1506
|
+
return pred_answers, corrects
|
|
1507
|
+
|
|
1508
|
+
def batch_get_eq_map(
|
|
1509
|
+
self,
|
|
1510
|
+
ref_answers: Sequence[str],
|
|
1511
|
+
pred_answers: Sequence[str],
|
|
1512
|
+
querying4set_flags: Sequence[bool],
|
|
1513
|
+
) -> T_Dict[T_Tuple[str, str, bool], bool]:
|
|
1514
|
+
corrects: List[bool] = batch_exec(
|
|
1515
|
+
self.eq,
|
|
1516
|
+
[
|
|
1517
|
+
{"ref_ans": ref_ans, "pred": pred, "compare_sets": set_flag}
|
|
1518
|
+
for ref_ans, pred, set_flag in zip(
|
|
1519
|
+
ref_answers, pred_answers, querying4set_flags
|
|
1520
|
+
)
|
|
1521
|
+
],
|
|
1522
|
+
n_procs=self.n_procs,
|
|
1523
|
+
timeout=self.timeout,
|
|
1524
|
+
use_tqdm=self.use_tqdm,
|
|
1525
|
+
desc="Judging",
|
|
1526
|
+
def_val=False,
|
|
1527
|
+
)
|
|
1528
|
+
eq_map: T_Dict[T_Tuple[str, str, bool], bool] = dict(
|
|
1529
|
+
zip(zip(ref_answers, pred_answers, querying4set_flags), corrects)
|
|
1530
|
+
)
|
|
1531
|
+
return eq_map
|
|
1532
|
+
|
|
1533
|
+
def batch_eq(
|
|
1534
|
+
self,
|
|
1535
|
+
ref_answers: Sequence[str],
|
|
1536
|
+
pred_answers: Sequence[str],
|
|
1537
|
+
problems: Optional[Sequence[T_Union[str, bool]]] = None,
|
|
1538
|
+
) -> List[bool]:
|
|
1539
|
+
"""Evaluate a batch of `pred_answers` against `ref_answers`."""
|
|
1540
|
+
assert len(ref_answers) == len(
|
|
1541
|
+
pred_answers
|
|
1542
|
+
), f"{len(ref_answers) = } != {len(pred_answers) = }"
|
|
1543
|
+
set_flags: List[bool] = (
|
|
1544
|
+
[is_querying4set(p) if isinstance(p, str) else p for p in problems]
|
|
1545
|
+
if problems is not None
|
|
1546
|
+
else [False] * len(ref_answers)
|
|
1547
|
+
)
|
|
1548
|
+
uniq_judge_data: Set[T_Tuple[str, str, bool]] = set(
|
|
1549
|
+
zip(ref_answers, pred_answers, set_flags)
|
|
1550
|
+
)
|
|
1551
|
+
uniq_ref_answers, uniq_pred_answers, uniq_set_flags = zip(*uniq_judge_data)
|
|
1552
|
+
|
|
1553
|
+
uniq_judge_data2correct: T_Dict[T_Tuple[str, str, bool], bool] = (
|
|
1554
|
+
self.batch_get_eq_map(uniq_ref_answers, uniq_pred_answers, uniq_set_flags)
|
|
1555
|
+
)
|
|
1556
|
+
|
|
1557
|
+
return [
|
|
1558
|
+
uniq_judge_data2correct[(ref, pred, set_flag)]
|
|
1559
|
+
for ref, pred, set_flag in zip(ref_answers, pred_answers, set_flags)
|
|
1560
|
+
]
|
|
1561
|
+
|
|
1562
|
+
def batch_extract_ans(
|
|
1563
|
+
self,
|
|
1564
|
+
resps: List[str],
|
|
1565
|
+
) -> List[str]:
|
|
1566
|
+
"""Extract answers from a batch of responses."""
|
|
1567
|
+
answers: List[str] = batch_exec(
|
|
1568
|
+
self.extract_ans,
|
|
1569
|
+
[{"resp_str": resp} for resp in resps],
|
|
1570
|
+
n_procs=self.n_procs,
|
|
1571
|
+
timeout=self.timeout,
|
|
1572
|
+
use_tqdm=self.use_tqdm,
|
|
1573
|
+
desc="Extracting",
|
|
1574
|
+
def_val="",
|
|
1575
|
+
)
|
|
1576
|
+
return answers
|
|
1577
|
+
|
|
1578
|
+
def batch_get_maj_answers(
|
|
1579
|
+
self,
|
|
1580
|
+
answers_list: List[List[str]],
|
|
1581
|
+
problems: Optional[List[T_Union[str, bool]]] = None,
|
|
1582
|
+
) -> T_Tuple[List[List[str]], List[List[str]]]:
|
|
1583
|
+
"""Get the majority answers for a batch of answers."""
|
|
1584
|
+
maj_answers_list: List[List[str]] = []
|
|
1585
|
+
norm_answers_list: List[List[str]] = []
|
|
1586
|
+
# ans_vote_list: List[T_Dict[str, int]] = []
|
|
1587
|
+
# Gather all unique pairs of answers to evaluate
|
|
1588
|
+
|
|
1589
|
+
all_judge_data: List[T_Tuple[str, str, bool]] = []
|
|
1590
|
+
|
|
1591
|
+
set_flags: List[bool] = (
|
|
1592
|
+
[
|
|
1593
|
+
is_querying4set(problem) if isinstance(problem, str) else problem
|
|
1594
|
+
for problem in problems
|
|
1595
|
+
]
|
|
1596
|
+
if problems is not None
|
|
1597
|
+
else [False] * len(answers_list)
|
|
1598
|
+
)
|
|
1599
|
+
for answers, set_flag in zip(answers_list, set_flags):
|
|
1600
|
+
all_judge_data.extend(
|
|
1601
|
+
(answer, answers[j], set_flag)
|
|
1602
|
+
for j, answer in enumerate(answers)
|
|
1603
|
+
if j < len(answers) - 1
|
|
1604
|
+
)
|
|
1605
|
+
|
|
1606
|
+
# Unzip pairs for batch evaluation
|
|
1607
|
+
all_ref_answers, all_pred_answers, all_set_flags = zip(*all_judge_data)
|
|
1608
|
+
|
|
1609
|
+
all_judge_data2eq: T_Dict[T_Tuple[str, str, bool], bool] = (
|
|
1610
|
+
self.batch_get_eq_map(all_ref_answers, all_pred_answers, all_set_flags)
|
|
1611
|
+
)
|
|
1612
|
+
|
|
1613
|
+
# Get the majority answers for each set of answers
|
|
1614
|
+
for answers, set_flag in zip(answers_list, set_flags):
|
|
1615
|
+
maj_answers: List[str] = []
|
|
1616
|
+
norm_answers: List[str] = []
|
|
1617
|
+
ans_vote: T_Counter[str] = Counter()
|
|
1618
|
+
|
|
1619
|
+
for answer in answers:
|
|
1620
|
+
exist_ans = next(
|
|
1621
|
+
(
|
|
1622
|
+
exist_answer
|
|
1623
|
+
for exist_answer in ans_vote
|
|
1624
|
+
if all_judge_data2eq.get(
|
|
1625
|
+
(answer, exist_answer, set_flag), False
|
|
1626
|
+
)
|
|
1627
|
+
),
|
|
1628
|
+
None,
|
|
1629
|
+
)
|
|
1630
|
+
norm_ans: str = exist_ans if exist_ans is not None else answer
|
|
1631
|
+
ans_vote[norm_ans] += 1
|
|
1632
|
+
|
|
1633
|
+
norm_answers.append(norm_ans)
|
|
1634
|
+
maj_answers.append(self.get_maj_ans_from_votes(ans_vote))
|
|
1635
|
+
|
|
1636
|
+
maj_answers_list.append(maj_answers)
|
|
1637
|
+
norm_answers_list.append(norm_answers)
|
|
1638
|
+
# ans_vote_list.append(dict(ans_vote))
|
|
1639
|
+
|
|
1640
|
+
return maj_answers_list, norm_answers_list
|