# Financial QA - Extractive

Ask extractive questions about a (long) financial document.

|---|---|
| You can query a model directly and test the results returned when using different parameter values with the Cloud console, or by calling the Vertex AI API directly. - For an example of using the Vertex AI API, see [Quickstart using the Vertex AI API](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/api-quickstart). - To view this sample in the Cloud console: [Go to Google Cloud console](https://console.cloud.google.com/vertex-ai/generative/language/prompt-examples/Financial%20QA%20-%20Extractive) <br /> ||
| #### Prompt Freeform [financial_qa_example_MCD_2022_10K.pdf](https://storage.mtls.cloud.google.com/cloud-samples-data/generative-ai/pdf/financial_qa_extractive.pdf) Using the diluted earnings per share (EPS) from FY2022 and the stock price based on the average price paid per share from November 1-30, 2022, calculate the P/E ratio for FY2022. Round answer to two decimal places. Explain the answer and point me to the evidence. #### Response ## Calculation: The P/E ratio is calculated as follows: P/E Ratio = Stock Price / Earnings Per Share P/E Ratio = $270.40 / $8.33 **P/E Ratio = 32.47** ## Explanation: The Price-to-Earnings (P/E) ratio is a valuation metric that compares a company's current stock price to its earnings per share. It indicates how much investors are willing to pay for each dollar of a company's earnings. For McDonald's in fiscal year 2022: - Diluted earnings per share (EPS) were **$8.33**. - The average stock price in November 2022 was **$270.40**. Therefore, a P/E ratio of **32.47** signifies that investors were willing to pay approximately $32.47 for every dollar of McDonald's earnings during FY2022. ## Evidence: - **Diluted EPS (FY2022):** Found on **Page 11** of the provided document, within the "Consolidated Statement of Income" section, under the line item "Earnings per common share-diluted" for the year ended December 31, 2022. - **Average Price Paid Per Share (November 2022):** Located on **Page 26** of the provided document, within the "ISSUER PURCHASES OF EQUITY SECURITIES" table, specifically for the period "November 1-30, 2022", under the column "Average Price Paid per Share". | |---|---| | **Model:** | gemini-2.5-pro | | **Temperature:** | 0.2 | | **Max output tokens:** | 8192 | | **TopK:** | 40.0 | | **TopP:** | 0.95 | |