File size: 1,477 Bytes
9b23edc
e5d260a
 
9b23edc
e5d260a
 
 
9b23edc
 
 
e5d260a
9b23edc
e5d260a
9b23edc
 
 
e5d260a
9b23edc
e5d260a
9b23edc
e5d260a
9b23edc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e5d260a
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
# 3rd party - located in requirements.txt
import streamlit as st
# local
import summarizer

st.set_page_config(page_title='Transcript Notetaker', page_icon=':memo:', layout='wide')

# App Content
'''
# Transcript Notetaker

Upload a transcript of a Google Meet call and this app will use the OpenAI API to generate detailed notes for the meeting.

_This program was designed to work with the transcript documents automatically generated by Google Meet meetings, using 
transcripts with a different format may result in unexpected behavior._  
'''

api_key = st.text_input("Enter your OpenAI API key", type='password')

uploaded_file = st.file_uploader('Upload your Transcript', type='.txt')

if api_key and uploaded_file:
    create_notes_button_disabled = False
    create_notes_button_help = ''
else:
    create_notes_button_disabled = True
    create_notes_button_help = "Enter your API key and upload a file to continue"

button_create_notes = st.button("Create Notes", disabled=create_notes_button_disabled, help=create_notes_button_help)

meeting_notes = None

if button_create_notes:

    header, transcript = summarizer.load_transcript(uploaded_file)

    chunks = summarizer.chunk_transcript(transcript)

    summaries = summarizer.summarize_chunks(chunks, api_key)

    meeting_notes = summarizer.format_notes(summaries, header)

if meeting_notes:
    st.divider()

    st.download_button("Download Notes", meeting_notes, "notes.md")

    st.markdown(meeting_notes)