Update app.py
Browse files
app.py
CHANGED
|
@@ -13,14 +13,14 @@ def process(audio_file, transcript_text, meeting_title):
|
|
| 13 |
text = (text + "\n" + extra).strip() if text else extra
|
| 14 |
|
| 15 |
if not text or len(text) < 40:
|
| 16 |
-
return "
|
| 17 |
|
| 18 |
resum = summarize(text)
|
| 19 |
ed = extract_actions_decisions(text)
|
| 20 |
actions = ed.get("actions", [])
|
| 21 |
decisions = ed.get("decisions", [])
|
| 22 |
|
| 23 |
-
title = meeting_title or "
|
| 24 |
md = make_minutes_md(title, resum, actions, decisions)
|
| 25 |
md_path = os.path.join(OUT_DIR, "minutes.md")
|
| 26 |
with open(md_path, "w", encoding="utf-8") as f:
|
|
@@ -28,26 +28,26 @@ def process(audio_file, transcript_text, meeting_title):
|
|
| 28 |
|
| 29 |
# HighlightedText expects list of (text, label). We'll tag each item.
|
| 30 |
actions_ht = [(a, "Action") for a in actions] if actions else []
|
| 31 |
-
decisions_ht = [(d, "
|
| 32 |
|
| 33 |
-
return "
|
| 34 |
|
| 35 |
with gr.Blocks(title="MeetingNotes AI") as demo:
|
| 36 |
gr.Markdown("# MeetingNotes AI")
|
| 37 |
-
gr.Markdown("
|
| 38 |
|
| 39 |
with gr.Row():
|
| 40 |
with gr.Column():
|
| 41 |
-
meeting_title = gr.Textbox(label="
|
| 42 |
audio = gr.Audio(label="Audio (mp3/wav)", sources=["upload"], type="filepath")
|
| 43 |
-
transcript = gr.Textbox(label="Transcript (
|
| 44 |
-
btn = gr.Button("
|
| 45 |
with gr.Column():
|
| 46 |
-
status = gr.Textbox(label="
|
| 47 |
-
resume = gr.Textbox(label="
|
| 48 |
-
actions = gr.HighlightedText(label="Points
|
| 49 |
-
decisions = gr.HighlightedText(label="
|
| 50 |
-
files = gr.File(label="
|
| 51 |
|
| 52 |
btn.click(process, inputs=[audio, transcript, meeting_title], outputs=[status, resume, actions, decisions, files])
|
| 53 |
|
|
|
|
| 13 |
text = (text + "\n" + extra).strip() if text else extra
|
| 14 |
|
| 15 |
if not text or len(text) < 40:
|
| 16 |
+
return "Please, upload an audio or paste a transcript (≥ 40 characters).", "", [], [], None
|
| 17 |
|
| 18 |
resum = summarize(text)
|
| 19 |
ed = extract_actions_decisions(text)
|
| 20 |
actions = ed.get("actions", [])
|
| 21 |
decisions = ed.get("decisions", [])
|
| 22 |
|
| 23 |
+
title = meeting_title or "Meeting"
|
| 24 |
md = make_minutes_md(title, resum, actions, decisions)
|
| 25 |
md_path = os.path.join(OUT_DIR, "minutes.md")
|
| 26 |
with open(md_path, "w", encoding="utf-8") as f:
|
|
|
|
| 28 |
|
| 29 |
# HighlightedText expects list of (text, label). We'll tag each item.
|
| 30 |
actions_ht = [(a, "Action") for a in actions] if actions else []
|
| 31 |
+
decisions_ht = [(d, "Decision") for d in decisions] if decisions else []
|
| 32 |
|
| 33 |
+
return "Analyze finished ✅", resum, actions_ht, decisions_ht, md_path
|
| 34 |
|
| 35 |
with gr.Blocks(title="MeetingNotes AI") as demo:
|
| 36 |
gr.Markdown("# MeetingNotes AI")
|
| 37 |
+
gr.Markdown("Upload an **audio** or **paste a transcript**, then clic **Analyze**.")
|
| 38 |
|
| 39 |
with gr.Row():
|
| 40 |
with gr.Column():
|
| 41 |
+
meeting_title = gr.Textbox(label="Title of the meeting", value="Launch product — Weekly")
|
| 42 |
audio = gr.Audio(label="Audio (mp3/wav)", sources=["upload"], type="filepath")
|
| 43 |
+
transcript = gr.Textbox(label="Transcript (optional if audio)", lines=10, placeholder="Paste here…")
|
| 44 |
+
btn = gr.Button("Analyze")
|
| 45 |
with gr.Column():
|
| 46 |
+
status = gr.Textbox(label="Statu")
|
| 47 |
+
resume = gr.Textbox(label="Sum up", lines=8)
|
| 48 |
+
actions = gr.HighlightedText(label="Action Points", combine_adjacent=True)
|
| 49 |
+
decisions = gr.HighlightedText(label="Decisions Taken", combine_adjacent=True)
|
| 50 |
+
files = gr.File(label="Download minutes.md")
|
| 51 |
|
| 52 |
btn.click(process, inputs=[audio, transcript, meeting_title], outputs=[status, resume, actions, decisions, files])
|
| 53 |
|