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;
};
export type ScoreType = "bert" | "f" | "nearest";
export type ScoreType = "bert" | "f" | "nearest" | "total";
export type ScoreDescriptor = {
[key in ScoreType]: {

View File

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