Tweaks to persist good judgment superforecaster commentary at the suggestion of MichaelA

This commit is contained in:
NunoSempere 2021-04-11 21:40:21 +02:00
parent 965336bf9d
commit ff91af4183
2 changed files with 11 additions and 4 deletions

View File

@ -50,7 +50,8 @@ export async function goodjudgment() {
probability: Number(row['3'].split("%")[0]) / 100, probability: Number(row['3'].split("%")[0]) / 100,
type: "PROBABILITY" type: "PROBABILITY"
})) }))
let analysis = table.filter(row => row[0].includes("Examples of Superforecaster commentary"))[0][0]
// console.log(analysis)
let standardObj = ({ let standardObj = ({
"title": title, "title": title,
"url": endpoint, "url": endpoint,
@ -60,15 +61,20 @@ export async function goodjudgment() {
"timestamp": new Date().toISOString(), "timestamp": new Date().toISOString(),
"qualityindicators": { "qualityindicators": {
"stars": calculateStars("Good Judgment", ({})), "stars": calculateStars("Good Judgment", ({})),
},
"extra": {
"superforecastercommentary": analysis
} }
}) })
results.push(standardObj) results.push(standardObj)
} }
} }
// console.log(results.slice(0,10)) // console.log(results.slice(0,10))
// let string = JSON.stringify(results, null, 2) let string = JSON.stringify(results, null, 2)
// fs.writeFileSync('./data/goodjudgment-questions.json', string); // fs.writeFileSync('./data/goodjudgment-questions.json', string);
// fs.writeFileSync('./goodjudgment-questions-test.json', string);
// console.log(results)
await upsert(results, "goodjudgment-questions") await upsert(results, "goodjudgment-questions")
console.log("Done") console.log("Done")
} }
//goodjudgment() goodjudgment()

View File

@ -31,7 +31,8 @@ export async function addToHistory(){
"options": correspondingNewElement.options, "options": correspondingNewElement.options,
"qualityindicators": correspondingNewElement.qualityindicators "qualityindicators": correspondingNewElement.qualityindicators
}) })
let newHistoryElement = {...historyElement, "history": historyWithNewElement} let newHistoryElement = {...correspondingNewElement, "history": historyWithNewElement}
// If some element (like the description) changes, we keep the new one.
newHistoryJSON.push(newHistoryElement) newHistoryJSON.push(newHistoryElement)
}else{ }else{
newHistoryJSON.push(historyElement) newHistoryJSON.push(historyElement)