Replace toxicity model with multi-label classifier
This commit is contained in:
parent
803df7feee
commit
1568c787f8
24 changed files with 2581129 additions and 119717 deletions
|
|
@ -23,7 +23,7 @@ class FakeWorker implements InferenceWorker {
|
|||
terminate(): void { this.terminated = true; }
|
||||
|
||||
reply(): void {
|
||||
const event = new MessageEvent("message", { data: { results: [{ requestId: request.requestId, id: request.id, textHash: "hash", label: "not_toxic", probability: .1, navigationId: request.navigationId }] } });
|
||||
const event = new MessageEvent("message", { data: { results: [{ requestId: request.requestId, id: request.id, textHash: "hash", scores: { toxicity: .1, severe_toxicity: 0, obscene: 0, threat: 0, insult: 0, identity_attack: 0, sexual_explicit: 0 }, navigationId: request.navigationId }] } });
|
||||
this.listeners.get("message")?.forEach((listener) => listener(event));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue