Skip to content

Commit

Permalink
added improved prompts for better consistent results
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashish-Abraham committed Nov 5, 2024
1 parent a3c23fb commit 570371e
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions examples/video_summarization/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,19 @@ def classify_meeting_intent(speech: Transcription) -> Transcription:
)
transcription_text = "\n".join([segment.text for segment in speech.segments])
prompt = f"""
Classify the intent of the audio. Possible intents:
Analyze the audio transcript and classify the intent of the audio FROM THE FOLLOWING OPTIONS ONLY:
- job-interview
- sales-call
- customer-support-call
- technical-support-call
- marketing-call
- product-call
- financial-call
Format: intent: <intent>
Required Output Format: intent: <intent>
Transcription:
{transcription_text}
DO NOT ATTATCH ANY OTHER PHRASES,* symbols OR ANNOTATIONS WITH THE OUTPUT! Provide ONLY the intent in the required format.
"""
output = model(prompt=prompt, max_tokens=50, stop=["\n"])
response = output["choices"][0]["text"]
Expand Down Expand Up @@ -136,15 +137,16 @@ def summarize_job_interview(speech: Transcription) -> Summary:
)
transcription_text = "\n".join([segment.text for segment in speech.segments])
prompt = f"""
Summarize the key points from this job interview transcript, including:
Analyze this job interview transcript and summarize the key points in the below format ONLY:
1. Candidate's Strengths and Qualifications
2. Key Responses and Insights
3. Cultural Fit and Soft Skills
4. Areas of Concern or Improvement
5. Overall Impression and Recommendation
Transcript:
{transcription_text}
{transcription_text[:1000]}
DO NOT ATTATCH ANY OTHER PHRASES,* symbols OR ANNOTATIONS WITH THE OUTPUT!
"""
output = model(prompt=prompt, max_tokens=30000, stop=["\n"])
return Summary(summary=output["choices"][0]["text"])
Expand All @@ -161,15 +163,16 @@ def summarize_sales_call(speech: Transcription) -> Summary:
)
transcription_text = "\n".join([segment.text for segment in speech.segments])
prompt = f"""
Summarize this sales call transcript, highlighting:
- Key details
- Client concerns
- Action items
- Next steps
- Recommendations for improving the approach
Analyze this sales call transcript and summarize in the below format ONLY:
1. Key details
2. Client concerns
3. Action items
4. Next steps
5. Recommendations for improving the approach
Transcript:
{transcription_text}
DO NOT ATTATCH ANY OTHER PHRASES,* symbols OR ANNOTATIONS WITH THE OUTPUT!
"""
output = model(prompt=prompt, max_tokens=30000, stop=["\n"])
return Summary(summary=output["choices"][0]["text"])
Expand Down

0 comments on commit 570371e

Please sign in to comment.