-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample
More file actions
53 lines (50 loc) · 3.85 KB
/
example
File metadata and controls
53 lines (50 loc) · 3.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
451 +
452 + # Interleave and shuffle
453 + import random
454 + all_ids = [r[0] for r in male_sample] + [r[0] for r in female_sample]
455 + random.shuffle(all_ids)
456 +
457 + # Insert with order
458 + for i, cid in enumerate(all_ids):
459 + db.execute('INSERT INTO validation_sample (comment_id, sample_order) VALUES (?, ?)', [cid, i])
460 +
461 + db.commit()
462 +
463 + return existing
464 +
465 +
466 @app.route('/validate', methods=['GET', 'POST'])
467 def validate():
468 """Spot-check validation interface for LLM classifications."""
469 db = get_db()
470
471 + # Ensure we have a stratified sample
472 + get_or_create_validation_sample(db, target_per_gender=100)
473 +
474 # Handle POST (save blind validation - direction only)
475 if request.method == 'POST':
476 comment_id = request.form.get('comment_id')
...
490
491 db.commit()
492
434 - # Redirect to next comment (with same filters)
435 - gender = request.form.get('filter_gender', '')
436 - direction = request.form.get('filter_direction', '')
437 - tone = request.form.get('filter_tone', '')
438 - return redirect(f'/validate?gender={gender}&direction={direction}&tone={tone}')
493 + # Redirect to next
494 + return redirect('/validate')
495
496 # GET: Show validation form
497 gender_filter = request.args.get('gender', '')
⎿ You've hit your limit · resets 8pm (Europe/London)
Opening your options…
> /rate-limit-options
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ What do you want to do? │
│ │
│ ❯ 1. Stop and wait for limit to reset │
│ 2. Switch to extra usage │
│ 3. Upgrade your plan │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯