mirror of
https://github.com/magnum-opus-nn-cp/word-plugin.git
synced 2024-11-24 17:33:42 +03:00
feat: add total metric
This commit is contained in:
parent
d9d3bec53b
commit
a4cb23807c
|
@ -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]: {
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user