Tune the temperature

Temperature is a configurable parameter that controls the randomness of the text output generated by the platform . This parameter ranges from 0 to 1, inclusive, and the default value is 0.2. A higher value generates more creative text, while a lower value produces more deterministic text output.

Common use cases include:

  • Writers: Choose a higher temperature when seeking inspiration or a lower temperature for factual or technical writing.
  • Marketing professionals: Choose a higher temperature to generate more unique and eye-catching content.
  • Educators and students: Choose a lower temperature for summarizing educational content or a higher temperature for more engaging results.
  • Law enforcement and security: Choose a lower temperature for generating factual reports, such as creating detailed and accurate police reports based on video evidence or drafting documents where precision is important.
  • Meeting facilitators: Choose a lower temperature for taking accurate and concise meeting minutes. This setting helps capture key points, decisions, and action items.

Prerequisites

  • You’ve already uploaded a video and created an asset. For details, see the Analyze videos guide.

Example

The example code below demonstrates setting the value of the temperature parameter to 0.1 in the body of the request for this video: Tim Urban: Inside the mind of a master procrastinator | TED. This results in a more deterministic result than the default settings.

1from twelvelabs import TwelveLabs
2from twelvelabs.types import VideoContext_AssetId
3
4client = TwelveLabs(api_key="<YOUR_API_KEY>")
5
6res = client.analyze(
7 video=VideoContext_AssetId(asset_id="<YOUR_ASSET_ID>"),
8 prompt="I want to generate a description for my video with the following format: Title of the video, followed by a summary in 2-3 sentences, highlighting the main topic, key events, and concluding remarks.",
9 temperature=0.1,
10)
11print(f"Generated text: {res.data}")

Below are the three responses, with bold representing content that appears across all three, and italics denoting content that is unique to each response or contradicts the others.

Title: TEDx Talk - The Art of Procrastination\

Summary: In this TEDx talkthe speaker delves into the topic of procrastinationsharing insights into the origins of this human behavior and its psychological implicationsThe speaker uses vivid storytelling, humor, and relatable examples to engage the audience and encourage them to reevaluate their relationship with procrastinationThe talk concludes with a call to action for viewers to recognize the role of the “instant gratification monkey” in their lives and take steps towards overcoming their procrastination habits.
The video opens with the speaker sharing his personal experience of procrastination, starting from his college days when he had to write a 90-page thesis. He describes how he came up with a plan to spread the work out evenly, but ended up procrastinating and having to write the entire thesis in just a few days before the deadline. The speaker then discusses the concept of short-term and long-term procrastination, explaining how the latter can be more insidious as it often goes unnoticed and can lead to significant regret over missed opportunities.
The speaker then introduces the idea of the “instant gratification monkey,” *which is the part of our brain that seeks pleasure and avoids pain in the present moment. He shares that this monkey can cause us to delay important tasks and instead engage in activities that provide immediate satisfaction, such as browsing social media or watching TV. However,*the speaker emphasizes that this behavior can lead to feelings of guilt, anxiety, and regret in the long term.
To illustrate the concept further, the speaker uses the analogy of a life calendar, emphasizing that each week of a 90-year life represents only one box. He encourages viewers to think about what they are truly procrastinating on and to be aware of the instant gratification monkeyas everyone experiences it to some degreeThe speaker concludes his talk by thanking the audience for their attention and encouraging them to start addressing their procrastination habits sooner rather than later.
Throughout the talk, the speaker uses body language, facial expressions, and hand gestures to engage the audience and emphasize key points. He also uses visual aidssuch as the life calendar and a blank gridto illustrate his conceptsThe audience is attentively listening and responding positively to the speaker’s messageas evidenced by their nodding and applauseOverall, this TEDx talk provides valuable insights into the psychology of procrastination and offers practical advice for overcoming it.