o
    6ti                     @   sh   d dl Z d dlZd dlZG dd dZdd Zdededed	dfd
dZdddZe	dkr2e  dS dS )    Nc                   @   s   e Zd Zdd ZdS )FunctionTagc                 C   s
   || _ d S )N)value)selfr    r   `/home/ubuntu/.local/lib/python3.10/site-packages/lm_eval/tasks/afrobench/masakhapos/gen_utils.py__init__   s   
zFunctionTag.__init__N)__name__
__module____qualname__r   r   r   r   r   r      s    r   c                 C   s.   dd| d| dd| dddd	}||  S )
Na  Please provide the POS tags for each word in the input sentence. The input will be a list of words in the sentence. The output format should be a list of tuples, where each tuple consists of a word from the input text and its corresponding POS tag label from the tag label set: ['ADJ', 'ADP', 'ADV', 'AUX', 'CCONJ, 'DET', 'INTJ', 'NOUN', 'NUM', 'PART', 'PRON', 'PROPN', 'PUNCT', 'SCONJ', 'SYM', 'VERB', 'X']. 
Your response should include only a list of tuples, in the order that the words appear in the input sentence, including punctuations, with each tuple containing the corresponding POS tag label for a word. 

Sentence: {{tokens}} 
Output: z4You are an expert in tagging words and sentences in zL with the right POS tag. 

Please provide the POS tags for each word in the aj   sentence. The input is a list of words in the sentence. POS tag label set: ['ADJ', 'ADP', 'ADV', 'AUX', 'CCONJ, 'DET', 'INTJ', 'NOUN', 'NUM', 'PART', 'PRON', 'PROPN', 'PUNCT', 'SCONJ', 'SYM', 'VERB', 'X']. The output format should be a list of tuples, where each tuple consists of a word from the input text and its corresponding POS tag label from the POS tag label set provided
Your response should include only a list of tuples, in the order that the words appear in the input sentence, including punctuations, with each tuple containing the corresponding POS tag label for a word. 

Sentence: {{tokens}} 
Output: zActing as a a   linguist and without making any corrections or changes to the text, perform a part of speech (POS) analysis of the sentences using the following POS tag label annotation ['ADJ', 'ADP', 'ADV', 'AUX', 'CCONJ, 'DET', 'INTJ', 'NOUN', 'NUM', 'PART', 'PRON', 'PROPN', 'PUNCT', 'SCONJ', 'SYM', 'VERB', 'X']. The input will be a list of words in the sentence. The output format should be a list of tuples, where each tuple consists of a word from the input text and its corresponding POS tag label from the POS tag label set provided
Your response should include only a list of tuples, in the order that the words appear in the input sentence, including punctuations, with each tuple containing the corresponding POS tag label for a word. 

Sentence: {{tokens}} 
Output: a  Annotate each word in the provided sentence with the appropriate POS tag. The annotation list is given as: ['ADJ', 'ADP', 'ADV', 'AUX', 'CCONJ, 'DET', 'INTJ', 'NOUN', 'NUM', 'PART', 'PRON', 'PROPN', 'PUNCT', 'SCONJ', 'SYM', 'VERB', 'X']. The input sentence will be a list of words in the sentence. The output format should be a list of tuples, where each tuple consists of a word from the input text and its corresponding POS tag label from the POS tag label set provided
Your response should include only a list of tuples, in the order that the words appear in the input sentence, including punctuations, with each tuple containing the corresponding POS tag label for a word. 

Sentence: {{tokens}} 
Output: a  Given the following sentence, identify the part of speech (POS) for each word. Use the following POS tag set: 
NOUN: Noun (person, place, thing), 
VERB: Verb (action, state), 
ADJ: Adjective (describes a noun), 
ADV: Adverb (modifies a verb, adjective, or adverb), 
PRON: Pronoun (replaces a noun), 
DET: Determiner (introduces a noun), 
ADP: Adposition (preposition or postposition), 
CCONJ: Conjunction (connects words, phrases, clauses)
PUNCT: Punctuation, 
PROPN: Proper Noun, 
AUX: Auxiliary verb (helper verb), 
SCONJ: Subordinating conjunction 
PART: Particle, 
SYM: Symbol, 
INTJ: Interjection, 
NUM: Numeral, 
X: others. The output format should be a list of tuples, where each tuple consists of a word from the input text and its corresponding POS tag label key only from the POS tag set provided
Your response should include only a list of tuples, in the order that the words appear in the input sentence, including punctuations, with each tuple containing the corresponding POS tag label for a word. 

Sentence: {{tokens}} 
Output: prompt_1prompt_2prompt_3prompt_4prompt_5r   )modelang
prompt_mapr   r   r   prompt_func   s   
-r   
output_dir	overwriter   returnc              	   C   s|  g }i ddddddddd	d
dddddddddddddddddddddd d!d"d#d$d%d&}|  D ]j}zZd'| d(}d'| d)| }d*}|||t||| d+}	tj|  d,| d-d. t|  d,| d,| |rzd/nd0d1d2}
|
d3 tj|	|
d-d4 W d5   n1 sw   Y  W qA ty   |	| Y qAw t
|d6krtd7d8| d5S )9z
    Generate a yaml file for each language.

    :param output_dir: The directory to output the files to.
    :param overwrite: Whether to overwrite files if they already exist.
    bamBambarabbjGhomalaeweEwefonFonhauHausaiboIgbokinKinyarwandalugLugandaluoDholuomosMossinyaChichewapcmzNigerian PidginsnachiShonaswa	KiswahilitsnSetswanatwiTwiwolWolofisiXhosaYorubaisiZulu)xhoyorzulmasakhapos_z.yaml_masakhapos_yaml)includetaskdataset_namedoc_to_text/T)exist_okwxutf8)encodingz# Generated by utils.py
)allow_unicodeNr   zJFiles were not created because they already exist (use --overwrite flag): z, )keysr   osmakedirsopenwriteyamldumpFileExistsErrorappendlenjoin)r   r   r   err	languagesr   	file_name	task_nameyaml_templateyaml_detailsfr   r   r   gen_lang_yamls=   s   	


r_   c                  C   s`   t  } | jddddd | jdddd	 | jd
dg ddd |  }t|j|j|jd dS )z9Parse CLI args and generate language-specific yaml files.z--overwriteT
store_truez%Overwrite files if they already exist)defaultactionhelpz--output-dirz./z Directory to write yaml files to)ra   rc   z--moder   r   zPrompt number)ra   choicesrc   )r   r   r   N)argparseArgumentParseradd_argument
parse_argsr_   r   r   r   )parserargsr   r   r   main}   s(   rk   __main__)r   N)
re   rN   rR   r   r   strboolr_   rk   r   r   r   r   r   <module>   s    1
@
