Methodology

A transparent pipeline, from raw text to a decision.

HomeLens AI combines supervised sentiment models with a rule-based aspect dictionary and a provider-level scoring layer. Every step can be inspected.

CollectYelp reviews of home-service providers in one market
MaskURLs, emails, phones, dollar amounts and star phrases replaced with tokens
ScoreEach review scored for risk against an operating threshold
ExplainPhrase dictionary finds the aspect and the evidence sentence
MonitorAggregate to providers, trends and relative tiers
Three layers

What happens to a review.

01 — Layer 1

Is this review a risk signal?

One- and two-star reviews are the risk class, four- and five-star the comparison class; three-star reviews are held out.

A fine-tuned DistilBERT model is the primary scorer. A TF–IDF logistic regression is the fallback and powers this website’s demo.

Thresholds keep negative-class recall at or above 90%.

02 — Layer 2

What exactly went wrong?

A curated phrase dictionary over eight aspects finds the complaint language in each sentence and picks the evidence sentence.

High-risk reviews with no match go to manual review.

03 — Layer 3

Does it keep happening?

Reviews roll up to providers with at least 20 reviews.

A score blends mean risk, recent risk and high-severity rate as percentiles, then maps to a relative tier.

Results

Validated on businesses the model never saw.

The split holds out whole businesses, so test scores are not inflated by a provider appearing in both training and test data.

ModelThresholdAccuracyMacro-F1Neg. precisionNeg. recallROC-AUC
Fine-tuned DistilBERT0.9500.9760.9730.9720.9550.996
TF–IDF Logistic Regression0.6200.9570.9510.9500.9170.991
TextBlob0.4050.7930.7850.6300.9090.911

Test set: 3,331 reviews from 213 held-out businesses (1,100 negative, 2,231 positive). TextBlob is the lexicon baseline. Source: artifacts/model_comparison.csv.

The data

What the models learned from.

17,943 core reviews

Filtered from 23,685 candidates. 1,054 providers and 12,384 reviewers in Tucson, AZ, Nov 2006–Jan 2022. Median length 83 words.

Business-held-out splits

Train: 10,411 reviews, 630 businesses

Validation: 3,691 reviews, 211 businesses

Test: 3,331 reviews, 213 businesses

Masked before modeling

Phone numbers, emails, links, dollar amounts and star phrases are replaced with tokens so a model cannot lean on a rating written into the text.

Provider scoring

A relative score, not a probability.

The risk score is a weighted blend of percentiles, which makes it a ranking inside this corpus.

Score formula

100 × (0.50 · mean-risk percentile + 0.30 · recent-risk percentile + 0.20 · high-severity percentile)

Recent means 2021 onward. The trend compares recent against the 2020 mean and only appears with at least three reviews in each period.

Tiers

StableScore below 50 · 126 providers

WatchScore 50–75 · 75 providers

ElevatedScore 75–90 · 47 providers

High concernScore 90 and above · 6 providers

Inspect it yourself.

Paste a review and read the evidence, the matched phrases and the term weights.