feat: added confidence data export and visualization

This commit is contained in:
averel10
2026-04-17 13:24:21 +02:00
parent 4c168af9d1
commit a1116e4333
2 changed files with 8 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ export interface ParticipantDetail extends ParticipantListItem {
rating: number; rating: number;
dialectLabel: string; dialectLabel: string;
createdAt: Date; createdAt: Date;
confidence: number;
}>; }>;
} }
@@ -172,6 +173,7 @@ export async function getParticipantDetail(
rating: annotation.rating, rating: annotation.rating,
dialectLabel: annotation.dialectLabel, dialectLabel: annotation.dialectLabel,
createdAt: annotation.createdAt, createdAt: annotation.createdAt,
confidence: annotation.confidence,
}) })
.from(annotation) .from(annotation)
.leftJoin(dataset_entry, eq(annotation.datasetEntryId, dataset_entry.id)) .leftJoin(dataset_entry, eq(annotation.datasetEntryId, dataset_entry.id))
@@ -201,6 +203,7 @@ export async function getParticipantDetail(
externalId: a.externalId || 'Unknown', fileName: a.fileName || 'Unknown', externalId: a.externalId || 'Unknown', fileName: a.fileName || 'Unknown',
datasetId: a.datasetId || 0, rating: a.rating, datasetId: a.datasetId || 0, rating: a.rating,
dialectLabel: a.dialectLabel, dialectLabel: a.dialectLabel,
confidence: a.confidence,
createdAt: a.createdAt, createdAt: a.createdAt,
})), })),
createdAt: p.createdAt, createdAt: p.createdAt,
@@ -316,6 +319,7 @@ export async function exportParticipantDataAsJson(
fileName: ann.fileName, fileName: ann.fileName,
datasetId: ann.datasetId, datasetId: ann.datasetId,
rating: ann.rating, rating: ann.rating,
confidence: ann.confidence,
dialectLabel: ann.dialectLabel, dialectLabel: ann.dialectLabel,
createdAt: ann.createdAt, createdAt: ann.createdAt,
})), })),

View File

@@ -153,6 +153,10 @@ export default function ParticipantDetailView({ participant, experimentId }: Par
<div className="text-sm text-gray-600 mb-1">Rating</div> <div className="text-sm text-gray-600 mb-1">Rating</div>
<div className="text-2xl font-bold text-gray-900">{selectedAnnotation.rating}</div> <div className="text-2xl font-bold text-gray-900">{selectedAnnotation.rating}</div>
</div> </div>
<div>
<div className="text-sm text-gray-600 mb-1">Confidence</div>
<div className="text-2xl font-bold text-gray-900">{selectedAnnotation.confidence}</div>
</div>
<div> <div>
<div className="text-sm text-gray-600 mb-1">Dialect</div> <div className="text-sm text-gray-600 mb-1">Dialect</div>
<div className="inline-block px-3 py-1 bg-blue-100 text-blue-800 rounded-full text-sm font-medium"> <div className="inline-block px-3 py-1 bg-blue-100 text-blue-800 rounded-full text-sm font-medium">