相对价格排名打分
This commit is contained in:
@@ -62,6 +62,8 @@ def build_doc(item):
|
||||
doc_dict = dict()
|
||||
if 'relative_price_ranking' in item and pd.notna(item['relative_price_ranking']):
|
||||
doc_dict['relative_price_ranking'] = item['relative_price_ranking']
|
||||
if 'credit_detail' in item:
|
||||
doc_dict['credit_detail'] = item['credit_detail']
|
||||
return doc_dict
|
||||
|
||||
|
||||
@@ -87,6 +89,18 @@ def find_around_price_item(seaweed):
|
||||
'relative_price_ranking']
|
||||
elif len(around_seaweed_df) == 1:
|
||||
seaweed['relative_price_ranking'] = 0.5
|
||||
|
||||
around_community_num = len(around_seaweed_df)
|
||||
if around_community_num >= 20:
|
||||
relative_price_ranking_score = 10
|
||||
elif 5 <= around_community_num < 20:
|
||||
relative_price_ranking_score = 9
|
||||
elif 1 < around_community_num < 5:
|
||||
relative_price_ranking_score = 8
|
||||
elif around_community_num == 1:
|
||||
relative_price_ranking_score = 7
|
||||
|
||||
seaweed['credit_detail'] = {'around_community_num': around_community_num, 'relative_price_ranking_score': relative_price_ranking_score}
|
||||
mutex.release()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user