Case Study
In this lab, you will act as a forensic analyst. You must process unstructured MD&A data from 2024 and 2025 to detect shifts in corporate tone regarding AI implementation and supply chain risks using the Bag of Words technique.
Financial reports are composed of 80% unstructured text. Natural Language Processing (NLP) allows auditors to quantify qualitative risk disclosures that traditional financial ratios might miss.
Computers cannot "read" paragraphs like humans do. Tokenization is the process of breaking a text stream into meaningful elements called tokens. In accounting, this transforms unstructured MD&A text into structured rows of data that can be analyzed.
Common words (e.g., "the", "and", "is", "at") appear frequently but carry no financial sentiment. These are called Stop Words. We filter them out to increase the "signal-to-noise" ratio, allowing us to focus on words that impact value (e.g., "loss", "gain", "risk").
The Bag of Words model simplifies text by disregarding grammar and word order, treating the document as a "bag" of tokens. We simply count the frequency of positive vs. negative words against a domain-specific dictionary (like Loughran-McDonald).
1. The Text
"The innovative strategy improved profits, though litigation risks remain."
2. Dictionary Match
| innovative | Positive Word |
| improved | Positive Word |
| litigation | Negative Word |
| strategy/risks | Neutral (Ignore) |
3. The Formula
Result: Moderately Optimistic
Click analyze to process this sample sentence using the dictionary above.
Financial Sentiment: Authors Tim Loughran and Bill McDonald (Notre Dame) revolutionized the field by creating a domain-specific dictionary for accounting. They noted that words like 'liability' are negative in standard English but neutral in financial statements.
Social Media: Early research used Yahoo forums, while recent studies focus on Twitter and StockTwits. Twitter provides instantaneous information, such as predicting stock market reactions to FOMC meetings based on tweet sentiment. Researchers have found that while social media represents a small percentage of traders, its sentiment (especially negative) significantly impacts market liquidity.
Political Bias: Textual analysis is used to measure partisan differences in the speech of U.S. Congress members and financial regulators. For example, SEC Commissioners have shown an increasing trend in partisan language since the mid-1970s.
Fraud Detection: Specific vocabulary choices and topics in MD&A sections of 10-K filings can help predict accounting fraud. Managers committing fraud often disassociate their names from deceptive plans and may unintentionally transfer linguistic cues from fraudulent memos into their reports.
Copy the text blocks below into Excel or Power BI as your raw corpus. Detailed data processing steps are located in Part 4.
Loughran-McDonald Financial Sentiment (Subset)
The full dictionary is accessible through the Loughran-McDonald Master Dictionary website.
| Word | Sentiment |
|---|
Create an Excel table. Column A (ID): Manually type "Apex 2025" (or 2024). Column B (Text): Paste the copied MD&A data.
Before splitting:
. , " ') and replace with (empty) to clean the text.
Right-click [MD&A Text] → Split Column → By Delimiter (Space).
Important: Expand 'Advanced Options' and select Split into Rows. Finally, transform the column to Lowercase and Trim.
Perform a Merge between Token Table (Left) and Dictionary (Right). Use Left Outer Join. Expand [Sentiment]. Filter out null rows.
([Positive] - [Negative]) / ([Positive] + [Negative])Score Logic: (15 Positive - 1 Negative) / 16 Total = 0.875
Dominant Tokens: Efficiency, Opportunity, Innovation, Enhancement, Lucrative.
Interpretation: Management is signaling successful restructuring and AI integration.
Score Logic: (0 Positive - 15 Negative) / 15 Total = -1.00
Dominant Tokens: Volatility, Decline, Burden, Loss, Litigation, Uncertainty.
Interpretation: Clear indicators of financial distress and macro-economic pressure.
While the sentiment score accurately captures the shift in tone, standard dictionaries like Loughran-McDonald do not yet include terms like "AI" or "Autonomous". An advanced analysis would require a custom dictionary to capture the positive sentiment associated with these specific technological investments.