File size: 64,671 Bytes
29c5704
b3301a4
37fc349
47f38d5
37fc349
 
b3301a4
37fc349
47f38d5
37fc349
062e6a2
b9a198e
47f38d5
b9a198e
47f38d5
 
 
b9a198e
 
 
 
 
 
37fc349
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b9a198e
37fc349
 
 
 
aa47040
6469f49
 
37fc349
 
 
ffe7a35
37fc349
 
 
6469f49
 
 
37fc349
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b9a198e
 
215e416
aa47040
b9a198e
37fc349
 
567a866
37fc349
dcabcbb
286dd08
 
37fc349
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
645c754
e483bf1
37fc349
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e483bf1
71e2445
b9a198e
37fc349
71e2445
37fc349
 
 
 
e483bf1
 
 
 
 
 
 
 
37fc349
29c5704
 
7af1a44
 
a11ee17
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import gradio
import torch

from transformers import pipeline
from transformers import BertForSequenceClassification, BertTokenizer


tokenizer = BertTokenizer.from_pretrained('ProsusAI/finbert')

model = BertForSequenceClassification.from_pretrained('ProsusAI/finbert')

summarizer = pipeline('summarization', model='t5-base')

classifier_emotions = ['positive', 'neutral', 'negative']
# classifier_model_name = 'bhadresh-savani/distilbert-base-uncased-emotion'
# classifier_emotions = ['anger', 'disgust', 'fear', 'joy', 'sadness', 'surprise']

def summarize_sentences(sentences_by_emotion, min_length, max_length):
    for k in sentences_by_emotion.keys():
        if (len(sentences_by_emotion[k])!=0):
            text = ' '.join(sentences_by_emotion[k])
            summary = summarizer(text, min_length=min_length, max_length=max_length)
            print(f"{k.upper()}: {summary[0]['summary_text']}\n")


def chunk_text_to_window_size_and_predict_proba(input_ids, attention_mask, total_len):
    """
    This function splits the given input text into chunks of a specified window length, 
    applies transformer model to each chunk and computes probabilities of each class for each chunk. 
    The computed probabilities are then appended to a list.

    Args:
        input_ids (List[int]): List of token ids representing the input text.
        attention_mask (List[int]): List of attention masks corresponding to input_ids.
        total_len (int): Total length of the input_ids.

    Returns:
        proba_list (List[torch.Tensor]): List of probability tensors for each chunk.
    """
    proba_list = []

    start = 0
    window_length = 510
    
    loop = True
    count = 1
    print(f'Total Length: {total_len}')
    
    while loop:
        end = start  + window_length
        # If the end index exceeds total length, set the flag to False and adjust the end index
        if (end >= total_len) or (count >= 25):
            loop = False
            end = total_len

        print(f'Start: {start}')
        print(f'End: {end}')
    
        # 1 => Define the text chunk
        input_ids_chunk = input_ids[start : end]
        attention_mask_chunk = attention_mask[start : end]
        
        # 2 => Append [CLS] and [SEP]
        input_ids_chunk = [101] + input_ids_chunk + [102]
        attention_mask_chunk = [1] + attention_mask_chunk + [1]
        
        #3 Convert regular python list to Pytorch Tensor
        input_dict = {
            'input_ids' : torch.Tensor([input_ids_chunk]).long(),
            'attention_mask' : torch.Tensor([attention_mask_chunk]).int()
        }
        
        outputs = model(**input_dict)

        decoded = tokenizer.decode(input_ids_chunk)
        print(f'Loop Count: {count}')
        count = count + 1
        print("########:", decoded , ":##############")
        
        probabilities = torch.nn.functional.softmax(outputs[0], dim = -1)
        print("########:", probabilities , ":##############")
        proba_list.append(probabilities)
        start = end
    
    return proba_list

def get_mean_from_proba(proba_list):
    """
    This function computes the mean probabilities of class predictions over all the chunks.

    Args:
        proba_list (List[torch.Tensor]): List of probability tensors for each chunk.

    Returns:
        mean (torch.Tensor): Mean of the probabilities across all chunks.
    """
    
    # Ensures that gradients are not computed, saving memory
    with torch.no_grad():
        # Stack the list of tensors into a single tensor
        stacks = torch.stack(proba_list)

        # Resize the tensor to match the dimensions needed for mean computation
        stacks = stacks.resize(stacks.shape[0], stacks.shape[2])

        # Compute the mean along the zeroth dimension (i.e., the chunk dimension)
        mean = stacks.mean(dim = 0)
        
    return mean


def my_inference_function(sec_text):
    txt = """
    UNITED STATES SECURITIES AND EXCHANGE COMMISSION Washington, D.C. 20549 FORM 10-Q (Mark One) ☒ QUARTERLY REPORT PURSUANT TO SECTION 13 OR 15(d) OF THE SECURITIES EXCHANGE ACT OF 1934 For the quarterly period ended April 1, 2023 or ☐ TRANSITION REPORT PURSUANT TO SECTION 13 OR 15(d) OF THE SECURITIES EXCHANGE ACT OF 1934 For the transition period from to . Commission File Number: 001-36743 Apple Inc. (Exact name of Registrant as specified in its charter) California 94-2404110 (State or other jurisdictionof incorporation or organization) (I.R.S. Employer Identification No.) One Apple Park Way Cupertino, California 95014 (Address of principal executive offices) (Zip Code) (408) 996-1010 (Registrant’s telephone number, including area code) Securities registered pursuant to Section 12(b) of the Act: Title of each class Trading symbol(s) Name of each exchange on which registered Common Stock, $0.00001 par value per share AAPL The Nasdaq Stock Market LLC 1.375% Notes due 2024 The Nasdaq Stock Market LLC 0.000% Notes due 2025 The Nasdaq Stock Market LLC 0.875% Notes due 2025 The Nasdaq Stock Market LLC 1.625% Notes due 2026 The Nasdaq Stock Market LLC 2.000% Notes due 2027 
    The Nasdaq Stock Market LLC 1.375% Notes due 2029 The Nasdaq Stock Market LLC 3.050% Notes due 2029 The Nasdaq Stock Market LLC 0.500% Notes due 2031 The Nasdaq Stock Market LLC 3.600% Notes due 2042 The Nasdaq Stock Market LLC Indicate by check mark whether the Registrant (1) has filed all reports required to be filed by Section 13 or 15(d) of the Securities Exchange Act of 1934 during the preceding 12 months (or for such shorter period that the Registrant was required to file such reports), and (2) has been subject to such filing requirements for the past 90 days. Yes ☒ No ☐ Indicate by check mark whether the Registrant has submitted electronically every Interactive Data File required to be submitted pursuant to Rule 405 of Regulation S-T (§232.405 of this chapter) during the preceding 12 months (or for such shorter period that the Registrant was required to submit such files). Yes ☒ No ☐ Indicate by check mark whether the Registrant is a large accelerated filer, an accelerated filer, a non-accelerated filer, a smaller reporting company, or an emerging growth company. See the definitions of “large accelerated filer,” “accelerated filer,” “smaller reporting company,” and “emerging growth company” in Rule 12b-2 of the Exchange Act. 
    Large accelerated filer ☒ Accelerated filer ☐ Non-accelerated filer ☐ Smaller reporting company ☐ Emerging growth company ☐ If an emerging growth company, indicate by check mark if the Registrant has elected not to use the extended transition period for complying with any new or revised financial accounting standards provided pursuant to Section 13(a) of the Exchange Act. ☐ Indicate by check mark whether the Registrant is a shell company (as defined in Rule 12b-2 of the Exchange Act). Yes ☐ No ☒ 15,728,702,000 shares of common stock were issued and outstanding as of April 21, 2023. Apple Inc. Form 10-Q For the Fiscal Quarter Ended April 1, 2023 TABLE OF CONTENTS Page Part I Item 1. Financial Statements Item 2. Management’s Discussion and Analysis of Financial Condition and Results of Operations 14 Item 3. Quantitative and Qualitative Disclosures About Market Risk 19 Item 4. Controls and Procedures 19 Part II Item 1. Legal Proceedings 20 Item 1A. Risk Factors 20 Item 2. Unregistered Sales of Equity Securities and Use of Proceeds 20 Item 3. Defaults Upon Senior Securities 21 Item 4. Mine Safety Disclosures 21 Item 5. Other Information 21 Item 6. Exhibits 21 
    PART I — FINANCIAL INFORMATION Item 1. Financial Statements Apple Inc. CONDENSED CONSOLIDATED STATEMENTS OF OPERATIONS (Unaudited) (In millions, except number of shares which are reflected in thousands and per share amounts) Three Months Ended Six Months Ended April 1,2023 March 26,2022 April 1,2023 March 26,2022 Net sales: Products $ 73,929 $ 77,457 $ 170,317 $ 181,886 Services 20,907 19,821 41,673 39,337 Total net sales 94,836 97,278 211,990 221,223 Cost of sales: Products 46,795 49,290 107,560 113,599 Services 6,065 5,429 12,122 10,822 Total cost of sales 52,860 54,719 119,682 124,421 Gross margin 41,976 42,559 92,308 96,802 Operating expenses: Research and development 7,457 6,387 15,166 12,693 Selling, general and administrative 6,201 6,193 12,808 12,642 Total operating expenses 13,658 12,580 27,974 25,335 Operating income 28,318 29,979 64,334 71,467 Other income/(expense), net 64 160 (329) (87) Income before provision for income taxes 28,382 30,139 64,005 71,380 Provision for income taxes 4,222 5,129 9,847 11,740 Net income $ 24,160 $ 25,010 $ 54,158 $ 59,640 Earnings per share: Basic $ 1.53 $ 1.54 $ 3.42 $ 3.65 Diluted $ 1.52 $ 1.52 $ 3.41 $ 3.62 Shares used in computing earnings per share: Basic 15,787,154 16,278,802 15,839,939 16,335,263 Diluted 15,847,050 16,403,316 15,901,384 16,461,304 See accompanying Notes to Condensed Consolidated Financial Statements. Apple Inc. | Q2 2023 Form 10-Q | 1 Apple Inc. CONDENSED CONSOLIDATED STATEMENTS OF COMPREHENSIVE INCOME (Unaudited) (In millions) Three Months Ended Six Months Ended April 1,2023 March 26,2022 April 1,2023 March 26,2022 Net income $ 24,160 $ 25,010 $ 54,158 $ 59,640 Other comprehensive income/(loss): Change in foreign currency translation, net of tax (95) (21) (109) (381) Change in unrealized gains/losses on derivative instruments, net of tax: Change in fair value of derivative instruments (13) 334 (1,001) 696 Adjustment for net (gains)/losses realized and included in net income (191) (301) (1,957) (208) 
    Total change in unrealized gains/losses on derivative instruments (204) 33 (2,958) 488 Change in unrealized gains/losses on marketable debt securities, net of tax: Change in fair value of marketable debt securities 1,403 (5,633) 2,303 (6,809) Adjustment for net (gains)/losses realized and included in net income 62 54 127 45 Total change in unrealized gains/losses on marketable debt securities 1,465 (5,579) 2,430 (6,764) Total other comprehensive income/(loss) 1,166 (5,567) (637) (6,657) Total comprehensive income $ 25,326 $ 19,443 $ 53,521 $ 52,983 See accompanying Notes to Condensed Consolidated Financial Statements. Apple Inc. | Q2 2023 Form 10-Q | 2 Apple Inc. CONDENSED CONSOLIDATED BALANCE SHEETS (Unaudited) (In millions, except number of shares which are reflected in thousands and par value) April 1,2023 September 24,2022 ASSETS: Current assets: Cash and cash equivalents $ 24,687 $ 23,646 Marketable securities 31,185 24,658 Accounts receivable, net 17,936 28,184 Inventories 7,482 4,946 Vendor non-trade receivables 17,963 32,748 Other current assets 13,660 21,223 Total current assets 112,913 135,405 Non-current assets: Marketable securities 110,461 120,805 Property, plant and equipment, net 43,398 42,117 Other non-current assets 65,388 54,428 
    Total non-current assets 219,247 217,350 Total assets $ 332,160 $ 352,755 LIABILITIES AND SHAREHOLDERS’ EQUITY: Current liabilities: Accounts payable $ 42,945 $ 64,115 Other current liabilities 56,425 60,845 Deferred revenue 8,131 7,912 Commercial paper 1,996 9,982 Term debt 10,578 11,128 Total current liabilities 120,075 153,982 Non-current liabilities: Term debt 97,041 98,959 Other non-current liabilities 52,886 49,142 Total non-current liabilities 149,927 148,101 Total liabilities 270,002 302,083 Commitments and contingencies Shareholders’ equity: Common stock and additional paid-in capital, $0.00001 par value: 50,400,000 shares authorized; 15,723,406 and 15,943,425 shares issued and outstanding, respectively 69,568 64,849 Retained earnings/(Accumulated deficit) 4,336 (3,068) Accumulated other comprehensive income/(loss) (11,746) (11,109) Total shareholders’ equity 62,158 50,672 Total liabilities and shareholders’ equity $ 332,160 $ 352,755 See accompanying Notes to Condensed Consolidated Financial Statements. Apple Inc. | Q2 2023 Form 10-Q | 3 Apple Inc. CONDENSED CONSOLIDATED STATEMENTS OF SHAREHOLDERS’ EQUITY (Unaudited) (In millions, except per share amounts) Three Months Ended Six Months Ended April 1,2023 March 26,2022 April 1,2023 March 26,2022 Total shareholders’ equity, beginning balances $ 56,727 $ 71,932 $ 50,672 $ 63,090 Common stock and additional paid-in capital: Beginning balances 66,399 58,424 64,849 57,365 Common stock issued 690 593 690 593 Common stock withheld related to net share settlement of equity awards (281) (149) (1,715) (1,412) Share-based compensation 2,760 2,313 5,744 4,635 Ending balances 69,568 61,181 69,568 61,181 Retained earnings/(Accumulated deficit): 
    Beginning balances 3,240 14,435 (3,068) 5,562 Net income 24,160 25,010 54,158 59,640 Dividends and dividend equivalents declared (3,684) (3,633) (7,396) (7,298) Common stock withheld related to net share settlement of equity awards (152) (190) (1,130) (1,920) Common stock repurchased (19,228) (22,910) (38,228) (43,272) Ending balances 4,336 12,712 4,336 12,712 Accumulated other comprehensive income/(loss): Beginning balances (12,912) (927) (11,109) 163 Other comprehensive income/(loss) 1,166 (5,567) (637) (6,657) Ending balances (11,746) (6,494) (11,746) (6,494) Total shareholders’ equity, ending balances $ 62,158 $ 67,399 $ 62,158 $ 67,399 Dividends and dividend equivalents declared per share or RSU $ 0.23 $ 0.22 $ 0.46 $ 0.44 See accompanying Notes to Condensed Consolidated Financial Statements. Apple Inc. | Q2 2023 Form 10-Q | 4 Apple Inc. CONDENSED CONSOLIDATED STATEMENTS OF CASH FLOWS (Unaudited) (In millions) Six Months Ended April 1,2023 March 26,2022 Cash, cash equivalents and restricted cash, beginning balances $ 24,977 $ 35,929 Operating activities: Net income 54,158 59,640 Adjustments to reconcile net income to cash generated by operating activities: Depreciation and amortization 5,814 5,434 Share-based compensation expense 5,591 4,517 Other (1,732) 1,068 Changes in operating assets and liabilities: Accounts receivable, net 9,596 5,542 Inventories (2,548) 1,065 Vendor non-trade receivables 14,785 643 Other current and non-current assets (4,092) (3,542) Accounts payable (20,764) (1,750) Other current and non-current liabilities 1,757 2,515 Cash generated by operating activities 62,565 75,132 Investing activities: Purchases of marketable securities (11,197) (61,987) Proceeds from maturities of marketable securities 17,124 18,000 Proceeds from sales of marketable securities 1,897 24,668 Payments for acquisition of property, plant and equipment (6,703) (5,317) Other (247) (735) Cash generated by/(used in) investing activities 874 (25,371) Financing activities: Payments for taxes related to net share settlement of equity awards (2,734) (3,218) 
    Payments for dividends and dividend equivalents (7,418) (7,327) Repurchases of common stock (39,069) (43,109) Repayments of term debt (3,651) (3,750) Proceeds from/(Repayments of) commercial paper, net (7,960) 999 Other (455) (105) Cash used in financing activities (61,287) (56,510) Increase/(Decrease) in cash, cash equivalents and restricted cash 2,152 (6,749) Cash, cash equivalents and restricted cash, ending balances $ 27,129 $ 29,180 Supplemental cash flow disclosure: Cash paid for income taxes, net $ 4,894 $ 9,301 Cash paid for interest $ 1,873 $ 1,406 See accompanying Notes to Condensed Consolidated Financial Statements. Apple Inc. | Q2 2023 Form 10-Q | 5 Apple Inc. Notes to Condensed Consolidated Financial Statements (Unaudited) Note 1 – Summary of Significant Accounting Policies Basis of Presentation and Preparation The condensed consolidated financial statements include the accounts of Apple Inc. and its wholly owned subsidiaries (collectively “Apple” or the “Company”). Intercompany accounts and transactions have been eliminated. In the opinion of the Company’s management, the condensed consolidated financial statements reflect all adjustments, which are normal and recurring in nature, necessary for fair financial statement presentation. The preparation of these condensed consolidated financial statements and accompanying notes in conformity with U.S. generally accepted accounting principles requires management to make estimates and assumptions that affect the amounts reported. Actual results could differ materially from those estimates. Certain prior period amounts in the condensed consolidated financial statements and accompanying notes have been reclassified to conform to the current period’s presentation. These condensed consolidated financial statements and accompanying notes should be read in conjunction with the Company’s annual consolidated financial statements and accompanying notes included in its Annual Report on Form 10-K for the fiscal year ended September 24, 2022. The Company’s fiscal year is the 52- or 53-week period that ends on the last Saturday of September. An additional week is included in the first fiscal quarter every five or six years to realign the Company’s fiscal quarters with calendar quarters, which occurred in the first fiscal quarter of 2023. The Company’s fiscal years 2023 and 2022 span 53 and 52 weeks, respectively. Unless otherwise stated, references to particular years, quarters, months and periods refer to the Company’s fiscal years ended in September and the associated quarters, months and periods of those fiscal years. Earnings Per Share The following table shows the computation of basic and diluted earnings per share for the three- and six-month periods ended April 1, 2023 and March 26, 2022 (net income in millions and shares in thousands): Three Months Ended Six Months Ended April 1,2023 March 26,2022 April 1,2023 March 26,2022 Numerator: Net income $ 24,160 $ 25,010 $ 54,158 $ 59,640 Denominator: Weighted-average basic shares outstanding 15,787,154 16,278,802 15,839,939 16,335,263 Effect of dilutive securities 59,896 124,514 61,445 126,041 Weighted-average diluted shares 15,847,050 16,403,316 15,901,384 16,461,304 Basic earnings per share $ 1.53 $ 1.54 $ 3.42 $ 3.65 Diluted earnings per share $ 1.52 $ 1.52 $ 3.41 $ 3.62 Approximately 48 million restricted stock units (“RSUs”) were excluded from the computation of diluted earnings per share for the six months ended April 1, 2023 because their effect would have been antidilutive. Apple Inc. | Q2 2023 Form 10-Q | 6 Note 2 – Revenue Net sales disaggregated by significant products and services for the three- and six-month periods ended April 1, 2023 and March 26, 2022 were as follows (in millions): Three Months Ended Six Months Ended April 1,2023 March 26,2022 April 1,2023 March 26,2022 iPhone® $ 51,334 $ 50,570 $ 117,109 $ 122,198 Mac® 7,168 10,435 14,903 21,287 iPad® 6,670 7,646 16,066 14,894 Wearables, Home and Accessories 8,757 8,806 22,239 23,507 Services 20,907 19,821 41,673 39,337 Total net sales $ 94,836 $ 97,278 $ 211,990 $ 221,223 Total net sales include $3.5 billion of revenue recognized in the three months ended April 1, 2023 that was included in deferred revenue as of December 31, 2022, $3.0 billion of revenue recognized in the three months ended March 26, 2022 that was included in deferred revenue as of December 25, 2021, $5.5 billion of revenue recognized in the six months ended April 1, 2023 that was included in deferred revenue as of September 24, 2022, and $4.8 billion of revenue recognized in the six months ended March 26, 2022 that was included in deferred revenue as of September 25, 2021. 
    The Company’s proportion of net sales by disaggregated revenue source was generally consistent for each reportable segment in Note 10, “Segment Information and Geographic Data” for the three- and six-month periods ended April 1, 2023 and March 26, 2022, except in Greater China, where iPhone revenue represented a moderately higher proportion of net sales. As of April 1, 2023 and September 24, 2022, the Company had total deferred revenue of $12.5 billion and $12.4 billion, respectively. As of April 1, 2023, the Company expects 65% of total deferred revenue to be realized in less than a year, 26% within one-to-two years, 7% within two-to-three years and 2% in greater than three years. Note 3 – Financial Instruments Cash, Cash Equivalents and Marketable Securities The following tables show the Company’s cash, cash equivalents and marketable securities by significant investment category as of April 1, 2023 and September 24, 2022 (in millions): April 1, 2023 AdjustedCost UnrealizedGains UnrealizedLosses FairValue Cash andCashEquivalents CurrentMarketableSecurities Non-CurrentMarketableSecurities Cash $ 20,050 $ — $ — $ 20,050 $ 20,050 $ — $ — Level 1 (1): Money market funds 1,656 — — 1,656 1,656 — — Mutual funds 345 5 (26) 324 — 324 — Subtotal 2,001 5 (26) 1,980 1,656 324 — Level 2 (2): U.S. Treasury securities 22,754 1 (1,262) 21,493 9 8,002 13,482 U.S. agency securities 5,743 — (538) 5,205 — 199 5,006 Non-U.S. government securities 17,380 20 (961) 16,439 — 10,222 6,217 Certificates of deposit and time deposits 2,999 — — 2,999 2,881 118 — Commercial paper 271 — — 271 — 271 — Corporate debt securities 82,802 32 (6,049) 76,785 91 11,676 65,018 Municipal securities 790 — (20) 770 — 257 513 Mortgage- and asset-backed securities 22,438 9 (2,106) 20,341 — 116 20,225 Subtotal 155,177 62 (10,936) 144,303 2,981 30,861 110,461 Total (3) $ 177,228 $ 67 $ (10,962) $ 166,333 $ 24,687 $ 31,185 $ 110,461 Apple Inc. | Q2 2023 Form 10-Q | 7 September 24, 2022 AdjustedCost UnrealizedGains UnrealizedLosses FairValue Cash andCashEquivalents CurrentMarketableSecurities Non-CurrentMarketableSecurities Cash $ 18,546 $ — $ — $ 18,546 $ 18,546 $ — $ — Level 1 (1): Money market funds 2,929 — — 2,929 2,929 — — Mutual funds 274 — (47) 227 — 227 — Subtotal 3,203 — (47) 3,156 2,929 227 — Level 2 (2): U.S. Treasury securities 25,134 — (1,725) 23,409 338 5,091 17,980 U.S. agency securities 5,823 — (655) 5,168 — 240 4,928 Non-U.S. government securities 16,948 2 (1,201) 15,749 — 8,806 6,943 Certificates of deposit and time deposits 2,067 — — 2,067 1,805 262 — Commercial paper 718 — — 718 28 690 — Corporate debt securities 87,148 9 (7,707) 79,450 — 9,023 70,427 Municipal securities 921 — (35) 886 — 266 620 Mortgage- and asset-backed securities 22,553 — (2,593) 19,960 — 53 19,907 Subtotal 161,312 11 (13,916) 147,407 2,171 24,431 120,805 Total (3) $ 183,061 $ 11 $ (13,963) $ 169,109 $ 23,646 $ 24,658 $ 120,805 (1)Level 1 fair value estimates are based on quoted prices in active markets for identical assets or liabilities. (2)Level 2 fair value estimates are based on observable inputs other than quoted prices in active markets for identical assets and liabilities, quoted prices for identical or similar assets or liabilities in inactive markets, or other inputs that are observable or can be corroborated by observable market data for substantially the full term of the assets or liabilities. (3)As of April 1, 2023 and September 24, 2022, total marketable securities included $13.1 billion and $12.7 billion, respectively, that were restricted from general use, related to the State Aid Decision (refer to Note 5, “Income Taxes”) and other agreements. The following table shows the fair value of the Company’s non-current marketable debt securities, by contractual maturity, as of April 1, 2023 (in millions): Due after 1 year through 5 years $ 81,352 Due after 5 years through 10 years 11,928 Due after 10 years 17,181 Total fair value $ 110,461 Derivative Instruments and Hedging The Company may use derivative instruments to partially offset its business exposure to foreign exchange and interest rate risk. However, the Company may choose not to hedge certain exposures for a variety of reasons, including accounting considerations or the prohibitive economic cost of hedging particular exposures. There can be no assurance the hedges will offset more than a portion of the financial impact resulting from movements in foreign exchange or interest rates. Foreign Exchange Risk To protect gross margins from fluctuations in foreign currency exchange rates, the Company may enter into forward contracts, option contracts or other instruments, and may designate these instruments as cash flow hedges. The Company generally hedges portions of its forecasted foreign currency exposure associated with revenue and inventory purchases, typically for up to 12 months. To protect the Company’s foreign currency–denominated term debt or marketable securities from fluctuations in foreign currency exchange rates, the Company may enter into forward contracts, cross-currency swaps or other instruments. 
    The Company designates these instruments as either cash flow or fair value hedges. As of April 1, 2023, the maximum length of time over which the Company is hedging its exposure to the variability in future cash flows for term debt–related foreign currency transactions is 19 years. Apple Inc. | Q2 2023 Form 10-Q | 8 The Company may also enter into derivative instruments that are not designated as accounting hedges to protect gross margins from certain fluctuations in foreign currency exchange rates, as well as to offset a portion of the foreign currency exchange gains and losses generated by the remeasurement of certain assets and liabilities denominated in non-functional currencies. Interest Rate Risk To protect the Company’s term debt or marketable securities from fluctuations in interest rates, the Company may enter into interest rate swaps, options or other instruments. The Company designates these instruments as either cash flow or fair value hedges. The notional amounts of the Company’s outstanding derivative instruments as of April 1, 2023 and September 24, 2022 were as follows (in millions): April 1,2023 September 24,2022 Derivative instruments designated as accounting hedges: Foreign exchange contracts $ 51,119 $ 102,670 Interest rate contracts $ 19,375 $ 20,125 Derivative instruments not designated as accounting hedges: Foreign exchange contracts $ 111,696 $ 185,381 The gross fair values of the Company’s derivative assets and liabilities as of September 24, 2022 were as follows (in millions): September 24, 2022 Fair Value ofDerivatives Designatedas Accounting Hedges Fair Value ofDerivatives Not Designatedas Accounting Hedges TotalFair Value Derivative assets (1): Foreign exchange contracts $ 4,317 $ 2,819 $ 7,136 Derivative liabilities (2): Foreign exchange contracts $ 2,205 $ 2,547 $ 4,752 Interest rate contracts $ 1,367 $ — $ 1,367 (1)Derivative assets are measured using Level 2 fair value inputs and are included in other current assets and other non-current assets in the Condensed Consolidated Balance Sheet. (2)Derivative liabilities are measured using Level 2 fair value inputs and are included in other current liabilities and other non-current liabilities in the Condensed Consolidated Balance Sheet. The derivative assets above represent the Company’s gross credit exposure if all counterparties failed to perform. To mitigate credit risk, the Company generally enters into collateral security arrangements that provide for collateral to be received or posted when the net fair values of certain derivatives fluctuate from contractually established thresholds. To further limit credit risk, the Company generally enters into master netting arrangements with the respective counterparties to the Company’s derivative contracts, under which the Company is allowed to settle transactions with a single net amount payable by one party to the other. As of September 24, 2022, the potential effects of these rights of set-off associated with the Company’s derivative contracts, including the effects of collateral, would be a reduction to both derivative assets and derivative liabilities of $7.8 billion, resulting in a net derivative asset of $412 million. The carrying amounts of the Company’s hedged items in fair value hedges as of April 1, 2023 and September 24, 2022 were as follows (in millions): April 1,2023 September 24,2022 Hedged assets/(liabilities): Current and non-current marketable securities $ 14,651 $ 13,378 Current and non-current term debt $ (18,249) $ (18,739) Apple Inc. | Q2 2023 Form 10-Q | 9 Accounts Receivable Trade Receivables The Company has considerable trade receivables outstanding with its third-party cellular network carriers, wholesalers, retailers, resellers, small and mid-sized businesses and education, enterprise and government customers. The Company generally does not require collateral from its customers; however, the Company will require collateral or third-party credit support in certain instances to limit credit risk. In addition, when possible, the Company attempts to limit credit risk on trade receivables with credit insurance for certain customers or by requiring third-party financing, loans or leases to support credit exposure. These credit-financing arrangements are directly between the third-party financing company and the end customer. As such, the Company generally does not assume any recourse or credit risk sharing related to any of these arrangements. As of both April 1, 2023 and September 24, 2022, the Company had one customer that represented 10% or more of total trade receivables, which accounted for 10%. The Company’s cellular network carriers accounted for 32% and 44% of total trade receivables as of April 1, 2023 and September 24, 2022, respectively. Vendor Non-Trade Receivables The Company has non-trade receivables from certain of its manufacturing vendors resulting from the sale of components to these vendors who manufacture subassemblies or assemble final products for the Company. The Company purchases these components directly from suppliers. As of April 1, 2023, the Company had threevendors that individually represented 10% or more of total vendor non-trade receivables, which accounted for 43%, 19% and 13%. As of September 24, 2022, the Company had two vendors that individually represented 10% or more of total vendor non-trade receivables, which accounted for 54% and 13%. 
    Note 4 – Condensed Consolidated Financial Statement Details The following tables show the Company’s condensed consolidated financial statement details as of April 1, 2023 and September 24, 2022 (in millions): Inventories April 1,2023 September 24,2022 Components $ 3,379 $ 1,637 Finished goods 4,103 3,309 Total inventories $ 7,482 $ 4,946 Property, Plant and Equipment, Net April 1,2023 September 24,2022 Gross property, plant and equipment $ 113,066 $ 114,457 Accumulated depreciation and amortization (69,668) (72,340) Total property, plant and equipment, net $ 43,398 $ 42,117 Other Income/(Expense), Net The following table shows the detail of other income/(expense), net for the three- and six-month periods ended April 1, 2023 and March 26, 2022 (in millions): Three Months Ended Six Months Ended April 1,2023 March 26,2022 April 1,2023 March 26,2022 Interest and dividend income $ 918 $ 700 $ 1,786 $ 1,350 Interest expense (930) (691) (1,933) (1,385) Other income/(expense), net 76 151 (182) (52) Total other income/(expense), net $ 64 $ 160 $ (329) $ (87) Apple Inc. | Q2 2023 Form 10-Q | 10 Note 5 – Income Taxes European Commission State Aid Decision On August 30, 2016, the European Commission announced its decision that Ireland granted state aid to the Company by providing tax opinions in 1991 and 2007 concerning the tax allocation of profits of the Irish branches of two subsidiaries of the Company (the “State Aid Decision”). The State Aid Decision ordered Ireland to calculate and recover additional taxes from the Company for the period June 2003 through December 2014. Irish legislative changes, effective as of January 2015, eliminated the application of the tax opinions from that date forward. The Company and Ireland appealed the State Aid Decision to the General Court of the Court of Justice of the European Union (the “General Court”). On July 15, 2020, the General Court annulled the State Aid Decision. On September 25, 2020, the European Commission appealed the General Court’s decision to the European Court of Justice and a hearing has been scheduled for May 23, 2023. The Company believes it would be eligible to claim a U.S. foreign tax credit for a portion of any incremental Irish corporate income taxes potentially due related to the State Aid Decision. Note 6 – Debt Commercial Paper The Company issues unsecured short-term promissory notes (“Commercial Paper”) pursuant to a commercial paper program. The Company uses net proceeds from the commercial paper program for general corporate purposes, including dividends and share repurchases. As of April 1, 2023 and September 24, 2022, the Company had $2.0 billion and $10.0 billion of Commercial Paper outstanding, respectively. The following table provides a summary of cash flows associated with the issuance and maturities of Commercial Paper for the six months ended April 1, 2023 and March 26, 2022 (in millions): Six Months EndedApril 1,2023March 26,2022Maturities 90 days or less:Proceeds from/(Repayments of) commercial paper, net$(5,315)$4,952 Maturities greater than 90 days:Proceeds from commercial paper— 1,191 Repayments of commercial paper(2,645)(5,144)Repayments of commercial paper, net(2,645)(3,953)Total proceeds from/(repayments of) commercial paper, net$(7,960)$999 Term Debt As of April 1, 2023 and September 24, 2022, the Company had outstanding fixed-rate notes with varying maturities for an aggregate carrying amount of $107.6 billion and $110.1 billion, respectively (collectively the “Notes”). As of April 1, 2023 and September 24, 2022, the fair value of the Company’s Notes, based on Level 2 inputs, was $98.4 billion and $98.8 billion, respectively. Note 7 – Shareholders’ Equity Share Repurchase Program During the six months ended April 1, 2023, the Company repurchased 262 million shares of its common stock under an authorized share repurchase program for $38.1 billion, excluding excise tax due under the Inflation Reduction Act of 2022. The program does not obligate the Company to acquire a minimum amount of shares. Under the program, shares may be repurchased in privately negotiated or open market transactions, including under plans complying with Rule 10b5-1 under the Securities Exchange Act of 1934, as amended. Apple Inc. | Q2 2023 Form 10-Q | 11 Note 8 – Benefit Plans Restricted Stock Units A summary of the Company’s RSU activity and related information for the six months ended April 1, 2023 is as follows: Number of RSUs (in thousands) Weighted-AverageGrant Date FairValue Per RSU Aggregate Fair Value (in millions) Balance as of September 24, 2022 201,501 $ 109.48 RSUs granted 84,902 $ 149.73 RSUs vested (54,795) $ 86.72 RSUs canceled (4,671) $ 122.79 Balance as of April 1, 2023 226,937 $ 129.76 $ 37,422 The fair value as of the respective vesting dates of RSUs was $1.1 billion and $8.0 billion for the three- and six-month periods ended April 1, 2023, respectively, and was $1.0 billion and $9.5 billion for the three- and six-month periods ended March 26, 2022, respectively. Share-Based Compensation The following table shows share-based compensation expense and the related income tax benefit included in the Condensed Consolidated Statements of Operations for the three- and six-month periods ended April 1, 2023 and March 26, 2022 (in millions): Three Months Ended Six Months Ended April 1,2023 March 26,2022 April 1,2023 March 26,2022 Share-based compensation expense $ 2,686 $ 2,252 $ 5,591 $ 4,517 Income tax benefit related to share-based compensation expense $ (620) $ (649) $ (1,798) $ (2,185) As of April 1, 2023, the total unrecognized compensation cost related to outstanding RSUs and stock options was $23.2 billion, which the Company expects to recognize over a weighted-average period of 2.8 years. 
    Note 9 – Commitments and Contingencies Unconditional Purchase Obligations The Company has entered into certain off–balance sheet commitments that require the future purchase of goods or services (“unconditional purchase obligations”). The Company’s unconditional purchase obligations primarily consist of supplier arrangements, licensed content and distribution rights. Future payments under noncancelable unconditional purchase obligations with a remaining term in excess of one year as of April 1, 2023, are as follows (in millions): 2023 (remaining six months)$2,263 20242,716 20252,028 20262,602 2027571 Thereafter5,897 Total$16,077 Contingencies The Company is subject to various legal proceedings and claims that have arisen in the ordinary course of business and that have not been fully resolved. The outcome of litigation is inherently uncertain. In the opinion of management, there was not at least a reasonable possibility the Company may have incurred a material loss, or a material loss greater than a recorded accrual, concerning loss contingencies for asserted legal and other claims. Apple Inc. | Q2 2023 Form 10-Q | 12 Note 10 – Segment Information and Geographic Data The following table shows information by reportable segment for the three- and six-month periods ended April 1, 2023 and March 26, 2022 (in millions):Three Months EndedSix Months EndedApril 1,2023March 26,2022April 1,2023March 26,2022Americas:Net sales$37,784 $40,882 $87,062 $92,378 Operating income$13,927 $15,279 $31,791 $34,864 Europe:Net sales$23,945 $23,287 $51,626 $53,036 Operating income$9,368 $8,505 $19,385 $20,050 Greater China:Net sales$17,812 $18,343 $41,717 $44,126 Operating income$7,531 $8,112 $17,968 $19,295 Japan:Net sales$7,176 $7,724 $13,931 $14,831 Operating income$3,394 $3,496 $6,630 $6,845 Rest of Asia Pacific:Net sales$8,119 $7,042 $17,654 $16,852 Operating income$3,268 $2,823 $7,119 $6,818 A reconciliation of the Company’s segment operating income to the Condensed Consolidated Statements of Operations for the three- and six-month periods ended April 1, 2023 and March 26, 2022 is as follows (in millions):Three Months EndedSix Months EndedApril 1,2023March 26,2022April 1,2023March 26,2022Segment operating income$37,488 $38,215 $82,893 $87,872 Research and development expense(7,457)(6,387)(15,166)(12,693)Other corporate expenses, net(1,713)(1,849)(3,393)(3,712)Total operating income$28,318 $29,979 $64,334 $71,467 Apple Inc. | Q2 2023 Form 10-Q | 13 Item 2. Management’s Discussion and Analysis of Financial Condition and Results of Operations This section and other parts of this Quarterly Report on Form 10-Q (“Form 10-Q”) contain forward-looking statements, within the meaning of the Private Securities Litigation Reform Act of 1995, that involve risks and uncertainties. Forward-looking statements provide current expectations of future events based on certain assumptions and include any statement that does not directly relate to any historical or current fact. For example, statements in this Form 10-Q regarding the potential future impact of macroeconomic conditions on the Company’s business and results of operations are forward-looking statements. Forward-looking statements can also be identified by words such as “future,” “anticipates,” “believes,” “estimates,” “expects,” “intends,” “plans,” “predicts,” “will,” “would,” “could,” “can,” “may,” and similar terms. Forward-looking statements are not guarantees of future performance and the Company’s actual results may differ significantly from the results discussed in the forward-looking statements. Factors that might cause such differences include, but are not limited to, those discussed in Part I, Item 1A of the Company’s Annual Report on Form 10-K for the fiscal year ended September 24, 2022 (the “2022 Form 10-K”) under the heading “Risk Factors.” The Company assumes no obligation to revise or update any forward-looking statements for any reason, except as required by law. Unless otherwise stated, all information presented herein is based on the Company’s fiscal calendar, and references to particular years, quarters, months or periods refer to the Company’s fiscal years ended in September and the associated quarters, months and periods of those fiscal years. Each of the terms the “Company” and “Apple” as used herein refers collectively to Apple Inc. and its wholly owned subsidiaries, unless otherwise stated. The following discussion should be read in conjunction with the 2022 Form 10-K filed with the U.S. Securities and Exchange Commission (the “SEC”) and the condensed consolidated financial statements and accompanying notes included in Part I, Item 1 of this Form 10-Q. Available Information The Company periodically provides certain information for investors on its corporate website, www.apple.com, and its investor relations website, investor.apple.com. This includes press releases and other information about financial performance, information on environmental, social and governance matters, and details related to the Company’s annual meeting of shareholders. The information contained on the websites referenced in this Form 10-Q is not incorporated by reference into this filing. Further, the Company’s references to website URLs are intended to be inactive textual references only. Business Seasonality and Product Introductions The Company has historically experienced higher net sales in its first quarter compared to other quarters in its fiscal year due in part to seasonal holiday demand. Additionally, new product and service introductions can significantly impact net sales, cost of sales and operating expenses. The timing of product introductions can also impact the Company’s net sales to its indirect distribution channels as these channels are filled with new inventory following a product launch, and channel inventory of an older product often declines as the launch of a newer product approaches. Net sales can also be affected when consumers and distributors anticipate a product introduction. Fiscal Period The Company’s fiscal year is the 52- or 53-week period that ends on the last Saturday of September. 
    An additional week is included in the first fiscal quarter every five or six years to realign the Company’s fiscal quarters with calendar quarters, which occurred in the first quarter of 2023. The Company’s fiscal years 2023 and 2022 span 53 and 52 weeks, respectively. Quarterly Highlights Weakness in foreign currencies relative to the U.S. dollar had an unfavorable impact on the Company’s total net sales, which decreased 3% or $2.4 billion during the second quarter of 2023 compared to the same quarter in 2022. The year-over-year net sales decrease consisted primarily of lower net sales of Mac, partially offset by higher net sales of Services. During the second quarter of 2023, the Company announced the following new products: •MacBook Pro® 14” and MacBook Pro 16”, powered by the Apple M2 Pro and M2 Max chip; •Mac mini®, powered by the Apple M2 and M2 Pro chip; and •Second-generation HomePod®. The Company repurchased $19.1 billion of its common stock and paid dividends and dividend equivalents of $3.7 billion during the second quarter of 2023. Apple Inc. | Q2 2023 Form 10-Q | 14 Macroeconomic Conditions Macroeconomic conditions, including inflation, changes in interest rates, and currency fluctuations, have directly and indirectly impacted, and could in the future materially impact, the Company’s results of operations and financial condition. Segment Operating Performance The following table shows net sales by reportable segment for the three- and six-month periods ended April 1, 2023 and March 26, 2022 (dollars in millions): Three Months Ended Six Months Ended April 1,2023 March 26,2022 Change April 1,2023 March 26,2022 Change Net sales by reportable segment: Americas $ 37,784 $ 40,882 (8) % $ 87,062 $ 92,378 (6) % Europe 23,945 23,287 3 % 51,626 53,036 (3) % Greater China 17,812 18,343 (3) % 41,717 44,126 (5) % Japan 7,176 7,724 (7) % 13,931 14,831 (6) % Rest of Asia Pacific 8,119 7,042 15 % 17,654 16,852 5 % Total net sales $ 94,836 $ 97,278 (3) % $ 211,990 $ 221,223 (4) % Americas Americas net sales decreased during the second quarter and first six months of 2023 compared to the same periods in 2022 due primarily to lower net sales of iPhone and Mac, partially offset by higher net sales of Services. Europe The weakness in foreign currencies relative to the U.S. dollar had a net unfavorable year-over-year impact on Europe net sales during the second quarter and first six months of 2023. During the second quarter of 2023, the Europe net sales increase consisted primarily of higher net sales of iPhone, partially offset by lower net sales of Mac. During the first six months of 2023, the Europe net sales decrease consisted primarily of lower net sales of Mac, partially offset by higher net sales of iPhone. Greater China The weakness in the renminbi relative to the U.S. dollar had an unfavorable year-over-year impact on Greater China net sales during the second quarter and first six months of 2023. During the second quarter and first six months of 2023, the Greater China net sales decrease consisted primarily of lower net sales of iPhone and Mac. Japan The weakness in the yen relative to the U.S. dollar had an unfavorable year-over-year impact on Japan net sales during the second quarter and first six months of 2023. During the second quarter of 2023, the Japan net sales decrease consisted primarily of lower net sales of iPad, Services and iPhone. During the first six months of 2023, the Japan net sales decrease consisted primarily of lower net sales of Services, Wearables, Home and Accessories and Mac. Rest of Asia Pacific The weakness in foreign currencies relative to the U.S. dollar had an unfavorable year-over-year impact on Rest of Asia Pacific net sales during the second quarter and first six months of 2023. During the second quarter and first six months of 2023, the Rest of Asia Pacific net sales increase consisted primarily of higher net sales of iPhone, partially offset by lower net sales of Mac. Apple Inc. | Q2 2023 Form 10-Q | 15 Products and Services Performance The following table shows net sales by category for the three- and six-month periods ended April 1, 2023 and March 26, 2022 (dollars in millions): Three Months Ended Six Months Ended April 1,2023 March 26,2022 Change April 1,2023 March 26,2022 Change Net sales by category: iPhone $ 51,334 $ 50,570 2 % $ 117,109 $ 122,198 (4) % Mac 7,168 10,435 (31) % 14,903 21,287 (30) % iPad 6,670 7,646 (13) % 16,066 14,894 8 % Wearables, Home and Accessories 8,757 8,806 (1) % 22,239 23,507 (5) % Services 20,907 19,821 5 % 41,673 39,337 6 % Total net sales $ 94,836 $ 97,278 (3) % $ 211,990 $ 221,223 (4) % iPhone iPhone net sales were relatively flat during the second quarter of 2023 compared to the second quarter of 2022. Year-over-year iPhone net sales decreased during the first six months of 2023 due primarily to lower net sales from the Company’s new iPhone models launched in the fourth quarter of 2022. Mac Mac net sales decreased during the second quarter and first six months of 2023 compared to the same periods in 2022 due primarily to lower net sales of MacBook Pro. iPad iPad net sales decreased during the second quarter of 2023 compared to the second quarter of 2022 due primarily to lower net sales of iPad Pro® and iPad Air®. Year-over-year iPad net sales increased during the first six months of 2023 due primarily to higher net sales of iPad, partially offset by lower net sales of iPad mini®. Wearables, Home and Accessories Wearables, Home and Accessories net sales were relatively flat during the second quarter of 2023 compared to the second quarter of 2022. Year-over-year Wearables, Home and Accessories net sales decreased during the first six months of 2023 due primarily to lower net sales of AirPods®. Services Services net sales increased during the second quarter and first six months of 2023 compared to the same periods in 2022 due primarily to higher net sales from cloud services, music and advertising. Apple Inc. | Q2 2023 Form 10-Q | 16 Gross Margin Products and Services gross margin and gross margin percentage for the three- and six-month periods ended April 1, 2023 and March 26, 2022 were as follows (dollars in millions): Three Months Ended Six Months Ended April 1,2023 March 26,2022 April 1,2023 March 26,2022 Gross margin: Products $ 27,134 $ 28,167 $ 62,757 $ 68,287 Services 14,842 14,392 29,551 28,515 Total gross margin $ 41,976 $ 42,559 $ 92,308 $ 96,802 Gross margin percentage: Products 36.7 % 36.4 % 36.8 % 37.5 % Services 71.0 % 72.6 % 70.9 % 72.5 % Total gross margin percentage 44.3 % 43.7 % 43.5 % 43.8 % Products Gross Margin Products gross margin decreased during the second quarter and first six months of 2023 compared to the same periods in 2022 due primarily to lower Products volume and the weakness in foreign currencies relative to the U.S. dollar, partially offset by a different Products mix. Products gross margin percentage increased during the second quarter of 2023 compared to the second quarter of 2022 due primarily to a different Products mix, partially offset by the weakness in foreign currencies relative to the U.S. dollar. Year-over-year Products gross margin percentage decreased during the first six months of 2023 due primarily to the weakness in foreign currencies relative to the U.S. dollar, partially offset by a different Products mix. Services Gross Margin Services gross margin increased during the second quarter and first six months of 2023 compared to the same periods in 2022 due primarily to higher Services net sales, partially offset by the weakness in foreign currencies relative to the U.S. dollar and higher Services costs. Services gross margin percentage decreased during the second quarter and first six months of 2023 compared to the same periods in 2022 due primarily to the weakness in foreign currencies relative to the U.S. dollar and higher Services costs, partially offset by improved leverage. 
    The Company’s future gross margins can be impacted by a variety of factors, as discussed in Part I, Item 1A of the 2022 Form 10-K under the heading “Risk Factors.” As a result, the Company believes, in general, gross margins will be subject to volatility and downward pressure. Apple Inc. | Q2 2023 Form 10-Q | 17 Operating Expenses Operating expenses for the three- and six-month periods ended April 1, 2023 and March 26, 2022 were as follows (dollars in millions): Three Months Ended Six Months Ended April 1,2023 March 26,2022 April 1,2023 March 26,2022 Research and development $ 7,457 $ 6,387 $ 15,166 $ 12,693 Percentage of total net sales 8 % 7 % 7 % 6 % Selling, general and administrative $ 6,201 $ 6,193 $ 12,808 $ 12,642 Percentage of total net sales 7 % 6 % 6 % 6 % Total operating expenses $ 13,658 $ 12,580 $ 27,974 $ 25,335 Percentage of total net sales 14 % 13 % 13 % 11 % Research and Development The growth in research and development (“R&D”) expense during the second quarter and first six months of 2023 compared to the same periods in 2022 was driven primarily by increases in headcount-related expenses. Selling, General and Administrative Selling, general and administrative expense was relatively flat during the second quarter and first six months of 2023 compared to the same periods in 2022. Provision for Income Taxes Provision for income taxes, effective tax rate and statutory federal income tax rate for the three- and six-month periods ended April 1, 2023 and March 26, 2022 were as follows (dollars in millions): Three Months Ended Six Months Ended April 1,2023 March 26,2022 April 1,2023 March 26,2022 Provision for income taxes $ 4,222 $ 5,129 $ 9,847 $ 11,740 Effective tax rate 14.9 % 17.0 % 15.4 % 16.4 % Statutory federal income tax rate 21 % 21 % 21 % 21 % The Company’s effective tax rate for the second quarter of 2023 was lower than the statutory federal income tax rate due primarily to a lower effective tax rate on foreign earnings and the U.S. federal R&D credit, partially offset by state income taxes. The Company’s effective tax rate for the first six months of 2023 was lower than the statutory federal income tax rate due primarily to a lower effective tax rate on foreign earnings, the U.S. federal R&D credit and tax benefits from share-based compensation, partially offset by state income taxes. The Company’s effective tax rate for the second quarter of 2023 was lower compared to the second quarter of 2022 due primarily to the impact of U.S. foreign tax credit regulations issued by the U.S. Department of the Treasury in 2022 and a higher U.S. federal R&D credit. The Company’s effective tax rate for the first six months of 2023 was lower compared to the same period in 2022 due primarily to the impact of U.S. foreign tax credit regulations issued by the U.S. Department of the Treasury in 2022 and a higher U.S. federal R&D credit, partially offset by lower tax benefits from share-based compensation. Liquidity and Capital Resources The Company believes its balances of cash, cash equivalents and unrestricted marketable securities, along with cash generated by ongoing operations and continued access to debt markets, will be sufficient to satisfy its cash requirements and capital return program over the next 12 months and beyond. The Company’s contractual cash requirements have not changed materially since the 2022 Form 10-K, except for commercial paper and manufacturing purchase obligations. Apple Inc. | Q2 2023 Form 10-Q | 18 Commercial Paper The Company issues unsecured short-term promissory notes (“Commercial Paper”) pursuant to a commercial paper program. As of April 1, 2023, the Company had $2.0 billion of Commercial Paper outstanding, all of which was payable within 12 months. Manufacturing Purchase Obligations The Company utilizes several outsourcing partners to manufacture subassemblies for the Company’s products and to perform final assembly and testing of finished products. The Company also obtains individual components for its products from a wide variety of individual suppliers. Outsourcing partners acquire components and build product based on demand information supplied by the Company, which typically covers periods up to 150 days. As of April 1, 2023, the Company had manufacturing purchase obligations of $40.5 billion, with $40.1 billion payable within 12 months. The Company’s manufacturing purchase obligations are primarily noncancelable. Capital Return Program In addition to its contractual cash requirements, the Company has an authorized share repurchase program, under which the remaining availability was $22.6 billion as of April 1, 2023. On May 4, 2023, the Company announced the Board of Directors had authorized an additional program to repurchase up to $90 billion of the Company’s common stock. The programs do not obligate the Company to acquire a minimum amount of shares. On May 4, 2023, the Company also announced the Board of Directors raised the Company’s quarterly cash dividend from $0.23 to $0.24 per share, beginning with the dividend to be paid during the third quarter of 2023. The Company intends to increase its dividend on an annual basis, subject to declaration by the Board of Directors. Critical Accounting Estimates The preparation of financial statements and related disclosures in conformity with U.S. generally accepted accounting principles and the Company’s discussion and analysis of its financial condition and operating results require the Company’s management to make judgments, assumptions and estimates that affect the amounts reported. Note 1, “Summary of Significant Accounting Policies” of the Notes to condensed consolidated Financial Statements in Part I, Item 1 of this Form 10-Q and in the Notes to Consolidated Financial Statements in Part II, Item 8 of the 2022 Form 10-K describe the significant accounting policies and methods used in the preparation of the Company’s condensed consolidated financial statements. There have been no material changes to the Company’s critical accounting estimates since the 2022 Form 10-K. Item 3. Quantitative and Qualitative Disclosures About Market Risk There have been no material changes to the Company’s market risk during the first six months of 2023. For a discussion of the Company’s exposure to market risk, refer to the Company’s market risk disclosures set forth in Part II, Item 7A, “Quantitative and Qualitative Disclosures About Market Risk” of the 2022 Form 10-K. Item 4. Controls and Procedures Evaluation of Disclosure Controls and Procedures Based on an evaluation under the supervision and with the participation of the Company’s management, the Company’s principal executive officer and principal financial officer have concluded that the Company’s disclosure controls and procedures as defined in Rules 13a-15(e) and 15d-15(e) under the Securities Exchange Act of 1934, as amended (the “Exchange Act”) were effective as of April 1, 2023 to provide reasonable assurance that information required to be disclosed by the Company in reports that it files or submits under the Exchange Act is (i) recorded, processed, summarized and reported within the time periods specified in the SEC rules and forms and (ii) accumulated and communicated to the Company’s management, including its principal executive officer and principal financial officer, as appropriate to allow timely decisions regarding required disclosure. Changes in Internal Control over Financial Reporting There were no changes in the Company’s internal control over financial reporting during the second quarter of 2023, which were identified in connection with management’s evaluation required by paragraph (d) of Rules 13a-15 and 15d-15 under the Exchange Act, that have materially affected, or are reasonably likely to materially affect, the Company’s internal control over financial reporting. 
    Apple Inc. | Q2 2023 Form 10-Q | 19 PART II — OTHER INFORMATION Item 1. Legal Proceedings Epic Games Epic Games, Inc. (“Epic”) filed a lawsuit in the U.S. District Court for the Northern District of California (the “Northern California District Court”) against the Company alleging violations of federal and state antitrust laws and California’s unfair competition law based upon the Company’s operation of its App Store®. 
    The Company filed a counterclaim for breach of contract. On September 10, 2021, the Northern California District Court ruled in favor of the Company with respect to nine out of the ten counts included in Epic’s claim, and in favor of the Company with respect to the Company’s claims for breach of contract. The Northern California District Court found that certain provisions of the Company’s App Store Review Guidelines violate California’s unfair competition law and issued an injunction. On April 24, 2023, the U.S. Court of Appeals for the Ninth Circuit affirmed the Northern California District Court’s ruling. The Company is considering further review of the decision. Other Legal Proceedings The Company is subject to other legal proceedings and claims that have not been fully resolved and that have arisen in the ordinary course of business. The Company settled certain matters during the second quarter of 2023 that did not individually or in the aggregate have a material impact on the Company’s financial condition or operating results. The outcome of litigation is inherently uncertain. If one or more legal matters were resolved against the Company in a reporting period for amounts above management’s expectations, the Company’s financial condition and operating results for that reporting period could be materially adversely affected. Item 1A. Risk Factors The Company’s business, reputation, results of operations, financial condition and stock price can be affected by a number of factors, whether currently known or unknown, including those described in Part I, Item 1A of the 2022 Form 10-K under the heading “Risk Factors.” When any one or more of these risks materialize from time to time, the Company’s business, reputation, results of operations, financial condition and stock price can be materially and adversely affected. There have been no material changes to the Company’s risk factors since the 2022 Form 10-K. Item 2. Unregistered Sales of Equity Securities and Use of Proceeds Purchases of Equity Securities by the Issuer and Affiliated Purchasers Share repurchase activity during the three months ended April 1, 2023 was as follows (in millions, except number of shares, which are reflected in thousands, and per share amounts): Periods Total Numberof Shares Purchased Average PricePaid Per Share Total Number of SharesPurchased as Part of PubliclyAnnounced Plans or Programs Approximate Dollar Value of Shares That May Yet Be Purchased Under the Plans or Programs (1) January 1, 2023 to February 4, 2023: Open market and privately negotiated purchases 36,980 $ 135.21 36,980 February 5, 2023 to March 4, 2023: Open market and privately negotiated purchases 49,168 $ 150.33 49,168 March 5, 2023 to April 1, 2023: Open market and privately negotiated purchases 43,164 $ 155.32 43,164 Total 129,312 $ 22,570 (1)On April 28, 2022, the Board of Directors authorized the purchase of an additional $90 billion of the Company’s common stock under a share repurchase program. As of April 1, 2023, total utilization under the April 2022 authorization was $67.4 billion. On May 4, 2023, the Company announced the Board of Directors had authorized an additional program to repurchase up to $90 billion of the Company’s common stock. The programs do not obligate the Company to acquire a minimum amount of shares. Under the programs, shares may be repurchased in privately negotiated or open market transactions, including under plans complying with Rule 10b5-1 under the Exchange Act. Apple Inc. | Q2 2023 Form 10-Q | 20 Item 3. Defaults Upon Senior Securities None. Item 4. Mine Safety Disclosures Not applicable. Item 5. Other Information Rule 10b5-1 Trading Plans During the three months ended April 1, 2023, Katherine L. Adams, Timothy D. Cook, Luca Maestri, Deirdre O’Brien and Jeffrey Williams, each an officer for purposes of Section 16 of the Exchange Act, had equity trading plans in place in accordance with Rule 10b5-1(c)(1) under the Exchange Act. An equity trading plan is a written document that preestablishes the amounts, prices and dates (or formula for determining the amounts, prices and dates) of future purchases or sales of the Company’s stock, including sales of shares acquired under the Company’s employee and director equity plans. Item 6. Exhibits Incorporated by Reference Exhibit Number Exhibit Description Form Exhibit Filing Date/Period End Date 31.1* Rule 13a-14(a) / 15d-14(a) Certification of Chief Executive Officer. 31.2* Rule 13a-14(a) / 15d-14(a) Certification of Chief Financial Officer. 32.1** Section 1350 Certifications of Chief Executive Officer and Chief Financial Officer. 101* Inline XBRL Document Set for the condensed consolidated financial statements and accompanying notes in Part I, Item 1, “Financial Statements” of this Quarterly Report on Form 10-Q. 104* Inline XBRL for the cover page of this Quarterly Report on Form 10-Q, included in the Exhibit 101 Inline XBRL Document Set. * Filed herewith. ** Furnished herewith. Apple Inc. | Q2 2023 Form 10-Q | 21 SIGNATURE Pursuant to the requirements of the Securities Exchange Act of 1934, the Registrant has duly caused this report to be signed on its behalf by the undersigned thereunto duly authorized. Date: May 4, 2023 Apple Inc. By: /s/ Luca Maestri Luca Maestri Senior Vice President,Chief Financial Officer Apple Inc. | Q2 2023 Form 10-Q | 22
    """
    tokens = tokenizer.encode_plus(sec_text, add_special_tokens=False)
    
    
    input_ids = tokens['input_ids']
    total_len = len(input_ids)
    attention_mask = tokens['attention_mask']
    
    proba_list = chunk_text_to_window_size_and_predict_proba(input_ids, attention_mask, total_len )
    mean = get_mean_from_proba(proba_list)
    sentiment = torch.argmax(mean).item()

    if sentiment == 0:
        return "Positive Sentiment"
    elif sentiment == 1:
        return "Negative Sentiment"
    else:
        return "Neutral"
    
gr_interface = gradio.Interface(
    fn = my_inference_function,
    inputs = "text",
    outputs = "text"
)

gr_interface.launch()