|
@@ -1,7 +1,9 @@
|
|
|
"""
|
|
|
@author: luojunhui
|
|
|
"""
|
|
|
-import pandas as pd
|
|
|
+import time
|
|
|
+import requests
|
|
|
+from concurrent.futures import ThreadPoolExecutor
|
|
|
|
|
|
body = {
|
|
|
"version":"v2",
|
|
@@ -26,9 +28,16 @@ features = {
|
|
|
"out_like_cnt": 1,
|
|
|
"out_share_cnt": 41,
|
|
|
"title": "收藏好这九种中成药,让你少往医院跑。?",
|
|
|
- "lop": 701 / 24698, # like_cnt + 700 / play_cnt + 24000
|
|
|
+ "lop": 701 / 24698,
|
|
|
"duration": 180
|
|
|
}
|
|
|
|
|
|
-df = pd.DataFrame([features])
|
|
|
-print(df.columns)
|
|
|
+url = "http://127.0.0.1:5000/lightgbm_score"
|
|
|
+
|
|
|
+while True:
|
|
|
+ t = time.time()
|
|
|
+ res = requests.post(url, json=body)
|
|
|
+ e = time.time()
|
|
|
+ print(res.json())
|
|
|
+ print("cost time:", e - t, "s")
|
|
|
+ time.sleep(0.5)
|