Skip to content

Commit

Permalink
Rename.
Browse files Browse the repository at this point in the history
  • Loading branch information
goldmermaid committed Apr 3, 2024
1 parent 025e85a commit 1a316e7
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 109 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# File Extraction"
]
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -18,7 +25,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -29,7 +36,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -40,7 +47,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -53,14 +60,14 @@
"\n",
"## Overview\n",
"\n",
"| Investor Metrics | FY23 Q1 | FY23 Q2 | FY23 Q3 | FY23 Q4 | FY24 Q1 |\n",
"|:----------------|:--------|:--------|:--------|:--------|:--------|\n",
"| Office Commercial products and cloud services revenue growth (y/y) | 7% / 13% | 7% 14% | 13% / 17% | 12% / 14% | 15% / 14% |\n",
"| Office Consumer products and cloud services revenue growth (y/y) | 7% 11% | (2)% 3% | 1% 4% | 3% 6% | 3% 4% |\n",
"| Office 365 Commercial seat growth (y/y) | 14% | 12% | 11% | 11% | 10% |\n",
"| Microsoft 365 Consumer subscribers (in millions) | 65.1 | 67.7 | 70.8 | 74.9 | 76.7 |\n",
"| Dynamics products and cloud services revenue growth (y/y) | 15% / 22% | 13% 20% | 17% / 21% | 19% / 21% | 22% / 21% |\n",
"| LinkedIn revenue growth (y/y) | 17% / 21% | 10% / 14% | 8% 11% | 6% 8% | 8% |\n",
"| Investor Metrics | FY23 Q1 | FY23 Q2 | FY23 Q3 | FY23 Q4 | FY24 Q1 |\n",
"|:-------------------------------------------------------------------|:----------|:----------|:----------|:----------|:----------|\n",
"| Office Commercial products and cloud services revenue growth (y/y) | 7% / 13% | 7% 14% | 13% / 17% | 12% / 14% | 15% / 14% |\n",
"| Office Consumer products and cloud services revenue growth (y/y) | 7% 11% | (2)% 3% | 1% 4% | 3% 6% | 3% 4% |\n",
"| Office 365 Commercial seat growth (y/y) | 14% | 12% | 11% | 11% | 10% |\n",
"| Microsoft 365 Consumer subscribers (in millions) | 65.1 | 67.7 | 70.8 | 74.9 | 76.7 |\n",
"| Dynamics products and cloud services revenue growth (y/y) | 15% / 22% | 13% 20% | 17% / 21% | 19% / 21% | 22% / 21% |\n",
"| LinkedIn revenue growth (y/y) | 17% / 21% | 10% / 14% | 8% 11% | 6% 8% | 8% |\n",
"\n",
"Growth rates include non-GAAP CC growth (GAAP %/CC%)\n",
"\n",
Expand All @@ -75,6 +82,8 @@
"LinkedIn revenue increased 10% (up 14% in constant currency)\n",
"Dynamics products and cloud services revenue increased 13% (up 20% in constant currency) driven by Dynamics 365 revenue growth of 21% (up 29% in constant currency)\n",
"\n",
"Revenue in Intelligent Cloud was $21.5 billion and increased 18% (up 24% in constant currency), with the following business highlights:\n",
"\n",
"Server products and cloud services revenue increased 20% (up 26% in constant currency) driven by Azure and other cloud services revenue growth of 31% (up 38% in constant currency)\n",
"\n",
"Revenue in More Personal Computing was $14.2 billion and decreased 19% (down 16% in constant currency), with the following business highlights:\n",
Expand Down Expand Up @@ -108,13 +117,6 @@
"content_result = op.extract(example_local_file)\n",
"print(content_result)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
4 changes: 2 additions & 2 deletions examples/test_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

op = OpenParser(example_apikey)

print("file content extraction test:")
print("file/document extraction test:")
content_result = op.extract(example_local_file)
print(type(content_result))
print(content_result)

print("file information QA test:")
print("information extraction test:")
example_prompt = "Return table under Investor Metrics in JSON format with year as the key and the column as subkeys."
qa_result = op.parse(example_local_file, example_prompt)
print(type(qa_result))
Expand Down
95 changes: 95 additions & 0 deletions examples/test_information_extraction.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Information Extraction"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%reload_ext autoreload\n",
"%autoreload 2\n",
"\n",
"import sys\n",
"\n",
"sys.path.append(\".\")\n",
"sys.path.append(\"..\")\n",
"sys.path.append(\"../..\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"from dotenv import load_dotenv\n",
"from open_parser import OpenParser\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"load_dotenv(override=True)\n",
"\n",
"example_apikey = os.getenv(\"CAMBIO_API_KEY\")"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Upload response: 204\n",
"Extraction success.\n",
"[{'result': [{'FY23 Q1': {'Office Commercial products and cloud services revenue growth (y/y)': '7% / 13%', 'Office Consumer products and cloud services revenue growth (y/y)': '7% / 11%', 'Office 365 Commercial seat growth (y/y)': '14%', 'Microsoft 365 Consumer subscribers (in millions)': '65.1', 'Dynamics products and cloud services revenue growth (y/y)': '15% / 22%', 'LinkedIn revenue growth (y/y)': '17% / 21%'}}, {'FY23 Q2': {'Office Commercial products and cloud services revenue growth (y/y)': '7% / 14%', 'Office Consumer products and cloud services revenue growth (y/y)': '2% / 3%', 'Office 365 Commercial seat growth (y/y)': '12%', 'Microsoft 365 Consumer subscribers (in millions)': '67.7', 'Dynamics products and cloud services revenue growth (y/y)': '13% / 20%', 'LinkedIn revenue growth (y/y)': '10% / 14%'}}, {'FY23 Q3': {'Office Commercial products and cloud services revenue growth (y/y)': '13% / 17%', 'Office Consumer products and cloud services revenue growth (y/y)': '1% / 4%', 'Office 365 Commercial seat growth (y/y)': '11%', 'Microsoft 365 Consumer subscribers (in millions)': '70.8', 'Dynamics products and cloud services revenue growth (y/y)': '17% / 21%', 'LinkedIn revenue growth (y/y)': '8% / 11%'}}, {'FY23 Q4': {'Office Commercial products and cloud services revenue growth (y/y)': '12% / 14%', 'Office Consumer products and cloud services revenue growth (y/y)': '3% / 6%', 'Office 365 Commercial seat growth (y/y)': '11%', 'Microsoft 365 Consumer subscribers (in millions)': '74.9', 'Dynamics products and cloud services revenue growth (y/y)': '19% / 21%', 'LinkedIn revenue growth (y/y)': '6% / 8%'}}, {'FY24 Q1': {'Office Commercial products and cloud services revenue growth (y/y)': '15% / 14%', 'Office Consumer products and cloud services revenue growth (y/y)': '3% / 4%', 'Office 365 Commercial seat growth (y/y)': '10%', 'Microsoft 365 Consumer subscribers (in millions)': '76.7', 'Dynamics products and cloud services revenue growth (y/y)': '22% / 21%', 'LinkedIn revenue growth (y/y)': '8%'}}], 'log': {'instruction': 'Return table under Investor Metrics in JSON format with year as the key and the column as subkeys.', 'source': '', 'usage': {'input_tokens': 1758, 'output_tokens': 771}}, 'page_num': 0}]\n"
]
}
],
"source": [
"example_local_file = \"./test2.pdf\"\n",
"example_prompt = \"Return table under Investor Metrics in JSON format with year as the key and the column as subkeys.\"\n",
"\n",
"op = OpenParser(example_apikey)\n",
"qa_result = op.parse(example_local_file, example_prompt)\n",
"\n",
"print(qa_result)\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "open-parser",
"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.14"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
88 changes: 0 additions & 88 deletions examples/test_parse.ipynb

This file was deleted.

0 comments on commit 1a316e7

Please sign in to comment.