mirror of
https://github.com/marcogll/telegram_expenses_controller.git
synced 2026-01-13 13:25:15 +00:00
feat: Implement core application structure, AI extraction, persistence, and Telegram bot modules with updated configuration and dependencies.
This commit is contained in:
16
app/ai/confidence.py
Normal file
16
app/ai/confidence.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
Functions for calculating confidence scores.
|
||||
"""
|
||||
|
||||
def calculate_confidence(extracted_data: dict) -> float:
|
||||
"""
|
||||
Calculates a confidence score based on the quality of the extracted data.
|
||||
Stub function.
|
||||
"""
|
||||
score = 1.0
|
||||
# Lower score if key fields are missing
|
||||
if not extracted_data.get("amount"):
|
||||
score -= 0.5
|
||||
if not extracted_data.get("description"):
|
||||
score -= 0.3
|
||||
return max(0.0, score)
|
||||
Reference in New Issue
Block a user