Files
LLMsForDisinformationAnalysis/agent/tools/robertaCall.ts
T

22 lines
826 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import axios from "axios";
export async function evaluateWithRoberta({
answer
}: {
answer: string;
}): Promise<{ validProb: number; invalidProb: number; }> {
const res = await axios.post("http://localhost:8000/evaluate", {
answer
});
// console.log(res.data)
const validProb = res.data["probabilities"][0][0]
const invalidProb = res.data["probabilities"][0][1]
return {validProb, invalidProb};
}
// 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)