UNPKG

@thecodingwhale/cv-processor

Version:

CV Processor to extract structured data from PDF resumes using TypeScript

52 lines (51 loc) 1.56 kB
/** * AccuracyScorer - Evaluates the accuracy of extracted CV data * * This utility helps measure how well the AI extraction performed by: * - Checking structural validity (schema compliance) * - Measuring field completeness * - Validating category/type assignments * - Calculating an overall accuracy score */ interface AccuracyResult { overall: number; categoryAssignment: number; completeness: number; structuralValidity: number; missingFields: string[]; } export declare class AccuracyScorer { /** * Evaluate the accuracy of CV data extraction */ static evaluateAccuracy(cvData: any): AccuracyResult; /** * Check the structural validity of the CV data * Returns a score from 0-100 */ private static checkStructuralValidity; /** * Check if a credit object has the expected structure */ private static isValidCredit; /** * Check how well categories are assigned based on official categories * Returns a score from 0-100 */ private static checkCategoryAssignment; /** * Check if a category string is valid by comparing to official categories * Uses partial matching to handle variations */ private static isValidCategoryName; /** * Check completeness of fields in the CV data * Returns a score from 0-100 and a list of missing fields */ private static checkCompleteness; /** * Calculate the overall accuracy score from component scores */ private static calculateOverallScore; } export {};