Datasets:

Modalities:
Text
Formats:
json
Languages:
Hindi
Size:
< 1K
ArXiv:
Libraries:
Datasets
pandas
License:
ravirajoshi commited on
Commit
220063f
·
verified ·
1 Parent(s): d65d07f

Upload IFEVAL-EVAL.md

Browse files
Files changed (1) hide show
  1. IFEVAL-EVAL.md +124 -0
IFEVAL-EVAL.md ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # IFEval-Hi Evaluation Framework
2
+
3
+ ## Overview
4
+
5
+ IFEval-Hi is a Hindi language adaptation of the IFEval (Instruction Following Evaluation) benchmark, designed to evaluate the instruction-following capabilities of Large Language Models (LLMs) in Hindi. This implementation maintains the core evaluation methodology of the original English IFEval while incorporating language-specific modifications to ensure accurate and fair assessment of Hindi language models.
6
+
7
+ ## Setup and Usage
8
+
9
+ ### Step 1: Create Task Configuration
10
+
11
+ 1. Navigate to the lm-evaluation-harness tasks directory:
12
+ ```
13
+ https://github.com/EleutherAI/lm-evaluation-harness/tree/main/lm_eval/tasks/ifeval
14
+ ```
15
+
16
+ 2. Create a copy of the English IFEval directory and rename it to ifevalhi
17
+
18
+ 3. Rename the task file in the copied folder to `ifevalhi.yaml` for Hindi-specific configuration
19
+
20
+ ### Step 2: Configure Parameters
21
+
22
+ Update the `ifevalhi.yaml` configuration file with the following Hindi-specific parameters:
23
+
24
+ ```yaml
25
+ # Dataset Configuration
26
+ dataset_path: nvidia/IFEval-Hi
27
+
28
+ # Generation Parameters
29
+ max_gen_toks: 4096 # Increased from 1280 to accommodate Hindi morphology
30
+
31
+ # Additional Hindi-specific settings
32
+ # (Include language-specific preprocessing and normalization settings as needed)
33
+ ```
34
+
35
+ **Key Configuration Changes:**
36
+ - **`dataset_path`**: Changed from `google/IFEval` to `nvidia/IFEval-Hi`
37
+ - **`max_gen_toks`**: Increased to 4096 tokens to handle Hindi's linguistic complexity
38
+
39
+ ### Step 3: Run Evaluation
40
+
41
+ Execute the evaluation using the lm-eval-harness framework with the Hindi task configuration:
42
+
43
+ ```bash
44
+ # Basic evaluation command add other arguments as per lm-eval-harness repo
45
+ lm-eval --model hf \
46
+ --model_args pretrained=<model_name_or_path> \
47
+ --tasks ifevalhi \
48
+ --batch_size auto \
49
+ --output_path ./results/
50
+ ```
51
+
52
+ ### Expected Output
53
+
54
+ The evaluation will generate results including:
55
+ - **prompt_level_strict_acc**: Primary accuracy metric
56
+ - **normalised_acc**: Normalized accuracy with text preprocessing
57
+
58
+ ## Key Differences from English IFEval
59
+
60
+ ### 1. Configuration Parameters
61
+
62
+ #### Maximum Generation Token Limit
63
+ - **English IFEval**: 1,280 tokens
64
+ - **IFEval-Hindi**: 4,096 tokens
65
+
66
+ The increased token limit accommodates the morphological and syntactic properties of Hindi text, which often requires more tokens to express equivalent content compared to English.
67
+
68
+ ### 2. Language-Specific Processing
69
+
70
+ #### Tokenization and Segmentation
71
+ - **English Implementation**: Uses standard tokenizer for sentence and word segmentation
72
+ - **IFEval-Hi**: Incorporates Hindi-specific punctuation handling, including:
73
+ - Sentence delimitation using the vertical bar (`|`) character
74
+ - Custom punctuation rules tailored to Hindi text structure
75
+
76
+ ### 3. Constrained Response Categories
77
+
78
+ IFEval-Hi expands the constrained response category with Hindi-specific response patterns:
79
+
80
+ ```
81
+ - मेरा जवाब हाँ है (My answer is yes)
82
+ - मेरा जवाब नहीं है (My answer is no)
83
+ - मेरा जवाब शायद है (My answer is maybe)
84
+ - हाँ (Yes)
85
+ - नहीं (No)
86
+ - शायद (Maybe)
87
+ ```
88
+
89
+ These additions ensure fair evaluation for Hindi responses and align with natural Hindi language usage patterns.
90
+
91
+ ### 4. Text Normalization
92
+
93
+ IFEval-Hindi implements comprehensive normalization procedures for model-generated Hindi text and evaluation parameters:
94
+
95
+ #### Character Normalization
96
+ - **Consonant Unification**: Characters like क़ and क are unified to maintain consistency
97
+ - **Diacritic Removal**: Diacritical marks such as "ँ" (chandrabindu) are stripped
98
+ - **Symbol Cleanup**: Redundant symbols and spacing irregularities are removed
99
+ - **Orthographic Standardization**: Variations in Hindi script representation are normalized
100
+
101
+ These normalization steps ensure consistent processing across input prompts and model-generated outputs, reducing evaluation bias from orthographic variations.
102
+
103
+ ### 5. Validation Logic Updates
104
+
105
+ #### Letter Frequency Checker
106
+ - **English IFEval**: Includes English alphabet-only validation logic
107
+ - **IFEval-Hi**: English alphabet validation has been deprecated and removed from `instructions.py` to align with Hindi-specific evaluation requirements
108
+
109
+ This modification ensures that character-level constraints are appropriately evaluated for the Devanagari script used in Hindi.
110
+
111
+
112
+ IFEval-Hi follows the same execution pipeline as the English variant within the lm-eval-harness repository
113
+
114
+ ```
115
+ Pipeline Structure:
116
+ 1. Load dataset from nvidia/IFEval-Hi
117
+ 2. Generate model responses with Hindi-specific configurations
118
+ 3. Apply Hindi text normalization
119
+ 4. Evaluate instruction-following accuracy
120
+ 5. Report metrics
121
+ ```
122
+
123
+ Both implementations utilize the same core Python utility modules, ensuring consistency in evaluation methodology while supporting language-specific adaptations.
124
+ Please find the fork to the evaluation repo here https://github.com/anushaknvidia/lm-evaluation-harness