mistermprah commited on
Commit
a68a153
·
verified ·
1 Parent(s): f9dbd70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -10,7 +10,17 @@ def classify_audio(filepath):
10
  preds = pipe(filepath)
11
  outputs = {}
12
  for p in preds:
13
- outputs[p["label"].replace('_', ' ')] = p["score"]
 
 
 
 
 
 
 
 
 
 
14
  return outputs
15
 
16
  # Streamlit app layout
 
10
  preds = pipe(filepath)
11
  outputs = {}
12
  for p in preds:
13
+ label = p["label"].replace('_', ' ')
14
+ # Simplify the labels as required
15
+ if "artifact" in label:
16
+ label = "artifact"
17
+ elif "murmur" in label:
18
+ label = "murmur"
19
+ elif "extra" in label:
20
+ label = "normal"
21
+ elif "normal" in label:
22
+ label = "normal"
23
+ outputs[label] = p["score"]
24
  return outputs
25
 
26
  # Streamlit app layout