-
Notifications
You must be signed in to change notification settings - Fork 3
/
loaders.js
56 lines (52 loc) · 4.86 KB
/
loaders.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const assert = require('assert')
const CsvLoader = require('../src/loaders/common/csv')
const csv = `"time","text"
"1679952774000","us foreign policy now dropping below bronze tier"
"1679953932000","not so much in the banking sector rn"
"1679954577000","no, descriptions should be accurate. if only a small segment of the right or left is pushing something, then it wouldn't be correct to paint all of the left or right with that viewpoint."
"1679965382000","cybertruck will change the look of the roads. finally feels like the future."
"1679975697000","starting april 15th, only verified accounts will be eligible to be in for you recommendations. the is the only realistic way to address advanced ai bot swarms taking over. it is otherwise a hopeless losing battle. voting in polls will require verification for same reason."
"1679975843000","not having a massive short position against tesla would be a step in the right direction!"
"1679982902000","that said, it's ok to have verified bot accounts if they follow terms of service don't impersonate a human"
"1679991113000","of course, you need to have good customer service for money. working on it "
"1680005696000","i hear you, but we're not getting to mars if civilization falls apart before then!"
"1680011183000","great interview with cbc geoff! we live for only ~3b seconds, which is just a tiny flash in the pan by cosmological standards."
"1680042588000","i eat a donut every morning. still alive."
"1680046703000","forgot to mention that accounts you follow directly will also be in for you, since you have explicitly asked for them"
"1680088558000","i thought both spacex and tesla each had less then a 10% chance of success"
"1680088899000","tesla car temp is automatically kept within a safe range, even when the car appears 'off', in order to protect infants comfort if the camera detects occupants. we will make that change."
"1680125791000","leading agi developers will not heed this warning, but at least it was said"
"1680127354000","given that there are ~500 million tweets per day, making individual human review impossible, this is the most salient point. one possible mitigation is a shorter suspension of 6 hours instead of 12."
"1680131137000","ai optimizing for the greatest understanding of the universe might be the right objective. eliminating or stunting human civilization would reduce understanding."
"1680144708000","serious issue. us policy has been too heavy-handed, making countries want to ditch the dollar."
"1680144789000","combined with excess government spending, which forces other countries to absorb a significant part of our inflation"
"1680172664000","old joke about agnostic technologists building artificial super intelligence to find out if there's a god. they finally finish ask the question. ai replies: 'there is now, mfs!!'"
"1680244594000","important to establish whether someone actually belongs to an organization or not so as to avoid impersonation"
"1680301770000","it will matter if we extend consciousness to the stars"
"1680302779000","most of the recommendation algorithm will be made open source today. the rest will follow. acid test is that independent third parties should be able to determine, with reasonable accuracy, what will probably be shown to users. no doubt, many embarrassing issues will be"
"1680302887000","the ai carousel spins ever faster"
"1680310333000","twitter will be updating its recommendation algorithm based on user suggestions every 24 to 48 hours"
"1680343838000","avoiding dystopian outcomes is not easy. the intent is not for the algorithm to be some judgy moral arbiter, but rather that it do its best to inform entertain. trying to maximize unregretted user-minutes seems like the right objective."
"1680352959000","this is most of the recommendation code. in the coming weeks, we will open source literally everything that contributes to showing a tweet, such that the output can be at least roughly approximated."
"1680390100000","also, that doc looks pretty old for someone who's only age 25"
"1680390369000","somehow, i'm still alive, despite having ice cream since i was a child. it's a miracle!"
"1680396505000","they know they cannot defend what their algorithm actually does, so they will keep it closed"
`
async function testLoader () {
const loader = new CsvLoader(csv)
const field = await loader.getField()
assert.equal(await loader.save(field), `.,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,0,4,7,0,6,0,31,23,16,13,0,0,0,0,0,0,0,13,55,22,12,4,15,24,
2,0,4,2,0,1,0,4,3,5,0,0,0,0,0,0,0,0,3,13,9,4,3,6,3,
3,0,3,1,0,0,0,1,2,0,0,0,0,0,0,0,0,0,1,3,3,2,0,0,2,
4,0,1,0,0,0,0,3,0,1,0,0,0,0,0,0,0,0,0,3,3,3,0,0,2,
5,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,1,
7,0,0,1,0,0,0,2,0,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,
14,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,5,1,2,1,0,2,
`)
}
async function test () {
await testLoader()
}
test()