from dataclasses import dataclass
from enum import Enum
NUM_FEWSHOT = 0 # Change with your few shot
# ---------------------------------------------------
TITLE = """
🇹🇠Thai LLM Leaderboard
"""
#
INTRODUCTION_TEXT = """
The Thai LLM Leaderboard 🇹🇠aims to standardize evaluation methods for large language models (LLMs) in the Thai language, building on SEACrowd.
As part of an open community project, we welcome you to submit new evaluation tasks or models.
This leaderboard is developed in collaboration with SCB 10X, Vistec, and SEACrowd. Read more on Introduction Blog
"""
LLM_BENCHMARKS_TEXT = f"""
The leaderboard currently consists of the following benchmarks:
- Exam
- ThaiExam: ThaiExam is a Thai language benchmark based on examinations for high-school students and investment professionals in Thailand.
- M3Exam: M3Exam is a novel benchmark sourced from authentic and official human exam questions for evaluating LLMs in a multilingual, multimodal, and multilevel context. This leaderboard uses the Thai subset of M3Exam.
- LLM-as-a-Judge
- Thai MT-Bench: A Thai version of MT-Bench developed specially by VISTEC for probing Thai generative skills using the LLM-as-a-judge method.
- NLU
- Belebele: Belebele is a multiple-choice machine reading comprehension (MRC) dataset spanning 122 language variants, where the Thai subset is used in this leaderboard.
- XNLI: XNLI is an evaluation corpus for language transfer and cross-lingual sentence classification in 15 languages. This leaderboard uses the Thai subset of this corpus.
- XCOPA: XCOPA is a corpus of translated and re-annotated English COPA, covers 11 languages. This is designed to measure the commonsense reasoning ability in non-English languages. This leaderboard uses the Thai subset of this corpus.
- Wisesight: Wisesight sentiment analysis corpus contains social media messages in the Thai language with sentiment labels.
- NLG
- XLSum: XLSum is a comprehensive and diverse dataset comprising 1.35 million professionally annotated article-summary pairs from the BBC. This corpus evaluates the summarization performance in non-English languages, and this leaderboard uses the Thai subset.
- Flores200: FLORES is a machine translation benchmark dataset used to evaluate translation quality between English and low-resource languages. This leaderboard uses the Thai subset of Flores200.
- iapp Wiki QA Squad: iapp Wiki QA Squad is an extractive question-answering dataset derived from Thai Wikipedia articles.
Metric Implementation Details:
- Multiple-choice accuracy is calculated using the SEACrowd implementation of logits comparison, similar to the method used by the Open LLM Leaderboard (EleutherAI Harness). explain
- BLEU is calculated using flores200's tokenizer using HuggingFace `evaluate` implementation.
- ROUGEL is calculated using PyThaiNLP newmm tokenizer and HuggingFace `evaluate` implementation.
- LLM-as-a-judge rating is based on OpenAI's gpt-4o-2024-05-13 using the prompt defined in lmsys MT-Bench.
Reproducibility:
- For the reproducibility of results, we have open-sourced the evaluation pipeline. Please check out the repository seacrowd-experiments.
Acknowledgements:
- We are grateful to previous open-source projects that released datasets, tools, and knowledge. We thank community members for tasks and model submissions. To contribute, please see the submit tab.
"""
CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"
CITATION_BUTTON_TEXT = r"""@misc{thaillm-leaderboard,
author={SCB 10X and VISTEC and SEACrowd},
title={Thai LLM Leaderboard},
year={2024},
publisher={Hugging Face},
url={https://huggingface.co/spaces/ThaiLLM-Leaderboard/leaderboard}
}"""