feat: add total metric

This commit is contained in:
Pavel Torbeev 2023-09-10 07:08:35 +03:00
parent 3151ed72d3
commit 52c93b18b5
7 changed files with 28 additions and 2 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

@ -23,6 +23,7 @@ export type FormFields = {
files: File[];
};
// 595491f8-a53e-4af0-91ca-4004a944e645
// 3207
export const PROCESS_POLLING_MS = 2000;

View File

@ -62,6 +62,10 @@
td {
@include transition(border-color, color);
&.ResponsePage__result {
font-weight: $font-weight-medium;
}
&.ResponsePage__tableSummary {
//@include transition(opacity);
//opacity: 0;

View File

@ -69,7 +69,7 @@ export const ResponsePage: FC = () => {
<th>Нейросетевой метод</th>
<th>Статистический метод</th>
<th>Метод схожести</th>
{/*<th>Рез.</th>*/}
<th>Итоговая оценка</th>
<th>Крат. сод.</th>
</tr>
</thead>
@ -112,6 +112,7 @@ export const ResponsePage: FC = () => {
</>
)}
</td>
<td className={s.ResponsePage__result}>{text.score.total as unknown as string}</td>
<td className={s.ResponsePage__tableSummary}>
<Link
component={'button'}

View File

@ -67,6 +67,12 @@ export const TextItem: ReactFCC<TextItemProps> = (props) => {
</Text>
</div>
<div className={s.TextItem__row}>
<Text component={'span'} variant={ETextVariants.PROGRAMMING_CODE_REGULAR}>
Итоговая оценка: {text.score.total as unknown as string}
</Text>
</div>
<div className={clsx(s.TextItem__row, s.TextItem__row_link)}>
<Text component={'span'} variant={ETextVariants.BODY_S_REGULAR}>
<Link

View File

@ -25,6 +25,12 @@
line-height: $line-height-20;
}
.TextPage__prop_total {
font-size: $font-size-16;
line-height: $line-height-24;
font-weight: $font-weight-600;
}
.TextPage__tooltip {
display: inline-block;
}

View File

@ -1,5 +1,6 @@
import { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useForm } from 'react-hook-form';
import clsx from 'clsx';
import { Heading, HeadingSize } from '../../components/Heading';
import { useUrlParam } from '../../hooks/useUrlParam';
import { TEXT_PAGE_PARAM } from '../../app/routes';
@ -211,6 +212,13 @@ export const TextPage: FC = () => {
</>
)}
</Text>
<Text
component={'div'}
className={clsx(s.TextPage__prop, s.TextPage__prop_total)}
variant={ETextVariants.PROGRAMMING_CODE_MEDIUM}>
Итоговая оценка: {textEntity.score.total as unknown as string}
</Text>
</div>
<div className={s.TextPage__summary}>