score_list_dev.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. """
  2. @author: luojunhui
  3. """
  4. import json
  5. import requests
  6. class ArticleRank(object):
  7. """
  8. 账号排序
  9. """
  10. url = "http://192.168.100.31:8179/score_list"
  11. url1 = "http://47.98.154.124:6060/score_list"
  12. # url1 = "http://localhost:6060/score_list"
  13. url2 = "http://192.168.100.31:8179/score_list"
  14. @classmethod
  15. def rank(cls, account_list, text_list):
  16. """
  17. Rank
  18. :param account_list:
  19. :param text_list:
  20. :return:
  21. """
  22. body = {
  23. "account_nickname_list": account_list,
  24. "text_list": text_list,
  25. "max_time": None,
  26. "min_time": None,
  27. "interest_type": "avg",
  28. "sim_type": "mean",
  29. "rate": 0.1
  30. }
  31. response = requests.post(url=cls.url, headers={}, json=body).json()
  32. return response
  33. if __name__ == '__main__':
  34. AR = ArticleRank()
  35. response = AR.rank(
  36. account_list=['生活良读'],
  37. text_list=['保姆为300万拆迁款,嫁给大24岁老头,丈夫去世后,她发现房产证没有丈夫名字'] * 10,
  38. )
  39. print(json.dumps(response, ensure_ascii=False, indent=4))