Spaces:
Running on Zero

khmersense / frontend /src /types.ts
vechey's picture
Deploy KhmerSense
3a260a9 verified
Raw History Blame Contribute Delete
1.19 kB
export type Label = "negative" | "neutral" | "positive";
export type Lang = "km" | "en" | "mixed" | "other";
export interface Item {
id: number;
text: string;
language: Lang;
label: Label;
confidence: number;
scores: Record<Label, number>;
likes: number | null;
published_at: string | null;
}
export interface Report {
total: number;
counts: Record<Label, number>;
percent: Record<Label, number>;
net_score: number;
languages: Record<Lang, number>;
trend: ({ date: string } & Record<Label, number>)[];
needs_attention: Item[];
top_positive: Item[];
items: Item[];
}
export interface Video {
id: string;
title: string;
channel: string;
published_at: string | null;
thumbnail: string | null;
comment_count: number | null;
url: string;
}
export type Source =
| { type: "youtube"; video: Video }
| { type: "text" }
| { type: "file"; filename: string; column: string };
export interface Result { source: Source; report: Report }
export interface Health {
model: string;
model_loaded: boolean;
youtube_enabled: boolean;
facebook_enabled: boolean;
max_comments: number;
}