Spaces:
Running
Running
Update Operational_Instructions/create-submission-result.ipynb
Browse files
Operational_Instructions/create-submission-result.ipynb
CHANGED
@@ -8,79 +8,7 @@
|
|
8 |
"outputs": [],
|
9 |
"source": [
|
10 |
"import pandas as pd\n",
|
11 |
-
|
12 |
-
"# Use this schema: \n",
|
13 |
-
"\"\"\"\n",
|
14 |
-
"{ \n",
|
15 |
-
"\n",
|
16 |
-
"\"$schema\": \"http://json-schema.org/draft-07/schema#\", \n",
|
17 |
-
"\n",
|
18 |
-
" \"title\": \"Answer file schema\", \n",
|
19 |
-
" \"type\": \"object\", \n",
|
20 |
-
" \"properties\": { \n",
|
21 |
-
" \"id\": { \n",
|
22 |
-
" \"type\": \"integer\", \n",
|
23 |
-
" \"description\": \"Question ID\" \n",
|
24 |
-
" }, \n",
|
25 |
-
" \"question\": { \n",
|
26 |
-
" \"type\": \"string\", \n",
|
27 |
-
" \"description\": \"The question\" \n",
|
28 |
-
" }, \n",
|
29 |
-
" \"passages\": { \n",
|
30 |
-
" \"type\": \"array\", \n",
|
31 |
-
" \"description\": \"Passages used and related FineWeb doc IDs, ordered by decreasing importance\", \n",
|
32 |
-
" \"items\": { \n",
|
33 |
-
" \"type\": \"object\", \n",
|
34 |
-
" \"properties\": {\n",
|
35 |
-
" \"passage\": { \n",
|
36 |
-
" \"type\": \"string\", \n",
|
37 |
-
" \"description\": \"Passage text\" \n",
|
38 |
-
" }, \n",
|
39 |
-
" \"doc_IDs\": {\n",
|
40 |
-
" \"type\": \"array\", \n",
|
41 |
-
" \"description\": \"Passage related FineWeb doc IDs, ordered by decreasing importance\", \n",
|
42 |
-
" \"items\": { \n",
|
43 |
-
" \"type\": \"string\", \n",
|
44 |
-
" \"description\": \"FineWeb doc ID, e.g., <urn:uuid:d69cbebc-133a-4ebe-9378-68235ec9f091>\"\n",
|
45 |
-
" } \n",
|
46 |
-
" } \n",
|
47 |
-
" },\n",
|
48 |
-
" \"required\": [\"passage\", \"doc_IDs\"]\n",
|
49 |
-
" }\n",
|
50 |
-
" }, \n",
|
51 |
-
" \"final_prompt\": {\n",
|
52 |
-
" \"type\": \"string\",\n",
|
53 |
-
" \"description\": \"Final prompt, as submitted to Falcon LLM\"\n",
|
54 |
-
" },\n",
|
55 |
-
" \"answer\": {\n",
|
56 |
-
" \"type\": \"string\",\n",
|
57 |
-
" \"description\": \"Your answer\"\n",
|
58 |
-
" }\n",
|
59 |
-
" },\n",
|
60 |
-
" \"required\": [\"id\", \"question\", \"passages\", \"final_prompt\", \"answer\"]\n",
|
61 |
-
"} \n",
|
62 |
-
"\"\"\"\n",
|
63 |
-
"\n",
|
64 |
-
"# Example output:\n",
|
65 |
-
"\"\"\"\n",
|
66 |
-
"{\n",
|
67 |
-
" \"id\": 17,\n",
|
68 |
-
" \"question\": \"What is the capital of France?\",\n",
|
69 |
-
" \"passages\": [\n",
|
70 |
-
" {\n",
|
71 |
-
" \"passage\": \"Paris is the capital and most populous city of France.\",\n",
|
72 |
-
" \"doc_IDs\": [\"<urn:uuid:1234abcd-5678-efgh-9101-ijklmnopqrst>\", \"<urn:uuid:1234abcd-5678-efgh-9202-ijklmnopqrst>\"]\n",
|
73 |
-
" },\n",
|
74 |
-
" {\n",
|
75 |
-
" \"passage\": \"France is located in Western Europe.\",\n",
|
76 |
-
" \"doc_IDs\": [\"<urn:uuid:1234abcd-5678-efgh-9101-ijklmnopqrst>\"]\n",
|
77 |
-
" }\n",
|
78 |
-
" ],\n",
|
79 |
-
" \"final_prompt\": \"Using the following - Paris is the capital and most populous city of France - and - France is located in Western Europe - answer the question: What is the capital of France?\",\n",
|
80 |
-
" \"answer\": \"Paris\" \n",
|
81 |
-
"} \n",
|
82 |
-
"\"\"\"\n",
|
83 |
-
"\n",
|
84 |
"# Code that generates the output\n",
|
85 |
"answers = pd.DataFrame({\n",
|
86 |
" \"id\": [1, 2],\n",
|
|
|
8 |
"outputs": [],
|
9 |
"source": [
|
10 |
"import pandas as pd\n",
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
"# Code that generates the output\n",
|
13 |
"answers = pd.DataFrame({\n",
|
14 |
" \"id\": [1, 2],\n",
|