Upload 20250406_msmarco处理.ipynb
Browse files- 20250406_msmarco处理.ipynb +745 -0
20250406_msmarco处理.ipynb
ADDED
@@ -0,0 +1,745 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"metadata": {
|
3 |
+
"kernelspec": {
|
4 |
+
"language": "python",
|
5 |
+
"display_name": "Python 3",
|
6 |
+
"name": "python3"
|
7 |
+
},
|
8 |
+
"language_info": {
|
9 |
+
"name": "python",
|
10 |
+
"version": "3.10.12",
|
11 |
+
"mimetype": "text/x-python",
|
12 |
+
"codemirror_mode": {
|
13 |
+
"name": "ipython",
|
14 |
+
"version": 3
|
15 |
+
},
|
16 |
+
"pygments_lexer": "ipython3",
|
17 |
+
"nbconvert_exporter": "python",
|
18 |
+
"file_extension": ".py"
|
19 |
+
},
|
20 |
+
"kaggle": {
|
21 |
+
"accelerator": "none",
|
22 |
+
"dataSources": [],
|
23 |
+
"dockerImageVersionId": 30918,
|
24 |
+
"isInternetEnabled": true,
|
25 |
+
"language": "python",
|
26 |
+
"sourceType": "notebook",
|
27 |
+
"isGpuEnabled": false
|
28 |
+
},
|
29 |
+
"colab": {
|
30 |
+
"name": "“20250406.msmarco处理",
|
31 |
+
"provenance": []
|
32 |
+
}
|
33 |
+
},
|
34 |
+
"nbformat_minor": 0,
|
35 |
+
"nbformat": 4,
|
36 |
+
"cells": [
|
37 |
+
{
|
38 |
+
"cell_type": "code",
|
39 |
+
"source": [
|
40 |
+
"import pandas as pd\n",
|
41 |
+
"\n",
|
42 |
+
"df_corpus = pd.read_json(\"hf://datasets/mteb/msmarco/corpus.jsonl\", lines=True)\n",
|
43 |
+
"\n",
|
44 |
+
"df_queries = pd.read_json(\"hf://datasets/mteb/msmarco/queries.jsonl\", lines=True)\n",
|
45 |
+
"\n",
|
46 |
+
"splits = {'train': 'qrels/train.jsonl', 'dev': 'qrels/dev.jsonl', 'test': 'qrels/test.jsonl'}\n",
|
47 |
+
"df_qrels_train = pd.read_json(\"hf://datasets/mteb/msmarco/\" + splits[\"train\"], lines=True)\n",
|
48 |
+
"df_qrels_dev = pd.read_json(\"hf://datasets/mteb/msmarco/\" + splits[\"dev\"], lines=True)\n",
|
49 |
+
"df_qrels_test = pd.read_json(\"hf://datasets/mteb/msmarco/\" + splits[\"test\"], lines=True)"
|
50 |
+
],
|
51 |
+
"metadata": {
|
52 |
+
"_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e0e5",
|
53 |
+
"_cell_guid": "b1076dfc-b9ad-4769-8c92-a6c4dae69d19",
|
54 |
+
"trusted": true,
|
55 |
+
"execution": {
|
56 |
+
"iopub.status.busy": "2025-04-06T09:21:38.449921Z",
|
57 |
+
"iopub.execute_input": "2025-04-06T09:21:38.450179Z",
|
58 |
+
"iopub.status.idle": "2025-04-06T09:22:42.947898Z",
|
59 |
+
"shell.execute_reply.started": "2025-04-06T09:21:38.450152Z",
|
60 |
+
"shell.execute_reply": "2025-04-06T09:22:42.946353Z"
|
61 |
+
},
|
62 |
+
"id": "DVah_FHJgb-v"
|
63 |
+
},
|
64 |
+
"outputs": [],
|
65 |
+
"execution_count": null
|
66 |
+
},
|
67 |
+
{
|
68 |
+
"cell_type": "code",
|
69 |
+
"source": [
|
70 |
+
"df_corpus"
|
71 |
+
],
|
72 |
+
"metadata": {
|
73 |
+
"trusted": true,
|
74 |
+
"execution": {
|
75 |
+
"iopub.status.busy": "2025-04-06T09:22:52.63252Z",
|
76 |
+
"iopub.execute_input": "2025-04-06T09:22:52.633017Z",
|
77 |
+
"iopub.status.idle": "2025-04-06T09:22:52.661247Z",
|
78 |
+
"shell.execute_reply.started": "2025-04-06T09:22:52.632863Z",
|
79 |
+
"shell.execute_reply": "2025-04-06T09:22:52.660038Z"
|
80 |
+
},
|
81 |
+
"id": "-gGXexjkgb-w",
|
82 |
+
"outputId": "c7b7a345-be86-4233-d263-376384c55c94"
|
83 |
+
},
|
84 |
+
"outputs": [
|
85 |
+
{
|
86 |
+
"execution_count": 2,
|
87 |
+
"output_type": "execute_result",
|
88 |
+
"data": {
|
89 |
+
"text/plain": " _id title text\n0 0 The presence of communication amid scientific ...\n1 1 The Manhattan Project and its atomic bomb help...\n2 2 Essay on The Manhattan Project - The Manhattan...\n3 3 The Manhattan Project was the name for a proje...\n4 4 versions of each volume as well as complementa...\n... ... ... ...\n8841818 8841818 When metal salts emit short wavelengths of vis...\n8841819 8841819 Thousands of people across the United States w...\n8841820 8841820 The recipe that creates blue, for example, inc...\n8841821 8841821 On Independence Days of yore, old-timey crowds...\n8841822 8841822 View full size image. Behind the scenes of the...\n\n[8841823 rows x 3 columns]",
|
90 |
+
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>_id</th>\n <th>title</th>\n <th>text</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>0</td>\n <td></td>\n <td>The presence of communication amid scientific ...</td>\n </tr>\n <tr>\n <th>1</th>\n <td>1</td>\n <td></td>\n <td>The Manhattan Project and its atomic bomb help...</td>\n </tr>\n <tr>\n <th>2</th>\n <td>2</td>\n <td></td>\n <td>Essay on The Manhattan Project - The Manhattan...</td>\n </tr>\n <tr>\n <th>3</th>\n <td>3</td>\n <td></td>\n <td>The Manhattan Project was the name for a proje...</td>\n </tr>\n <tr>\n <th>4</th>\n <td>4</td>\n <td></td>\n <td>versions of each volume as well as complementa...</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>8841818</th>\n <td>8841818</td>\n <td></td>\n <td>When metal salts emit short wavelengths of vis...</td>\n </tr>\n <tr>\n <th>8841819</th>\n <td>8841819</td>\n <td></td>\n <td>Thousands of people across the United States w...</td>\n </tr>\n <tr>\n <th>8841820</th>\n <td>8841820</td>\n <td></td>\n <td>The recipe that creates blue, for example, inc...</td>\n </tr>\n <tr>\n <th>8841821</th>\n <td>8841821</td>\n <td></td>\n <td>On Independence Days of yore, old-timey crowds...</td>\n </tr>\n <tr>\n <th>8841822</th>\n <td>8841822</td>\n <td></td>\n <td>View full size image. Behind the scenes of the...</td>\n </tr>\n </tbody>\n</table>\n<p>8841823 rows × 3 columns</p>\n</div>"
|
91 |
+
},
|
92 |
+
"metadata": {}
|
93 |
+
}
|
94 |
+
],
|
95 |
+
"execution_count": null
|
96 |
+
},
|
97 |
+
{
|
98 |
+
"cell_type": "code",
|
99 |
+
"source": [
|
100 |
+
"df_queries"
|
101 |
+
],
|
102 |
+
"metadata": {
|
103 |
+
"trusted": true,
|
104 |
+
"execution": {
|
105 |
+
"iopub.status.busy": "2025-04-06T09:23:07.314817Z",
|
106 |
+
"iopub.execute_input": "2025-04-06T09:23:07.315257Z",
|
107 |
+
"iopub.status.idle": "2025-04-06T09:23:07.329863Z",
|
108 |
+
"shell.execute_reply.started": "2025-04-06T09:23:07.315222Z",
|
109 |
+
"shell.execute_reply": "2025-04-06T09:23:07.328637Z"
|
110 |
+
},
|
111 |
+
"id": "Gqy5Y2ezgb-x",
|
112 |
+
"outputId": "a06e1003-5b30-4cef-eaaa-ad688f5793f4"
|
113 |
+
},
|
114 |
+
"outputs": [
|
115 |
+
{
|
116 |
+
"execution_count": 3,
|
117 |
+
"output_type": "execute_result",
|
118 |
+
"data": {
|
119 |
+
"text/plain": " _id text\n0 1185869 )what was the immediate impact of the success ...\n1 1185868 _________ justice is designed to repair the ha...\n2 597651 what color is amber urine\n3 403613 is autoimmune hepatitis a bile acid synthesis ...\n4 1183785 elegxo meaning\n... ... ...\n509957 147073 difference between discrete and process manufa...\n509958 243761 how long did abraham lincoln serve\n509959 162662 does adult acne rosacea give you blepharitis\n509960 247194 how long do you bake muffins\n509961 195199 glioma meaning\n\n[509962 rows x 2 columns]",
|
120 |
+
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>_id</th>\n <th>text</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>1185869</td>\n <td>)what was the immediate impact of the success ...</td>\n </tr>\n <tr>\n <th>1</th>\n <td>1185868</td>\n <td>_________ justice is designed to repair the ha...</td>\n </tr>\n <tr>\n <th>2</th>\n <td>597651</td>\n <td>what color is amber urine</td>\n </tr>\n <tr>\n <th>3</th>\n <td>403613</td>\n <td>is autoimmune hepatitis a bile acid synthesis ...</td>\n </tr>\n <tr>\n <th>4</th>\n <td>1183785</td>\n <td>elegxo meaning</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>509957</th>\n <td>147073</td>\n <td>difference between discrete and process manufa...</td>\n </tr>\n <tr>\n <th>509958</th>\n <td>243761</td>\n <td>how long did abraham lincoln serve</td>\n </tr>\n <tr>\n <th>509959</th>\n <td>162662</td>\n <td>does adult acne rosacea give you blepharitis</td>\n </tr>\n <tr>\n <th>509960</th>\n <td>247194</td>\n <td>how long do you bake muffins</td>\n </tr>\n <tr>\n <th>509961</th>\n <td>195199</td>\n <td>glioma meaning</td>\n </tr>\n </tbody>\n</table>\n<p>509962 rows × 2 columns</p>\n</div>"
|
121 |
+
},
|
122 |
+
"metadata": {}
|
123 |
+
}
|
124 |
+
],
|
125 |
+
"execution_count": null
|
126 |
+
},
|
127 |
+
{
|
128 |
+
"cell_type": "code",
|
129 |
+
"source": [
|
130 |
+
"df_qrels_train"
|
131 |
+
],
|
132 |
+
"metadata": {
|
133 |
+
"trusted": true,
|
134 |
+
"execution": {
|
135 |
+
"iopub.status.busy": "2025-04-06T09:23:40.361043Z",
|
136 |
+
"iopub.execute_input": "2025-04-06T09:23:40.361369Z",
|
137 |
+
"iopub.status.idle": "2025-04-06T09:23:40.373621Z",
|
138 |
+
"shell.execute_reply.started": "2025-04-06T09:23:40.361342Z",
|
139 |
+
"shell.execute_reply": "2025-04-06T09:23:40.372723Z"
|
140 |
+
},
|
141 |
+
"id": "yo8pouAegb-x",
|
142 |
+
"outputId": "2e7d0732-f66b-4690-fddb-2cd721bc4dab"
|
143 |
+
},
|
144 |
+
"outputs": [
|
145 |
+
{
|
146 |
+
"execution_count": 5,
|
147 |
+
"output_type": "execute_result",
|
148 |
+
"data": {
|
149 |
+
"text/plain": " query-id corpus-id score\n0 1185869 0 1\n1 1185868 16 1\n2 597651 49 1\n3 403613 60 1\n4 1183785 389 1\n... ... ... ...\n532746 19285 8841362 1\n532747 558837 4989159 1\n532748 559149 8841547 1\n532749 706678 8841643 1\n532750 405466 8841735 1\n\n[532751 rows x 3 columns]",
|
150 |
+
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>query-id</th>\n <th>corpus-id</th>\n <th>score</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>1185869</td>\n <td>0</td>\n <td>1</td>\n </tr>\n <tr>\n <th>1</th>\n <td>1185868</td>\n <td>16</td>\n <td>1</td>\n </tr>\n <tr>\n <th>2</th>\n <td>597651</td>\n <td>49</td>\n <td>1</td>\n </tr>\n <tr>\n <th>3</th>\n <td>403613</td>\n <td>60</td>\n <td>1</td>\n </tr>\n <tr>\n <th>4</th>\n <td>1183785</td>\n <td>389</td>\n <td>1</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>532746</th>\n <td>19285</td>\n <td>8841362</td>\n <td>1</td>\n </tr>\n <tr>\n <th>532747</th>\n <td>558837</td>\n <td>4989159</td>\n <td>1</td>\n </tr>\n <tr>\n <th>532748</th>\n <td>559149</td>\n <td>8841547</td>\n <td>1</td>\n </tr>\n <tr>\n <th>532749</th>\n <td>706678</td>\n <td>8841643</td>\n <td>1</td>\n </tr>\n <tr>\n <th>532750</th>\n <td>405466</td>\n <td>8841735</td>\n <td>1</td>\n </tr>\n </tbody>\n</table>\n<p>532751 rows × 3 columns</p>\n</div>"
|
151 |
+
},
|
152 |
+
"metadata": {}
|
153 |
+
}
|
154 |
+
],
|
155 |
+
"execution_count": null
|
156 |
+
},
|
157 |
+
{
|
158 |
+
"cell_type": "code",
|
159 |
+
"source": [
|
160 |
+
"df_qrels_dev"
|
161 |
+
],
|
162 |
+
"metadata": {
|
163 |
+
"trusted": true,
|
164 |
+
"execution": {
|
165 |
+
"iopub.status.busy": "2025-04-06T09:23:50.855651Z",
|
166 |
+
"iopub.execute_input": "2025-04-06T09:23:50.856029Z",
|
167 |
+
"iopub.status.idle": "2025-04-06T09:23:50.867014Z",
|
168 |
+
"shell.execute_reply.started": "2025-04-06T09:23:50.855996Z",
|
169 |
+
"shell.execute_reply": "2025-04-06T09:23:50.866073Z"
|
170 |
+
},
|
171 |
+
"id": "OM_oEoFCgb-x",
|
172 |
+
"outputId": "a2c303be-ca2f-4d13-a4ca-8bbd3ed83d71"
|
173 |
+
},
|
174 |
+
"outputs": [
|
175 |
+
{
|
176 |
+
"execution_count": 6,
|
177 |
+
"output_type": "execute_result",
|
178 |
+
"data": {
|
179 |
+
"text/plain": " query-id corpus-id score\n0 300674 7067032 1\n1 125705 7067056 1\n2 94798 7067181 1\n3 9083 7067274 1\n4 174249 7067348 1\n... ... ... ...\n7432 147073 8008770 1\n7433 243761 8008787 1\n7434 162662 8008977 1\n7435 247194 8009319 1\n7436 195199 8009377 1\n\n[7437 rows x 3 columns]",
|
180 |
+
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>query-id</th>\n <th>corpus-id</th>\n <th>score</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>300674</td>\n <td>7067032</td>\n <td>1</td>\n </tr>\n <tr>\n <th>1</th>\n <td>125705</td>\n <td>7067056</td>\n <td>1</td>\n </tr>\n <tr>\n <th>2</th>\n <td>94798</td>\n <td>7067181</td>\n <td>1</td>\n </tr>\n <tr>\n <th>3</th>\n <td>9083</td>\n <td>7067274</td>\n <td>1</td>\n </tr>\n <tr>\n <th>4</th>\n <td>174249</td>\n <td>7067348</td>\n <td>1</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>7432</th>\n <td>147073</td>\n <td>8008770</td>\n <td>1</td>\n </tr>\n <tr>\n <th>7433</th>\n <td>243761</td>\n <td>8008787</td>\n <td>1</td>\n </tr>\n <tr>\n <th>7434</th>\n <td>162662</td>\n <td>8008977</td>\n <td>1</td>\n </tr>\n <tr>\n <th>7435</th>\n <td>247194</td>\n <td>8009319</td>\n <td>1</td>\n </tr>\n <tr>\n <th>7436</th>\n <td>195199</td>\n <td>8009377</td>\n <td>1</td>\n </tr>\n </tbody>\n</table>\n<p>7437 rows × 3 columns</p>\n</div>"
|
181 |
+
},
|
182 |
+
"metadata": {}
|
183 |
+
}
|
184 |
+
],
|
185 |
+
"execution_count": null
|
186 |
+
},
|
187 |
+
{
|
188 |
+
"cell_type": "code",
|
189 |
+
"source": [
|
190 |
+
"df_qrels_test"
|
191 |
+
],
|
192 |
+
"metadata": {
|
193 |
+
"trusted": true,
|
194 |
+
"execution": {
|
195 |
+
"iopub.status.busy": "2025-04-06T09:23:59.489691Z",
|
196 |
+
"iopub.execute_input": "2025-04-06T09:23:59.490182Z",
|
197 |
+
"iopub.status.idle": "2025-04-06T09:23:59.503658Z",
|
198 |
+
"shell.execute_reply.started": "2025-04-06T09:23:59.490139Z",
|
199 |
+
"shell.execute_reply": "2025-04-06T09:23:59.502273Z"
|
200 |
+
},
|
201 |
+
"id": "mLhpMdt_gb-x",
|
202 |
+
"outputId": "9ef08f2b-b832-4c71-ca8c-685f92092772"
|
203 |
+
},
|
204 |
+
"outputs": [
|
205 |
+
{
|
206 |
+
"execution_count": 7,
|
207 |
+
"output_type": "execute_result",
|
208 |
+
"data": {
|
209 |
+
"text/plain": " query-id corpus-id score\n0 19335 1017759 0\n1 19335 1082489 0\n2 19335 109063 0\n3 19335 1160863 0\n4 19335 1160871 0\n... ... ... ...\n9255 1133167 8839920 2\n9256 1133167 8839922 2\n9257 1133167 944810 0\n9258 1133167 949411 0\n9259 1133167 977421 0\n\n[9260 rows x 3 columns]",
|
210 |
+
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>query-id</th>\n <th>corpus-id</th>\n <th>score</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>19335</td>\n <td>1017759</td>\n <td>0</td>\n </tr>\n <tr>\n <th>1</th>\n <td>19335</td>\n <td>1082489</td>\n <td>0</td>\n </tr>\n <tr>\n <th>2</th>\n <td>19335</td>\n <td>109063</td>\n <td>0</td>\n </tr>\n <tr>\n <th>3</th>\n <td>19335</td>\n <td>1160863</td>\n <td>0</td>\n </tr>\n <tr>\n <th>4</th>\n <td>19335</td>\n <td>1160871</td>\n <td>0</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>9255</th>\n <td>1133167</td>\n <td>8839920</td>\n <td>2</td>\n </tr>\n <tr>\n <th>9256</th>\n <td>1133167</td>\n <td>8839922</td>\n <td>2</td>\n </tr>\n <tr>\n <th>9257</th>\n <td>1133167</td>\n <td>944810</td>\n <td>0</td>\n </tr>\n <tr>\n <th>9258</th>\n <td>1133167</td>\n <td>949411</td>\n <td>0</td>\n </tr>\n <tr>\n <th>9259</th>\n <td>1133167</td>\n <td>977421</td>\n <td>0</td>\n </tr>\n </tbody>\n</table>\n<p>9260 rows × 3 columns</p>\n</div>"
|
211 |
+
},
|
212 |
+
"metadata": {}
|
213 |
+
}
|
214 |
+
],
|
215 |
+
"execution_count": null
|
216 |
+
},
|
217 |
+
{
|
218 |
+
"cell_type": "code",
|
219 |
+
"source": [
|
220 |
+
"df_qrels_train['query-id'].value_counts()"
|
221 |
+
],
|
222 |
+
"metadata": {
|
223 |
+
"trusted": true,
|
224 |
+
"execution": {
|
225 |
+
"iopub.status.busy": "2025-04-06T09:27:02.375382Z",
|
226 |
+
"iopub.execute_input": "2025-04-06T09:27:02.375802Z",
|
227 |
+
"iopub.status.idle": "2025-04-06T09:27:02.472982Z",
|
228 |
+
"shell.execute_reply.started": "2025-04-06T09:27:02.375765Z",
|
229 |
+
"shell.execute_reply": "2025-04-06T09:27:02.471956Z"
|
230 |
+
},
|
231 |
+
"id": "ZzPvmtlZgb-y",
|
232 |
+
"outputId": "0a7543b8-5619-4cbc-ba38-270b6d2567de"
|
233 |
+
},
|
234 |
+
"outputs": [
|
235 |
+
{
|
236 |
+
"execution_count": 8,
|
237 |
+
"output_type": "execute_result",
|
238 |
+
"data": {
|
239 |
+
"text/plain": "query-id\n574458 7\n913949 7\n199730 7\n49751 7\n47866 7\n ..\n384305 1\n979676 1\n1042805 1\n948363 1\n405466 1\nName: count, Length: 502939, dtype: int64"
|
240 |
+
},
|
241 |
+
"metadata": {}
|
242 |
+
}
|
243 |
+
],
|
244 |
+
"execution_count": null
|
245 |
+
},
|
246 |
+
{
|
247 |
+
"cell_type": "code",
|
248 |
+
"source": [
|
249 |
+
"df_corpus_rn = df_corpus[['_id', 'text']].rename(columns={\"_id\": \"corpus-id\",\"text\": \"corpus\"})\n",
|
250 |
+
"print(df_corpus_rn)\n",
|
251 |
+
"df_queries_rn = df_queries[['_id', 'text']].rename(columns={\"_id\": \"query-id\",\"text\": \"query\"})\n",
|
252 |
+
"print(df_queries_rn)\n"
|
253 |
+
],
|
254 |
+
"metadata": {
|
255 |
+
"trusted": true,
|
256 |
+
"execution": {
|
257 |
+
"iopub.status.busy": "2025-04-06T09:30:25.893358Z",
|
258 |
+
"iopub.execute_input": "2025-04-06T09:30:25.893793Z",
|
259 |
+
"iopub.status.idle": "2025-04-06T09:30:26.828416Z",
|
260 |
+
"shell.execute_reply.started": "2025-04-06T09:30:25.893715Z",
|
261 |
+
"shell.execute_reply": "2025-04-06T09:30:26.82703Z"
|
262 |
+
},
|
263 |
+
"id": "gVdV-v4sgb-y",
|
264 |
+
"outputId": "70059fab-b036-470b-a738-069ba611d15e"
|
265 |
+
},
|
266 |
+
"outputs": [
|
267 |
+
{
|
268 |
+
"name": "stdout",
|
269 |
+
"text": " corpus-id corpus\n0 0 The presence of communication amid scientific ...\n1 1 The Manhattan Project and its atomic bomb help...\n2 2 Essay on The Manhattan Project - The Manhattan...\n3 3 The Manhattan Project was the name for a proje...\n4 4 versions of each volume as well as complementa...\n... ... ...\n8841818 8841818 When metal salts emit short wavelengths of vis...\n8841819 8841819 Thousands of people across the United States w...\n8841820 8841820 The recipe that creates blue, for example, inc...\n8841821 8841821 On Independence Days of yore, old-timey crowds...\n8841822 8841822 View full size image. Behind the scenes of the...\n\n[8841823 rows x 2 columns]\n query-id query\n0 1185869 )what was the immediate impact of the success ...\n1 1185868 _________ justice is designed to repair the ha...\n2 597651 what color is amber urine\n3 403613 is autoimmune hepatitis a bile acid synthesis ...\n4 1183785 elegxo meaning\n... ... ...\n509957 147073 difference between discrete and process manufa...\n509958 243761 how long did abraham lincoln serve\n509959 162662 does adult acne rosacea give you blepharitis\n509960 247194 how long do you bake muffins\n509961 195199 glioma meaning\n\n[509962 rows x 2 columns]\n",
|
270 |
+
"output_type": "stream"
|
271 |
+
}
|
272 |
+
],
|
273 |
+
"execution_count": null
|
274 |
+
},
|
275 |
+
{
|
276 |
+
"cell_type": "code",
|
277 |
+
"source": [
|
278 |
+
"df_qrels_train_final = df_qrels_train.merge(df_corpus_rn, on='corpus-id', how=\"left\").merge(df_queries_rn, on='query-id', how=\"left\")\n",
|
279 |
+
"print(df_qrels_train_final)\n",
|
280 |
+
"print()\n",
|
281 |
+
"df_qrels_dev_final = df_qrels_dev.merge(df_corpus_rn, on='corpus-id', how=\"left\").merge(df_queries_rn, on='query-id', how=\"left\")\n",
|
282 |
+
"print(df_qrels_dev_final)\n",
|
283 |
+
"print()\n",
|
284 |
+
"df_qrels_test_final = df_qrels_test.merge(df_corpus_rn, on='corpus-id', how=\"left\").merge(df_queries_rn, on='query-id', how=\"left\")\n",
|
285 |
+
"print(df_qrels_test_final)"
|
286 |
+
],
|
287 |
+
"metadata": {
|
288 |
+
"trusted": true,
|
289 |
+
"execution": {
|
290 |
+
"iopub.status.busy": "2025-04-06T09:33:28.433846Z",
|
291 |
+
"iopub.execute_input": "2025-04-06T09:33:28.434207Z",
|
292 |
+
"iopub.status.idle": "2025-04-06T09:33:33.572173Z",
|
293 |
+
"shell.execute_reply.started": "2025-04-06T09:33:28.43418Z",
|
294 |
+
"shell.execute_reply": "2025-04-06T09:33:33.570969Z"
|
295 |
+
},
|
296 |
+
"id": "YKw-nZ2tgb-y",
|
297 |
+
"outputId": "d78d3cb6-652f-49a3-d970-99541d082756"
|
298 |
+
},
|
299 |
+
"outputs": [
|
300 |
+
{
|
301 |
+
"name": "stdout",
|
302 |
+
"text": " query-id corpus-id score \\\n0 1185869 0 1 \n1 1185868 16 1 \n2 597651 49 1 \n3 403613 60 1 \n4 1183785 389 1 \n... ... ... ... \n532746 19285 8841362 1 \n532747 558837 4989159 1 \n532748 559149 8841547 1 \n532749 706678 8841643 1 \n532750 405466 8841735 1 \n\n corpus \\\n0 The presence of communication amid scientific ... \n1 The approach is based on a theory of justice t... \n2 Colorâurine can be a variety of colors, most... \n3 Inborn errors of bile acid synthesis can produ... \n4 The word convict here (elegcw /elegxo) means t... \n... ... \n532746 What is Anterolisthesis? Anterolisthesis is de... \n532747 Fly fishing in a river. Fly fishing is an angl... \n532748 FSH and LH levels in perimenopause are often f... \n532749 Yowie is one of several names given to a homin... \n532750 Carbonic acid is unstable and decomposes to CO... \n\n query \n0 )what was the immediate impact of the success ... \n1 _________ justice is designed to repair the ha... \n2 what color is amber urine \n3 is autoimmune hepatitis a bile acid synthesis ... \n4 elegxo meaning \n... ... \n532746 anterolisthesis definition \n532747 what are fishing flies \n532748 what are fsh levels during perimenopause \n532749 what is a yowie \n532750 is carbonic acid soluble \n\n[532751 rows x 5 columns]\n\n query-id corpus-id score \\\n0 300674 7067032 1 \n1 125705 7067056 1 \n2 94798 7067181 1 \n3 9083 7067274 1 \n4 174249 7067348 1 \n... ... ... ... \n7432 147073 8008770 1 \n7433 243761 8008787 1 \n7434 162662 8008977 1 \n7435 247194 8009319 1 \n7436 195199 8009377 1 \n\n corpus \\\n0 http://en.wikipedia.org/wiki/William_Bradford_... \n1 Adjective[edit] preventive â(comparative mor... \n2 Photoshop: color overlay. In my sunlight touch... \n3 TRUE. Hippocrates is considered the father of ... \n4 How to create a PaySlip using a printer: 1 Lo... \n... ... \n7432 Process Manufacturing involves Variable Ingred... \n7433 Abraham Lincoln served as president from March... \n7434 Rosacea is a facial skin condition that can ca... \n7435 1 Bake at 425F degrees for 5 minutes. 2 Reduc... \n7436 Webster Dictionary (0.00 / 0 votes) Rate this ... \n\n query \n0 how many years did william bradford serve as g... \n1 define preventive \n2 color overlay photoshop \n3 ____________________ is considered the father ... \n4 does xpress bet charge to deposit money in you... \n... ... \n7432 difference between discrete and process manufa... \n7433 how long did abraham lincoln serve \n7434 does adult acne rosacea give you blepharitis \n7435 how long do you bake muffins \n7436 glioma meaning \n\n[7437 rows x 5 columns]\n\n query-id corpus-id score \\\n0 19335 1017759 0 \n1 19335 1082489 0 \n2 19335 109063 0 \n3 19335 1160863 0 \n4 19335 1160871 0 \n... ... ... ... \n9255 1133167 8839920 2 \n9256 1133167 8839922 2 \n9257 1133167 944810 0 \n9258 1133167 949411 0 \n9259 1133167 977421 0 \n\n corpus \\\n0 Man and environment reciprocal relationship. T... \n1 Ethnographic research is a qualitative method ... \n2 1. Identify the fields of anthropology and maj... \n3 Human impact on the environment. Human impact ... \n4 Human impact on the environment. Human impact ... \n... ... \n9255 Weather In Ocho Rios Jamaica - Spring (March, ... \n9256 What's the best time to travel to Ocho Rios in... \n9257 Cairo Yearly Weather Summary. Cairo has an ari... \n9258 The average high temperature reaches 90 degree... \n9259 More trip calculations. 1 flight time from Mi... \n\n query \n0 anthropological definition of environment \n1 anthropological definition of environment \n2 anthropological definition of environment \n3 anthropological definition of environment \n4 anthropological definition of environment \n... ... \n9255 how is the weather in jamaica \n9256 how is the weather in jamaica \n9257 how is the weather in jamaica \n9258 how is the weather in jamaica \n9259 how is the weather in jamaica \n\n[9260 rows x 5 columns]\n",
|
303 |
+
"output_type": "stream"
|
304 |
+
}
|
305 |
+
],
|
306 |
+
"execution_count": null
|
307 |
+
},
|
308 |
+
{
|
309 |
+
"cell_type": "markdown",
|
310 |
+
"source": [
|
311 |
+
"## 数据集处理\n",
|
312 |
+
"query作为cond\n",
|
313 |
+
"corpus作为group\n",
|
314 |
+
"只处理train和dev,test先不管"
|
315 |
+
],
|
316 |
+
"metadata": {
|
317 |
+
"id": "UpHjFx16gb-y"
|
318 |
+
}
|
319 |
+
},
|
320 |
+
{
|
321 |
+
"cell_type": "code",
|
322 |
+
"source": [
|
323 |
+
"def handle(row):\n",
|
324 |
+
" # query_id = row[0]\n",
|
325 |
+
" cond = row[1]['query'].tolist()[0]\n",
|
326 |
+
" group = row[1]['corpus'].tolist()\n",
|
327 |
+
" return (cond, group)\n"
|
328 |
+
],
|
329 |
+
"metadata": {
|
330 |
+
"trusted": true,
|
331 |
+
"execution": {
|
332 |
+
"iopub.status.busy": "2025-04-06T09:37:11.62826Z",
|
333 |
+
"iopub.execute_input": "2025-04-06T09:37:11.628583Z",
|
334 |
+
"iopub.status.idle": "2025-04-06T09:37:11.633852Z",
|
335 |
+
"shell.execute_reply.started": "2025-04-06T09:37:11.628556Z",
|
336 |
+
"shell.execute_reply": "2025-04-06T09:37:11.632279Z"
|
337 |
+
},
|
338 |
+
"id": "iEiQcfzUgb-z"
|
339 |
+
},
|
340 |
+
"outputs": [],
|
341 |
+
"execution_count": null
|
342 |
+
},
|
343 |
+
{
|
344 |
+
"cell_type": "markdown",
|
345 |
+
"source": [
|
346 |
+
"### train"
|
347 |
+
],
|
348 |
+
"metadata": {
|
349 |
+
"id": "71O78ERCgb-z"
|
350 |
+
}
|
351 |
+
},
|
352 |
+
{
|
353 |
+
"cell_type": "code",
|
354 |
+
"source": [
|
355 |
+
"name_group_list_train = [(name[0], group) for name, group in df_qrels_train_final.groupby(['query-id'])]\n",
|
356 |
+
"print(len(name_group_list_train))\n",
|
357 |
+
"print(len(name_group_list_train[0][1]))\n",
|
358 |
+
"print(name_group_list_train[1][1])\n",
|
359 |
+
"print(len(name_group_list_train[1][1]))\n",
|
360 |
+
"\n",
|
361 |
+
"print(\"过滤后\")\n",
|
362 |
+
"name_group_list_train_filter = list(filter(lambda _: len(_[1]) > 1, name_group_list_train))\n",
|
363 |
+
"print(len(name_group_list_train_filter))\n",
|
364 |
+
"print(len(name_group_list_train_filter[0][1]))\n",
|
365 |
+
"print(name_group_list_train_filter[1][1])\n",
|
366 |
+
"print(len(name_group_list_train_filter[1][1]))"
|
367 |
+
],
|
368 |
+
"metadata": {
|
369 |
+
"trusted": true,
|
370 |
+
"execution": {
|
371 |
+
"iopub.status.busy": "2025-04-06T09:38:51.057346Z",
|
372 |
+
"iopub.execute_input": "2025-04-06T09:38:51.057702Z",
|
373 |
+
"iopub.status.idle": "2025-04-06T09:39:15.549519Z",
|
374 |
+
"shell.execute_reply.started": "2025-04-06T09:38:51.05767Z",
|
375 |
+
"shell.execute_reply": "2025-04-06T09:39:15.54838Z"
|
376 |
+
},
|
377 |
+
"id": "PpyOvz7xgb-0",
|
378 |
+
"outputId": "46b0f70b-0e13-4a26-96a4-86a8bd14ae3c"
|
379 |
+
},
|
380 |
+
"outputs": [
|
381 |
+
{
|
382 |
+
"name": "stdout",
|
383 |
+
"text": "502939\n1\n query-id corpus-id score \\\n395137 4 5613529 1 \n\n corpus \\\n395137 The formation of AA â Alcoholics Anonymous â... \n\n query \n395137 Defining alcoholism as a disease is associate... \n1\n过滤后\n25352\n2\n query-id corpus-id score \\\n280941 374 4086051 1 \n280942 374 4086052 1 \n280943 374 4086057 1 \n\n corpus \\\n280941 Quick Answer. The Internet was created essenti... \n280942 2003-06-30: the World Wide Web was invented by... \n280943 Tim Berners-Lee. The first web browser - or br... \n\n query \n280941 . what is the world wide web, when was it crea... \n280942 . what is the world wide web, when was it crea... \n280943 . what is the world wide web, when was it crea... \n3\n",
|
384 |
+
"output_type": "stream"
|
385 |
+
}
|
386 |
+
],
|
387 |
+
"execution_count": null
|
388 |
+
},
|
389 |
+
{
|
390 |
+
"cell_type": "code",
|
391 |
+
"source": [
|
392 |
+
"result_train = list(map(handle, name_group_list_train_filter))\n",
|
393 |
+
"result_train_df = pd.DataFrame(result_train, columns=['condition', 'group'])\n",
|
394 |
+
"result_train_df"
|
395 |
+
],
|
396 |
+
"metadata": {
|
397 |
+
"trusted": true,
|
398 |
+
"execution": {
|
399 |
+
"iopub.status.busy": "2025-04-06T09:40:31.639048Z",
|
400 |
+
"iopub.execute_input": "2025-04-06T09:40:31.639405Z",
|
401 |
+
"iopub.status.idle": "2025-04-06T09:40:33.318217Z",
|
402 |
+
"shell.execute_reply.started": "2025-04-06T09:40:31.639376Z",
|
403 |
+
"shell.execute_reply": "2025-04-06T09:40:33.317132Z"
|
404 |
+
},
|
405 |
+
"id": "mvn7K7fEgb-0",
|
406 |
+
"outputId": "67b09522-42e3-46b8-dfcd-7a5501727462"
|
407 |
+
},
|
408 |
+
"outputs": [
|
409 |
+
{
|
410 |
+
"execution_count": 21,
|
411 |
+
"output_type": "execute_result",
|
412 |
+
"data": {
|
413 |
+
"text/plain": " condition \\\n0 +pregnant woman symptoms \n1 . what is the world wide web, when was it crea... \n2 12 centimeters equals how many inches \n3 1984 buick regal gear ratio \n4 2% milk calories per glass \n... ... \n25347 why does carpal tunnel syndrome and the little... \n25348 why do you need a will \n25349 why do thunderstorms form \n25350 why do the english say leftenant \n25351 why did us declare war when \n\n group \n0 [Although the CDC states that pregnant women a... \n1 [Quick Answer. The Internet was created essent... \n2 [12 cm x (1 in./2.54 cm) = 4.7 inches multiply... \n3 [Read more. Although they are not listed speci... \n4 [An 8 ounce glass of whole milk contains appro... \n... ... \n25347 [Carpal tunnel syndrome can cause tingling, nu... \n25348 [If you want to leave any part of your assets ... \n25349 [How do they form? Thunderstorms are formed by... \n25350 [It's only the difference in pronunciation. In... \n25351 [The United States declared war on Germany for... \n\n[25352 rows x 2 columns]",
|
414 |
+
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>condition</th>\n <th>group</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>+pregnant woman symptoms</td>\n <td>[Although the CDC states that pregnant women a...</td>\n </tr>\n <tr>\n <th>1</th>\n <td>. what is the world wide web, when was it crea...</td>\n <td>[Quick Answer. The Internet was created essent...</td>\n </tr>\n <tr>\n <th>2</th>\n <td>12 centimeters equals how many inches</td>\n <td>[12 cm x (1 in./2.54 cm) = 4.7 inches multiply...</td>\n </tr>\n <tr>\n <th>3</th>\n <td>1984 buick regal gear ratio</td>\n <td>[Read more. Although they are not listed speci...</td>\n </tr>\n <tr>\n <th>4</th>\n <td>2% milk calories per glass</td>\n <td>[An 8 ounce glass of whole milk contains appro...</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>25347</th>\n <td>why does carpal tunnel syndrome and the little...</td>\n <td>[Carpal tunnel syndrome can cause tingling, nu...</td>\n </tr>\n <tr>\n <th>25348</th>\n <td>why do you need a will</td>\n <td>[If you want to leave any part of your assets ...</td>\n </tr>\n <tr>\n <th>25349</th>\n <td>why do thunderstorms form</td>\n <td>[How do they form? Thunderstorms are formed by...</td>\n </tr>\n <tr>\n <th>25350</th>\n <td>why do the english say leftenant</td>\n <td>[It's only the difference in pronunciation. In...</td>\n </tr>\n <tr>\n <th>25351</th>\n <td>why did us declare war when</td>\n <td>[The United States declared war on Germany for...</td>\n </tr>\n </tbody>\n</table>\n<p>25352 rows × 2 columns</p>\n</div>"
|
415 |
+
},
|
416 |
+
"metadata": {}
|
417 |
+
}
|
418 |
+
],
|
419 |
+
"execution_count": null
|
420 |
+
},
|
421 |
+
{
|
422 |
+
"cell_type": "code",
|
423 |
+
"source": [
|
424 |
+
"sum(map(lambda _: len(_[1]), name_group_list_train_filter))"
|
425 |
+
],
|
426 |
+
"metadata": {
|
427 |
+
"trusted": true,
|
428 |
+
"execution": {
|
429 |
+
"iopub.status.busy": "2025-04-06T09:49:01.525313Z",
|
430 |
+
"iopub.execute_input": "2025-04-06T09:49:01.525673Z",
|
431 |
+
"iopub.status.idle": "2025-04-06T09:49:01.68355Z",
|
432 |
+
"shell.execute_reply.started": "2025-04-06T09:49:01.525648Z",
|
433 |
+
"shell.execute_reply": "2025-04-06T09:49:01.682423Z"
|
434 |
+
},
|
435 |
+
"id": "igGbXGZEgb-0",
|
436 |
+
"outputId": "c630715d-e72b-4e48-fb59-c6f7d28fa091"
|
437 |
+
},
|
438 |
+
"outputs": [
|
439 |
+
{
|
440 |
+
"execution_count": 31,
|
441 |
+
"output_type": "execute_result",
|
442 |
+
"data": {
|
443 |
+
"text/plain": "55164"
|
444 |
+
},
|
445 |
+
"metadata": {}
|
446 |
+
}
|
447 |
+
],
|
448 |
+
"execution_count": null
|
449 |
+
},
|
450 |
+
{
|
451 |
+
"cell_type": "markdown",
|
452 |
+
"source": [
|
453 |
+
"### test"
|
454 |
+
],
|
455 |
+
"metadata": {
|
456 |
+
"id": "yT4dp3i0gb-0"
|
457 |
+
}
|
458 |
+
},
|
459 |
+
{
|
460 |
+
"cell_type": "code",
|
461 |
+
"source": [
|
462 |
+
"name_group_list_dev = [(name[0], group) for name, group in df_qrels_dev_final.groupby(['query-id'])]\n",
|
463 |
+
"print(len(name_group_list_dev))\n",
|
464 |
+
"print(len(name_group_list_dev[0][1]))\n",
|
465 |
+
"print(name_group_list_dev[1][1])\n",
|
466 |
+
"print(len(name_group_list_dev[1][1]))\n",
|
467 |
+
"\n",
|
468 |
+
"print(\"过滤后\")\n",
|
469 |
+
"name_group_list_dev_filter = list(filter(lambda _: len(_[1]) > 1, name_group_list_dev))\n",
|
470 |
+
"print(len(name_group_list_dev_filter))\n",
|
471 |
+
"print(len(name_group_list_dev_filter[0][1]))\n",
|
472 |
+
"print(name_group_list_dev_filter[1][1])\n",
|
473 |
+
"print(len(name_group_list_dev_filter[1][1]))"
|
474 |
+
],
|
475 |
+
"metadata": {
|
476 |
+
"trusted": true,
|
477 |
+
"execution": {
|
478 |
+
"iopub.status.busy": "2025-04-06T09:42:06.63411Z",
|
479 |
+
"iopub.execute_input": "2025-04-06T09:42:06.634475Z",
|
480 |
+
"iopub.status.idle": "2025-04-06T09:42:06.768768Z",
|
481 |
+
"shell.execute_reply.started": "2025-04-06T09:42:06.634446Z",
|
482 |
+
"shell.execute_reply": "2025-04-06T09:42:06.767698Z"
|
483 |
+
},
|
484 |
+
"id": "Id-dKaMkgb-1",
|
485 |
+
"outputId": "d50d6998-beb4-489e-f9d4-3f3156424221"
|
486 |
+
},
|
487 |
+
"outputs": [
|
488 |
+
{
|
489 |
+
"name": "stdout",
|
490 |
+
"text": "6980\n1\n query-id corpus-id score \\\n2655 1215 7395960 1 \n\n corpus \\\n2655 In Canada, there are 3 levels of government. E... \n\n query \n2655 3 levels of government in canada and their res... \n1\n过滤后\n390\n2\n query-id corpus-id score \\\n4136 4947 7581255 1 \n4137 4947 7581263 1 \n\n corpus query \n4136 $25 Million. Ludacris net worth: Award winning... Ludacris Net Worth \n4137 Ludacris net worth is estimated at $25 million... Ludacris Net Worth \n2\n",
|
491 |
+
"output_type": "stream"
|
492 |
+
}
|
493 |
+
],
|
494 |
+
"execution_count": null
|
495 |
+
},
|
496 |
+
{
|
497 |
+
"cell_type": "code",
|
498 |
+
"source": [
|
499 |
+
"result_dev = list(map(handle, name_group_list_dev_filter))\n",
|
500 |
+
"result_dev_df = pd.DataFrame(result_dev, columns=['condition', 'group'])\n",
|
501 |
+
"result_dev_df"
|
502 |
+
],
|
503 |
+
"metadata": {
|
504 |
+
"trusted": true,
|
505 |
+
"execution": {
|
506 |
+
"iopub.status.busy": "2025-04-06T09:43:09.323632Z",
|
507 |
+
"iopub.execute_input": "2025-04-06T09:43:09.324034Z",
|
508 |
+
"iopub.status.idle": "2025-04-06T09:43:09.358933Z",
|
509 |
+
"shell.execute_reply.started": "2025-04-06T09:43:09.324002Z",
|
510 |
+
"shell.execute_reply": "2025-04-06T09:43:09.357829Z"
|
511 |
+
},
|
512 |
+
"id": "SWhMrWLigb-1",
|
513 |
+
"outputId": "23a401b0-c8be-4da8-e9cb-7227e06973bb"
|
514 |
+
},
|
515 |
+
"outputs": [
|
516 |
+
{
|
517 |
+
"execution_count": 23,
|
518 |
+
"output_type": "execute_result",
|
519 |
+
"data": {
|
520 |
+
"text/plain": " condition \\\n0 Explain what a bone scan is and what it is use... \n1 Ludacris Net Worth \n2 age not to take off shoes at airline security \n3 aplastic anemia causes and symptoms \n4 asus phones price list \n.. ... \n385 hazel haskett in real life \n386 foods to keep constipation away \n387 effects of using pedialyte \n388 diff types of fuses \n389 definition of shagreen \n\n group \n0 [Why It Is Done. A bone scan is done to: 1 Fi... \n1 [$25 Million. Ludacris net worth: Award winnin... \n2 [Itâs a victory for old soles. Travelers ove... \n3 [Symptoms and Complications. Symptoms of aplas... \n4 [More about Asus Mobiles Price List in India. ... \n.. ... \n385 [Hazel Haskett is the young heroine of Dolphin... \n386 [Focus on soluble fiber instead. Keep in mind ... \n387 [Plus, if youâre aiming for weight loss, the... \n388 [Automotive fuses are a class of fuses used to... \n389 [What is Shagreen Shagreen is an exotic materi... \n\n[390 rows x 2 columns]",
|
521 |
+
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>condition</th>\n <th>group</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>Explain what a bone scan is and what it is use...</td>\n <td>[Why It Is Done. A bone scan is done to: 1 Fi...</td>\n </tr>\n <tr>\n <th>1</th>\n <td>Ludacris Net Worth</td>\n <td>[$25 Million. Ludacris net worth: Award winnin...</td>\n </tr>\n <tr>\n <th>2</th>\n <td>age not to take off shoes at airline security</td>\n <td>[Itâs a victory for old soles. Travelers ove...</td>\n </tr>\n <tr>\n <th>3</th>\n <td>aplastic anemia causes and symptoms</td>\n <td>[Symptoms and Complications. Symptoms of aplas...</td>\n </tr>\n <tr>\n <th>4</th>\n <td>asus phones price list</td>\n <td>[More about Asus Mobiles Price List in India. ...</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>385</th>\n <td>hazel haskett in real life</td>\n <td>[Hazel Haskett is the young heroine of Dolphin...</td>\n </tr>\n <tr>\n <th>386</th>\n <td>foods to keep constipation away</td>\n <td>[Focus on soluble fiber instead. Keep in mind ...</td>\n </tr>\n <tr>\n <th>387</th>\n <td>effects of using pedialyte</td>\n <td>[Plus, if youâre aiming for weight loss, the...</td>\n </tr>\n <tr>\n <th>388</th>\n <td>diff types of fuses</td>\n <td>[Automotive fuses are a class of fuses used to...</td>\n </tr>\n <tr>\n <th>389</th>\n <td>definition of shagreen</td>\n <td>[What is Shagreen Shagreen is an exotic materi...</td>\n </tr>\n </tbody>\n</table>\n<p>390 rows × 2 columns</p>\n</div>"
|
522 |
+
},
|
523 |
+
"metadata": {}
|
524 |
+
}
|
525 |
+
],
|
526 |
+
"execution_count": null
|
527 |
+
},
|
528 |
+
{
|
529 |
+
"cell_type": "markdown",
|
530 |
+
"source": [
|
531 |
+
"### 处理上传"
|
532 |
+
],
|
533 |
+
"metadata": {
|
534 |
+
"id": "33AYPse6gb-1"
|
535 |
+
}
|
536 |
+
},
|
537 |
+
{
|
538 |
+
"cell_type": "code",
|
539 |
+
"source": [
|
540 |
+
"! pip install datasets"
|
541 |
+
],
|
542 |
+
"metadata": {
|
543 |
+
"trusted": true,
|
544 |
+
"execution": {
|
545 |
+
"iopub.status.busy": "2025-04-06T09:43:47.96705Z",
|
546 |
+
"iopub.execute_input": "2025-04-06T09:43:47.967417Z",
|
547 |
+
"iopub.status.idle": "2025-04-06T09:43:54.54077Z",
|
548 |
+
"shell.execute_reply.started": "2025-04-06T09:43:47.967389Z",
|
549 |
+
"shell.execute_reply": "2025-04-06T09:43:54.539401Z"
|
550 |
+
},
|
551 |
+
"id": "d4zkEVddgb-1",
|
552 |
+
"outputId": "c5380e14-5acd-4347-f334-dba7102fe64f"
|
553 |
+
},
|
554 |
+
"outputs": [
|
555 |
+
{
|
556 |
+
"name": "stdout",
|
557 |
+
"text": "Requirement already satisfied: datasets in /usr/local/lib/python3.10/dist-packages (3.3.1)\nRequirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from datasets) (3.17.0)\nRequirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from datasets) (1.26.4)\nRequirement already satisfied: pyarrow>=15.0.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (19.0.1)\nRequirement already satisfied: dill<0.3.9,>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (0.3.8)\nRequirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from datasets) (2.2.3)\nRequirement already satisfied: requests>=2.32.2 in /usr/local/lib/python3.10/dist-packages (from datasets) (2.32.3)\nRequirement already satisfied: tqdm>=4.66.3 in /usr/local/lib/python3.10/dist-packages (from datasets) (4.67.1)\nRequirement already satisfied: xxhash in /usr/local/lib/python3.10/dist-packages (from datasets) (3.5.0)\nRequirement already satisfied: multiprocess<0.70.17 in /usr/local/lib/python3.10/dist-packages (from datasets) (0.70.16)\nRequirement already satisfied: fsspec<=2024.12.0,>=2023.1.0 in /usr/local/lib/python3.10/dist-packages (from fsspec[http]<=2024.12.0,>=2023.1.0->datasets) (2024.12.0)\nRequirement already satisfied: aiohttp in /usr/local/lib/python3.10/dist-packages (from datasets) (3.11.12)\nRequirement already satisfied: huggingface-hub>=0.24.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (0.29.0)\nRequirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from datasets) (24.2)\nRequirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from datasets) (6.0.2)\nRequirement already satisfied: aiohappyeyeballs>=2.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (2.4.6)\nRequirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.3.2)\nRequirement already satisfied: async-timeout<6.0,>=4.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (5.0.1)\nRequirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (25.1.0)\nRequirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.5.0)\nRequirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (6.1.0)\nRequirement already satisfied: propcache>=0.2.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (0.2.1)\nRequirement already satisfied: yarl<2.0,>=1.17.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.18.3)\nRequirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.24.0->datasets) (4.12.2)\nRequirement already satisfied: mkl_fft in /usr/local/lib/python3.10/dist-packages (from numpy>=1.17->datasets) (1.3.8)\nRequirement already satisfied: mkl_random in /usr/local/lib/python3.10/dist-packages (from numpy>=1.17->datasets) (1.2.4)\nRequirement already satisfied: mkl_umath in /usr/local/lib/python3.10/dist-packages (from numpy>=1.17->datasets) (0.1.1)\nRequirement already satisfied: mkl in /usr/local/lib/python3.10/dist-packages (from numpy>=1.17->datasets) (2025.0.1)\nRequirement already satisfied: tbb4py in /usr/local/lib/python3.10/dist-packages (from numpy>=1.17->datasets) (2022.0.0)\nRequirement already satisfied: mkl-service in /usr/local/lib/python3.10/dist-packages (from numpy>=1.17->datasets) (2.4.1)\nRequirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.32.2->datasets) (3.4.1)\nRequirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.32.2->datasets) (3.10)\nRequirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.32.2->datasets) (2.3.0)\nRequirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.32.2->datasets) (2025.1.31)\nRequirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets) (2.9.0.post0)\nRequirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets) (2025.1)\nRequirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets) (2025.1)\nRequirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.2->pandas->datasets) (1.17.0)\nRequirement already satisfied: intel-openmp>=2024 in /usr/local/lib/python3.10/dist-packages (from mkl->numpy>=1.17->datasets) (2024.2.0)\nRequirement already satisfied: tbb==2022.* in /usr/local/lib/python3.10/dist-packages (from mkl->numpy>=1.17->datasets) (2022.0.0)\nRequirement already satisfied: tcmlib==1.* in /usr/local/lib/python3.10/dist-packages (from tbb==2022.*->mkl->numpy>=1.17->datasets) (1.2.0)\nRequirement already satisfied: intel-cmplr-lib-rt in /usr/local/lib/python3.10/dist-packages (from mkl_umath->numpy>=1.17->datasets) (2024.2.0)\nRequirement already satisfied: intel-cmplr-lib-ur==2024.2.0 in /usr/local/lib/python3.10/dist-packages (from intel-openmp>=2024->mkl->numpy>=1.17->datasets) (2024.2.0)\n",
|
558 |
+
"output_type": "stream"
|
559 |
+
}
|
560 |
+
],
|
561 |
+
"execution_count": null
|
562 |
+
},
|
563 |
+
{
|
564 |
+
"cell_type": "code",
|
565 |
+
"source": [
|
566 |
+
"from datasets import Dataset, DatasetDict\n",
|
567 |
+
"from huggingface_hub import login, create_repo"
|
568 |
+
],
|
569 |
+
"metadata": {
|
570 |
+
"trusted": true,
|
571 |
+
"execution": {
|
572 |
+
"iopub.status.busy": "2025-04-06T09:44:15.739725Z",
|
573 |
+
"iopub.execute_input": "2025-04-06T09:44:15.74019Z",
|
574 |
+
"iopub.status.idle": "2025-04-06T09:44:16.888346Z",
|
575 |
+
"shell.execute_reply.started": "2025-04-06T09:44:15.740153Z",
|
576 |
+
"shell.execute_reply": "2025-04-06T09:44:16.886998Z"
|
577 |
+
},
|
578 |
+
"id": "t5jZUv9ogb-1"
|
579 |
+
},
|
580 |
+
"outputs": [],
|
581 |
+
"execution_count": null
|
582 |
+
},
|
583 |
+
{
|
584 |
+
"cell_type": "code",
|
585 |
+
"source": [
|
586 |
+
"dataset_train = Dataset.from_pandas(result_train_df)\n",
|
587 |
+
"dataset_dev = Dataset.from_pandas(result_dev_df)"
|
588 |
+
],
|
589 |
+
"metadata": {
|
590 |
+
"trusted": true,
|
591 |
+
"execution": {
|
592 |
+
"iopub.status.busy": "2025-04-06T09:44:57.703617Z",
|
593 |
+
"iopub.execute_input": "2025-04-06T09:44:57.70424Z",
|
594 |
+
"iopub.status.idle": "2025-04-06T09:44:57.97515Z",
|
595 |
+
"shell.execute_reply.started": "2025-04-06T09:44:57.704205Z",
|
596 |
+
"shell.execute_reply": "2025-04-06T09:44:57.974158Z"
|
597 |
+
},
|
598 |
+
"id": "9v0L_tQ9gb-2"
|
599 |
+
},
|
600 |
+
"outputs": [],
|
601 |
+
"execution_count": null
|
602 |
+
},
|
603 |
+
{
|
604 |
+
"cell_type": "code",
|
605 |
+
"source": [
|
606 |
+
"dataset_dict = DatasetDict({\n",
|
607 |
+
" \"train\": dataset_train,\n",
|
608 |
+
" \"validation\": dataset_dev\n",
|
609 |
+
"})\n",
|
610 |
+
"dataset_dict"
|
611 |
+
],
|
612 |
+
"metadata": {
|
613 |
+
"trusted": true,
|
614 |
+
"execution": {
|
615 |
+
"iopub.status.busy": "2025-04-06T09:45:35.556553Z",
|
616 |
+
"iopub.execute_input": "2025-04-06T09:45:35.556942Z",
|
617 |
+
"iopub.status.idle": "2025-04-06T09:45:35.563684Z",
|
618 |
+
"shell.execute_reply.started": "2025-04-06T09:45:35.556909Z",
|
619 |
+
"shell.execute_reply": "2025-04-06T09:45:35.562624Z"
|
620 |
+
},
|
621 |
+
"id": "UiEFU-Mdgb-2",
|
622 |
+
"outputId": "1f11b39b-2854-46a8-cfb7-07da1adf2217"
|
623 |
+
},
|
624 |
+
"outputs": [
|
625 |
+
{
|
626 |
+
"execution_count": 28,
|
627 |
+
"output_type": "execute_result",
|
628 |
+
"data": {
|
629 |
+
"text/plain": "DatasetDict({\n train: Dataset({\n features: ['condition', 'group'],\n num_rows: 25352\n })\n validation: Dataset({\n features: ['condition', 'group'],\n num_rows: 390\n })\n})"
|
630 |
+
},
|
631 |
+
"metadata": {}
|
632 |
+
}
|
633 |
+
],
|
634 |
+
"execution_count": null
|
635 |
+
},
|
636 |
+
{
|
637 |
+
"cell_type": "code",
|
638 |
+
"source": [
|
639 |
+
"login(token=\"\")"
|
640 |
+
],
|
641 |
+
"metadata": {
|
642 |
+
"trusted": true,
|
643 |
+
"execution": {
|
644 |
+
"iopub.status.busy": "2025-04-06T09:46:22.37811Z",
|
645 |
+
"iopub.execute_input": "2025-04-06T09:46:22.378487Z",
|
646 |
+
"iopub.status.idle": "2025-04-06T09:46:22.551342Z",
|
647 |
+
"shell.execute_reply.started": "2025-04-06T09:46:22.378457Z",
|
648 |
+
"shell.execute_reply": "2025-04-06T09:46:22.550182Z"
|
649 |
+
},
|
650 |
+
"id": "AzHT7K6mgb-2"
|
651 |
+
},
|
652 |
+
"outputs": [],
|
653 |
+
"execution_count": null
|
654 |
+
},
|
655 |
+
{
|
656 |
+
"cell_type": "code",
|
657 |
+
"source": [
|
658 |
+
"# 创建数据集仓库\n",
|
659 |
+
"repo_id = \"bcai001/c-sts-msmarco-query-as-condition-group-as-pos\" # 例如: \"johnsmith/sentiment-analysis-data\"\n",
|
660 |
+
"create_repo(repo_id, repo_type=\"dataset\", exist_ok=True)\n",
|
661 |
+
"\n",
|
662 |
+
"# 上传数据集\n",
|
663 |
+
"dataset_dict.push_to_hub(repo_id, private=True)\n",
|
664 |
+
"\n",
|
665 |
+
"print(f\"Dataset uploaded to: https://huggingface.co/datasets/{repo_id}\")"
|
666 |
+
],
|
667 |
+
"metadata": {
|
668 |
+
"trusted": true,
|
669 |
+
"execution": {
|
670 |
+
"iopub.status.busy": "2025-04-06T09:47:17.953954Z",
|
671 |
+
"iopub.execute_input": "2025-04-06T09:47:17.954409Z",
|
672 |
+
"iopub.status.idle": "2025-04-06T09:47:24.300149Z",
|
673 |
+
"shell.execute_reply.started": "2025-04-06T09:47:17.954373Z",
|
674 |
+
"shell.execute_reply": "2025-04-06T09:47:24.299078Z"
|
675 |
+
},
|
676 |
+
"id": "S4cpLc2tgb-2",
|
677 |
+
"outputId": "3974e20d-75a8-4708-b61e-c7c6a86e77c3",
|
678 |
+
"colab": {
|
679 |
+
"referenced_widgets": [
|
680 |
+
"c9b5dc7a19cd4d92a8196115f7800616",
|
681 |
+
"eeee18a3be884f9193bab5859c17a690",
|
682 |
+
"54279d4beff64e3a9fbaed1122b15e36",
|
683 |
+
"fee0329cca8c449ca832b910cdbf3754"
|
684 |
+
]
|
685 |
+
}
|
686 |
+
},
|
687 |
+
"outputs": [
|
688 |
+
{
|
689 |
+
"output_type": "display_data",
|
690 |
+
"data": {
|
691 |
+
"text/plain": "Uploading the dataset shards: 0%| | 0/1 [00:00<?, ?it/s]",
|
692 |
+
"application/vnd.jupyter.widget-view+json": {
|
693 |
+
"version_major": 2,
|
694 |
+
"version_minor": 0,
|
695 |
+
"model_id": "c9b5dc7a19cd4d92a8196115f7800616"
|
696 |
+
}
|
697 |
+
},
|
698 |
+
"metadata": {}
|
699 |
+
},
|
700 |
+
{
|
701 |
+
"output_type": "display_data",
|
702 |
+
"data": {
|
703 |
+
"text/plain": "Creating parquet from Arrow format: 0%| | 0/26 [00:00<?, ?ba/s]",
|
704 |
+
"application/vnd.jupyter.widget-view+json": {
|
705 |
+
"version_major": 2,
|
706 |
+
"version_minor": 0,
|
707 |
+
"model_id": "eeee18a3be884f9193bab5859c17a690"
|
708 |
+
}
|
709 |
+
},
|
710 |
+
"metadata": {}
|
711 |
+
},
|
712 |
+
{
|
713 |
+
"output_type": "display_data",
|
714 |
+
"data": {
|
715 |
+
"text/plain": "Uploading the dataset shards: 0%| | 0/1 [00:00<?, ?it/s]",
|
716 |
+
"application/vnd.jupyter.widget-view+json": {
|
717 |
+
"version_major": 2,
|
718 |
+
"version_minor": 0,
|
719 |
+
"model_id": "54279d4beff64e3a9fbaed1122b15e36"
|
720 |
+
}
|
721 |
+
},
|
722 |
+
"metadata": {}
|
723 |
+
},
|
724 |
+
{
|
725 |
+
"output_type": "display_data",
|
726 |
+
"data": {
|
727 |
+
"text/plain": "Creating parquet from Arrow format: 0%| | 0/1 [00:00<?, ?ba/s]",
|
728 |
+
"application/vnd.jupyter.widget-view+json": {
|
729 |
+
"version_major": 2,
|
730 |
+
"version_minor": 0,
|
731 |
+
"model_id": "fee0329cca8c449ca832b910cdbf3754"
|
732 |
+
}
|
733 |
+
},
|
734 |
+
"metadata": {}
|
735 |
+
},
|
736 |
+
{
|
737 |
+
"name": "stdout",
|
738 |
+
"text": "Dataset uploaded to: https://huggingface.co/datasets/bcai001/c-sts-msmarco-query-as-condition-group-as-pos\n",
|
739 |
+
"output_type": "stream"
|
740 |
+
}
|
741 |
+
],
|
742 |
+
"execution_count": null
|
743 |
+
}
|
744 |
+
]
|
745 |
+
}
|