Skip to content

Commit

Permalink
add demo examples for mintify
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Oct 1, 2024
1 parent 69161f3 commit ba3289c
Show file tree
Hide file tree
Showing 4 changed files with 381 additions and 0 deletions.
204 changes: 204 additions & 0 deletions examples/async_example.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# Install the libraries (ipython is used for displaying markdown in this demo)\n",
"# !pip3 install --upgrade ipython\n",
"# !pip3 install --upgrade any-parser"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import display, Markdown\n",
"from any_parser import AnyParser"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"ap = AnyParser(api_key=\"...\")"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"file_id = ap.async_extract(file_path=\"./sample_data/Earnings-Presentation-Q2-2024.pdf\")"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Waiting for response...\n",
"Waiting for response...\n",
"Waiting for response...\n"
]
}
],
"source": [
"markdown_output = ap.async_fetch(file_id=file_id)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"## Meta Earnings Presentation\n",
"## Q2 2024\n",
"\n",
"investor.fb.com Meta logo, consisting of a stylized infinity symbol next to the word \"Meta\"\n",
"Revenue by User Geography In Millions Meta logo\n",
"\n",
"| Quarter | Rest of World | Asia-Pacific | Europe | US & Canada |\n",
"|---------|---------------|--------------|--------|-------------|\n",
"| Q2'24 | $39,071 | $7,888 | $9,300 | $16,847 |\n",
"| Q1'24 | $16,847 | $15,824 | $15,824 | $15,190 |\n",
"| Q4'23 | $18,585 | $15,483 | $15,483 | $15,777 |\n",
"| Q3'23 | $15,777 | $9,441 | $8,483 | $15,323 |\n",
"| Q2'23 | $18,585 | $9,441 | $9,441 | $14,422 |\n",
"| Q1'23 | $15,190 | $7,777 | $7,777 | $13,048 |\n",
"| Q4'23 | $18,585 | $9,441 | $9,441 | $14,422 |\n",
"| Q3'23 | $15,777 | $9,441 | $9,441 | $13,048 |\n",
"| Q2'23 | $15,190 | $7,777 | $7,777 | $13,035 |\n",
"| Q1'23 | $15,190 | $7,777 | $7,777 | $13,035 |\n",
"| Q4'22 | $15,824 | $7,481 | $7,481 | $14,422 |\n",
"| Q3'22 | $15,190 | $7,777 | $7,777 | $13,035 |\n",
"| Q2'22 | $15,190 | $7,777 | $7,777 | $13,035 |\n",
"| Q1'22 | $15,190 | $7,777 | $7,777 | $13,035 |\n",
"\n",
"The chart shows revenue by user geography in millions of dollars for Q2'22 to Q2'24. It is divided into three categories: Rest of World, Asia-Pacific, and Europe. The data is presented in a stacked bar format, with each bar representing a quarter and the total revenue for that quarter. The y-axis shows the revenue in millions of dollars, ranging from $28,822 to $32,165 million.\n",
"\n",
"Our revenue by user geography is geographically apportioned based on our estimation of the geographic location of our users when they perform a revenue-generating activity. This allocation differs from our revenue disaggregated by geography disclosure in our condensed consolidated financial statements where revenue is geographically apportioned based on the addresses of our customers.\n",
"\n",
"3\n",
"Segment Results In Millions Meta logo\n",
"\n",
"| | Q2'22 | Q3'22 | Q4'22 | Q1'23 | Q2'23 | Q3'23 | Q4'23 | Q1'24 | Q2'24 |\n",
"|---|---|---|---|---|---|---|---|---|---|\n",
"| Advertising | $ 28,152 | $ 27,237 | $ 31,254 | $ 28,101 | $ 31,498 | $ 33,643 | $ 38,706 | $ 35,635 | $ 38,329 |\n",
"| Other | 218 | 192 | 184 | 205 | 225 | 293 | 334 | 380 | 389 |\n",
"| Family of Apps Revenue | 28,370 | 27,429 | 31,438 | 28,306 | 31,723 | 33,936 | 39,040 | 36,015 | 38,718 |\n",
"| Reality Labs Revenue | 452 | 285 | 727 | 339 | 276 | 210 | 1,071 | 440 | 353 |\n",
"| Total Revenue | $ 28,822 | $ 27,714 | $ 32,165 | $ 28,645 | $ 31,999 | $ 34,146 | $ 40,111 | $ 36,455 | $ 39,071 |\n",
"\n",
"| | Q2'22 | Q3'22 | Q4'22 | Q1'23 | Q2'23 | Q3'23 | Q4'23 | Q1'24 | Q2'24 |\n",
"|---|---|---|---|---|---|---|---|---|---|\n",
"| Family of Apps Operating Income | $ 11,164 | $ 9,336 | $ 10,678 | $ 11,219 | $ 13,131 | $ 17,490 | $ 21,030 | $ 17,664 | $ 19,335 |\n",
"| Reality Labs Operating (Loss) | (2,806) | (3,672) | (4,279) | (3,992) | (3,739) | (3,742) | (4,646) | (3,846) | (4,488) |\n",
"| Total Income from Operations | $ 8,358 | $ 5,664 | $ 6,399 | $ 7,227 | $ 9,392 | $ 13,748 | $ 16,384 | $ 13,818 | $ 14,847 |\n",
"| Operating Margin | 29% | 20% | 20% | 25% | 29% | 40% | 41% | 38% | 38% |\n",
"\n",
"We report our financial results based on two reportable segments: Family of Apps (FoA) and Reality Labs (RL). FoA includes Facebook, Instagram, Messenger, WhatsApp, and other services. RL includes our virtual, augmented, and mixed reality related consumer hardware, software, and content.\n",
"\n",
"4\n",
"Net Income In Millions Meta logo\n",
"\n",
"| Quarter | Net Income (In Millions) |\n",
"|---------|--------------------------|\n",
"| Q2'22 | 6,687 |\n",
"| Q3'22 | 4,395 |\n",
"| Q4'22 | 4,652 |\n",
"| Q1'23 | 5,709 |\n",
"| Q2'23 | 7,788 |\n",
"| Q3'23 | 11,583 |\n",
"| Q4'23 | 12,369 |\n",
"| Q1'24 | 13,465 |\n",
"| Q2'24 | 14,017 |\n",
"\n",
"This bar chart shows the Net Income in millions of dollars for Meta from Q2'22 to Q2'24. The y-axis ranges from $6,687 million to $14,017 million, with each quarter's data represented by a dark blue bar. The highest net income was in Q3'22 at $5,709 million, while the lowest was in Q1'24 at $12,369 million.\n",
"\n",
"7\n",
"Diluted Earnings Per Share Meta logo, consisting of an infinity symbol\n",
"\n",
"| Quarter | Diluted Earnings Per Share |\n",
"|---------|---------------------------|\n",
"| Q2'22 | $2.46 |\n",
"| Q3'22 | $1.64 |\n",
"| Q4'22 | $1.76 |\n",
"| Q1'23 | $2.20 |\n",
"| Q2'23 | $2.98 |\n",
"| Q3'23 | $4.39 |\n",
"| Q4'23 | $5.33 |\n",
"| Q1'24 | $4.71 |\n",
"| Q2'24 | $5.16 |\n",
"\n",
"This chart shows the diluted earnings per share from Q2'22 to Q2'24. The bars represent the earnings per share values for each quarter, with Q2'24 having the highest value at $5.16.\n",
"\n",
"8\n",
"Limitations of Key Metrics and Other Data Meta logo\n",
"\n",
"To calculate our estimates of DAP, we currently use a series of machine learning models that are developed based on internal reviews of limited samples of user accounts and calibrated against user survey data. We apply significant judgment in designing these models and calculating these estimates. For example, to match user accounts within individual products and across multiple products, we use data signals such as similar device information, IP addresses, and user names. We also calibrate our models against data from periodic user surveys of varying sizes and frequency across our products, which survey questions are based on monthly usage, and which are inherently subject to error. The timing and results of such user surveys have in the past contributed, and may in the future contribute, to changes in our reported Family metrics from period to period. In addition, our data limitations may affect our understanding of certain details of our business and increase the risk of error for our Family metrics estimates. Our techniques and models rely on a variety of data signals from different products, and we rely on more limited data signals for some products compared to others. For example, as a result of limited visibility into encrypted products, we have fewer data signals from WhatsApp user accounts and primarily rely on phone numbers and device information to match WhatsApp user accounts with accounts on our other products. Any loss of access to data signals we use in our process for calculating Family metrics, whether as a result of our own product decisions, actions by third-party browser or mobile platforms, regulatory or legislative requirements, or other factors, also may impact the stability or accuracy of our reported Family metrics, as well as our ability to report these metrics at all. Our estimates of Family metrics also may change as our methodologies evolve, including through the application of new data signals or technologies, product changes, or other improvements in our user surveys, algorithms, or machine learning that may improve our ability to match accounts within and across our products or otherwise evaluate the broad population of our users. In addition, such evolution may allow us to identify previously undetected violating accounts (as defined below).\n",
"\n",
"We regularly evaluate our Family metrics to estimate the percentage of our DAP consisting solely of \"violating\" accounts. We define \"violating\" accounts as accounts which we believe are intended to be used for purposes that violate our terms of service, including bots and spam. In the first quarter of 2024, we estimated that less than 3% of our worldwide DAP consisted solely of violating accounts. Such estimation is based on an internal review of a limited sample of accounts, and we apply significant judgment in making this determination. For example, we look for account information and behaviors associated with Facebook and Instagram accounts that appear to be authentic to the reviewers, but we have limited visibility into WhatsApp user activity due to encryption. In addition, if we believe an individual person has one or more violating accounts, we do not include such person in our violating accounts estimation as long as we believe they have one account that does not constitute a violating account. From time to time, we disable certain user accounts, make product changes, or take other actions to reduce the number of violating accounts among our users, which may also reduce our DAP estimates in a particular period. We intend to disclose our estimates of the percentage of our DAP consisting solely of violating accounts on an annual basis. Violating accounts are very difficult to measure at our scale, and it is possible that the actual number of violating accounts may vary significantly from our estimates.\n",
"\n",
"## User Geography\n",
"\n",
"Our estimates for revenue by user location, as well as year-over-year percentage changes in ad impressions delivered and the average price per ad by user location, are also affected by data limitations and other challenges in measuring user geography. Our data regarding the geographic location of our users is estimated based on a number of factors, such as the user's IP address and self-disclosed location. These factors may not always accurately reflect the user's actual location. For example, a user may appear to be accessing our products from the location of the proxy server that the user connects to rather than from the user's actual location. The methodologies used to measure our metrics are also susceptible to algorithm or other technical errors.\n",
"\n",
"17"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display(Markdown(markdown_output))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "poetry",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.15"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Binary file not shown.
Binary file removed examples/sample_data/cambioml_logo_large.png
Binary file not shown.
Loading

0 comments on commit ba3289c

Please sign in to comment.