o
    6ti                     @   s0   d Z ddddddZg dZdd	 Zd
d ZdS )zBThis is a {}. Select the correct answer!

Question: {}
{}

Answer:zprimary schoolzmiddle schoolzhigh school
universityprofessional)PrimaryMiddleHighUnivProf)zA.zB.zC.zD.zE.c           	      C   s   | d sdndt | d   }| d sdnd| d  }| d  d| | }| d s-| d	 n
| d  d
| d	  }g }tg dD ]\}}| | sJ n|t|  d| |   q@t||d|}|S )z
    Refactoring `prepare_data_en` to fit with the lm harness framework.
    https://github.com/mbzuai-nlp/ArabicMMLU/blob/main/util_prompt.py
    Level z for Countryz in Subjectz	 questionContextQuestionz

)zOption 1zOption 2zOption 3zOption 4zOption 5 
)level_en	enumerateappendalpaPROMPTformatjoin)	doclevelcountrymain_meta_dataquestionoptionsioptdoc_text r    R/home/ubuntu/.local/lib/python3.10/site-packages/lm_eval/tasks/arabicmmlu/utils.pydoc_to_text   s    
r"   c                    s    fddt dD S )Nc                    s*   g | ]} d |d   rt | d qS )zOption        )r   ).0r   r   r    r!   
<listcomp>,   s   * z!doc_to_choice.<locals>.<listcomp>   )ranger&   r    r&   r!   doc_to_choice+   s   r*   N)r   r   r   r"   r*   r    r    r    r!   <module>   s    