Trying to find books to chunk on heading
Browse files- pydantic-1.ipynb +13 -6
- rag-1.ipynb +351 -0
pydantic-1.ipynb
CHANGED
@@ -147,7 +147,7 @@
|
|
147 |
},
|
148 |
{
|
149 |
"cell_type": "code",
|
150 |
-
"execution_count":
|
151 |
"metadata": {},
|
152 |
"outputs": [],
|
153 |
"source": [
|
@@ -167,7 +167,7 @@
|
|
167 |
" \n",
|
168 |
"# values = {'url': 'https://www.example.com'}\n",
|
169 |
"#w = WebSite(**values)\n",
|
170 |
-
"#
|
171 |
"#w = WebSite(url='abc')\n",
|
172 |
"\n",
|
173 |
"# website_parser = PydanticOutputParser(pydantic_object=WebSite)\n",
|
@@ -176,13 +176,18 @@
|
|
176 |
},
|
177 |
{
|
178 |
"cell_type": "code",
|
179 |
-
"execution_count":
|
180 |
"metadata": {},
|
181 |
"outputs": [
|
182 |
{
|
183 |
"name": "stdout",
|
184 |
"output_type": "stream",
|
185 |
"text": [
|
|
|
|
|
|
|
|
|
|
|
186 |
"The output should be formatted as a JSON instance that conforms to the JSON schema below.\n",
|
187 |
"\n",
|
188 |
"As an example, for the schema {\"properties\": {\"foo\": {\"title\": \"Foo\", \"description\": \"a list of strings\", \"type\": \"array\", \"items\": {\"type\": \"string\"}}}, \"required\": [\"foo\"]}\n",
|
@@ -190,7 +195,7 @@
|
|
190 |
"\n",
|
191 |
"Here is the output schema:\n",
|
192 |
"```\n",
|
193 |
-
"{\"properties\": {\"
|
194 |
"```\n"
|
195 |
]
|
196 |
}
|
@@ -201,7 +206,7 @@
|
|
201 |
"model = OpenAI(model_name=model_name, temperature=temperature)\n",
|
202 |
"\n",
|
203 |
"# And a query intented to prompt a language model to populate the data structure.\n",
|
204 |
-
"
|
205 |
"\n",
|
206 |
"# Set up a parser + inject instructions into the prompt template.\n",
|
207 |
"parser = PydanticOutputParser(pydantic_object=WebSite)\n",
|
@@ -212,8 +217,10 @@
|
|
212 |
" partial_variables={\"format_instructions\": parser.get_format_instructions()},\n",
|
213 |
")\n",
|
214 |
"\n",
|
|
|
|
|
215 |
"print(parser.get_format_instructions())\n",
|
216 |
-
"# _input = prompt.format_prompt(query=
|
217 |
"# output = model(_input.to_string())\n",
|
218 |
"# parser.parse(output)"
|
219 |
]
|
|
|
147 |
},
|
148 |
{
|
149 |
"cell_type": "code",
|
150 |
+
"execution_count": 82,
|
151 |
"metadata": {},
|
152 |
"outputs": [],
|
153 |
"source": [
|
|
|
167 |
" \n",
|
168 |
"# values = {'url': 'https://www.example.com'}\n",
|
169 |
"#w = WebSite(**values)\n",
|
170 |
+
"#w = WebSite(url='https://www.example.com')\n",
|
171 |
"#w = WebSite(url='abc')\n",
|
172 |
"\n",
|
173 |
"# website_parser = PydanticOutputParser(pydantic_object=WebSite)\n",
|
|
|
176 |
},
|
177 |
{
|
178 |
"cell_type": "code",
|
179 |
+
"execution_count": 88,
|
180 |
"metadata": {},
|
181 |
"outputs": [
|
182 |
{
|
183 |
"name": "stdout",
|
184 |
"output_type": "stream",
|
185 |
"text": [
|
186 |
+
"Answer the user query.\n",
|
187 |
+
"{format_instructions}\n",
|
188 |
+
"{query}\n",
|
189 |
+
"\n",
|
190 |
+
"##############\n",
|
191 |
"The output should be formatted as a JSON instance that conforms to the JSON schema below.\n",
|
192 |
"\n",
|
193 |
"As an example, for the schema {\"properties\": {\"foo\": {\"title\": \"Foo\", \"description\": \"a list of strings\", \"type\": \"array\", \"items\": {\"type\": \"string\"}}}, \"required\": [\"foo\"]}\n",
|
|
|
195 |
"\n",
|
196 |
"Here is the output schema:\n",
|
197 |
"```\n",
|
198 |
+
"{\"properties\": {\"url\": {\"format\": \"uri\", \"maxLength\": 2083, \"minLength\": 1, \"title\": \"Url\", \"type\": \"string\"}}, \"required\": [\"url\"]}\n",
|
199 |
"```\n"
|
200 |
]
|
201 |
}
|
|
|
206 |
"model = OpenAI(model_name=model_name, temperature=temperature)\n",
|
207 |
"\n",
|
208 |
"# And a query intented to prompt a language model to populate the data structure.\n",
|
209 |
+
"query = \"Fetch a news website\"\n",
|
210 |
"\n",
|
211 |
"# Set up a parser + inject instructions into the prompt template.\n",
|
212 |
"parser = PydanticOutputParser(pydantic_object=WebSite)\n",
|
|
|
217 |
" partial_variables={\"format_instructions\": parser.get_format_instructions()},\n",
|
218 |
")\n",
|
219 |
"\n",
|
220 |
+
"print(prompt.template)\n",
|
221 |
+
"print('##############')\n",
|
222 |
"print(parser.get_format_instructions())\n",
|
223 |
+
"# _input = prompt.format_prompt(query=query)\n",
|
224 |
"# output = model(_input.to_string())\n",
|
225 |
"# parser.parse(output)"
|
226 |
]
|
rag-1.ipynb
ADDED
@@ -0,0 +1,351 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 106,
|
6 |
+
"metadata": {},
|
7 |
+
"outputs": [
|
8 |
+
{
|
9 |
+
"name": "stdout",
|
10 |
+
"output_type": "stream",
|
11 |
+
"text": [
|
12 |
+
"Reading settings from ../../env/ai.json\n"
|
13 |
+
]
|
14 |
+
}
|
15 |
+
],
|
16 |
+
"source": [
|
17 |
+
"import os\n",
|
18 |
+
"import json\n",
|
19 |
+
"\n",
|
20 |
+
"pathToSettings = '../../env/ai.json'\n",
|
21 |
+
"if os.path.exists(pathToSettings):\n",
|
22 |
+
" # Load setting from Json outside of project.\n",
|
23 |
+
" print(f'Reading settings from {pathToSettings}')\n",
|
24 |
+
" f = open(pathToSettings)\n",
|
25 |
+
" settingsJson = json.load(f)\n",
|
26 |
+
" del f\n",
|
27 |
+
"\n",
|
28 |
+
" for key in settingsJson:\n",
|
29 |
+
" os.environ[key] = settingsJson[key]\n",
|
30 |
+
" \n",
|
31 |
+
" del settingsJson"
|
32 |
+
]
|
33 |
+
},
|
34 |
+
{
|
35 |
+
"cell_type": "markdown",
|
36 |
+
"metadata": {},
|
37 |
+
"source": [
|
38 |
+
"# PyPdf"
|
39 |
+
]
|
40 |
+
},
|
41 |
+
{
|
42 |
+
"cell_type": "code",
|
43 |
+
"execution_count": 107,
|
44 |
+
"metadata": {},
|
45 |
+
"outputs": [],
|
46 |
+
"source": [
|
47 |
+
"from pypdf import PdfReader\n",
|
48 |
+
"from pypdf.generic import Destination\n",
|
49 |
+
"import os"
|
50 |
+
]
|
51 |
+
},
|
52 |
+
{
|
53 |
+
"cell_type": "code",
|
54 |
+
"execution_count": 108,
|
55 |
+
"metadata": {},
|
56 |
+
"outputs": [],
|
57 |
+
"source": [
|
58 |
+
"#path = '../my-data/finance/FINANCE Essencial finance.pdf'\n",
|
59 |
+
"#path = '../my-data/finance/CoreCourseFinancialAccounting.pdf'\n",
|
60 |
+
"path = '../my-data/finance/Liquidity Markets and Trading in Action An Interdisciplinary.pdf'"
|
61 |
+
]
|
62 |
+
},
|
63 |
+
{
|
64 |
+
"cell_type": "code",
|
65 |
+
"execution_count": 109,
|
66 |
+
"metadata": {},
|
67 |
+
"outputs": [],
|
68 |
+
"source": [
|
69 |
+
"pathFooterDict = { \n",
|
70 |
+
" '../my-data/finance/Liquidity Markets and Trading in Action An Interdisciplinary.pdf': \n",
|
71 |
+
" ['2 Liquidity, Trading, and Price Determination in Equity Markets: A Finance Course…', \n",
|
72 |
+
" '2 Liquidity, Trading, and Price Determination in Equity Markets: A Finance Course'\n",
|
73 |
+
" ]\n",
|
74 |
+
" }\n"
|
75 |
+
]
|
76 |
+
},
|
77 |
+
{
|
78 |
+
"cell_type": "code",
|
79 |
+
"execution_count": 110,
|
80 |
+
"metadata": {},
|
81 |
+
"outputs": [],
|
82 |
+
"source": [
|
83 |
+
"import re \n",
|
84 |
+
"\n",
|
85 |
+
"def clean_characters(text):\n",
|
86 |
+
" text = re.sub(r'[^\\x00-\\x7F]',' ', text) \n",
|
87 |
+
" text = text.replace('\\t', ' ') \n",
|
88 |
+
" \n",
|
89 |
+
" while ' ' in text:\n",
|
90 |
+
" text = text.replace(' ', ' ')\n",
|
91 |
+
" \n",
|
92 |
+
" return text\n",
|
93 |
+
"\n",
|
94 |
+
"def clean_footer_out(filename, text):\n",
|
95 |
+
" for t in pathFooterDict[filename]:\n",
|
96 |
+
" text = text.replace(t, '')\n",
|
97 |
+
" return text"
|
98 |
+
]
|
99 |
+
},
|
100 |
+
{
|
101 |
+
"cell_type": "code",
|
102 |
+
"execution_count": 111,
|
103 |
+
"metadata": {},
|
104 |
+
"outputs": [
|
105 |
+
{
|
106 |
+
"name": "stdout",
|
107 |
+
"output_type": "stream",
|
108 |
+
"text": [
|
109 |
+
"../my-data/finance/Liquidity Markets and Trading in Action An Interdisciplinary.pdf\n"
|
110 |
+
]
|
111 |
+
}
|
112 |
+
],
|
113 |
+
"source": [
|
114 |
+
"def get_bookmarks(pdf):\n",
|
115 |
+
" bookmarks = []\n",
|
116 |
+
" rd = PdfReader(pdf)\n",
|
117 |
+
"\n",
|
118 |
+
" def recursive(outline, level=0):\n",
|
119 |
+
" for i in outline:\n",
|
120 |
+
" if isinstance(i, Destination):\n",
|
121 |
+
" d = {\n",
|
122 |
+
" 'page': rd.get_destination_page_number(i),\n",
|
123 |
+
" 'level': level,\n",
|
124 |
+
" 'bookmark': i.title # clean_characters(i.title),\n",
|
125 |
+
" }\n",
|
126 |
+
" bookmarks.append(d)\n",
|
127 |
+
" elif isinstance(i, list):\n",
|
128 |
+
" recursive(i, level + 1)\n",
|
129 |
+
"\n",
|
130 |
+
" recursive(rd.outline)\n",
|
131 |
+
" return bookmarks\n",
|
132 |
+
"\n",
|
133 |
+
"result = get_bookmarks(path)\n",
|
134 |
+
"print(path)\n"
|
135 |
+
]
|
136 |
+
},
|
137 |
+
{
|
138 |
+
"cell_type": "code",
|
139 |
+
"execution_count": 112,
|
140 |
+
"metadata": {},
|
141 |
+
"outputs": [],
|
142 |
+
"source": [
|
143 |
+
"# reader = PdfReader(path)\n",
|
144 |
+
"# print(reader.pages[33].extract_text())\n",
|
145 |
+
"\n",
|
146 |
+
"# print(\"#########################\")\n",
|
147 |
+
"# value = clean_footer_out(path, reader.pages[33].extract_text())\n",
|
148 |
+
"# print(value)\n",
|
149 |
+
"\n",
|
150 |
+
"# # print('########################################')\n",
|
151 |
+
"# # print(reader.pages[34].extract_text())\n",
|
152 |
+
"# # print('########################################')\n",
|
153 |
+
"# # print(reader.pages[100].extract_text())\n",
|
154 |
+
"# # print('########################################')\n",
|
155 |
+
"# # print(reader.pages[101].extract_text())\n"
|
156 |
+
]
|
157 |
+
},
|
158 |
+
{
|
159 |
+
"cell_type": "code",
|
160 |
+
"execution_count": 113,
|
161 |
+
"metadata": {},
|
162 |
+
"outputs": [],
|
163 |
+
"source": [
|
164 |
+
"pages = []\n",
|
165 |
+
"reader = PdfReader(path)\n",
|
166 |
+
"for p in reader.pages:\n",
|
167 |
+
" page_text = p.extract_text()\n",
|
168 |
+
" pages.append(page_text)\n",
|
169 |
+
" \n",
|
170 |
+
"with open(f'{path}.txt', 'w') as f:\n",
|
171 |
+
" for page_text in pages: \n",
|
172 |
+
" #page_text = clean_characters(page_text)\n",
|
173 |
+
" #page_text = clean_footer_out(path, page_text)\n",
|
174 |
+
" f.write(f\"{page_text}\\n\")"
|
175 |
+
]
|
176 |
+
},
|
177 |
+
{
|
178 |
+
"cell_type": "code",
|
179 |
+
"execution_count": 114,
|
180 |
+
"metadata": {},
|
181 |
+
"outputs": [
|
182 |
+
{
|
183 |
+
"name": "stdout",
|
184 |
+
"output_type": "stream",
|
185 |
+
"text": [
|
186 |
+
"{'page': 0, 'level': 0, 'bookmark': 'Liquidity, Markets and Trading in Action'}\n",
|
187 |
+
"*********************\n",
|
188 |
+
"{'page': 5, 'level': 1, 'bookmark': 'Preface'}\n",
|
189 |
+
"*********************\n",
|
190 |
+
"{'page': 5, 'level': 2, 'bookmark': 'Microeconomics, Chap. 1'}\n",
|
191 |
+
"*********************\n",
|
192 |
+
"{'page': 6, 'level': 2, 'bookmark': 'Finance, Chap. 2'}\n",
|
193 |
+
"*********************\n",
|
194 |
+
"{'page': 6, 'level': 2, 'bookmark': 'Macroeconomics, Chap. 3'}\n",
|
195 |
+
"*********************\n",
|
196 |
+
"{'page': 7, 'level': 2, 'bookmark': 'Information Systems, Chap. 4'}\n",
|
197 |
+
"*********************\n",
|
198 |
+
"{'page': 7, 'level': 2, 'bookmark': 'Simulated Trading, Chap. 5'}\n",
|
199 |
+
"*********************\n",
|
200 |
+
"{'page': 7, 'level': 2, 'bookmark': 'Aim of\\xa0This Book'}\n",
|
201 |
+
"*********************\n",
|
202 |
+
"{'page': 9, 'level': 1, 'bookmark': 'Acknowledgment'}\n",
|
203 |
+
"*********************\n",
|
204 |
+
"{'page': 10, 'level': 1, 'bookmark': 'Contents'}\n",
|
205 |
+
"*********************\n",
|
206 |
+
"{'page': 11, 'level': 1, 'bookmark': '1: Economics and\\xa0the\\xa0Equity Market: A\\xa0Microeconomics Course Application'}\n",
|
207 |
+
"*********************\n",
|
208 |
+
"{'page': 12, 'level': 2, 'bookmark': '1.1\\t Microeconomics in\\xa0a\\xa0Nutshell'}\n",
|
209 |
+
"*********************\n",
|
210 |
+
"{'page': 13, 'level': 2, 'bookmark': '1.2\\t Microeconomic Analysis Goes to\\xa0an\\xa0Equity Market'}\n",
|
211 |
+
"*********************\n",
|
212 |
+
"{'page': 14, 'level': 2, 'bookmark': '1.3\\t Risk, Return Indifference Curves'}\n",
|
213 |
+
"*********************\n",
|
214 |
+
"{'page': 15, 'level': 2, 'bookmark': '1.4\\t The Constraint'}\n",
|
215 |
+
"*********************\n",
|
216 |
+
"{'page': 19, 'level': 2, 'bookmark': '1.5\\t Demand Curve to\\xa0Hold Shares of\\xa0the\\xa0Market Portfolio'}\n",
|
217 |
+
"*********************\n",
|
218 |
+
"{'page': 24, 'level': 2, 'bookmark': '1.6\\t What About the\\xa0Supply Curve?'}\n",
|
219 |
+
"*********************\n",
|
220 |
+
"{'page': 24, 'level': 2, 'bookmark': '1.7\\t Buy and\\xa0Sell Curves'}\n",
|
221 |
+
"*********************\n",
|
222 |
+
"{'page': 27, 'level': 2, 'bookmark': '1.8\\t The Non-frictionless Market'}\n",
|
223 |
+
"*********************\n",
|
224 |
+
"{'page': 28, 'level': 2, 'bookmark': '1.9\\t Wrap Up: Microeconomics in\\xa0a\\xa0Non-frictionless Financial Market'}\n",
|
225 |
+
"*********************\n",
|
226 |
+
"{'page': 30, 'level': 1, 'bookmark': '2: Liquidity, Trading, and\\xa0Price Determination in\\xa0Equity Markets: A\\xa0Finance Course Application'}\n",
|
227 |
+
"*********************\n",
|
228 |
+
"{'page': 33, 'level': 2, 'bookmark': '2.1\\t Order Types'}\n",
|
229 |
+
"*********************\n",
|
230 |
+
"{'page': 34, 'level': 2, 'bookmark': '2.2\\t Trading Costs'}\n",
|
231 |
+
"*********************\n",
|
232 |
+
"{'page': 36, 'level': 2, 'bookmark': '2.3\\t What Drives Trading?'}\n",
|
233 |
+
"*********************\n",
|
234 |
+
"{'page': 37, 'level': 2, 'bookmark': '2.4\\t Price Discovery: A\\xa0Major Function of\\xa0a\\xa0Marketplace'}\n",
|
235 |
+
"*********************\n",
|
236 |
+
"{'page': 37, 'level': 2, 'bookmark': '2.5\\t Trading: The\\xa0Implementation of\\xa0an\\xa0Investment Decision'}\n",
|
237 |
+
"*********************\n",
|
238 |
+
"{'page': 38, 'level': 2, 'bookmark': '2.6\\t Intraday Price Volatility'}\n",
|
239 |
+
"*********************\n",
|
240 |
+
"{'page': 39, 'level': 2, 'bookmark': '2.7\\t Liquidity'}\n",
|
241 |
+
"*********************\n",
|
242 |
+
"{'page': 40, 'level': 2, 'bookmark': '2.8\\t Equity Market Structures'}\n",
|
243 |
+
"*********************\n",
|
244 |
+
"{'page': 43, 'level': 3, 'bookmark': '2.8.1\\t Hybrid Markets'}\n",
|
245 |
+
"*********************\n",
|
246 |
+
"{'page': 43, 'level': 3, 'bookmark': '2.8.2\\t Handling Large Orders'}\n",
|
247 |
+
"*********************\n",
|
248 |
+
"{'page': 44, 'level': 2, 'bookmark': '2.9\\t Financial Markets and\\xa0the\\xa0Process of\\xa0Turning Orders into Trades'}\n",
|
249 |
+
"*********************\n",
|
250 |
+
"{'page': 44, 'level': 3, 'bookmark': '2.9.1\\t Trades in\\xa0Continuous Order-Driven Markets'}\n",
|
251 |
+
"*********************\n",
|
252 |
+
"{'page': 46, 'level': 3, 'bookmark': '2.9.2\\t Trades in\\xa0Call Auction Markets'}\n",
|
253 |
+
"*********************\n",
|
254 |
+
"{'page': 48, 'level': 3, 'bookmark': '2.9.3\\t Trades in\\xa0Continuous Dealer Markets'}\n",
|
255 |
+
"*********************\n",
|
256 |
+
"{'page': 48, 'level': 2, 'bookmark': '2.10\\t Regulation, Technology, and the Quality of Market Structure\\x04'}\n",
|
257 |
+
"*********************\n",
|
258 |
+
"{'page': 55, 'level': 2, 'bookmark': '2.11\\t Wrapping It Up: Market Efficiency in\\xa0a\\xa0Non-frictionless World'}\n",
|
259 |
+
"*********************\n",
|
260 |
+
"{'page': 59, 'level': 1, 'bookmark': '3: Liquidity and\\xa0the\\xa0Impact of\\xa0Information Shocks: A\\xa0Macroeconomics Course Application'}\n",
|
261 |
+
"*********************\n",
|
262 |
+
"{'page': 60, 'level': 2, 'bookmark': '3.1\\t Economic Conditions, Business Cycles, and\\xa0the\\xa0Role of\\xa0Interest Rates'}\n",
|
263 |
+
"*********************\n",
|
264 |
+
"{'page': 61, 'level': 2, 'bookmark': '3.2\\t The Federal Reserve and\\xa0the\\xa0Link Between the\\xa0Macroeconomy and\\xa0Financial Markets'}\n",
|
265 |
+
"*********************\n",
|
266 |
+
"{'page': 62, 'level': 2, 'bookmark': '3.3\\t The Impact of\\xa0Information Shocks on\\xa0Divergent Expectations and\\xa0Price Discovery'}\n",
|
267 |
+
"*********************\n",
|
268 |
+
"{'page': 63, 'level': 2, 'bookmark': '3.4\\t The Various Types of\\xa0Financial Markets'}\n",
|
269 |
+
"*********************\n",
|
270 |
+
"{'page': 66, 'level': 2, 'bookmark': '3.5\\t Example of\\xa0an\\xa0Information Shock Based on\\xa0the\\xa0Fed’s Actions and\\xa0the\\xa0Financial Market’s Reactions'}\n",
|
271 |
+
"*********************\n",
|
272 |
+
"{'page': 72, 'level': 2, 'bookmark': '3.6\\t Using the\\xa0TraderEx Simulation to\\xa0Understand Interactions Between Financial Markets and\\xa0the\\xa0Macroeconomy'}\n",
|
273 |
+
"*********************\n",
|
274 |
+
"{'page': 73, 'level': 2, 'bookmark': '3.7\\t Making the\\xa0Trade: Combining Macroeconomics with\\xa0Fundamental Analysis and\\xa0Technical Analysis'}\n",
|
275 |
+
"*********************\n",
|
276 |
+
"{'page': 76, 'level': 2, 'bookmark': '3.8\\t Wrapping Up: How Information Shocks Affect Financial Markets and\\xa0the\\xa0Economy'}\n",
|
277 |
+
"*********************\n",
|
278 |
+
"{'page': 78, 'level': 1, 'bookmark': '4: Trading and\\xa0Technology: An\\xa0Information Systems Course Application'}\n",
|
279 |
+
"*********************\n",
|
280 |
+
"{'page': 79, 'level': 2, 'bookmark': '4.1\\t IT Innovations: Disruptive Versus Incremental'}\n",
|
281 |
+
"*********************\n",
|
282 |
+
"{'page': 80, 'level': 2, 'bookmark': '4.2\\t IT Infrastructure for\\xa0Financial Markets'}\n",
|
283 |
+
"*********************\n",
|
284 |
+
"{'page': 81, 'level': 2, 'bookmark': '4.3\\t IT Support for\\xa0the\\xa0Economic Functions of\\xa0Financial Markets'}\n",
|
285 |
+
"*********************\n",
|
286 |
+
"{'page': 82, 'level': 2, 'bookmark': '4.4\\t Instruments and\\xa0Market Data'}\n",
|
287 |
+
"*********************\n",
|
288 |
+
"{'page': 84, 'level': 2, 'bookmark': '4.5\\t Foundational Technologies for\\xa0Trading'}\n",
|
289 |
+
"*********************\n",
|
290 |
+
"{'page': 85, 'level': 2, 'bookmark': '4.6\\t IT Functions in\\xa0Trading'}\n",
|
291 |
+
"*********************\n",
|
292 |
+
"{'page': 87, 'level': 2, 'bookmark': '4.7\\t Managing Trading Technology'}\n",
|
293 |
+
"*********************\n",
|
294 |
+
"{'page': 92, 'level': 2, 'bookmark': '4.8\\t Conclusion'}\n",
|
295 |
+
"*********************\n",
|
296 |
+
"{'page': 94, 'level': 1, 'bookmark': '5: Experiencing Market Dynamics with\\xa0TraderEx: A\\xa0Trading Decision-Making Simulation'}\n",
|
297 |
+
"*********************\n",
|
298 |
+
"{'page': 95, 'level': 2, 'bookmark': '5.1\\t Conceptual Features of\\xa0the\\xa0TraderEx Trading Simulation'}\n",
|
299 |
+
"*********************\n",
|
300 |
+
"{'page': 98, 'level': 2, 'bookmark': '5.2\\t Using the\\xa0TraderEx Trading Simulation'}\n",
|
301 |
+
"*********************\n",
|
302 |
+
"{'page': 99, 'level': 2, 'bookmark': '5.3\\t Orders Types'}\n",
|
303 |
+
"*********************\n",
|
304 |
+
"{'page': 101, 'level': 2, 'bookmark': '5.4\\t Running a\\xa0TraderEx Simulation'}\n",
|
305 |
+
"*********************\n",
|
306 |
+
"{'page': 105, 'level': 2, 'bookmark': '5.5\\t Diving Deeper'}\n",
|
307 |
+
"*********************\n",
|
308 |
+
"{'page': 106, 'level': 2, 'bookmark': '5.6\\t Conclusion'}\n",
|
309 |
+
"*********************\n",
|
310 |
+
"{'page': 108, 'level': 1, 'bookmark': 'Index'}\n",
|
311 |
+
"*********************\n"
|
312 |
+
]
|
313 |
+
}
|
314 |
+
],
|
315 |
+
"source": [
|
316 |
+
"# print(result[0])\n",
|
317 |
+
"# print('###################################')\n",
|
318 |
+
"# print(result[1])\n",
|
319 |
+
"# print('###################################')\n",
|
320 |
+
"# print(result[5])\n",
|
321 |
+
"# print('###################################')\n",
|
322 |
+
"# print(len(result))\n",
|
323 |
+
"\n",
|
324 |
+
"for p in result:\n",
|
325 |
+
" print(p)\n",
|
326 |
+
" print('*********************')"
|
327 |
+
]
|
328 |
+
}
|
329 |
+
],
|
330 |
+
"metadata": {
|
331 |
+
"kernelspec": {
|
332 |
+
"display_name": ".venv",
|
333 |
+
"language": "python",
|
334 |
+
"name": "python3"
|
335 |
+
},
|
336 |
+
"language_info": {
|
337 |
+
"codemirror_mode": {
|
338 |
+
"name": "ipython",
|
339 |
+
"version": 3
|
340 |
+
},
|
341 |
+
"file_extension": ".py",
|
342 |
+
"mimetype": "text/x-python",
|
343 |
+
"name": "python",
|
344 |
+
"nbconvert_exporter": "python",
|
345 |
+
"pygments_lexer": "ipython3",
|
346 |
+
"version": "3.10.6"
|
347 |
+
}
|
348 |
+
},
|
349 |
+
"nbformat": 4,
|
350 |
+
"nbformat_minor": 2
|
351 |
+
}
|