DawnC commited on
Commit
4f9ae1f
1 Parent(s): 2293434

Update recommendation_html_format.py

Browse files
Files changed (1) hide show
  1. recommendation_html_format.py +1 -18
recommendation_html_format.py CHANGED
@@ -54,26 +54,9 @@ def format_recommendation_html(recommendations: List[Dict], is_description_searc
54
  print(f"Error in convert_to_display_score: {str(e)}")
55
  return 70
56
 
57
- # def _generate_progress_bar(score: float) -> float:
58
- # """生成非線性的進度條寬度"""
59
- # if score <= 0.3:
60
- # width = 30 + (score / 0.3) * 20
61
- # elif score <= 0.6:
62
- # width = 50 + ((score - 0.3) / 0.3) * 20
63
- # elif score <= 0.8:
64
- # width = 70 + ((score - 0.6) / 0.2) * 15
65
- # else:
66
- # width = 85 + ((score - 0.8) / 0.2) * 15
67
-
68
- # import random
69
- # width += random.uniform(-2, 2)
70
- # return min(100, max(20, width))
71
 
72
  def _generate_progress_bar(score: float) -> float:
73
- """
74
- 優化進度條寬度計算
75
-
76
- 改進:
77
  - 確保100%時完全填滿
78
  - 更線性的視覺呈現
79
  - 保持合理的視覺比例
 
54
  print(f"Error in convert_to_display_score: {str(e)}")
55
  return 70
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  def _generate_progress_bar(score: float) -> float:
59
+ """
 
 
 
60
  - 確保100%時完全填滿
61
  - 更線性的視覺呈現
62
  - 保持合理的視覺比例