-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathAnnotationConfidenceTable.tsx
54 lines (50 loc) · 1.56 KB
/
AnnotationConfidenceTable.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { AccordionMetadataTable } from 'app/components/AccordionMetadataTable'
import { useI18n } from 'app/hooks/useI18n'
import { useSelectedAnnotationShape } from 'app/state/annotation'
export function AnnotationConfidenceTable() {
const { selectedAnnotationShape } = useSelectedAnnotationShape()
const { t } = useI18n()
if (!selectedAnnotationShape) {
return null
}
const isGroundTruth = selectedAnnotationShape.annotation?.groundTruthStatus
return (
<AccordionMetadataTable
id="annotation-confidence"
header={t('annotationConfidence')}
data={[
{
label: t('groundTruthStatus'),
values: [isGroundTruth ? t('true') : t('false')],
},
{
label: t('groundTruthUsed'),
values: [
isGroundTruth
? t('notApplicable')
: (selectedAnnotationShape.annotation?.groundTruthUsed ?? '--'),
],
className: 'text-sds-color-primitive-gray-500',
},
{
label: t('precision'),
values: [
isGroundTruth
? t('notApplicable')
: (selectedAnnotationShape.annotation?.confidenceRecall ?? '--'),
],
className: 'text-sds-color-primitive-gray-500',
},
{
label: t('recall'),
values: [
isGroundTruth
? t('notApplicable')
: (selectedAnnotationShape.annotation?.confidenceRecall ?? '--'),
],
className: 'text-sds-color-primitive-gray-500',
},
]}
/>
)
}