AhmadMustafa commited on
Commit
dd57ac1
·
1 Parent(s): e22ec09

update: si prompt

Browse files
Files changed (1) hide show
  1. app.py +33 -15
app.py CHANGED
@@ -339,21 +339,39 @@ def get_initial_analysis(
339
 
340
  if ct == "si": # street interview
341
  prompt = f"""This is a transcript for a street interview. Transcript: {transcript}
342
- In this street interview, the host asks multiple questions to the interviewees.
343
- The interviewee can repeat a single answer multiple time to get the best take.
344
- Your job is to find out the timestamp of the best answer given by the interviewee (Do not include the Question timestamp by interviwer in this). If there are multiple attempts for a question, best part is the last part of the question. If no question was asked but something is repeated, please include that in the answer as well.
345
- Even if the answer is scattered across the transcript, the last occurence of the topic is the best answer for that topic.
346
- The way to know if there are multiple takes to a question is to see in the transcript if the same text is repeated, If not then number of takes is 1.
347
- Question 1 should always be the introduction if the speaker has introduced themselves to find the best introduction time (Last timestamp is the best timestamp), Rest of questions should be in the order they were asked.
348
- Return format is:
349
- 1. Question Title
350
- Total takes: (Only include this if Number of takes is > 1 otherwise ignore it.)
351
- [Best Answer: start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}}"').
352
- For Example:
353
- If the start time is 10:13 and end time is 10:18, the url will be:
354
- {link_start}://roll.ai/colab/1234aq_12314/51234151?st=613&et=618
355
- In the URL, make sure that after RSID there is ? and then rest of the fields are added via &. Keep the answer less verbose and to the point.
356
- """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  else:
358
  prompt = f"""Given the transcript {transcript}, For All the speakers, short list all people, news, events, trends, and source that are discussed by speakers along with the start time of that topic and end time of that topic from the transcript. Rank all topics based on what would make for the best social clips. I need atleast 3 topics per speaker.
359
  You should mention the Speaker Name first, then atleast 3 posts with their timestamps, and so on.
 
339
 
340
  if ct == "si": # street interview
341
  prompt = f"""This is a transcript for a street interview. Transcript: {transcript}
342
+
343
+ Your task is to analyze this street interview transcript and identify the final/best timestamps for each topic or question discussed. Here are the key rules:
344
+
345
+ 1. For any topic/answer that appears multiple times in the transcript (even partially):
346
+ - The LAST occurrence is always considered the best version
347
+ - This includes cases where parts of an answer are scattered throughout the transcript
348
+ - Even slight variations of the same answer should be tracked
349
+
350
+ 2. Introduction handling:
351
+ - Question 1 is ALWAYS the speaker's introduction/self-introduction
352
+ - If someone introduces themselves multiple times, use the last timestamp
353
+ - Include all variations of how they state their name/background
354
+
355
+ 3. Question sequence:
356
+ - After the introduction, list questions in the order they were first asked
357
+ - If a question is revisited later, use the later timestamp
358
+ - Track partial answers to the same question across the transcript
359
+
360
+ Return format:
361
+
362
+ [Question Title]
363
+ Total takes: [X] (Include ONLY if content appears more than once)
364
+ [Best Answer: start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}})
365
+
366
+ URL formatting:
367
+ - Convert timestamps to seconds (e.g., 10:13 → 613)
368
+ - Format: {link_start}://[origin]/colab/[cid]/[rsid]?st=[start_seconds]&et=[end_seconds]
369
+ - Parameters after RSID must start with ? and subsequent parameters use &
370
+
371
+ Example:
372
+ 1. Introduction
373
+ Total takes: 2
374
+ [Best Answer: 10:13 - 10:18]({link_start}://roll.ai/colab/1234aq_12314/51234151?st=613&et=618)"""
375
  else:
376
  prompt = f"""Given the transcript {transcript}, For All the speakers, short list all people, news, events, trends, and source that are discussed by speakers along with the start time of that topic and end time of that topic from the transcript. Rank all topics based on what would make for the best social clips. I need atleast 3 topics per speaker.
377
  You should mention the Speaker Name first, then atleast 3 posts with their timestamps, and so on.