fix(geocoder): rejeter la confiance <= seuil (0.7 et moins → LLM)
is_reliable exige strictement > MIN_CONFIDENCE : une confiance de 0.7 pile (ou moins) n'est plus acceptée et part vers le LLM. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
72a52a8d3b
commit
88f6f2bff9
1 changed files with 5 additions and 2 deletions
|
|
@ -48,10 +48,13 @@ def _polite_sleep():
|
||||||
|
|
||||||
|
|
||||||
def is_reliable(confidence, granularity, is_country_only) -> bool:
|
def is_reliable(confidence, granularity, is_country_only) -> bool:
|
||||||
"""Un géocodage est fiable s'il est assez confiant ET assez précis."""
|
"""Un géocodage est fiable s'il est assez confiant ET assez précis.
|
||||||
|
|
||||||
|
On exige STRICTEMENT plus que le seuil : 0.7 et en-dessous → rejeté (LLM).
|
||||||
|
"""
|
||||||
if is_country_only:
|
if is_country_only:
|
||||||
return True # résolu par centroïde à l'enqueue, granularité pays assumée
|
return True # résolu par centroïde à l'enqueue, granularité pays assumée
|
||||||
if confidence is None or confidence < MIN_CONFIDENCE:
|
if confidence is None or confidence <= MIN_CONFIDENCE:
|
||||||
return False
|
return False
|
||||||
if granularity and granularity.lower() in COARSE_TYPES:
|
if granularity and granularity.lower() in COARSE_TYPES:
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue