|
@@ -133,11 +133,6 @@ class PBPredictor:
|
|
|
has_stage = 0
|
|
|
|
|
|
pb_json = {
|
|
|
- 'tenderee': tenderee,
|
|
|
- 'agency': agency,
|
|
|
- 'project_code': project_code,
|
|
|
- 'project_name': project_name,
|
|
|
- 'doctitle': doctitle,
|
|
|
'stage': stage,
|
|
|
'industry': industry,
|
|
|
'proportion': proportion,
|
|
@@ -160,12 +155,21 @@ class PBPredictor:
|
|
|
'has_stage': has_stage,
|
|
|
}
|
|
|
|
|
|
+ # 值为None的key删掉
|
|
|
+ delete_keys = []
|
|
|
+ for key in pb_json.keys():
|
|
|
+ if pb_json.get(key) in [None, "", 0.0, 0]:
|
|
|
+ delete_keys.append(key)
|
|
|
+ for key in delete_keys:
|
|
|
+ if key in pb_json.keys():
|
|
|
+ pb_json.pop(key)
|
|
|
+
|
|
|
pb_json = {'pb': pb_json}
|
|
|
return pb_json
|
|
|
|
|
|
except:
|
|
|
traceback.print_exc()
|
|
|
- return {'pb': 'error'}
|
|
|
+ return {'pb': {}}
|
|
|
|
|
|
|
|
|
def extract_legal_stage(content, _pattern, priority_dict, product='', tenderee='', agency=''):
|