Datasets:
Nikame Agent
fix: removed all duplicate candidates across the benchmark using rigorous multi-pass review
696b5d1 | import json | |
| import os | |
| import glob | |
| import re | |
| DATA_DIR = '/mnt/data/projects/GomParam-v1/data' | |
| def check_english(text, file): | |
| # Cross scripting inherently has Romi | |
| if 'cross_scripting' in file or 'code_switching' in file: | |
| return False | |
| # If there's an English letter | |
| if re.search(r'[a-zA-Z]', text): | |
| return True | |
| return False | |
| def main(): | |
| issues = 0 | |
| total_items = 0 | |
| for file in glob.glob(os.path.join(DATA_DIR, '*.json')): | |
| with open(file, 'r', encoding='utf-8') as f: | |
| data = json.load(f) | |
| for item in data: | |
| total_items += 1 | |
| idx = item.get('id', 'UNKNOWN') | |
| # 1. Check candidates length | |
| if 'candidates' in item: | |
| if len(item['candidates']) != 4: | |
| print(f"[{idx}] Wrong number of candidates: {len(item['candidates'])}") | |
| issues += 1 | |
| # 2. Check for duplicate candidates | |
| if len(set(item['candidates'])) != len(item['candidates']): | |
| print(f"[{idx}] Duplicate candidates found: {item['candidates']}") | |
| issues += 1 | |
| # 3. Check correct index | |
| corr = item.get('correct') | |
| if not isinstance(corr, int) or corr < 0 or corr > 3: | |
| print(f"[{idx}] Invalid correct index: {corr}") | |
| issues += 1 | |
| # 4. Check for empty strings | |
| for i, c in enumerate(item['candidates']): | |
| if not c.strip(): | |
| print(f"[{idx}] Empty candidate at index {i}") | |
| issues += 1 | |
| else: | |
| print(f"[{idx}] Missing 'candidates' field") | |
| issues += 1 | |
| # 5. Check for english letters in Devanagari modules | |
| for key in ['context', 'question', 'passage', 'sentence']: | |
| if key in item and isinstance(item[key], str): | |
| if check_english(item[key], file): | |
| # Some english might be valid like (Pinto Revolt), we'll print to manually inspect | |
| print(f"[{idx}] English letters found in {key}: {item[key]}") | |
| print(f"Diagnostic complete. Checked {total_items} items. Found {issues} strict issues.") | |
| if __name__ == '__main__': | |
| main() | |