stcoats
commited on
Commit
·
5fde344
1
Parent(s):
a31425b
Add application file
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ query = st.text_input("Search text (case-insensitive)", "").strip()
|
|
42 |
|
43 |
if query:
|
44 |
sql = """
|
45 |
-
SELECT channel,
|
46 |
FROM data
|
47 |
WHERE LOWER(text) LIKE LOWER(?)
|
48 |
LIMIT 100
|
@@ -50,8 +50,8 @@ if query:
|
|
50 |
df = con.execute(sql, [f"%{query}%"]).df()
|
51 |
else:
|
52 |
df = con.execute("""
|
53 |
-
SELECT channel,
|
54 |
-
FROM data
|
55 |
LIMIT 100
|
56 |
""").df()
|
57 |
|
@@ -64,11 +64,14 @@ if len(df) == 0:
|
|
64 |
for i, row in df.iterrows():
|
65 |
col1, col2, col3 = st.columns([3, 5, 2])
|
66 |
|
|
|
67 |
col1.markdown(f"**Channel:** {row['channel']}")
|
68 |
-
col1.markdown(f"**
|
|
|
69 |
col1.markdown(f"**Speaker:** {row['speaker']}")
|
70 |
col1.markdown(f"**Start Time:** {row['start_time']}")
|
71 |
col1.markdown(f"**End Time:** {row['end_time']}")
|
|
|
72 |
|
73 |
highlighted_text = row['text']
|
74 |
if query:
|
|
|
42 |
|
43 |
if query:
|
44 |
sql = """
|
45 |
+
SELECT id, channel, video_id, video_title, speaker, start_time, end_time, text, pos_tags, upload_date, audio
|
46 |
FROM data
|
47 |
WHERE LOWER(text) LIKE LOWER(?)
|
48 |
LIMIT 100
|
|
|
50 |
df = con.execute(sql, [f"%{query}%"]).df()
|
51 |
else:
|
52 |
df = con.execute("""
|
53 |
+
SELECT id, channel, video_id, video_title, speaker, start_time, end_time, text, pos_tags, upload_date, audio
|
54 |
+
FROM data
|
55 |
LIMIT 100
|
56 |
""").df()
|
57 |
|
|
|
64 |
for i, row in df.iterrows():
|
65 |
col1, col2, col3 = st.columns([3, 5, 2])
|
66 |
|
67 |
+
col1.markdown(f"**ID:** {row['id']}")
|
68 |
col1.markdown(f"**Channel:** {row['channel']}")
|
69 |
+
col1.markdown(f"**Video ID:** {row['video_id']}")
|
70 |
+
col1.markdown(f"**Video Title:** {row['video_title']}")
|
71 |
col1.markdown(f"**Speaker:** {row['speaker']}")
|
72 |
col1.markdown(f"**Start Time:** {row['start_time']}")
|
73 |
col1.markdown(f"**End Time:** {row['end_time']}")
|
74 |
+
col1.markdown(f"**Upload Date:** {row['upload_date']}")
|
75 |
|
76 |
highlighted_text = row['text']
|
77 |
if query:
|