Classify Consensus
retab-ui/classify-consensus-viewer-blockFreeBlock
A classification result with consensus visible in the sidebar: selected category, likelihood, and every vote beside the source document.
Install it
npx shadcn@latest add https://ui.retab.com/r/classify-consensus-viewer-block.jsonSource
1"use client";23import { ClassifyConsensusBlock } from "@/components/viewers/classify/classify-consensus-block";4import type { ViewerSource } from "@/components/ui/file-viewer";5import type { ClassifyResult } from "@/components/viewers/lib/classify-types";67const LOAN_APPLICATION_SOURCE: ViewerSource = {8 kind: "url",9 url: "/samples/loan-application.pdf",10 fileName: "loan-application.pdf",11};1213const CLASSIFY_RESULT: ClassifyResult = {14 category: "Loan Application",15 candidates: [16 {17 category: "Loan Application",18 description: "Uniform Residential Loan Application Form 1003.",19 },20 {21 category: "Tax Form",22 description: "Structured form, but no IRS tax identifiers.",23 },24 {25 category: "Bank Statement",26 description: "Financial fields are present, but no transactions.",27 },28 ],29 reasoning:30 "The document is a Uniform Residential Loan Application (Form 1003): it collects borrower, employment, and property details for a mortgage request.",31 consensus: {32 likelihoods: 0.67,33 choices: [34 {35 category: "Loan Application",36 reasoning:37 "The document is a Form 1003 loan application with borrower, employment, and property sections.",38 },39 {40 category: "Loan Application",41 reasoning:42 "The mortgage application fields and declarations match a loan application packet.",43 },44 {45 category: "Tax Form",46 reasoning:47 "The form is structured and financial, but it does not contain transaction rows or statement periods.",48 },49 ],50 },51};5253export function ClassifyConsensusViewerBlock() {54 return (55 <ClassifyConsensusBlock56 source={LOAN_APPLICATION_SOURCE}57 result={CLASSIFY_RESULT}58 sidebarWidth="18rem"59 sidebarLabel="Classification consensus"60 minHeightClassName="min-h-[680px]"61 />62 );63}
What it pulls in
npm packages
Other registry items
Files it writes
More from retab-ui
All 130 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| CSV Sourcescsv-sources-block | retab-ui | Blocks | Free | no deps · 2 files | |
| DOCX Sourcesdocx-sources-block | retab-ui | Blocks | Free | no deps · 2 files | |
| Avatar Image Slotdropzone-avatar-image-slot | retab-ui | Blocks | Free | 1 dep · 2 files | |
| Dropzonedropzone-block | retab-ui | Blocks | Free | 1 dep · 26 files | |
| Comparison Pairdropzone-comparison-pair-upload | retab-ui | Blocks | Free | 1 dep · 2 files | |
| Controlled Queuedropzone-controlled-queue | retab-ui | Blocks | Free | 1 dep · 2 files | |
| Custom Thumbnail Griddropzone-custom-thumbnail-grid | retab-ui | Blocks | Free | 1 dep · 2 files | |
| Disabled Dropzonedropzone-disabled-dropzone | retab-ui | Blocks | Free | 1 dep · 2 files |
