Skip to content

Commit 1546124

Browse files
committed
Merge branch 'errors_fixed' of https://github.com/Axiomatic-AI/axiomatic-python-sdk into errors_fixed
2 parents f513030 + 5cdf266 commit 1546124

File tree

5 files changed

+1707
-0
lines changed

5 files changed

+1707
-0
lines changed

equations.pkl

21.7 KB
Binary file not shown.

loaded_eqautions.pkl

21.8 KB
Binary file not shown.

new_axtract.ipynb

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"We begin with standard imports of Axiomatic clients and choose the file we want to digitalize. Please, provide either a path or a url of the file."
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": 1,
13+
"metadata": {},
14+
"outputs": [],
15+
"source": [
16+
"from axiomatic import Axiomatic\n",
17+
"from src.axiomatic.client import AxtractHelper\n",
18+
"ax_client = Axiomatic(timeout=100000, api_key=\"2d702671-4b31-4174-a88e-087a02e3c29a\")\n",
19+
"\n",
20+
"axtract = AxtractHelper(ax_client)\n",
21+
"\n",
22+
"file = \"https://storage.googleapis.com/ax-example-papers-pdf-storage/public/axtract_mechanics.pdf\"\n"
23+
]
24+
},
25+
{
26+
"cell_type": "markdown",
27+
"metadata": {},
28+
"source": [
29+
"We now send the paper to our analyzing tool"
30+
]
31+
},
32+
{
33+
"cell_type": "code",
34+
"execution_count": 2,
35+
"metadata": {},
36+
"outputs": [],
37+
"source": [
38+
"loaded_eqautions = axtract.analyze_equations(url_path=file)"
39+
]
40+
},
41+
{
42+
"cell_type": "markdown",
43+
"metadata": {},
44+
"source": [
45+
"Once the document is analyzed, we can create a html report to preview the results, as well, as see the relation graph of the document. Please select the path you want your report to be stored. By default it will be stored in this directory"
46+
]
47+
},
48+
{
49+
"cell_type": "code",
50+
"execution_count": 4,
51+
"metadata": {},
52+
"outputs": [],
53+
"source": [
54+
"axtract.create_report(loaded_eqautions, \"./report.html\")"
55+
]
56+
},
57+
{
58+
"cell_type": "markdown",
59+
"metadata": {},
60+
"source": [
61+
"Now, if we want to perform numercial calculations on the extracted equations, we can use our interactive table tool. The idea behind it is the following: The user chooses the quantities/variables of their interest by clicking Add Requirement as many times as all variables of interest are selected. The user can also save the configuration of your requirements.\n",
62+
"\n"
63+
]
64+
},
65+
{
66+
"cell_type": "code",
67+
"execution_count": null,
68+
"metadata": {},
69+
"outputs": [],
70+
"source": [
71+
"user_choice = axtract.set_numerical_requirements(loaded_eqautions)\n"
72+
]
73+
},
74+
{
75+
"cell_type": "markdown",
76+
"metadata": {},
77+
"source": [
78+
"Later, after the user provides numerical values of each of the variables and clicks Submit button, Axiomatic Math engine will look for all equations that are relevant for the given set of variable/requirements. The system will return the comprehensive description of the results. If given numerical values are contradictory, the user will be informed about that."
79+
]
80+
},
81+
{
82+
"cell_type": "code",
83+
"execution_count": null,
84+
"metadata": {},
85+
"outputs": [],
86+
"source": [
87+
"axtract.validate_equations(user_choice[0], loaded_eqautions)"
88+
]
89+
}
90+
],
91+
"metadata": {
92+
"kernelspec": {
93+
"display_name": "axiomatic",
94+
"language": "python",
95+
"name": "python3"
96+
},
97+
"language_info": {
98+
"codemirror_mode": {
99+
"name": "ipython",
100+
"version": 3
101+
},
102+
"file_extension": ".py",
103+
"mimetype": "text/x-python",
104+
"name": "python",
105+
"nbconvert_exporter": "python",
106+
"pygments_lexer": "ipython3",
107+
"version": "3.13.0"
108+
}
109+
},
110+
"nbformat": 4,
111+
"nbformat_minor": 2
112+
}

relation_graph.html

Lines changed: 147 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)