How to Summarize Earnings Calls Using ChatGPT's API
Earnings conference calls can be quite lengthy, and in certain cases, they can be as long as 2 hours or more. Due to the proliferation of Large Language Models (LLMs), new use cases have opened up that were previously not possible to do in an automated fashion. LLMs can be used to summarize large documents, and Earnings Call Transcripts are a prime use-case.
In this article, we will go over how to use the EarningsCall Library to download an Earnings Call Transcript, then to summarize the transcript using the ChatGPT Library. We will use the Python language, and we assume you have a basic knowledge of how to run Python scripts. You should already have a Python interpreter installed locally (at least Python 3.8+
) and pip
.
First, install the required dependencies.
Install OpenAI Python Library:
pip install --upgrade openai
Install the EarningsCall Python Library:
pip install --upgrade earningscall
Next, let’s construct a prompt to tell ChatGPT to summarize our text. We can create a helper-function to be able to summarize any piece of text. The function will inject the input_text into the summarization prompt.
from openai import OpenAI
client = OpenAI(api_key="YOUR SECRET OPENAI API KEY")
def generate_summary_and_sentiment(input_text: str):
summarization_prompt = f"""Summarize the following text:
{input_text}
Summary:
"""
completion = client.chat.completions.create(
model="gpt-4o",
messages=[
{
"role": "system",
"content": "You are an assistant that is able to read a piece of text and summarize it.",
},
{
"role": "user",
"content": summarization_prompt,
}
]
)
summary_text = " ".join([choice.message.content for choice in completion.choices])
return summary_text
Next, we need to retrieve the input text. We’ll use Apple’s Q1 2024 Earnings Conference Call. We can use the EarningsCall Python library to retrieve the Transcript Text:
from earningscall import get_company
company = get_company("aapl") # Lookup Apple, Inc by its ticker symbol, "AAPL"
transcript = company.get_transcript(year=2024, quarter=1)
print(f"{company} Q1 2024 Transcript Text: \"{transcript.text[:100]}...\"\n")
Next, we’ll pass the input text into our function to generate the summary:
result = generate_summary_and_sentiment(transcript.text)
print(f"Generated Summary : \"{result}\"")
The resulting output is as follows:
Input Transcript Text : Apple Inc. Q1 2024 Transcript Text: "Good day, and welcome to the Apple Q1 Fiscal Year 2024 Earnings Conference Call. Today's call is bei..."
Generated Summary : "Summary:
The Apple Q1 Fiscal Year 2024 Earnings Conference Call discussed the company's financial results for the December quarter, which included 13 weeks, one less than the previous year. Key points from the call included:
1. **Financial Performance:**
- Apple reported $119.6 billion in revenue for the December quarter, a 2% increase year-over-year.
- Earnings per share (EPS) were $2.18, up 16% from the prior year.
- All-time revenue records were set in multiple regions including Europe and Asia Pacific, with strong growth in emerging markets.
2. **Product and Services Highlights:**
- The iPhone generated $69.7 billion in revenue, a 6% increase year-over-year. The iPhone 15 lineup was well-received, with high customer satisfaction of 99%.
- The Mac had revenue of $7.8 billion, up 1% year-over-year, driven by the new M3-powered MacBook Pro models.
- iPad revenue was $7 billion, down 25% year-over-year.
- Wearables, Home, and Accessories revenue was $12 billion, down 11% year-over-year.
- Services revenue reached an all-time high of $23.1 billion, an 11% increase year-over-year, driven by areas like advertising, cloud services, and AppleCare.
3. **New Product Launches:**
- Apple Vision Pro will be available in U.S. stores, expanding to other countries later in the year. This new device is expected to unlock incredible user experiences with its advanced features.
4. **Market and Customer Insights:**
- Apple is seeing significant growth in emerging markets with double-digit growth in countries like India, Indonesia, and Mexico.
- The installed base has now surpassed 2.2 billion active devices, indicating strong customer loyalty and satisfaction.
- The company also expects to continue investing heavily in artificial intelligence and other future-shaping technologies.
5. **Outlook and Guidance:**
- For the March quarter, Apple expects both total company revenue and iPhone revenue to be similar to the same period last year, acknowledging difficult comparisons due to supply constraints from the previous year.
- Apple forecasts gross margin between 46% and 47%, with operating expenses between $14.3 and $14.5 billion.
6. **Strategic and Operational Update:**
- Apple is committed to environmental goals, aiming for 100% carbon neutrality by 2030 and continues to invest in clean energy.
- Efforts are being made to address new regulations in Europe with changes such as alternate billing and app store options.
The call concluded with a Q&A session where analysts asked about services growth, the impact of new regulations, and the potential of Vision Pro and AI in Apple’s future strategy."
Conclusion
Chat GPT’s latest model, GPT-4o
shows some impressive results. It’s able to generate a bulleted list summarizing some of the key points that were covered during the entire text. I have tried some previous models, and have not seen it do this. In particular, gpt-3.5-turbo
did not return bulleted lists.
For the full code, please visit the earnings-call-analysis summarization 👨💻.