Replace fuzzy string matching with semantic AI matching to fix false positives where similar-sounding but different companies were matched (e.g., "Families First CiC" incorrectly matching "FAMILIES AGAINST CONFORMITY LTD"). Changes: - Add ICompanyNameMatcherService interface and AICompanyNameMatcherService implementation using Claude Sonnet 4 for semantic company name comparison - Add SemanticMatchResult and related models for AI match results - Update CompanyVerifierService to use AI matching with fuzzy fallback - Add detection for public sector employers, charities, and self-employed entries that cannot be verified via Companies House - Update tests to work with new AI matcher integration Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
16 lines
510 B
C#
16 lines
510 B
C#
using TrueCV.Application.Models;
|
|
|
|
namespace TrueCV.Application.Interfaces;
|
|
|
|
public interface ICompanyNameMatcherService
|
|
{
|
|
/// <summary>
|
|
/// Uses AI to semantically compare a company name from a CV against Companies House candidates.
|
|
/// Returns the best match with confidence score and reasoning.
|
|
/// </summary>
|
|
Task<SemanticMatchResult?> FindBestMatchAsync(
|
|
string cvCompanyName,
|
|
List<CompanyCandidate> candidates,
|
|
CancellationToken cancellationToken = default);
|
|
}
|