1 --- 2 annotations_creators: 3 - found 4 language_creators: 5 - found 6 languages: 7 - en 8 licenses: 9 - cc-by-nc-sa-4.0 10 multilinguality: 11 - multilingual 12 pretty_name: stackexchange 13 size_categories: 14 - unknown 15 source_datasets: 16 - original 17 task_categories: 18 - question-answering 19 task_ids: 20 - closed-domain-qa 21 --- 22 23 # Dataset Card Creation Guide 24 25 ## Table of Contents 26 - [Dataset Card Creation Guide](#dataset-card-creation-guide) 27 - [Table of Contents](#table-of-contents) 28 - [Dataset Description](#dataset-description) 29 - [Dataset Summary](#dataset-summary) 30 - [Languages](#languages) 31 - [Dataset Structure](#dataset-structure) 32 - [Data Instances](#data-instances) 33 - [Data Fields](#data-fields) 34 - [Data Splits](#data-splits) 35 - [Dataset Creation](#dataset-creation) 36 - [Curation Rationale](#curation-rationale) 37 - [Source Data](#source-data) 38 - [Initial Data Collection and Normalization](#initial-data-collection-and-normalization) 39 - [Who are the source language producers?](#who-are-the-source-language-producers)s 40 - [Additional Information](#additional-information) 41 - [Licensing Information](#licensing-information) 42 - [Citation Information](#citation-information) 43 - [Contributions](#contributions) 44 45 ## Dataset Description 46 47 - **Homepage:** [stackexchange](https://archive.org/details/stackexchange) 48 - **Repository:** [flax-sentence-embeddings](https://github.com/nreimers/flax-sentence-embeddings) 49 50 ### Dataset Summary 51 52 We automatically extracted question and answer (Q&A) pairs from [Stack Exchange](https://stackexchange.com/) network. Stack Exchange gather many Q&A communities across 50 online plateform, including the well known Stack Overflow and other technical sites. 100 millon developpers consult Stack Exchange every month. The dataset is a parallel corpus with each question mapped to the top rated answer. The dataset is split given communities which cover a variety of domains from 3d printing, economics, raspberry pi or emacs. An exhaustive list of all communities is available [here](https://stackexchange.com/sites). 53 54 ### Languages 55 56 Stack Exchange mainly consist of english language (en). 57 58 ## Dataset Structure 59 60 ### Data Instances 61 62 Each data samples is presented as follow: 63 64  65 {'title_body': 'How to determine if 3 points on a 3-D graph are collinear? Let the points $A, B$ and $C$ be $(x_1, y_1, z_1), (x_2, y_2, z_2)$ and $(x_3, y_3, z_3)$ respectively. How do I prove that the 3 points are collinear? What is the formula?', 66 'upvoted_answer': 'From $A(x_1,y_1,z_1),B(x_2,y_2,z_2),C(x_3,y_3,z_3)$ we can get their position vectors.\n\n$\\vec{AB}=(x_2-x_1,y_2-y_1,z_2-z_1)$ and $\\vec{AC}=(x_3-x_1,y_3-y_1,z_3-z_1)$.\n\nThen $||\\vec{AB}\\times\\vec{AC}||=0\\implies A,B,C$ collinear.', 67  68 69 This particular exampe corresponds to the [following page](https://math.stackexchange.com/questions/947555/how-to-determine-if-3-points-on-a-3-d-graph-are-collinear) 70 71 ### Data Fields 72 73 The fields present in the dataset contain the following informations: 74 75 - title_body: This is the concatenation of the title and body from the question 76 - upvoted_answer: This is the body from the most upvoted answer 77 78 ### Data Splits 79 80 We provide multiple splits for this dataset, which each refers to a given community channel. We detail the number of pail for each split below: 81 82 83 | | Number of pairs | 84 | ----- | ------ | 85 | apple | 92,487 | 86 | english | 100,640 | 87 | codereview | 41,748 | 88 | dba | 71,449 | 89 | mathoverflow | 85,289 | 90 | electronics | 129,494 | 91 | mathematica | 59,895 | 92 | drupal | 67,817 | 93 | magento | 79,241 | 94 | gaming | 82,887 | 95 | ell | 77,892 | 96 | gamedev | 40,154 | 97 | gis | 100,254 | 98 | askubuntu | 267,135 | 99 | diy | 52,896 | 100 | academia | 32,137 | 101 | blender | 54,153 | 102 | cs | 30,010 | 103 | chemistry | 27,061 | 104 | judaism | 26,085 | 105 | crypto | 19,404 | 106 | android | 38,077 | 107 | ja | 17,376 | 108 | christianity | 11,498 | 109 | graphicdesign | 28,083 | 110 | aviation | 18,755 | 111 | ethereum | 26,124 | 112 | biology | 19,277 | 113 | datascience | 20,503 | 114 | law | 16,133 | 115 | dsp | 17,430 | 116 | japanese | 20,948 | 117 | hermeneutics | 9,516 | 118 | bicycles | 15,708 | 119 | arduino | 16,281 | 120 | history | 10,766 | 121 | bitcoin | 22,474 | 122 | cooking | 22,641 | 123 | hinduism | 8,999 | 124 | codegolf | 8,211 | 125 | boardgames | 11,805 | 126 | emacs | 16,830 | 127 | economics | 8,844 | 128 | gardening | 13,246 | 129 | astronomy | 9,086 | 130 | islam | 10,052 | 131 | german | 13,733 | 132 | fitness | 8,297 | 133 | french | 10,578 | 134 | anime | 10,131 | 135 | craftcms | 11,236 | 136 | cstheory | 7,742 | 137 | engineering | 8,649 | 138 | buddhism | 6,787 | 139 | linguistics | 6,843 | 140 | ai | 5,763 | 141 | expressionengine | 10,742 | 142 | cogsci | 5,101 | 143 | chinese | 8,646 | 144 | chess | 6,392 | 145 | civicrm | 10,648 | 146 | literature | 3,539 | 147 | interpersonal | 3,398 | 148 | health | 4,494 | 149 | avp | 6,450 | 150 | earthscience | 4,396 | 151 | joomla | 5,887 | 152 | homebrew | 5,608 | 153 | expatriates | 4,913 | 154 | latin | 3,969 | 155 | matheducators | 2,706 | 156 | ham | 3,501 | 157 | genealogy | 2,895 | 158 | 3dprinting | 3,488 | 159 | elementaryos | 5,917 | 160 | bioinformatics | 3,135 | 161 | devops | 3,462 | 162 | hsm | 2,517 | 163 | italian | 3,101 | 164 | computergraphics | 2,306 | 165 | martialarts | 1,737 | 166 | bricks | 3,530 | 167 | freelancing | 1,663 | 168 | crafts | 1,659 | 169 | lifehacks | 2,576 | 170 | cseducators | 902 | 171 | materials | 1,101 | 172 | hardwarerecs | 2,050 | 173 | iot | 1,359 | 174 | eosio | 1,940 | 175 | languagelearning | 948 | 176 | korean | 1,406 | 177 | coffee | 1,188 | 178 | esperanto | 1,466 | 179 | beer | 1,012 | 180 | ebooks | 1,107 | 181 | iota | 775 | 182 | cardano | 248 | 183 | drones | 496 | 184 | conlang | 334 | 185 | pt | 103,277 | 186 | stats | 115,679 | 187 | unix | 155,414 | 188 | physics | 141,230 | 189 | tex | 171,628 | 190 | serverfault | 238,507 | 191 | salesforce | 87,272 | 192 | wordpress | 83,621 | 193 | softwareengineering | 51,326 | 194 | scifi | 54,805 | 195 | security | 51,355 | 196 | ru | 253,289 | 197 | superuser | 352,610 | 198 | sharepoint | 80,420 | 199 | rpg | 40,435 | 200 | travel | 36,533 | 201 | worldbuilding | 26,210 | 202 | meta | 1,000 | 203 | workplace | 24,012 | 204 | ux | 28,901 | 205 | money | 29,404 | 206 | webmasters | 30,370 | 207 | raspberrypi | 24,143 | 208 | photo | 23,204 | 209 | music | 19,936 | 210 | philosophy | 13,114 | 211 | puzzling | 17,448 | 212 | movies | 18,243 | 213 | quant | 12,933 | 214 | politics | 11,047 | 215 | space | 12,893 | 216 | mechanics | 18,613 | 217 | skeptics | 8,145 | 218 | rus | 16,528 | 219 | writers | 9,867 | 220 | webapps | 24,867 | 221 | softwarerecs | 11,761 | 222 | networkengineering | 12,590 | 223 | parenting | 5,998 | 224 | scicomp | 7,036 | 225 | sqa | 9,256 | 226 | sitecore | 7,838 | 227 | vi | 9,000 | 228 | spanish | 7,675 | 229 | pm | 5,435 | 230 | pets | 6,156 | 231 | sound | 8,303 | 232 | reverseengineering | 5,817 | 233 | outdoors | 5,278 | 234 | tridion | 5,907 | 235 | retrocomputing | 3,907 | 236 | robotics | 4,648 | 237 | quantumcomputing | 4,320 | 238 | sports | 4,707 | 239 | russian | 3,937 | 240 | opensource | 3,221 | 241 | woodworking | 2,955 | 242 | patents | 3,573 | 243 | tor | 4,167 | 244 | ukrainian | 1,767 | 245 | opendata | 3,842 | 246 | monero | 3,508 | 247 | sustainability | 1,674 | 248 | portuguese | 1,964 | 249 | mythology | 1,595 | 250 | musicfans | 2,431 | 251 | or | 1,490 | 252 | poker | 1,665 | 253 | windowsphone | 2,807 | 254 | moderators | 504 | 255 | stackapps | 1,518 | 256 | stellar | 1,078 | 257 | vegetarianism | 585 | 258 | tezos | 1,169 | 259 | total | 4,750,619 | 260 261 ## Dataset Creation 262 263 ### Curation Rationale 264 265 We primary designed this dataset for sentence embeddings training. Indeed sentence embeddings may be trained using a contrastive learning setup for which the model is trained to associate each sentence with its corresponding pair out of multiple proposition. Such models require many examples to be efficient and thus the dataset creation may be tedious. Community networks such as Stack Exchange allow us to build many examples semi-automatically. 266 267 ### Source Data 268 269 The source data are dumps from [Stack Exchange](https://archive.org/details/stackexchange) 270 271 #### Initial Data Collection and Normalization 272 273 We collected the data from the math community. 274 275 We filtered out questions which title or body length is bellow 20 characters and questions for which body length is above 4096 characters. 276 When extracting most upvoted answer, we filtered to pairs for which their is at least 100 votes gap between most upvoted and downvoted answers. 277 278 #### Who are the source language producers? 279 280 Questions and answers are written by the community developpers of Stack Exchange. 281 282 ## Additional Information 283 284 ### Licensing Information 285 286 Please see the license information at: https://archive.org/details/stackexchange 287 288 ### Citation Information 289 290  291 @misc{StackExchangeDataset, 292 author = {Flax Sentence Embeddings Team}, 293 title = {Stack Exchange question pairs}, 294 year = {2021}, 295 howpublished = {https://huggingface.co/datasets/flax-sentence-embeddings/}, 296 } 297  298 299 300 ### Contributions 301 302 Thanks to the Flax Sentence Embeddings team for adding this dataset.