Commit
·
dea178c
verified
·
0
Parent(s):
Duplicate from StampyAI/alignment-research-dataset
Browse filesCo-authored-by: Cheng2 <[email protected]>
- .gitattributes +62 -0
- README.md +172 -0
- agentmodels.jsonl +0 -0
- agisf.jsonl +3 -0
- aisafety.info.jsonl +0 -0
- alignment-research-dataset.py +235 -0
- alignmentforum.jsonl +3 -0
- arbital.jsonl +0 -0
- arxiv.jsonl +3 -0
- blogs.jsonl +3 -0
- distill.jsonl +0 -0
- eaforum.jsonl +3 -0
- lesswrong.jsonl +3 -0
- special_docs.jsonl +3 -0
- youtube.jsonl +3 -0
.gitattributes
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
27 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
# Audio files - uncompressed
|
37 |
+
*.pcm filter=lfs diff=lfs merge=lfs -text
|
38 |
+
*.sam filter=lfs diff=lfs merge=lfs -text
|
39 |
+
*.raw filter=lfs diff=lfs merge=lfs -text
|
40 |
+
# Audio files - compressed
|
41 |
+
*.aac filter=lfs diff=lfs merge=lfs -text
|
42 |
+
*.flac filter=lfs diff=lfs merge=lfs -text
|
43 |
+
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
44 |
+
*.ogg filter=lfs diff=lfs merge=lfs -text
|
45 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
46 |
+
# Image files - uncompressed
|
47 |
+
*.bmp filter=lfs diff=lfs merge=lfs -text
|
48 |
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
49 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
50 |
+
*.tiff filter=lfs diff=lfs merge=lfs -text
|
51 |
+
# Image files - compressed
|
52 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
53 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
54 |
+
*.webp filter=lfs diff=lfs merge=lfs -text
|
55 |
+
arxiv_papers.jsonl filter=lfs diff=lfs merge=lfs -text
|
56 |
+
eaforum.jsonl filter=lfs diff=lfs merge=lfs -text
|
57 |
+
lesswrong.jsonl filter=lfs diff=lfs merge=lfs -text
|
58 |
+
gdrive_ebooks.jsonl filter=lfs diff=lfs merge=lfs -text
|
59 |
+
alignmentforum.jsonl filter=lfs diff=lfs merge=lfs -text
|
60 |
+
arxiv.jsonl filter=lfs diff=lfs merge=lfs -text
|
61 |
+
pdfs.jsonl filter=lfs diff=lfs merge=lfs -text
|
62 |
+
special_docs.jsonl filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
license: mit
|
5 |
+
size_categories:
|
6 |
+
- 10K<n<100K
|
7 |
+
task_categories:
|
8 |
+
- question-answering
|
9 |
+
pretty_name: alignment-research-dataset
|
10 |
+
dataset_info:
|
11 |
+
features:
|
12 |
+
- name: id
|
13 |
+
dtype: string
|
14 |
+
- name: source
|
15 |
+
dtype: string
|
16 |
+
- name: title
|
17 |
+
dtype: string
|
18 |
+
- name: text
|
19 |
+
dtype: large_string
|
20 |
+
- name: url
|
21 |
+
dtype: string
|
22 |
+
- name: date_published
|
23 |
+
dtype: string
|
24 |
+
- name: authors
|
25 |
+
sequence: string
|
26 |
+
- name: summary
|
27 |
+
sequence: string
|
28 |
+
- name: source_type
|
29 |
+
dtype: string
|
30 |
+
- name: book_title
|
31 |
+
dtype: string
|
32 |
+
- name: karma
|
33 |
+
dtype: int32
|
34 |
+
- name: votes
|
35 |
+
dtype: int32
|
36 |
+
- name: words
|
37 |
+
dtype: int32
|
38 |
+
- name: comment_count
|
39 |
+
dtype: int32
|
40 |
+
- name: tags
|
41 |
+
sequence: string
|
42 |
+
- name: modified_at
|
43 |
+
dtype: string
|
44 |
+
- name: alias
|
45 |
+
dtype: string
|
46 |
+
- name: data_last_modified
|
47 |
+
dtype: string
|
48 |
+
- name: abstract
|
49 |
+
dtype: string
|
50 |
+
- name: author_comment
|
51 |
+
dtype: string
|
52 |
+
- name: journal_ref
|
53 |
+
dtype: string
|
54 |
+
- name: doi
|
55 |
+
dtype: string
|
56 |
+
- name: primary_category
|
57 |
+
dtype: string
|
58 |
+
- name: categories
|
59 |
+
sequence: string
|
60 |
+
- name: initial_source
|
61 |
+
dtype: string
|
62 |
+
- name: bibliography_bib
|
63 |
+
sequence:
|
64 |
+
- name: title
|
65 |
+
dtype: string
|
66 |
+
config_name: all
|
67 |
+
splits:
|
68 |
+
- name: train
|
69 |
+
num_bytes: 471644446
|
70 |
+
num_examples: 14271
|
71 |
+
download_size: 484827959
|
72 |
+
dataset_size: 471644446
|
73 |
+
---
|
74 |
+
# AI Alignment Research Dataset
|
75 |
+
|
76 |
+
The AI Alignment Research Dataset is a collection of documents related to AI Alignment and Safety from various books, research papers, and alignment related blog posts. This is a work in progress. Components are still undergoing a cleaning process to be updated more regularly.
|
77 |
+
|
78 |
+
## Sources
|
79 |
+
|
80 |
+
Here are the list of sources along with sample contents:
|
81 |
+
|
82 |
+
- [agentmodel](https://agentmodels.org/)
|
83 |
+
- [agisf](https://course.aisafetyfundamentals.com/) - recommended readings from AGI Safety Fundamentals
|
84 |
+
- [aisafety.info](https://aisafety.info/) - Stampy's FAQ
|
85 |
+
- [alignmentforum](https://www.alignmentforum.org)
|
86 |
+
- [alignment_newsletter](https://rohinshah.com/alignment-newsletter/)
|
87 |
+
- [arbital](https://arbital.com/)
|
88 |
+
- [arxiv](https://arxiv.org/) - relevant research papers
|
89 |
+
|
90 |
+
- blogs - entire websites automatically scraped
|
91 |
+
- [AI Impacts](https://aiimpacts.org/)
|
92 |
+
- [AI Safety Camp](https://aisafety.camp/)
|
93 |
+
- [carado.moe](https://carado.moe/)
|
94 |
+
- [Cold Takes](https://www.cold-takes.com/)
|
95 |
+
- [DeepMind technical blogs](https://www.deepmind.com/blog-categories/technical-blogs)
|
96 |
+
- [DeepMind AI Safety Research](https://deepmindsafetyresearch.medium.com/)
|
97 |
+
- [EleutherAI](https://blog.eleuther.ai/)
|
98 |
+
- [generative.ink](https://generative.ink/posts/)
|
99 |
+
- [Gwern Branwen's blog](https://gwern.net/)
|
100 |
+
- [Jack Clark's Import AI](https://importai.substack.com/)
|
101 |
+
- [MIRI](https://intelligence.org/)
|
102 |
+
- [Jacob Steinhardt's blog](https://jsteinhardt.wordpress.com/)
|
103 |
+
- [ML Safety Newsletter](https://newsletter.mlsafety.org/)
|
104 |
+
- [Transformer Circuits Thread](https://transformer-circuits.pub/)
|
105 |
+
- [Open AI Research](https://openai.com/research/)
|
106 |
+
- [Victoria Krakovna's blog](https://vkrakovna.wordpress.com/)
|
107 |
+
- [Eliezer Yudkowsky's blog](https://www.yudkowsky.net/)
|
108 |
+
|
109 |
+
- [distill](https://distill.pub/)
|
110 |
+
- [eaforum](https://forum.effectivealtruism.org/) - selected posts
|
111 |
+
- [lesswrong](https://www.lesswrong.com/) - selected posts
|
112 |
+
|
113 |
+
- special_docs - individual documents curated from various resources
|
114 |
+
- [Make a suggestion](https://bit.ly/ard-suggestion) for sources not already in the dataset
|
115 |
+
|
116 |
+
- youtube - playlists & channels
|
117 |
+
- [AI Alignment playlist](https://www.youtube.com/playlist?list=PLCRVRLd2RhZTpdUdEzJjo3qhmX3y3skWA) and other lists
|
118 |
+
- [AI Explained](https://www.youtube.com/@aiexplained-official)
|
119 |
+
- [Evan Hubinger's AI Safety Talks](https://www.youtube.com/@aisafetytalks)
|
120 |
+
- [AI Safety Reading Group](https://www.youtube.com/@aisafetyreadinggroup/videos)
|
121 |
+
- [AiTech - TU Delft](https://www.youtube.com/@AiTechTUDelft/)
|
122 |
+
- [Rob Miles AI](https://www.youtube.com/@RobertMilesAI)
|
123 |
+
|
124 |
+
## Keys
|
125 |
+
|
126 |
+
All entries contain the following keys:
|
127 |
+
|
128 |
+
- `id` - string of unique identifier
|
129 |
+
- `source` - string of data source listed above
|
130 |
+
- `title` - string of document title of document
|
131 |
+
- `authors` - list of strings
|
132 |
+
- `text` - full text of document content
|
133 |
+
- `url` - string of valid link to text content
|
134 |
+
- `date_published` - in UTC format
|
135 |
+
|
136 |
+
Additional keys may be available depending on the source document.
|
137 |
+
|
138 |
+
## Usage
|
139 |
+
|
140 |
+
Execute the following code to download and parse the files:
|
141 |
+
|
142 |
+
```python
|
143 |
+
from datasets import load_dataset
|
144 |
+
data = load_dataset('StampyAI/alignment-research-dataset')
|
145 |
+
```
|
146 |
+
|
147 |
+
To only get the data for a specific source, pass it in as the second argument, e.g.:
|
148 |
+
|
149 |
+
```python
|
150 |
+
from datasets import load_dataset
|
151 |
+
data = load_dataset('StampyAI/alignment-research-dataset', 'lesswrong')
|
152 |
+
```
|
153 |
+
|
154 |
+
## Limitations and Bias
|
155 |
+
|
156 |
+
LessWrong posts have overweighted content on doom and existential risk, so please beware in training or finetuning generative language models on the dataset.
|
157 |
+
|
158 |
+
## Contributing
|
159 |
+
|
160 |
+
The scraper to generate this dataset is open-sourced on [GitHub](https://github.com/StampyAI/alignment-research-dataset) and currently maintained by volunteers at StampyAI / AI Safety Info. [Learn more](https://coda.io/d/AI-Safety-Info_dfau7sl2hmG/Get-involved_susRF#_lufSr) or join us on [Discord](https://discord.gg/vjFSCDyMCy).
|
161 |
+
|
162 |
+
## Rebuilding info
|
163 |
+
|
164 |
+
This README contains info about the number of rows and their features which should be rebuilt each time datasets get changed. To do so, run:
|
165 |
+
|
166 |
+
datasets-cli test ./alignment-research-dataset --save_info --all_configs
|
167 |
+
|
168 |
+
## Citing the Dataset
|
169 |
+
|
170 |
+
For more information, here is the [paper](https://arxiv.org/abs/2206.02841) and [LessWrong](https://www.lesswrong.com/posts/FgjcHiWvADgsocE34/a-descriptive-not-prescriptive-overview-of-current-ai) post. Please use the following citation when using the dataset:
|
171 |
+
|
172 |
+
Kirchner, J. H., Smith, L., Thibodeau, J., McDonnell, K., and Reynolds, L. "Understanding AI alignment research: A Systematic Analysis." arXiv preprint arXiv:2022.4338861 (2022).
|
agentmodels.jsonl
ADDED
The diff for this file is too large to render.
See raw diff
|
|
agisf.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:87339fe27558475ed2419d0d92af20b5035a686821b82440c1cecefe2a21fdf3
|
3 |
+
size 3168051
|
aisafety.info.jsonl
ADDED
The diff for this file is too large to render.
See raw diff
|
|
alignment-research-dataset.py
ADDED
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
from pathlib import Path
|
3 |
+
|
4 |
+
import datasets
|
5 |
+
from datasets import Value, Sequence, Features
|
6 |
+
|
7 |
+
|
8 |
+
_CITATION = '''
|
9 |
+
@article{kirchner2022understanding,
|
10 |
+
title={Understanding AI Alignment Research: A Systematic Analysis},
|
11 |
+
author={Kirchner, Jan H and Smith, Logan and Thibodeau, Jacques and McDonnell, Kyle and Reynolds, Laria},
|
12 |
+
journal={arXiv preprint arXiv:2022.4338861},
|
13 |
+
year={2022}
|
14 |
+
}
|
15 |
+
'''
|
16 |
+
|
17 |
+
_DESCRIPTION = """The AI Alignment Research Dataset is a collection of documents related to AI Alignment and Safety from various books, research papers, and alignment related blog posts."""
|
18 |
+
|
19 |
+
_HOMEPAGE = "https://github.com/StampyAI/alignment-research-dataset"
|
20 |
+
|
21 |
+
_LICENSE = "MIT license"
|
22 |
+
|
23 |
+
_VERSION_ = '0.0.0'
|
24 |
+
|
25 |
+
|
26 |
+
def iterate_file(filename):
|
27 |
+
print(filename)
|
28 |
+
with open(filename) as f:
|
29 |
+
for l in f:
|
30 |
+
try:
|
31 |
+
yield json.loads(l)
|
32 |
+
except Exception as e:
|
33 |
+
print(f'Could not parse: {l}')
|
34 |
+
|
35 |
+
|
36 |
+
## Feature extractor helpers
|
37 |
+
def get_type(value):
|
38 |
+
"""Recursively get the huggingface type for the provided value."""
|
39 |
+
if value is None:
|
40 |
+
return None
|
41 |
+
if value and isinstance(value, (tuple, list)):
|
42 |
+
return features.Sequence(
|
43 |
+
get_type(value[0])
|
44 |
+
)
|
45 |
+
if value and isinstance(value, dict):
|
46 |
+
return {k: get_type(v) for k, v in value.items()}
|
47 |
+
if isinstance(value, str):
|
48 |
+
return Value('string')
|
49 |
+
if isinstance(value, int):
|
50 |
+
return Value('int32')
|
51 |
+
if isinstance(value, float):
|
52 |
+
return Value('double')
|
53 |
+
if isinstance(value, bool):
|
54 |
+
return Value('bool')
|
55 |
+
return None
|
56 |
+
|
57 |
+
|
58 |
+
def print_extra_features(files):
|
59 |
+
"""Go through all the provided files, and get the non default features for the given file.
|
60 |
+
|
61 |
+
This can be done manually but would be a hassle.
|
62 |
+
It's assumed that the files contain a json object on each line.
|
63 |
+
"""
|
64 |
+
ignored_keys = [
|
65 |
+
'comments', # Comments are arbitrarily nested objects, which doesn't play nice with huggingface
|
66 |
+
]
|
67 |
+
|
68 |
+
per_file = {}
|
69 |
+
for filename in sorted(files):
|
70 |
+
extra_types = {}
|
71 |
+
for item in iterate_file(filename):
|
72 |
+
for k, v in item.items():
|
73 |
+
if (k not in extra_types or not extra_types[k]) and k not in ignored_keys and k not in DEFAULT_FEATURES:
|
74 |
+
extra_types[k] = get_type(v)
|
75 |
+
per_file[filename] = extra_types
|
76 |
+
|
77 |
+
print('DATASOURCES = {')
|
78 |
+
for k, features in per_file.items():
|
79 |
+
vals = ',\n'.join(f" '{k}': {v}" for k, v in features.items())
|
80 |
+
print(f" '{k.stem}': #\n{vals}\n $,".replace('#', '{').replace('$', '}'))
|
81 |
+
print('}')
|
82 |
+
|
83 |
+
|
84 |
+
# These keys are present in all files
|
85 |
+
DEFAULT_FEATURES = {
|
86 |
+
'id': Value('string'),
|
87 |
+
'source': Value('string'),
|
88 |
+
'title': Value('string'),
|
89 |
+
'text': Value('large_string'),
|
90 |
+
'url': Value('string'),
|
91 |
+
'date_published': Value(dtype='string'),
|
92 |
+
'authors': Sequence(feature=Value(dtype='string'), length=-1),
|
93 |
+
'summary': Sequence(feature=Value(dtype='string'), length=-1),
|
94 |
+
'source_type': Value(dtype='string'),
|
95 |
+
}
|
96 |
+
|
97 |
+
|
98 |
+
# Per datasource additional features
|
99 |
+
DATASOURCES = {
|
100 |
+
'agentmodels': {
|
101 |
+
'book_title': Value(dtype='string'),
|
102 |
+
},
|
103 |
+
'agisf': {},
|
104 |
+
'aisafety.info': {},
|
105 |
+
'alignmentforum': {
|
106 |
+
'karma': Value(dtype='int32'),
|
107 |
+
'votes': Value(dtype='int32'),
|
108 |
+
'words': Value(dtype='int32'),
|
109 |
+
'comment_count': Value(dtype='int32'),
|
110 |
+
'tags': Sequence(feature=Value(dtype='string')),
|
111 |
+
'modified_at': Value(dtype='string'),
|
112 |
+
},
|
113 |
+
'arbital': {
|
114 |
+
'alias': Value(dtype='string'),
|
115 |
+
'tags': Sequence(feature=Value(dtype='string')),
|
116 |
+
},
|
117 |
+
'arxiv': {
|
118 |
+
'data_last_modified': Value(dtype='string'),
|
119 |
+
'abstract': Value(dtype='string'),
|
120 |
+
'author_comment': Value(dtype='string'),
|
121 |
+
'journal_ref': Value(dtype='string'),
|
122 |
+
'doi': Value(dtype='string'),
|
123 |
+
'primary_category': Value(dtype='string'),
|
124 |
+
'categories': Sequence(feature=Value(dtype='string'), length=-1),
|
125 |
+
},
|
126 |
+
'blogs': {
|
127 |
+
'initial_source': Value(dtype='string'),
|
128 |
+
},
|
129 |
+
'distill': {
|
130 |
+
'abstract': Value(dtype='string'),
|
131 |
+
'journal_ref': Value(dtype='string'),
|
132 |
+
'doi': Value(dtype='string'),
|
133 |
+
'bibliography_bib': Sequence(feature={'title': Value(dtype='string')}, length=-1),
|
134 |
+
},
|
135 |
+
'eaforum': {
|
136 |
+
'karma': Value(dtype='int32'),
|
137 |
+
'votes': Value(dtype='int32'),
|
138 |
+
'words': Value(dtype='int32'),
|
139 |
+
'comment_count': Value(dtype='int32'),
|
140 |
+
'tags': Sequence(feature=Value(dtype='string')),
|
141 |
+
'modified_at': Value(dtype='string'),
|
142 |
+
},
|
143 |
+
'lesswrong': {
|
144 |
+
'karma': Value(dtype='int32'),
|
145 |
+
'votes': Value(dtype='int32'),
|
146 |
+
'words': Value(dtype='int32'),
|
147 |
+
'comment_count': Value(dtype='int32'),
|
148 |
+
'tags': Sequence(feature=Value(dtype='string')),
|
149 |
+
'modified_at': Value(dtype='string'),
|
150 |
+
},
|
151 |
+
'special_docs': {},
|
152 |
+
'youtube': {},
|
153 |
+
}
|
154 |
+
|
155 |
+
|
156 |
+
def join_features(features, to_join):
|
157 |
+
"""Recursively join the provided dicts.
|
158 |
+
|
159 |
+
`to_join` can either be a dict to be merged, or a list of dicts to merge.
|
160 |
+
"""
|
161 |
+
if not to_join:
|
162 |
+
return Features(features)
|
163 |
+
if isinstance(to_join, dict):
|
164 |
+
return Features(dict(features, **to_join))
|
165 |
+
return join_features(dict(features, **to_join[0]), to_join[1:])
|
166 |
+
|
167 |
+
|
168 |
+
class AlignmentResearchDatasetConfig(datasets.BuilderConfig):
|
169 |
+
"""BuilderConfig for AlignmentResaerchDataset."""
|
170 |
+
|
171 |
+
def __init__(self, sources, features, **kwargs):
|
172 |
+
"""BuilderConfig for AlignmentResaerchDataset.
|
173 |
+
|
174 |
+
:param List[string] sources: the sources which will be used by this config
|
175 |
+
"""
|
176 |
+
super().__init__(version=datasets.Version(_VERSION_), **kwargs)
|
177 |
+
self.sources = sources
|
178 |
+
self.features = join_features(DEFAULT_FEATURES, features)
|
179 |
+
|
180 |
+
@property
|
181 |
+
def files(self):
|
182 |
+
return [f'{source}.jsonl' for source in self.sources]
|
183 |
+
|
184 |
+
|
185 |
+
class AlignmentResaerchDataset(datasets.GeneratorBasedBuilder):
|
186 |
+
VERSION = datasets.Version(_VERSION_)
|
187 |
+
|
188 |
+
BUILDER_CONFIGS = [
|
189 |
+
AlignmentResearchDatasetConfig(
|
190 |
+
name='all',
|
191 |
+
description='All data files',
|
192 |
+
sources=list(DATASOURCES.keys()),
|
193 |
+
features=list(DATASOURCES.values())
|
194 |
+
)
|
195 |
+
] + [
|
196 |
+
AlignmentResearchDatasetConfig(name=source, sources=[source], features=features) for source, features in DATASOURCES.items()
|
197 |
+
]
|
198 |
+
DEFAULT_CONFIG_NAME = 'all'
|
199 |
+
|
200 |
+
def _info(self):
|
201 |
+
return datasets.DatasetInfo(
|
202 |
+
description=_DESCRIPTION,
|
203 |
+
features=self.config.features,
|
204 |
+
homepage=_HOMEPAGE,
|
205 |
+
license=_LICENSE,
|
206 |
+
citation=_CITATION,
|
207 |
+
)
|
208 |
+
|
209 |
+
def _split_generators(self, dl_manager):
|
210 |
+
downloaded_files = dl_manager.download_and_extract(self.config.files)
|
211 |
+
return [
|
212 |
+
datasets.SplitGenerator(
|
213 |
+
name=datasets.Split.TRAIN,
|
214 |
+
gen_kwargs={'files': downloaded_files}
|
215 |
+
)
|
216 |
+
]
|
217 |
+
|
218 |
+
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
219 |
+
def _generate_examples(self, files):
|
220 |
+
seen = set()
|
221 |
+
|
222 |
+
def is_good(item):
|
223 |
+
item_id = item and item.get('id')
|
224 |
+
if not item_id or item_id in seen:
|
225 |
+
return False
|
226 |
+
seen.add(item_id)
|
227 |
+
|
228 |
+
return item['text'] not in [None, '', 'n/a']
|
229 |
+
|
230 |
+
def prepare_example(item):
|
231 |
+
return item['id'], {k: item.get(k) for k in self.config.features}
|
232 |
+
|
233 |
+
lines = (item for filename in files for item in iterate_file(filename))
|
234 |
+
for item in map(prepare_example, filter(is_good, lines)):
|
235 |
+
yield item
|
alignmentforum.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1b7d6eb972aee832e9d5d56c13a818db25f2f2c13be16a4880958a0b8584c70c
|
3 |
+
size 80169358
|
arbital.jsonl
ADDED
The diff for this file is too large to render.
See raw diff
|
|
arxiv.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:15cbbddf46723aa2886b11dd8e4ef3f9a96fad742d47d93c08af97481bd664e6
|
3 |
+
size 117494042
|
blogs.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bf2061b2ef1e6a519707239ae3b6219877a8771188344aef0c417f7529f057a8
|
3 |
+
size 56011127
|
distill.jsonl
ADDED
The diff for this file is too large to render.
See raw diff
|
|
eaforum.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9c80947179b073d4e14da454efecb30483bb382cfdb1a6ba7b2c62b2680ba24e
|
3 |
+
size 28671720
|
lesswrong.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:338dc89597c0d388d658ae53c36ac15f10b07aa277b70152d0eff80ca437301b
|
3 |
+
size 56357590
|
special_docs.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:93719fcdbc317f483a8babd7f66b7d042328c923a9edce0fd96fbf40d2d03886
|
3 |
+
size 69814188
|
youtube.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f104aad83cc849075c9e4cb43c042da30dfb1109feb051eeaf551562a57935f9
|
3 |
+
size 21125409
|