feat: add total metric

This commit is contained in:
Pavel Torbeev 2023-09-10 07:21:01 +03:00
parent d9d3bec53b
commit a4cb23807c
2 changed files with 2 additions and 4 deletions

View File

@ -5,7 +5,7 @@ export type DetailDescriptor = {
features: DetailFeatures; features: DetailFeatures;
}; };
export type ScoreType = "bert" | "f" | "nearest"; export type ScoreType = "bert" | "f" | "nearest" | "total";
export type ScoreDescriptor = { export type ScoreDescriptor = {
[key in ScoreType]: { [key in ScoreType]: {

View File

@ -113,8 +113,7 @@ export const App: FC<PropsWithChildren<AppProps>> = () => {
}, },
}); });
const answer = textEntity?.score?.[typeKey]?.answer; const answer = textEntity?.score?.["total"] as unknown as string;
const metric = textEntity?.score?.[typeKey]?.metric;
const summary = textEntity?.summary; const summary = textEntity?.summary;
const initRef = useRef(false); const initRef = useRef(false);
@ -177,7 +176,6 @@ export const App: FC<PropsWithChildren<AppProps>> = () => {
<h3>Результат оценки</h3> <h3>Результат оценки</h3>
<p> <p>
Оценочный рейтинг: {answer} <br /> Оценочный рейтинг: {answer} <br />
{metric && `Точность: ${metric.toFixed(2)}`}
</p> </p>
<h4>Краткое содержание</h4> <h4>Краткое содержание</h4>
<p>{summary}</p> <p>{summary}</p>