Skip to content

Commit cbc91fb

Browse files
committed
DocumentView: some css tweaks and update API call
1 parent cb6324d commit cbc91fb

6 files changed

Lines changed: 33 additions & 42 deletions

File tree

client/src/api/evaluation.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ export const distributionPath = (corpus: UUID): string => `${evaluationPath(corp
2222
export const metricsPath = (corpus: UUID): string => `${evaluationPath(corpus)}/metrics`
2323
const metricsSamplesPath = (corpus: UUID): string => `${metricsPath(corpus)}/download`
2424
const downloadPath = (corpus: UUID): string => `${evaluationPath(corpus)}/download`
25-
const documentLayerComparisonPath = (corpus: UUID, job: string, document: string): string =>
26-
`/corpora/${corpus}/jobs/${job}/documents/${document}/evaluation`
25+
const documentLayerComparisonPath = (corpus: UUID, document: string): string => `/corpora/${corpus}/documents/${document}/evaluation/comparison`
2726
const documentEntitiesPath = (corpus: UUID, job: string, document: string): string =>
2827
`/corpora/${corpus}/jobs/${job}/documents/${document}/entities`
2928
const jobEntitiesPath = (corpus: UUID, job: string): string => `${evaluationPath(corpus, job)}/entities`
@@ -81,10 +80,10 @@ export function getConfusionSamples(
8180
reference: string,
8281
hypoFilter: string,
8382
refFilter: string,
84-
annotationType: string,
83+
annotation: string,
8584
): Promise<BlobResponse> {
86-
return getBlob(confusionSamplesPath(corpus, hypothesis), {
87-
params: { reference, hypoFilter, refFilter, annotationType },
85+
return getBlob(confusionSamplesPath(corpus), {
86+
params: { hypothesis, reference, hypoFilter, refFilter, annotation },
8887
})
8988
}
9089

@@ -126,7 +125,7 @@ export function getDocumentLayerComparison(
126125
document: string,
127126
reference: string,
128127
): Promise<AxiosResponse<TermComparison[]>> {
129-
return axios.get(documentLayerComparisonPath(corpus, job, document), { params: { reference } })
128+
return axios.get(documentLayerComparisonPath(corpus, document), { params: { reference, hypothesis: job } })
130129
}
131130

132131
export function getDocumentEntities(corpus: UUID, job: string, document: string): Promise<DocumentEntitiesResponse> {

client/src/components/input/AnnotationSelect.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<template>
2-
<label for="annotation-select">Annotation</label>
3-
<GSelect id="annotation-select" :options v-model="model" />
2+
<fieldset>
3+
<label for="annotation-select">Annotation</label>
4+
<GSelect id="annotation-select" :options v-model="model" />
5+
</fieldset>
46
</template>
57

68
<script setup lang="ts">

client/src/components/tables/SingleTermComparisonTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const columns: Ref<Column[]> = computed(() => {
4343
return acc
4444
}, [] as string[])
4545
.filter((i) => !ignorableAnnotations.includes(i))
46-
.map((key) => ({ key, label: key }))
46+
.map((key) => ({ key, label: key, noSort: true }))
4747
})
4848
4949
// Methods

client/src/router/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ const routes = [
6262
},
6363
{ meta: { title: "Evaluate" }, path: "grouped_metrics", component: GroupedMetricsView },
6464
{ meta: { title: "Evaluate" }, path: "confusion", component: ConfusionView },
65-
{
66-
meta: { title: "Evaluate" },
67-
path: "document_layer_comparison",
68-
component: DocumentLayerComparisonView,
69-
},
65+
{ meta: { title: "Evaluate" }, path: "document", component: DocumentLayerComparisonView },
7066
{ meta: { title: "Evaluate" }, path: "entities", component: EntitiesView },
7167
],
7268
},

client/src/views/annotate/subviews/evaluate/EvaluateView.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
{ id: 'grouped_metrics', title: 'Grouped Metrics' },
2424
{ id: 'confusion', title: 'Confusion' },
2525
{ id: 'entities', title: 'Entities' },
26+
{ id: 'document', title: 'Document' },
2627
]"
2728
>
2829
</GTabs>

client/src/views/annotate/subviews/evaluate/subviews/DocumentLayerComparisonView.vue

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@
3636
</template>
3737

3838
<script setup lang="ts">
39-
// Library & API
40-
4139
import * as API from "@/api/evaluation"
4240
import stores from "@/stores"
43-
// Types & Stores
4441
import type { Term, TermComparison } from "@/types/evaluation"
4542
import type { SelectOption } from "@/types/ui/select"
4643
@@ -85,9 +82,9 @@ watch(selectedDoc, async (newVal) => {
8582
8683
watch(termcomps, () => {
8784
if (!termcomps.value) return
88-
annotationOptions.value = documentsStore.documents
89-
.find((doc) => doc.name === selectedDoc.value)
90-
?.annotations.map((key) => ({ value: key, text: key }))
85+
annotationOptions.value = Object.keys(
86+
documentsStore.documents.find((doc) => doc.name === selectedDoc.value)?.annotations,
87+
).map((key) => ({ value: key, text: key }))
9188
})
9289
9390
// Methods
@@ -107,11 +104,6 @@ function cleanAnnotation(term: Term) {
107104
padding: 2rem;
108105
}
109106
110-
.tooltip {
111-
min-width: fit-content;
112-
min-height: fit-content;
113-
}
114-
115107
.wordComparison {
116108
display: inline-block;
117109
position: relative;
@@ -120,25 +112,26 @@ function cleanAnnotation(term: Term) {
120112
text-align: center;
121113
font-size: 0.8rem;
122114
line-height: 0.8rem;
123-
}
124-
125-
.incorrect {
126-
background-color: rgba(255, 0, 0, 0.1);
127-
}
115+
&.incorrect {
116+
background-color: rgba(255, 0, 0, 0.1);
117+
}
128118
129-
.wordComparison .tooltip {
130-
visibility: hidden;
131-
position: absolute;
132-
z-index: 1;
133-
width: max-content;
134-
bottom: 100%;
135-
text-align: left;
136-
padding: 0;
137-
margin: 0;
138-
}
119+
.tooltip {
120+
min-width: fit-content;
121+
min-height: fit-content;
122+
visibility: hidden;
123+
position: absolute;
124+
z-index: 1;
125+
width: max-content;
126+
bottom: 100%;
127+
text-align: left;
128+
padding: 0;
129+
margin: 0;
130+
}
139131
140-
.wordComparison:hover .tooltip {
141-
visibility: visible;
132+
&:hover .tooltip {
133+
visibility: visible;
134+
}
142135
}
143136
144137
.table-controls {

0 commit comments

Comments
 (0)