Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- benchmarking.ipynb +274 -88
benchmarking.ipynb
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
},
|
10 |
{
|
11 |
"cell_type": "code",
|
12 |
-
"execution_count":
|
13 |
"metadata": {},
|
14 |
"outputs": [],
|
15 |
"source": [
|
@@ -21,7 +21,9 @@
|
|
21 |
"import logging\n",
|
22 |
"from semscore import EmbeddingModelWrapper\n",
|
23 |
"from statistics import mean\n",
|
|
|
24 |
"\n",
|
|
|
25 |
"\n",
|
26 |
"def display_text_df(df):\n",
|
27 |
" display(df.style.set_properties(**{'white-space': 'pre-wrap'}).set_table_styles(\n",
|
@@ -33,80 +35,86 @@
|
|
33 |
},
|
34 |
{
|
35 |
"cell_type": "code",
|
36 |
-
"execution_count":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
"metadata": {},
|
38 |
"outputs": [
|
39 |
{
|
40 |
-
"
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
"Loading index...\n",
|
49 |
-
"Index loaded\n"
|
50 |
-
]
|
51 |
}
|
52 |
],
|
53 |
"source": [
|
54 |
-
"
|
55 |
-
"data = get_data(download=False)\n"
|
56 |
]
|
57 |
},
|
58 |
{
|
59 |
"cell_type": "code",
|
60 |
-
"execution_count":
|
61 |
"metadata": {},
|
62 |
"outputs": [
|
63 |
{
|
64 |
"data": {
|
65 |
"text/html": [
|
66 |
"<style type=\"text/css\">\n",
|
67 |
-
"#
|
68 |
" text-align: left;\n",
|
69 |
"}\n",
|
70 |
-
"#
|
71 |
" text-align: left;\n",
|
72 |
"}\n",
|
73 |
-
"#
|
74 |
" white-space: pre-wrap;\n",
|
75 |
"}\n",
|
76 |
"</style>\n",
|
77 |
-
"<table id=\"
|
78 |
" <thead>\n",
|
79 |
" <tr>\n",
|
80 |
-
" <th id=\"
|
81 |
-
" <th id=\"
|
82 |
-
" <th id=\"
|
83 |
-
" <th id=\"
|
84 |
" </tr>\n",
|
85 |
" </thead>\n",
|
86 |
" <tbody>\n",
|
87 |
" <tr>\n",
|
88 |
-
" <td id=\"
|
89 |
-
" <td id=\"
|
90 |
-
" <td id=\"
|
91 |
-
" <td id=\"
|
92 |
" </tr>\n",
|
93 |
" <tr>\n",
|
94 |
-
" <td id=\"
|
95 |
-
" <td id=\"
|
96 |
-
" <td id=\"
|
97 |
-
" <td id=\"
|
98 |
" </tr>\n",
|
99 |
" <tr>\n",
|
100 |
-
" <td id=\"
|
101 |
-
" <td id=\"
|
102 |
-
" <td id=\"
|
103 |
-
" <td id=\"
|
104 |
" </tr>\n",
|
105 |
" </tbody>\n",
|
106 |
"</table>\n"
|
107 |
],
|
108 |
"text/plain": [
|
109 |
-
"<pandas.io.formats.style.Styler at
|
110 |
]
|
111 |
},
|
112 |
"metadata": {},
|
@@ -119,98 +127,98 @@
|
|
119 |
},
|
120 |
{
|
121 |
"cell_type": "code",
|
122 |
-
"execution_count":
|
123 |
"metadata": {},
|
124 |
"outputs": [
|
125 |
{
|
126 |
"data": {
|
127 |
"text/html": [
|
128 |
"<style type=\"text/css\">\n",
|
129 |
-
"#
|
130 |
" text-align: left;\n",
|
131 |
"}\n",
|
132 |
-
"#
|
133 |
" text-align: left;\n",
|
134 |
"}\n",
|
135 |
-
"#
|
136 |
" white-space: pre-wrap;\n",
|
137 |
"}\n",
|
138 |
"</style>\n",
|
139 |
-
"<table id=\"
|
140 |
" <thead>\n",
|
141 |
" <tr>\n",
|
142 |
-
" <th id=\"
|
143 |
-
" <th id=\"
|
144 |
-
" <th id=\"
|
145 |
-
" <th id=\"
|
146 |
" </tr>\n",
|
147 |
" </thead>\n",
|
148 |
" <tbody>\n",
|
149 |
" <tr>\n",
|
150 |
-
" <td id=\"
|
151 |
-
" <td id=\"
|
152 |
-
" <td id=\"
|
153 |
-
" <td id=\"
|
154 |
" </tr>\n",
|
155 |
" <tr>\n",
|
156 |
-
" <td id=\"
|
157 |
-
" <td id=\"
|
158 |
-
" <td id=\"
|
159 |
-
" <td id=\"
|
160 |
" </tr>\n",
|
161 |
" <tr>\n",
|
162 |
-
" <td id=\"
|
163 |
-
" <td id=\"
|
164 |
-
" <td id=\"
|
165 |
-
" <td id=\"
|
166 |
" </tr>\n",
|
167 |
" <tr>\n",
|
168 |
-
" <td id=\"
|
169 |
-
" <td id=\"
|
170 |
-
" <td id=\"
|
171 |
-
" <td id=\"
|
172 |
" </tr>\n",
|
173 |
" <tr>\n",
|
174 |
-
" <td id=\"
|
175 |
-
" <td id=\"
|
176 |
-
" <td id=\"
|
177 |
-
" <td id=\"
|
178 |
" </tr>\n",
|
179 |
" <tr>\n",
|
180 |
-
" <td id=\"
|
181 |
-
" <td id=\"
|
182 |
-
" <td id=\"
|
183 |
-
" <td id=\"
|
184 |
" </tr>\n",
|
185 |
" <tr>\n",
|
186 |
-
" <td id=\"
|
187 |
-
" <td id=\"
|
188 |
-
" <td id=\"
|
189 |
-
" <td id=\"
|
190 |
" </tr>\n",
|
191 |
" <tr>\n",
|
192 |
-
" <td id=\"
|
193 |
-
" <td id=\"
|
194 |
-
" <td id=\"
|
195 |
-
" <td id=\"
|
196 |
" </tr>\n",
|
197 |
" <tr>\n",
|
198 |
-
" <td id=\"
|
199 |
-
" <td id=\"
|
200 |
-
" <td id=\"
|
201 |
-
" <td id=\"
|
202 |
" </tr>\n",
|
203 |
" <tr>\n",
|
204 |
-
" <td id=\"
|
205 |
-
" <td id=\"
|
206 |
-
" <td id=\"
|
207 |
-
" <td id=\"
|
208 |
" </tr>\n",
|
209 |
" </tbody>\n",
|
210 |
"</table>\n"
|
211 |
],
|
212 |
"text/plain": [
|
213 |
-
"<pandas.io.formats.style.Styler at
|
214 |
]
|
215 |
},
|
216 |
"metadata": {},
|
@@ -224,6 +232,184 @@
|
|
224 |
"display_text_df(dfSample)"
|
225 |
]
|
226 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
{
|
228 |
"cell_type": "markdown",
|
229 |
"metadata": {},
|
@@ -479,7 +665,7 @@
|
|
479 |
},
|
480 |
{
|
481 |
"cell_type": "code",
|
482 |
-
"execution_count":
|
483 |
"metadata": {},
|
484 |
"outputs": [],
|
485 |
"source": []
|
|
|
9 |
},
|
10 |
{
|
11 |
"cell_type": "code",
|
12 |
+
"execution_count": 14,
|
13 |
"metadata": {},
|
14 |
"outputs": [],
|
15 |
"source": [
|
|
|
21 |
"import logging\n",
|
22 |
"from semscore import EmbeddingModelWrapper\n",
|
23 |
"from statistics import mean\n",
|
24 |
+
"from dotenv import load_dotenv\n",
|
25 |
"\n",
|
26 |
+
"load_dotenv() # Load OPENAI_API_KEY from .env (not included in repo)\n",
|
27 |
"\n",
|
28 |
"def display_text_df(df):\n",
|
29 |
" display(df.style.set_properties(**{'white-space': 'pre-wrap'}).set_table_styles(\n",
|
|
|
35 |
},
|
36 |
{
|
37 |
"cell_type": "code",
|
38 |
+
"execution_count": 15,
|
39 |
+
"metadata": {},
|
40 |
+
"outputs": [],
|
41 |
+
"source": [
|
42 |
+
"from data import get_data\n",
|
43 |
+
"data = get_data(download=False)\n"
|
44 |
+
]
|
45 |
+
},
|
46 |
+
{
|
47 |
+
"cell_type": "code",
|
48 |
+
"execution_count": 16,
|
49 |
"metadata": {},
|
50 |
"outputs": [
|
51 |
{
|
52 |
+
"data": {
|
53 |
+
"text/plain": [
|
54 |
+
"(87599, 4)"
|
55 |
+
]
|
56 |
+
},
|
57 |
+
"execution_count": 16,
|
58 |
+
"metadata": {},
|
59 |
+
"output_type": "execute_result"
|
|
|
|
|
|
|
60 |
}
|
61 |
],
|
62 |
"source": [
|
63 |
+
"data.df.shape"
|
|
|
64 |
]
|
65 |
},
|
66 |
{
|
67 |
"cell_type": "code",
|
68 |
+
"execution_count": 17,
|
69 |
"metadata": {},
|
70 |
"outputs": [
|
71 |
{
|
72 |
"data": {
|
73 |
"text/html": [
|
74 |
"<style type=\"text/css\">\n",
|
75 |
+
"#T_1bcbb th {\n",
|
76 |
" text-align: left;\n",
|
77 |
"}\n",
|
78 |
+
"#T_1bcbb td {\n",
|
79 |
" text-align: left;\n",
|
80 |
"}\n",
|
81 |
+
"#T_1bcbb_row0_col0, #T_1bcbb_row0_col1, #T_1bcbb_row0_col2, #T_1bcbb_row0_col3, #T_1bcbb_row1_col0, #T_1bcbb_row1_col1, #T_1bcbb_row1_col2, #T_1bcbb_row1_col3, #T_1bcbb_row2_col0, #T_1bcbb_row2_col1, #T_1bcbb_row2_col2, #T_1bcbb_row2_col3 {\n",
|
82 |
" white-space: pre-wrap;\n",
|
83 |
"}\n",
|
84 |
"</style>\n",
|
85 |
+
"<table id=\"T_1bcbb\">\n",
|
86 |
" <thead>\n",
|
87 |
" <tr>\n",
|
88 |
+
" <th id=\"T_1bcbb_level0_col0\" class=\"col_heading level0 col0\" >Title</th>\n",
|
89 |
+
" <th id=\"T_1bcbb_level0_col1\" class=\"col_heading level0 col1\" >Context</th>\n",
|
90 |
+
" <th id=\"T_1bcbb_level0_col2\" class=\"col_heading level0 col2\" >Question</th>\n",
|
91 |
+
" <th id=\"T_1bcbb_level0_col3\" class=\"col_heading level0 col3\" >Answer</th>\n",
|
92 |
" </tr>\n",
|
93 |
" </thead>\n",
|
94 |
" <tbody>\n",
|
95 |
" <tr>\n",
|
96 |
+
" <td id=\"T_1bcbb_row0_col0\" class=\"data row0 col0\" >University_of_Notre_Dame</td>\n",
|
97 |
+
" <td id=\"T_1bcbb_row0_col1\" class=\"data row0 col1\" >Architecturally, the school has a Catholic character. Atop the Main Building's gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend \"Venite Ad Me Omnes\". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary.</td>\n",
|
98 |
+
" <td id=\"T_1bcbb_row0_col2\" class=\"data row0 col2\" >To whom did the Virgin Mary allegedly appear in 1858 in Lourdes France?</td>\n",
|
99 |
+
" <td id=\"T_1bcbb_row0_col3\" class=\"data row0 col3\" >Saint Bernadette Soubirous</td>\n",
|
100 |
" </tr>\n",
|
101 |
" <tr>\n",
|
102 |
+
" <td id=\"T_1bcbb_row1_col0\" class=\"data row1 col0\" >University_of_Notre_Dame</td>\n",
|
103 |
+
" <td id=\"T_1bcbb_row1_col1\" class=\"data row1 col1\" >Architecturally, the school has a Catholic character. Atop the Main Building's gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend \"Venite Ad Me Omnes\". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary.</td>\n",
|
104 |
+
" <td id=\"T_1bcbb_row1_col2\" class=\"data row1 col2\" >What is in front of the Notre Dame Main Building?</td>\n",
|
105 |
+
" <td id=\"T_1bcbb_row1_col3\" class=\"data row1 col3\" >a copper statue of Christ</td>\n",
|
106 |
" </tr>\n",
|
107 |
" <tr>\n",
|
108 |
+
" <td id=\"T_1bcbb_row2_col0\" class=\"data row2 col0\" >University_of_Notre_Dame</td>\n",
|
109 |
+
" <td id=\"T_1bcbb_row2_col1\" class=\"data row2 col1\" >Architecturally, the school has a Catholic character. Atop the Main Building's gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend \"Venite Ad Me Omnes\". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary.</td>\n",
|
110 |
+
" <td id=\"T_1bcbb_row2_col2\" class=\"data row2 col2\" >The Basilica of the Sacred heart at Notre Dame is beside to which structure?</td>\n",
|
111 |
+
" <td id=\"T_1bcbb_row2_col3\" class=\"data row2 col3\" >the Main Building</td>\n",
|
112 |
" </tr>\n",
|
113 |
" </tbody>\n",
|
114 |
"</table>\n"
|
115 |
],
|
116 |
"text/plain": [
|
117 |
+
"<pandas.io.formats.style.Styler at 0x143920b30>"
|
118 |
]
|
119 |
},
|
120 |
"metadata": {},
|
|
|
127 |
},
|
128 |
{
|
129 |
"cell_type": "code",
|
130 |
+
"execution_count": 28,
|
131 |
"metadata": {},
|
132 |
"outputs": [
|
133 |
{
|
134 |
"data": {
|
135 |
"text/html": [
|
136 |
"<style type=\"text/css\">\n",
|
137 |
+
"#T_7d834 th {\n",
|
138 |
" text-align: left;\n",
|
139 |
"}\n",
|
140 |
+
"#T_7d834 td {\n",
|
141 |
" text-align: left;\n",
|
142 |
"}\n",
|
143 |
+
"#T_7d834_row0_col0, #T_7d834_row0_col1, #T_7d834_row0_col2, #T_7d834_row0_col3, #T_7d834_row1_col0, #T_7d834_row1_col1, #T_7d834_row1_col2, #T_7d834_row1_col3, #T_7d834_row2_col0, #T_7d834_row2_col1, #T_7d834_row2_col2, #T_7d834_row2_col3, #T_7d834_row3_col0, #T_7d834_row3_col1, #T_7d834_row3_col2, #T_7d834_row3_col3, #T_7d834_row4_col0, #T_7d834_row4_col1, #T_7d834_row4_col2, #T_7d834_row4_col3, #T_7d834_row5_col0, #T_7d834_row5_col1, #T_7d834_row5_col2, #T_7d834_row5_col3, #T_7d834_row6_col0, #T_7d834_row6_col1, #T_7d834_row6_col2, #T_7d834_row6_col3, #T_7d834_row7_col0, #T_7d834_row7_col1, #T_7d834_row7_col2, #T_7d834_row7_col3, #T_7d834_row8_col0, #T_7d834_row8_col1, #T_7d834_row8_col2, #T_7d834_row8_col3, #T_7d834_row9_col0, #T_7d834_row9_col1, #T_7d834_row9_col2, #T_7d834_row9_col3 {\n",
|
144 |
" white-space: pre-wrap;\n",
|
145 |
"}\n",
|
146 |
"</style>\n",
|
147 |
+
"<table id=\"T_7d834\">\n",
|
148 |
" <thead>\n",
|
149 |
" <tr>\n",
|
150 |
+
" <th id=\"T_7d834_level0_col0\" class=\"col_heading level0 col0\" >Title</th>\n",
|
151 |
+
" <th id=\"T_7d834_level0_col1\" class=\"col_heading level0 col1\" >Context</th>\n",
|
152 |
+
" <th id=\"T_7d834_level0_col2\" class=\"col_heading level0 col2\" >Question</th>\n",
|
153 |
+
" <th id=\"T_7d834_level0_col3\" class=\"col_heading level0 col3\" >Answer</th>\n",
|
154 |
" </tr>\n",
|
155 |
" </thead>\n",
|
156 |
" <tbody>\n",
|
157 |
" <tr>\n",
|
158 |
+
" <td id=\"T_7d834_row0_col0\" class=\"data row0 col0\" >Institute_of_technology</td>\n",
|
159 |
+
" <td id=\"T_7d834_row0_col1\" class=\"data row0 col1\" >The world's first institution of technology or technical university with tertiary technical education is the Banská Akadémia in Banská Štiavnica, Slovakia, founded in 1735, Academy since December 13, 1762 established by queen Maria Theresa in order to train specialists of silver and gold mining and metallurgy in neighbourhood. Teaching started in 1764. Later the department of Mathematics, Mechanics and Hydraulics and department of Forestry were settled. University buildings are still at their place today and are used for teaching. University has launched the first book of electrotechnics in the world.</td>\n",
|
160 |
+
" <td id=\"T_7d834_row0_col2\" class=\"data row0 col2\" >What year was the Banská Akadémia founded?</td>\n",
|
161 |
+
" <td id=\"T_7d834_row0_col3\" class=\"data row0 col3\" >1735</td>\n",
|
162 |
" </tr>\n",
|
163 |
" <tr>\n",
|
164 |
+
" <td id=\"T_7d834_row1_col0\" class=\"data row1 col0\" >Film_speed</td>\n",
|
165 |
+
" <td id=\"T_7d834_row1_col1\" class=\"data row1 col1\" >The standard specifies how speed ratings should be reported by the camera. If the noise-based speed (40:1) is higher than the saturation-based speed, the noise-based speed should be reported, rounded downwards to a standard value (e.g. 200, 250, 320, or 400). The rationale is that exposure according to the lower saturation-based speed would not result in a visibly better image. In addition, an exposure latitude can be specified, ranging from the saturation-based speed to the 10:1 noise-based speed. If the noise-based speed (40:1) is lower than the saturation-based speed, or undefined because of high noise, the saturation-based speed is specified, rounded upwards to a standard value, because using the noise-based speed would lead to overexposed images. The camera may also report the SOS-based speed (explicitly as being an SOS speed), rounded to the nearest standard speed rating.</td>\n",
|
166 |
+
" <td id=\"T_7d834_row1_col2\" class=\"data row1 col2\" >What is another speed that can also be reported by the camera?</td>\n",
|
167 |
+
" <td id=\"T_7d834_row1_col3\" class=\"data row1 col3\" >SOS-based speed</td>\n",
|
168 |
" </tr>\n",
|
169 |
" <tr>\n",
|
170 |
+
" <td id=\"T_7d834_row2_col0\" class=\"data row2 col0\" >Sumer</td>\n",
|
171 |
+
" <td id=\"T_7d834_row2_col1\" class=\"data row2 col1\" >The most impressive and famous of Sumerian buildings are the ziggurats, large layered platforms which supported temples. Sumerian cylinder seals also depict houses built from reeds not unlike those built by the Marsh Arabs of Southern Iraq until as recently as 400 CE. The Sumerians also developed the arch, which enabled them to develop a strong type of dome. They built this by constructing and linking several arches. Sumerian temples and palaces made use of more advanced materials and techniques,[citation needed] such as buttresses, recesses, half columns, and clay nails.</td>\n",
|
172 |
+
" <td id=\"T_7d834_row2_col2\" class=\"data row2 col2\" >Where were the use of advanced materials and techniques on display in Sumer?</td>\n",
|
173 |
+
" <td id=\"T_7d834_row2_col3\" class=\"data row2 col3\" >Sumerian temples and palaces</td>\n",
|
174 |
" </tr>\n",
|
175 |
" <tr>\n",
|
176 |
+
" <td id=\"T_7d834_row3_col0\" class=\"data row3 col0\" >Ann_Arbor,_Michigan</td>\n",
|
177 |
+
" <td id=\"T_7d834_row3_col1\" class=\"data row3 col1\" >Ann Arbor has a council-manager form of government. The City Council has 11 voting members: the mayor and 10 city council members. The mayor and city council members serve two-year terms: the mayor is elected every even-numbered year, while half of the city council members are up for election annually (five in even-numbered and five in odd-numbered years). Two council members are elected from each of the city's five wards. The mayor is elected citywide. The mayor is the presiding officer of the City Council and has the power to appoint all Council committee members as well as board and commission members, with the approval of the City Council. The current mayor of Ann Arbor is Christopher Taylor, a Democrat who was elected as mayor in 2014. Day-to-day city operations are managed by a city administrator chosen by the city council.</td>\n",
|
178 |
+
" <td id=\"T_7d834_row3_col2\" class=\"data row3 col2\" >Who is elected every even numbered year?</td>\n",
|
179 |
+
" <td id=\"T_7d834_row3_col3\" class=\"data row3 col3\" >mayor</td>\n",
|
180 |
" </tr>\n",
|
181 |
" <tr>\n",
|
182 |
+
" <td id=\"T_7d834_row4_col0\" class=\"data row4 col0\" >John_von_Neumann</td>\n",
|
183 |
+
" <td id=\"T_7d834_row4_col1\" class=\"data row4 col1\" >Shortly before his death, when he was already quite ill, von Neumann headed the United States government's top secret ICBM committee, and it would sometimes meet in his home. Its purpose was to decide on the feasibility of building an ICBM large enough to carry a thermonuclear weapon. Von Neumann had long argued that while the technical obstacles were sizable, they could be overcome in time. The SM-65 Atlas passed its first fully functional test in 1959, two years after his death. The feasibility of an ICBM owed as much to improved, smaller warheads as it did to developments in rocketry, and his understanding of the former made his advice invaluable.</td>\n",
|
184 |
+
" <td id=\"T_7d834_row4_col2\" class=\"data row4 col2\" >What was the purpose of top secret ICBM committee?</td>\n",
|
185 |
+
" <td id=\"T_7d834_row4_col3\" class=\"data row4 col3\" >decide on the feasibility of building an ICBM large enough to carry a thermonuclear weapon</td>\n",
|
186 |
" </tr>\n",
|
187 |
" <tr>\n",
|
188 |
+
" <td id=\"T_7d834_row5_col0\" class=\"data row5 col0\" >Pope_Paul_VI</td>\n",
|
189 |
+
" <td id=\"T_7d834_row5_col1\" class=\"data row5 col1\" >Some critiqued Paul VI's decision; the newly created Synod of Bishops had an advisory role only and could not make decisions on their own, although the Council decided exactly that. During the pontificate of Paul VI, five such synods took place, and he is on record of implementing all their decisions. Related questions were raised about the new National Bishop Conferences, which became mandatory after Vatican II. Others questioned his Ostpolitik and contacts with Communism and the deals he engaged in for the faithful.</td>\n",
|
190 |
+
" <td id=\"T_7d834_row5_col2\" class=\"data row5 col2\" >What conferences became a requirement after Vatican II?</td>\n",
|
191 |
+
" <td id=\"T_7d834_row5_col3\" class=\"data row5 col3\" >National Bishop Conferences</td>\n",
|
192 |
" </tr>\n",
|
193 |
" <tr>\n",
|
194 |
+
" <td id=\"T_7d834_row6_col0\" class=\"data row6 col0\" >Spectre_(2015_film)</td>\n",
|
195 |
+
" <td id=\"T_7d834_row6_col1\" class=\"data row6 col1\" >Bond and Swann return to London where they meet M, Bill Tanner, Q, and Moneypenny; they intend to arrest C and stop Nine Eyes from going online. Swann leaves Bond, telling him she cannot be part of a life involving espionage, and is subsequently kidnapped. On the way, the group is ambushed and Bond is kidnapped, but the rest still proceed with the plan. After Q succeeds in preventing the Nine Eyes from going online, a brief struggle between M and C ends with the latter falling to his death. Meanwhile, Bond is taken to the old MI6 building, which is scheduled for demolition, and frees himself. Moving throughout the ruined labyrinth, he encounters a disfigured Blofeld, who tells him that he has three minutes to escape the building before explosives are detonated or die trying to save Swann. Bond finds Swann and the two escape by boat as the building collapses. Bond shoots down Blofeld's helicopter, which crashes onto Westminster Bridge. As Blofeld crawls away from the wreckage, Bond confronts him but ultimately leaves him to be arrested by M. Bond leaves the bridge with Swann.</td>\n",
|
196 |
+
" <td id=\"T_7d834_row6_col2\" class=\"data row6 col2\" >Who does M fight with?</td>\n",
|
197 |
+
" <td id=\"T_7d834_row6_col3\" class=\"data row6 col3\" >C</td>\n",
|
198 |
" </tr>\n",
|
199 |
" <tr>\n",
|
200 |
+
" <td id=\"T_7d834_row7_col0\" class=\"data row7 col0\" >Antarctica</td>\n",
|
201 |
+
" <td id=\"T_7d834_row7_col1\" class=\"data row7 col1\" >About 1150 species of fungi have been recorded from Antarctica, of which about 750 are non-lichen-forming and 400 are lichen-forming. Some of these species are cryptoendoliths as a result of evolution under extreme conditions, and have significantly contributed to shaping the impressive rock formations of the McMurdo Dry Valleys and surrounding mountain ridges. The apparently simple morphology, scarcely differentiated structures, metabolic systems and enzymes still active at very low temperatures, and reduced life cycles shown by such fungi make them particularly suited to harsh environments such as the McMurdo Dry Valleys. In particular, their thick-walled and strongly melanized cells make them resistant to UV light. Those features can also be observed in algae and cyanobacteria, suggesting that these are adaptations to the conditions prevailing in Antarctica. This has led to speculation that, if life ever occurred on Mars, it might have looked similar to Antarctic fungi such as Cryomyces minteri. Some of these fungi are also apparently endemic to Antarctica. Endemic Antarctic fungi also include certain dung-inhabiting species which have had to evolve in response to the double challenge of extreme cold while growing on dung, and the need to survive passage through the gut of warm-blooded animals.</td>\n",
|
202 |
+
" <td id=\"T_7d834_row7_col2\" class=\"data row7 col2\" >How many species of fungi have been found on Antarctica?</td>\n",
|
203 |
+
" <td id=\"T_7d834_row7_col3\" class=\"data row7 col3\" >1150</td>\n",
|
204 |
" </tr>\n",
|
205 |
" <tr>\n",
|
206 |
+
" <td id=\"T_7d834_row8_col0\" class=\"data row8 col0\" >North_Carolina</td>\n",
|
207 |
+
" <td id=\"T_7d834_row8_col1\" class=\"data row8 col1\" >In the Battle of Cowan's Ford, Cornwallis met resistance along the banks of the Catawba River at Cowan's Ford on February 1, 1781, in an attempt to engage General Morgan's forces during a tactical withdrawal. Morgan had moved to the northern part of the state to combine with General Greene's newly recruited forces. Generals Greene and Cornwallis finally met at the Battle of Guilford Courthouse in present-day Greensboro on March 15, 1781. Although the British troops held the field at the end of the battle, their casualties at the hands of the numerically superior Continental Army were crippling. Following this \"Pyrrhic victory\", Cornwallis chose to move to the Virginia coastline to get reinforcements, and to allow the Royal Navy to protect his battered army. This decision would result in Cornwallis' eventual defeat at Yorktown, Virginia, later in 1781. The Patriots' victory there guaranteed American independence.</td>\n",
|
208 |
+
" <td id=\"T_7d834_row8_col2\" class=\"data row8 col2\" >After losing the battle of Guilford Courthouse, Cornawallis moved his troops where?</td>\n",
|
209 |
+
" <td id=\"T_7d834_row8_col3\" class=\"data row8 col3\" >Virginia coastline</td>\n",
|
210 |
" </tr>\n",
|
211 |
" <tr>\n",
|
212 |
+
" <td id=\"T_7d834_row9_col0\" class=\"data row9 col0\" >2008_Summer_Olympics_torch_relay</td>\n",
|
213 |
+
" <td id=\"T_7d834_row9_col1\" class=\"data row9 col1\" >The Olympic Torch is based on traditional scrolls and uses a traditional Chinese design known as \"Lucky Cloud\". It is made from aluminum. It is 72 centimetres high and weighs 985 grams. The torch is designed to remain lit in 65 kilometre per hour (37 mile per hour) winds, and in rain of up to 50 millimetres (2 inches) per hour. An ignition key is used to ignite and extinguish the flame. The torch is fueled by cans of propane. Each can will light the torch for 15 minutes. It is designed by a team from Lenovo Group. The Torch is designed in reference to the traditional Chinese concept of the 5 elements that make up the entire universe.</td>\n",
|
214 |
+
" <td id=\"T_7d834_row9_col2\" class=\"data row9 col2\" >What is the Olympic Torch made from?</td>\n",
|
215 |
+
" <td id=\"T_7d834_row9_col3\" class=\"data row9 col3\" >aluminum.</td>\n",
|
216 |
" </tr>\n",
|
217 |
" </tbody>\n",
|
218 |
"</table>\n"
|
219 |
],
|
220 |
"text/plain": [
|
221 |
+
"<pandas.io.formats.style.Styler at 0x331785100>"
|
222 |
]
|
223 |
},
|
224 |
"metadata": {},
|
|
|
232 |
"display_text_df(dfSample)"
|
233 |
]
|
234 |
},
|
235 |
+
{
|
236 |
+
"cell_type": "code",
|
237 |
+
"execution_count": 29,
|
238 |
+
"metadata": {},
|
239 |
+
"outputs": [],
|
240 |
+
"source": [
|
241 |
+
"# use local gpt to synthesize questions with context\n",
|
242 |
+
"\n",
|
243 |
+
"synth_system_prompt = \"\"\"\n",
|
244 |
+
"You are an expert at clarifying what questions are really asking for.\n",
|
245 |
+
"\n",
|
246 |
+
"You will be given a question, a title and context.\n",
|
247 |
+
"Your task is come up with a new version of the question that resolves ambiguities by adding only and exactly the necessary details from the title and context in a way that clarifies the question without changing the meaning or intent of the question.\n",
|
248 |
+
"\n",
|
249 |
+
"For example: \n",
|
250 |
+
"Question: Who does M fight with?\n",
|
251 |
+
"Title: Spectre_(2015_film)\n",
|
252 |
+
"Context: Bond and Swann return to London where they meet M, Bill Tanner, Q, and Moneypenny; they intend to arrest C and stop Nine Eyes from going online. Swann leaves Bond, telling him she cannot be part of a life involving espionage, and is subsequently kidnapped. On the way, the group is ambushed and Bond is kidnapped, but the rest still proceed with the plan. After Q succeeds in preventing the Nine Eyes from going online, a brief struggle between M and C ends with the latter falling to his death. Meanwhile, Bond is taken to the old MI6 building, which is scheduled for demolition, and frees himself. Moving throughout the ruined labyrinth, he encounters a disfigured Blofeld, who tells him that he has three minutes to escape the building before explosives are detonated or die trying to save Swann. Bond finds Swann and the two escape by boat as the building collapses. Bond shoots down Blofeld's helicopter, which crashes onto Westminster Bridge. As Blofeld crawls away from the wreckage, Bond confronts him but ultimately leaves him to be arrested by M. Bond leaves the bridge with Swann.\n",
|
253 |
+
"Response: Who does M struggle with during the events of Spectre (2015)?\n",
|
254 |
+
"\"\"\"\n",
|
255 |
+
"\n",
|
256 |
+
"synth_user_prompt = \"\"\"\n",
|
257 |
+
"Question: {question}\n",
|
258 |
+
"Title: {title}\n",
|
259 |
+
"Context: {context}\n",
|
260 |
+
"\"\"\"\n"
|
261 |
+
]
|
262 |
+
},
|
263 |
+
{
|
264 |
+
"cell_type": "code",
|
265 |
+
"execution_count": 30,
|
266 |
+
"metadata": {},
|
267 |
+
"outputs": [
|
268 |
+
{
|
269 |
+
"data": {
|
270 |
+
"application/vnd.jupyter.widget-view+json": {
|
271 |
+
"model_id": "8219b65a8f464e249afcbc1df91936ae",
|
272 |
+
"version_major": 2,
|
273 |
+
"version_minor": 0
|
274 |
+
},
|
275 |
+
"text/plain": [
|
276 |
+
" 0%| | 0/10 [00:00<?, ?it/s]"
|
277 |
+
]
|
278 |
+
},
|
279 |
+
"metadata": {},
|
280 |
+
"output_type": "display_data"
|
281 |
+
},
|
282 |
+
{
|
283 |
+
"data": {
|
284 |
+
"text/html": [
|
285 |
+
"<style type=\"text/css\">\n",
|
286 |
+
"#T_3b850 th {\n",
|
287 |
+
" text-align: left;\n",
|
288 |
+
"}\n",
|
289 |
+
"#T_3b850 td {\n",
|
290 |
+
" text-align: left;\n",
|
291 |
+
"}\n",
|
292 |
+
"#T_3b850_row0_col0, #T_3b850_row0_col1, #T_3b850_row0_col2, #T_3b850_row0_col3, #T_3b850_row0_col4, #T_3b850_row1_col0, #T_3b850_row1_col1, #T_3b850_row1_col2, #T_3b850_row1_col3, #T_3b850_row1_col4, #T_3b850_row2_col0, #T_3b850_row2_col1, #T_3b850_row2_col2, #T_3b850_row2_col3, #T_3b850_row2_col4, #T_3b850_row3_col0, #T_3b850_row3_col1, #T_3b850_row3_col2, #T_3b850_row3_col3, #T_3b850_row3_col4, #T_3b850_row4_col0, #T_3b850_row4_col1, #T_3b850_row4_col2, #T_3b850_row4_col3, #T_3b850_row4_col4, #T_3b850_row5_col0, #T_3b850_row5_col1, #T_3b850_row5_col2, #T_3b850_row5_col3, #T_3b850_row5_col4, #T_3b850_row6_col0, #T_3b850_row6_col1, #T_3b850_row6_col2, #T_3b850_row6_col3, #T_3b850_row6_col4, #T_3b850_row7_col0, #T_3b850_row7_col1, #T_3b850_row7_col2, #T_3b850_row7_col3, #T_3b850_row7_col4, #T_3b850_row8_col0, #T_3b850_row8_col1, #T_3b850_row8_col2, #T_3b850_row8_col3, #T_3b850_row8_col4, #T_3b850_row9_col0, #T_3b850_row9_col1, #T_3b850_row9_col2, #T_3b850_row9_col3, #T_3b850_row9_col4 {\n",
|
293 |
+
" white-space: pre-wrap;\n",
|
294 |
+
"}\n",
|
295 |
+
"</style>\n",
|
296 |
+
"<table id=\"T_3b850\">\n",
|
297 |
+
" <thead>\n",
|
298 |
+
" <tr>\n",
|
299 |
+
" <th id=\"T_3b850_level0_col0\" class=\"col_heading level0 col0\" >Title</th>\n",
|
300 |
+
" <th id=\"T_3b850_level0_col1\" class=\"col_heading level0 col1\" >Context</th>\n",
|
301 |
+
" <th id=\"T_3b850_level0_col2\" class=\"col_heading level0 col2\" >Question</th>\n",
|
302 |
+
" <th id=\"T_3b850_level0_col3\" class=\"col_heading level0 col3\" >Answer</th>\n",
|
303 |
+
" <th id=\"T_3b850_level0_col4\" class=\"col_heading level0 col4\" >Synthesized Question</th>\n",
|
304 |
+
" </tr>\n",
|
305 |
+
" </thead>\n",
|
306 |
+
" <tbody>\n",
|
307 |
+
" <tr>\n",
|
308 |
+
" <td id=\"T_3b850_row0_col0\" class=\"data row0 col0\" >Institute_of_technology</td>\n",
|
309 |
+
" <td id=\"T_3b850_row0_col1\" class=\"data row0 col1\" >The world's first institution of technology or technical university with tertiary technical education is the Banská Akadémia in Banská Štiavnica, Slovakia, founded in 1735, Academy since December 13, 1762 established by queen Maria Theresa in order to train specialists of silver and gold mining and metallurgy in neighbourhood. Teaching started in 1764. Later the department of Mathematics, Mechanics and Hydraulics and department of Forestry were settled. University buildings are still at their place today and are used for teaching. University has launched the first book of electrotechnics in the world.</td>\n",
|
310 |
+
" <td id=\"T_3b850_row0_col2\" class=\"data row0 col2\" >What year was the Banská Akadémia founded?</td>\n",
|
311 |
+
" <td id=\"T_3b850_row0_col3\" class=\"data row0 col3\" >1735</td>\n",
|
312 |
+
" <td id=\"T_3b850_row0_col4\" class=\"data row0 col4\" >What year was the Banská Akadémia, the world's first institution of technology, founded in Banská Štiavnica, Slovakia?</td>\n",
|
313 |
+
" </tr>\n",
|
314 |
+
" <tr>\n",
|
315 |
+
" <td id=\"T_3b850_row1_col0\" class=\"data row1 col0\" >Film_speed</td>\n",
|
316 |
+
" <td id=\"T_3b850_row1_col1\" class=\"data row1 col1\" >The standard specifies how speed ratings should be reported by the camera. If the noise-based speed (40:1) is higher than the saturation-based speed, the noise-based speed should be reported, rounded downwards to a standard value (e.g. 200, 250, 320, or 400). The rationale is that exposure according to the lower saturation-based speed would not result in a visibly better image. In addition, an exposure latitude can be specified, ranging from the saturation-based speed to the 10:1 noise-based speed. If the noise-based speed (40:1) is lower than the saturation-based speed, or undefined because of high noise, the saturation-based speed is specified, rounded upwards to a standard value, because using the noise-based speed would lead to overexposed images. The camera may also report the SOS-based speed (explicitly as being an SOS speed), rounded to the nearest standard speed rating.</td>\n",
|
317 |
+
" <td id=\"T_3b850_row1_col2\" class=\"data row1 col2\" >What is another speed that can also be reported by the camera?</td>\n",
|
318 |
+
" <td id=\"T_3b850_row1_col3\" class=\"data row1 col3\" >SOS-based speed</td>\n",
|
319 |
+
" <td id=\"T_3b850_row1_col4\" class=\"data row1 col4\" >What is another speed rating that can be reported by the camera, besides the noise-based and saturation-based speeds, as mentioned in the context of film speed?</td>\n",
|
320 |
+
" </tr>\n",
|
321 |
+
" <tr>\n",
|
322 |
+
" <td id=\"T_3b850_row2_col0\" class=\"data row2 col0\" >Sumer</td>\n",
|
323 |
+
" <td id=\"T_3b850_row2_col1\" class=\"data row2 col1\" >The most impressive and famous of Sumerian buildings are the ziggurats, large layered platforms which supported temples. Sumerian cylinder seals also depict houses built from reeds not unlike those built by the Marsh Arabs of Southern Iraq until as recently as 400 CE. The Sumerians also developed the arch, which enabled them to develop a strong type of dome. They built this by constructing and linking several arches. Sumerian temples and palaces made use of more advanced materials and techniques,[citation needed] such as buttresses, recesses, half columns, and clay nails.</td>\n",
|
324 |
+
" <td id=\"T_3b850_row2_col2\" class=\"data row2 col2\" >Where were the use of advanced materials and techniques on display in Sumer?</td>\n",
|
325 |
+
" <td id=\"T_3b850_row2_col3\" class=\"data row2 col3\" >Sumerian temples and palaces</td>\n",
|
326 |
+
" <td id=\"T_3b850_row2_col4\" class=\"data row2 col4\" >Where were advanced materials and techniques used in the construction of Sumerian temples and palaces?</td>\n",
|
327 |
+
" </tr>\n",
|
328 |
+
" <tr>\n",
|
329 |
+
" <td id=\"T_3b850_row3_col0\" class=\"data row3 col0\" >Ann_Arbor,_Michigan</td>\n",
|
330 |
+
" <td id=\"T_3b850_row3_col1\" class=\"data row3 col1\" >Ann Arbor has a council-manager form of government. The City Council has 11 voting members: the mayor and 10 city council members. The mayor and city council members serve two-year terms: the mayor is elected every even-numbered year, while half of the city council members are up for election annually (five in even-numbered and five in odd-numbered years). Two council members are elected from each of the city's five wards. The mayor is elected citywide. The mayor is the presiding officer of the City Council and has the power to appoint all Council committee members as well as board and commission members, with the approval of the City Council. The current mayor of Ann Arbor is Christopher Taylor, a Democrat who was elected as mayor in 2014. Day-to-day city operations are managed by a city administrator chosen by the city council.</td>\n",
|
331 |
+
" <td id=\"T_3b850_row3_col2\" class=\"data row3 col2\" >Who is elected every even numbered year?</td>\n",
|
332 |
+
" <td id=\"T_3b850_row3_col3\" class=\"data row3 col3\" >mayor</td>\n",
|
333 |
+
" <td id=\"T_3b850_row3_col4\" class=\"data row3 col4\" >Who is elected as mayor in Ann Arbor, Michigan, every even-numbered year?</td>\n",
|
334 |
+
" </tr>\n",
|
335 |
+
" <tr>\n",
|
336 |
+
" <td id=\"T_3b850_row4_col0\" class=\"data row4 col0\" >John_von_Neumann</td>\n",
|
337 |
+
" <td id=\"T_3b850_row4_col1\" class=\"data row4 col1\" >Shortly before his death, when he was already quite ill, von Neumann headed the United States government's top secret ICBM committee, and it would sometimes meet in his home. Its purpose was to decide on the feasibility of building an ICBM large enough to carry a thermonuclear weapon. Von Neumann had long argued that while the technical obstacles were sizable, they could be overcome in time. The SM-65 Atlas passed its first fully functional test in 1959, two years after his death. The feasibility of an ICBM owed as much to improved, smaller warheads as it did to developments in rocketry, and his understanding of the former made his advice invaluable.</td>\n",
|
338 |
+
" <td id=\"T_3b850_row4_col2\" class=\"data row4 col2\" >What was the purpose of top secret ICBM committee?</td>\n",
|
339 |
+
" <td id=\"T_3b850_row4_col3\" class=\"data row4 col3\" >decide on the feasibility of building an ICBM large enough to carry a thermonuclear weapon</td>\n",
|
340 |
+
" <td id=\"T_3b850_row4_col4\" class=\"data row4 col4\" >What was the purpose of the top secret ICBM committee led by John von Neumann shortly before his death?</td>\n",
|
341 |
+
" </tr>\n",
|
342 |
+
" <tr>\n",
|
343 |
+
" <td id=\"T_3b850_row5_col0\" class=\"data row5 col0\" >Pope_Paul_VI</td>\n",
|
344 |
+
" <td id=\"T_3b850_row5_col1\" class=\"data row5 col1\" >Some critiqued Paul VI's decision; the newly created Synod of Bishops had an advisory role only and could not make decisions on their own, although the Council decided exactly that. During the pontificate of Paul VI, five such synods took place, and he is on record of implementing all their decisions. Related questions were raised about the new National Bishop Conferences, which became mandatory after Vatican II. Others questioned his Ostpolitik and contacts with Communism and the deals he engaged in for the faithful.</td>\n",
|
345 |
+
" <td id=\"T_3b850_row5_col2\" class=\"data row5 col2\" >What conferences became a requirement after Vatican II?</td>\n",
|
346 |
+
" <td id=\"T_3b850_row5_col3\" class=\"data row5 col3\" >National Bishop Conferences</td>\n",
|
347 |
+
" <td id=\"T_3b850_row5_col4\" class=\"data row5 col4\" >What National Bishop Conferences became a requirement after Vatican II during the pontificate of Pope Paul VI?</td>\n",
|
348 |
+
" </tr>\n",
|
349 |
+
" <tr>\n",
|
350 |
+
" <td id=\"T_3b850_row6_col0\" class=\"data row6 col0\" >Spectre_(2015_film)</td>\n",
|
351 |
+
" <td id=\"T_3b850_row6_col1\" class=\"data row6 col1\" >Bond and Swann return to London where they meet M, Bill Tanner, Q, and Moneypenny; they intend to arrest C and stop Nine Eyes from going online. Swann leaves Bond, telling him she cannot be part of a life involving espionage, and is subsequently kidnapped. On the way, the group is ambushed and Bond is kidnapped, but the rest still proceed with the plan. After Q succeeds in preventing the Nine Eyes from going online, a brief struggle between M and C ends with the latter falling to his death. Meanwhile, Bond is taken to the old MI6 building, which is scheduled for demolition, and frees himself. Moving throughout the ruined labyrinth, he encounters a disfigured Blofeld, who tells him that he has three minutes to escape the building before explosives are detonated or die trying to save Swann. Bond finds Swann and the two escape by boat as the building collapses. Bond shoots down Blofeld's helicopter, which crashes onto Westminster Bridge. As Blofeld crawls away from the wreckage, Bond confronts him but ultimately leaves him to be arrested by M. Bond leaves the bridge with Swann.</td>\n",
|
352 |
+
" <td id=\"T_3b850_row6_col2\" class=\"data row6 col2\" >Who does M fight with?</td>\n",
|
353 |
+
" <td id=\"T_3b850_row6_col3\" class=\"data row6 col3\" >C</td>\n",
|
354 |
+
" <td id=\"T_3b850_row6_col4\" class=\"data row6 col4\" >Who does M struggle with during the events of the film Spectre (2015)?</td>\n",
|
355 |
+
" </tr>\n",
|
356 |
+
" <tr>\n",
|
357 |
+
" <td id=\"T_3b850_row7_col0\" class=\"data row7 col0\" >Antarctica</td>\n",
|
358 |
+
" <td id=\"T_3b850_row7_col1\" class=\"data row7 col1\" >About 1150 species of fungi have been recorded from Antarctica, of which about 750 are non-lichen-forming and 400 are lichen-forming. Some of these species are cryptoendoliths as a result of evolution under extreme conditions, and have significantly contributed to shaping the impressive rock formations of the McMurdo Dry Valleys and surrounding mountain ridges. The apparently simple morphology, scarcely differentiated structures, metabolic systems and enzymes still active at very low temperatures, and reduced life cycles shown by such fungi make them particularly suited to harsh environments such as the McMurdo Dry Valleys. In particular, their thick-walled and strongly melanized cells make them resistant to UV light. Those features can also be observed in algae and cyanobacteria, suggesting that these are adaptations to the conditions prevailing in Antarctica. This has led to speculation that, if life ever occurred on Mars, it might have looked similar to Antarctic fungi such as Cryomyces minteri. Some of these fungi are also apparently endemic to Antarctica. Endemic Antarctic fungi also include certain dung-inhabiting species which have had to evolve in response to the double challenge of extreme cold while growing on dung, and the need to survive passage through the gut of warm-blooded animals.</td>\n",
|
359 |
+
" <td id=\"T_3b850_row7_col2\" class=\"data row7 col2\" >How many species of fungi have been found on Antarctica?</td>\n",
|
360 |
+
" <td id=\"T_3b850_row7_col3\" class=\"data row7 col3\" >1150</td>\n",
|
361 |
+
" <td id=\"T_3b850_row7_col4\" class=\"data row7 col4\" >How many species of fungi, both non-lichen-forming and lichen-forming, have been recorded in Antarctica?</td>\n",
|
362 |
+
" </tr>\n",
|
363 |
+
" <tr>\n",
|
364 |
+
" <td id=\"T_3b850_row8_col0\" class=\"data row8 col0\" >North_Carolina</td>\n",
|
365 |
+
" <td id=\"T_3b850_row8_col1\" class=\"data row8 col1\" >In the Battle of Cowan's Ford, Cornwallis met resistance along the banks of the Catawba River at Cowan's Ford on February 1, 1781, in an attempt to engage General Morgan's forces during a tactical withdrawal. Morgan had moved to the northern part of the state to combine with General Greene's newly recruited forces. Generals Greene and Cornwallis finally met at the Battle of Guilford Courthouse in present-day Greensboro on March 15, 1781. Although the British troops held the field at the end of the battle, their casualties at the hands of the numerically superior Continental Army were crippling. Following this \"Pyrrhic victory\", Cornwallis chose to move to the Virginia coastline to get reinforcements, and to allow the Royal Navy to protect his battered army. This decision would result in Cornwallis' eventual defeat at Yorktown, Virginia, later in 1781. The Patriots' victory there guaranteed American independence.</td>\n",
|
366 |
+
" <td id=\"T_3b850_row8_col2\" class=\"data row8 col2\" >After losing the battle of Guilford Courthouse, Cornawallis moved his troops where?</td>\n",
|
367 |
+
" <td id=\"T_3b850_row8_col3\" class=\"data row8 col3\" >Virginia coastline</td>\n",
|
368 |
+
" <td id=\"T_3b850_row8_col4\" class=\"data row8 col4\" >After losing the Battle of Guilford Courthouse, where did Cornwallis move his troops to seek reinforcements and naval protection?</td>\n",
|
369 |
+
" </tr>\n",
|
370 |
+
" <tr>\n",
|
371 |
+
" <td id=\"T_3b850_row9_col0\" class=\"data row9 col0\" >2008_Summer_Olympics_torch_relay</td>\n",
|
372 |
+
" <td id=\"T_3b850_row9_col1\" class=\"data row9 col1\" >The Olympic Torch is based on traditional scrolls and uses a traditional Chinese design known as \"Lucky Cloud\". It is made from aluminum. It is 72 centimetres high and weighs 985 grams. The torch is designed to remain lit in 65 kilometre per hour (37 mile per hour) winds, and in rain of up to 50 millimetres (2 inches) per hour. An ignition key is used to ignite and extinguish the flame. The torch is fueled by cans of propane. Each can will light the torch for 15 minutes. It is designed by a team from Lenovo Group. The Torch is designed in reference to the traditional Chinese concept of the 5 elements that make up the entire universe.</td>\n",
|
373 |
+
" <td id=\"T_3b850_row9_col2\" class=\"data row9 col2\" >What is the Olympic Torch made from?</td>\n",
|
374 |
+
" <td id=\"T_3b850_row9_col3\" class=\"data row9 col3\" >aluminum.</td>\n",
|
375 |
+
" <td id=\"T_3b850_row9_col4\" class=\"data row9 col4\" >What material is the Olympic Torch made from in the context of the 2008 Summer Olympics torch relay?</td>\n",
|
376 |
+
" </tr>\n",
|
377 |
+
" </tbody>\n",
|
378 |
+
"</table>\n"
|
379 |
+
],
|
380 |
+
"text/plain": [
|
381 |
+
"<pandas.io.formats.style.Styler at 0x30fbf3140>"
|
382 |
+
]
|
383 |
+
},
|
384 |
+
"metadata": {},
|
385 |
+
"output_type": "display_data"
|
386 |
+
}
|
387 |
+
],
|
388 |
+
"source": [
|
389 |
+
"# Example: reuse your existing OpenAI setup\n",
|
390 |
+
"from openai import OpenAI\n",
|
391 |
+
"\n",
|
392 |
+
"# Point to the local server\n",
|
393 |
+
"# client = OpenAI(base_url=\"http://localhost:1234/v1\", api_key=\"lm-studio\")\n",
|
394 |
+
"client = OpenAI()\n",
|
395 |
+
"\n",
|
396 |
+
"synth_answers = []\n",
|
397 |
+
"for title, context, question, answer in tqdm(dfSample.values):\n",
|
398 |
+
" completion = client.chat.completions.create(\n",
|
399 |
+
" # model=\"lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF\",\n",
|
400 |
+
" model=\"gpt-4o-mini-2024-07-18\",\n",
|
401 |
+
" messages=[\n",
|
402 |
+
" {\"role\": \"system\", \"content\": synth_system_prompt},\n",
|
403 |
+
" {\"role\": \"user\", \"content\": synth_user_prompt.format(question=question, title=title, context=context)}\n",
|
404 |
+
" ],\n",
|
405 |
+
" temperature=0.7,\n",
|
406 |
+
" )\n",
|
407 |
+
" synth_answers.append(completion.choices[0].message.content)\n",
|
408 |
+
"\n",
|
409 |
+
"dfSample[\"Synthesized Question\"] = synth_answers\n",
|
410 |
+
"display_text_df(dfSample)"
|
411 |
+
]
|
412 |
+
},
|
413 |
{
|
414 |
"cell_type": "markdown",
|
415 |
"metadata": {},
|
|
|
665 |
},
|
666 |
{
|
667 |
"cell_type": "code",
|
668 |
+
"execution_count": null,
|
669 |
"metadata": {},
|
670 |
"outputs": [],
|
671 |
"source": []
|