Skip to content

Commit

Permalink
♻️ refactor: fuzzywuzzy 정확도 임계값 하향 (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
synoti21 committed Nov 17, 2023
1 parent 5de5bc7 commit e60dbaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/nutrition_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def correct_ocr_text(text):
target_words = ["kcal", "탄수화물", "단백질", "지방"]
corrected_text = text
for word in target_words:
extracted_words = process.extractBests(word, text.split(), score_cutoff=75, limit=10)
extracted_words = process.extractBests(word, text.split(), score_cutoff=60, limit=10)
for extracted_word, score in extracted_words:
if abs(len(extracted_word) - len(word)) <= 1:
corrected_text = corrected_text.replace(extracted_word, word)
Expand Down

0 comments on commit e60dbaa

Please sign in to comment.