daasime Claude Opus 4.6 commited on
Commit
3d5e4e1
Β·
1 Parent(s): b565407

Clean up Features tab and remove Batch Analysis from Analyzer

Browse files

- Remove "Tier 1/2/3" labels from Features tab (user-facing names)
- Replace emdashes with colons in Features content
- Remove "Coming Soon: Batch Analysis" from Analyzer tab (already in Features/Roadmap)
- Show message when demo samples are not yet available
- Log demo generation errors instead of silencing them

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +32 -52
app.py CHANGED
@@ -95,8 +95,8 @@ def _ensure_demo_samples():
95
  try:
96
  from generate_demos import main as gen_demos
97
  gen_demos()
98
- except Exception:
99
- pass
100
  return samples_dir
101
 
102
 
@@ -308,8 +308,8 @@ def render_analyzer_tab():
308
  for name, fname in demo_files.items()
309
  if os.path.exists(os.path.join(samples_dir, fname))
310
  }
 
311
  if available_demos:
312
- st.markdown("#### Try a Demo")
313
  dc1, dc2 = st.columns([3, 1])
314
  with dc1:
315
  selected_demo = st.selectbox(
@@ -323,7 +323,12 @@ def render_analyzer_tab():
323
  if demo_clicked:
324
  demo_path = available_demos[selected_demo]
325
  analyze_recorded_audio(demo_path)
326
- st.divider()
 
 
 
 
 
327
 
328
  # Custom CSS for better styling
329
  st.markdown("""
@@ -410,21 +415,6 @@ def render_analyzer_tab():
410
  if st.button("πŸ” Analyze Upload", type="primary", use_container_width=True, key="analyze_upload_fallback"):
411
  analyze_recorded_audio(temp_path)
412
 
413
- st.divider()
414
-
415
- # ---- Batch Analysis (Coming Soon) ----
416
- with st.container(border=True):
417
- st.markdown(
418
- '<span style="background:#3b82f6;color:white;padding:0.2rem 0.6rem;'
419
- 'border-radius:10px;font-size:0.75rem;font-weight:bold">COMING SOON</span>'
420
- '&nbsp;&nbsp; **Batch Analysis**',
421
- unsafe_allow_html=True,
422
- )
423
- st.caption(
424
- "Upload multiple audio files or a ZIP archive and analyze them in sequence. "
425
- "Get a consolidated report with cross-test voice matching and fraud rate trends "
426
- "β€” built for evaluators processing 20+ tests per day."
427
- )
428
 
429
 
430
  def analyze_recorded_audio(audio_path: str):
@@ -1542,12 +1532,12 @@ def render_compare_tab():
1542
 
1543
 
1544
  def render_features_tab():
1545
- """Render the Features tab β€” showcases all app capabilities and improvements."""
1546
  st.markdown("## App Features")
1547
- st.caption("Complete list of capabilities, organized by release tier.")
1548
 
1549
- # ---- Core Platform ----
1550
- st.markdown("### Core Platform")
1551
  with st.container(border=True):
1552
  f1, f2 = st.columns(2)
1553
  with f1:
@@ -1561,7 +1551,7 @@ def render_features_tab():
1561
  **Voiceprint Database**
1562
  - 192-dim voice embeddings stored per speaker
1563
  - Cosine similarity matching (80% threshold)
1564
- - Cross-test voice tracking β€” flags recurring voices
1565
  - Searchable database with labels and notes
1566
  """)
1567
  with f2:
@@ -1581,13 +1571,8 @@ def render_features_tab():
1581
 
1582
  st.markdown("")
1583
 
1584
- # ---- Tier 1: Risk Intelligence ----
1585
- st.markdown("### Tier 1 β€” Risk Intelligence")
1586
- st.markdown(
1587
- '<span style="background:#22c55e;color:white;padding:0.2rem 0.6rem;'
1588
- 'border-radius:10px;font-size:0.7rem;font-weight:bold">RELEASED</span>',
1589
- unsafe_allow_html=True,
1590
- )
1591
  with st.container(border=True):
1592
  t1a, t1b = st.columns(2)
1593
  with t1a:
@@ -1599,37 +1584,32 @@ def render_features_tab():
1599
  - Categories: Synthetic (25pts), Reading (20pts), Playback (15pts), Whispers (15pts), Pauses (10pts), Wake Words (10pts), Recurring Voice (+5pts bonus)
1600
 
1601
  **Dashboard KPIs**
1602
- - Tests Analyzed β€” total count
1603
- - Fraud Rate β€” % of tests scoring > 60
1604
- - Unique Voices β€” distinct speakers in DB
1605
- - Alerts Today β€” tests flagged today
1606
  """)
1607
  with t1b:
1608
  st.markdown("""
1609
  **PDF Report Export**
1610
  - Professional downloadable report per analysis
1611
- - Includes: risk score banner, speaker summary, detection flags table, alert details, score breakdown
1612
  - Color-coded risk header
1613
  - One-click download alongside JSON export
1614
 
1615
  **Demo Audio Samples (6 scenarios)**
1616
- - Clean Exam β€” natural speech, LOW risk
1617
- - Reading Pattern β€” monotone + 7s pause
1618
- - Coaching β€” main speaker + whispered prompts
1619
- - Wake Word β€” "Alexa" call + device beep
1620
- - Synthetic Voice β€” robotic TTS + beep tones
1621
- - Two Speakers β€” different accents taking turns
1622
  """)
1623
 
1624
  st.markdown("")
1625
 
1626
- # ---- Tier 2: Advanced Analytics ----
1627
- st.markdown("### Tier 2 β€” Advanced Analytics")
1628
- st.markdown(
1629
- '<span style="background:#22c55e;color:white;padding:0.2rem 0.6rem;'
1630
- 'border-radius:10px;font-size:0.7rem;font-weight:bold">RELEASED</span>',
1631
- unsafe_allow_html=True,
1632
- )
1633
  with st.container(border=True):
1634
  t2a, t2b = st.columns(2)
1635
  with t2a:
@@ -1639,7 +1619,7 @@ def render_features_tab():
1639
  - Risk score cards with color semaphore
1640
  - Detection flags table: Test A vs Test B
1641
  - Speaker summary with voiceprint IDs
1642
- - Shared voice detection β€” alerts if same voice appears in both tests
1643
  - Grouped bar chart comparing risk breakdown across categories
1644
  """)
1645
  with t2b:
@@ -1658,8 +1638,8 @@ def render_features_tab():
1658
 
1659
  st.markdown("")
1660
 
1661
- # ---- Tier 3: Roadmap ----
1662
- st.markdown("### Tier 3 β€” Roadmap")
1663
  st.markdown(
1664
  '<span style="background:#3b82f6;color:white;padding:0.2rem 0.6rem;'
1665
  'border-radius:10px;font-size:0.7rem;font-weight:bold">PLANNED</span>',
 
95
  try:
96
  from generate_demos import main as gen_demos
97
  gen_demos()
98
+ except Exception as e:
99
+ print(f"[Demo generation failed] {e}")
100
  return samples_dir
101
 
102
 
 
308
  for name, fname in demo_files.items()
309
  if os.path.exists(os.path.join(samples_dir, fname))
310
  }
311
+ st.markdown("#### Try a Demo")
312
  if available_demos:
 
313
  dc1, dc2 = st.columns([3, 1])
314
  with dc1:
315
  selected_demo = st.selectbox(
 
323
  if demo_clicked:
324
  demo_path = available_demos[selected_demo]
325
  analyze_recorded_audio(demo_path)
326
+ else:
327
+ st.caption("Demo samples are being generated. Refresh the page in a few seconds.")
328
+ if st.button("Retry generating demos"):
329
+ st.cache_resource.clear()
330
+ st.rerun()
331
+ st.divider()
332
 
333
  # Custom CSS for better styling
334
  st.markdown("""
 
415
  if st.button("πŸ” Analyze Upload", type="primary", use_container_width=True, key="analyze_upload_fallback"):
416
  analyze_recorded_audio(temp_path)
417
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418
 
419
 
420
  def analyze_recorded_audio(audio_path: str):
 
1532
 
1533
 
1534
  def render_features_tab():
1535
+ """Render the Features tab with all app capabilities."""
1536
  st.markdown("## App Features")
1537
+ st.caption("Complete list of capabilities and what this platform can do.")
1538
 
1539
+ # ---- Analysis Engine ----
1540
+ st.markdown("### Analysis Engine")
1541
  with st.container(border=True):
1542
  f1, f2 = st.columns(2)
1543
  with f1:
 
1551
  **Voiceprint Database**
1552
  - 192-dim voice embeddings stored per speaker
1553
  - Cosine similarity matching (80% threshold)
1554
+ - Cross-test voice tracking, flags recurring voices
1555
  - Searchable database with labels and notes
1556
  """)
1557
  with f2:
 
1571
 
1572
  st.markdown("")
1573
 
1574
+ # ---- Risk Intelligence ----
1575
+ st.markdown("### Risk Intelligence")
 
 
 
 
 
1576
  with st.container(border=True):
1577
  t1a, t1b = st.columns(2)
1578
  with t1a:
 
1584
  - Categories: Synthetic (25pts), Reading (20pts), Playback (15pts), Whispers (15pts), Pauses (10pts), Wake Words (10pts), Recurring Voice (+5pts bonus)
1585
 
1586
  **Dashboard KPIs**
1587
+ - Tests Analyzed: total count
1588
+ - Fraud Rate: % of tests scoring > 60
1589
+ - Unique Voices: distinct speakers in DB
1590
+ - Alerts Today: tests flagged today
1591
  """)
1592
  with t1b:
1593
  st.markdown("""
1594
  **PDF Report Export**
1595
  - Professional downloadable report per analysis
1596
+ - Risk score banner, speaker summary, detection flags table, alert details, score breakdown
1597
  - Color-coded risk header
1598
  - One-click download alongside JSON export
1599
 
1600
  **Demo Audio Samples (6 scenarios)**
1601
+ - Clean Exam: natural speech, LOW risk
1602
+ - Reading Pattern: monotone + 7s pause
1603
+ - Coaching: main speaker + whispered prompts
1604
+ - Wake Word: "Alexa" call + device beep
1605
+ - Synthetic Voice: robotic TTS + beep tones
1606
+ - Two Speakers: different accents taking turns
1607
  """)
1608
 
1609
  st.markdown("")
1610
 
1611
+ # ---- Advanced Analytics ----
1612
+ st.markdown("### Advanced Analytics")
 
 
 
 
 
1613
  with st.container(border=True):
1614
  t2a, t2b = st.columns(2)
1615
  with t2a:
 
1619
  - Risk score cards with color semaphore
1620
  - Detection flags table: Test A vs Test B
1621
  - Speaker summary with voiceprint IDs
1622
+ - Shared voice detection: alerts if same voice appears in both tests
1623
  - Grouped bar chart comparing risk breakdown across categories
1624
  """)
1625
  with t2b:
 
1638
 
1639
  st.markdown("")
1640
 
1641
+ # ---- Roadmap ----
1642
+ st.markdown("### Roadmap")
1643
  st.markdown(
1644
  '<span style="background:#3b82f6;color:white;padding:0.2rem 0.6rem;'
1645
  'border-radius:10px;font-size:0.7rem;font-weight:bold">PLANNED</span>',