added cleaned dataset
Browse files- README.md +49 -2
- so_bigquery.ipynb +0 -0
- stackoverflow/train_clean.csv +3 -0
README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1 |
---
|
2 |
configs:
|
3 |
- config_name: default
|
|
|
|
|
|
|
|
|
4 |
data_files:
|
5 |
- split: train
|
6 |
path: "stackoverflow/train.csv"
|
@@ -10,8 +14,6 @@ configs:
|
|
10 |
|
11 |
Working doc: https://docs.google.com/document/d/1h585bH5sYcQW4pkHzqWyQqA4ape2Bq6o1Cya0TkMOQc/edit?usp=sharing
|
12 |
|
13 |
-
The code to create this dataset is [here](https://github.com/ag2435/arXiv-agent/datasets/stackexchange).
|
14 |
-
|
15 |
<!-- 1. We run the following query on StackExchange Data Explorer (note that this can be done programmatically using BigQuery for the StackOverflow site, but not the other sites)
|
16 |
```
|
17 |
SELECT *
|
@@ -41,6 +43,51 @@ FROM answers a
|
|
41 |
JOIN questions q ON q.Id = a.ParentId
|
42 |
``` -->
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
## File structure
|
45 |
|
46 |
Each folder represents the different StackExchange [sites](https://stackexchange.com/sites#oldest) (~182). The largest one is StackOverflow.
|
|
|
1 |
---
|
2 |
configs:
|
3 |
- config_name: default
|
4 |
+
data_files:
|
5 |
+
- split: train
|
6 |
+
path: "stackoverflow/train_clean.csv"
|
7 |
+
- config_name: raw
|
8 |
data_files:
|
9 |
- split: train
|
10 |
path: "stackoverflow/train.csv"
|
|
|
14 |
|
15 |
Working doc: https://docs.google.com/document/d/1h585bH5sYcQW4pkHzqWyQqA4ape2Bq6o1Cya0TkMOQc/edit?usp=sharing
|
16 |
|
|
|
|
|
17 |
<!-- 1. We run the following query on StackExchange Data Explorer (note that this can be done programmatically using BigQuery for the StackOverflow site, but not the other sites)
|
18 |
```
|
19 |
SELECT *
|
|
|
43 |
JOIN questions q ON q.Id = a.ParentId
|
44 |
``` -->
|
45 |
|
46 |
+
BigQuery query (see [so_bigquery.ipynb](so_bigquery.ipynb)):
|
47 |
+
```
|
48 |
+
CREATE TEMP TABLE answers AS
|
49 |
+
SELECT *
|
50 |
+
FROM bigquery-public-data.stackoverflow.posts_answers
|
51 |
+
WHERE LOWER(Body) LIKE '%arxiv%';
|
52 |
+
|
53 |
+
CREATE TEMPORARY TABLE questions AS
|
54 |
+
SELECT *
|
55 |
+
FROM bigquery-public-data.stackoverflow.posts_questions;
|
56 |
+
|
57 |
+
SELECT *
|
58 |
+
FROM answers
|
59 |
+
JOIN questions ON questions.id = answers.parent_id;
|
60 |
+
```
|
61 |
+
|
62 |
+
NOTE: BigQuery only has the StackOverflow site data, not the other sites.
|
63 |
+
So if we want to query the other sites, we would probably want to download the data dump to a cluster and run a SQL server.
|
64 |
+
|
65 |
+
Columns in the raw query output:
|
66 |
+
```
|
67 |
+
'id',
|
68 |
+
'title',
|
69 |
+
'body',
|
70 |
+
'accepted_answer_id',
|
71 |
+
'answer_count',
|
72 |
+
'comment_count',
|
73 |
+
'community_owned_date', # present only if post is community wiki'd
|
74 |
+
'creation_date',
|
75 |
+
'favorite_count',
|
76 |
+
'last_activity_date',
|
77 |
+
'last_edit_date',
|
78 |
+
'last_editor_display_name',
|
79 |
+
'last_editor_user_id',
|
80 |
+
'owner_display_name',
|
81 |
+
'owner_user_id',
|
82 |
+
'parent_id', # if post is answer, then this is the question id; if post is question, this is None
|
83 |
+
'post_type_id', # 1 = QUESTION, 2 = ANSWER
|
84 |
+
'score',
|
85 |
+
'tags',
|
86 |
+
'view_count',
|
87 |
+
```
|
88 |
+
|
89 |
+
(Official database schema)[https://meta.stackexchange.com/questions/2677/database-schema-documentation-for-the-public-data-dump-and-sede/2678#2678]
|
90 |
+
|
91 |
## File structure
|
92 |
|
93 |
Each folder represents the different StackExchange [sites](https://stackexchange.com/sites#oldest) (~182). The largest one is StackOverflow.
|
so_bigquery.ipynb
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
stackoverflow/train_clean.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:27ca6e8f7c0336abd15ea01858ac44571b0136342eadfbe23678d7b084ab280a
|
3 |
+
size 12386618
|