Add ROBERTA classifier ranking PoC, with 77pc off the bat

This commit is contained in:
William Jeynes
2026-03-13 11:24:51 +00:00
parent f09e36e740
commit 8311556855
8 changed files with 85 additions and 32 deletions
+22
View File
@@ -0,0 +1,22 @@
import axios from "axios";
export async function evaluateWithRoberta({
answer
}: {
answer: string;
}) {
const res = await axios.post("http://localhost:8000/evaluate", {
answer
});
// console.log(res.data)
const validProb = res.data["probabilities"][0][0]
const invalidProv = res.data["probabilities"][0][1]
return validProb > invalidProv ? 1 : 0;
}
// let res = await evaluateWithRoberta({answer: "High-profile political downplaying of COVID-19 (examples: President Trump saying 'it will go away' in MarchAugust 2020)"});
// console.log(res)
// res = await evaluateWithRoberta({answer: "Multiple mirrored reuploads (20202023) put the clip on other channels with titles implying it was a genuine 1970s public information film."});
// console.log(res)