abhishekjoel commited on
Commit
6d0e017
·
verified ·
1 Parent(s): 090f602

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -10
app.py CHANGED
@@ -77,6 +77,16 @@ def generate_notes(text):
77
  )
78
  return response.choices[0].message.content.strip()
79
 
 
 
 
 
 
 
 
 
 
 
80
  # Main app
81
  def main():
82
  st.set_page_config(layout="wide")
@@ -132,18 +142,34 @@ def main():
132
  f"<p>{summary}</p>" +
133
  "</div>", unsafe_allow_html=True)
134
 
135
- st.markdown("### Learning Outcomes:")
136
- st.markdown("<div style='background-color: black; color: white; padding: 10px; border-radius: 5px;'>" +
137
- "<ul>" +
138
- "<li>Understand key points discussed in the lecture.</li>" +
139
- "<li>Be able to explain concepts with clarity.</li>" +
140
- "<li>Implement ideas in practical scenarios.</li>" +
141
- "</ul>" +
142
  "</div>", unsafe_allow_html=True)
143
 
144
- st.markdown("### Lecture Slides:")
145
- st.markdown("<div style='background-color: black; color: white; padding: 10px; border-radius: 5px;'>" +
146
- "<p>Click here to upload or access slides.</p>" +
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  "</div>", unsafe_allow_html=True)
148
 
149
  if __name__ == "__main__":
 
77
  )
78
  return response.choices[0].message.content.strip()
79
 
80
+ # Function to generate additional sections
81
+ def generate_section(title, text):
82
+ prompt = f"Generate a section titled '{title}' with 3-6 sentences based on the following text:\n\n{text}"
83
+ response = openai.ChatCompletion.create(
84
+ model='gpt-3.5-turbo',
85
+ messages=[{'role': 'user', 'content': prompt}],
86
+ max_tokens=500,
87
+ )
88
+ return response.choices[0].message.content.strip()
89
+
90
  # Main app
91
  def main():
92
  st.set_page_config(layout="wide")
 
142
  f"<p>{summary}</p>" +
143
  "</div>", unsafe_allow_html=True)
144
 
145
+ st.markdown("### Key Concepts:")
146
+ key_concepts = generate_section("Key Concepts", summary)
147
+ st.markdown(f"<div style='background-color: black; color: white; padding: 10px; border-radius: 5px;'>" +
148
+ f"<p>{key_concepts}</p>" +
 
 
 
149
  "</div>", unsafe_allow_html=True)
150
 
151
+ st.markdown("### Key Takeaways:")
152
+ key_takeaways = generate_section("Key Takeaways", summary)
153
+ st.markdown(f"<div style='background-color: black; color: white; padding: 10px; border-radius: 5px;'>" +
154
+ f"<p>{key_takeaways}</p>" +
155
+ "</div>", unsafe_allow_html=True)
156
+
157
+ st.markdown("### Case Studies/Examples:")
158
+ case_studies = generate_section("Case Studies/Examples", summary)
159
+ st.markdown(f"<div style='background-color: black; color: white; padding: 10px; border-radius: 5px;'>" +
160
+ f"<p>{case_studies}</p>" +
161
+ "</div>", unsafe_allow_html=True)
162
+
163
+ st.markdown("### Glossary:")
164
+ glossary = generate_section("Glossary", summary)
165
+ st.markdown(f"<div style='background-color: black; color: white; padding: 10px; border-radius: 5px;'>" +
166
+ f"<p>{glossary}</p>" +
167
+ "</div>", unsafe_allow_html=True)
168
+
169
+ st.markdown("### FAQs:")
170
+ faqs = generate_section("FAQs", summary)
171
+ st.markdown(f"<div style='background-color: black; color: white; padding: 10px; border-radius: 5px;'>" +
172
+ f"<p>{faqs}</p>" +
173
  "</div>", unsafe_allow_html=True)
174
 
175
  if __name__ == "__main__":