functions.py 717 B

123456789101112131415161718192021222324252627282930
  1. """
  2. @author: luojunhui
  3. """
  4. import requests
  5. class Functions(object):
  6. """
  7. functions class
  8. """
  9. @classmethod
  10. def getTitleScore(cls, title_list, account_name):
  11. """
  12. 标题打分
  13. :param title_list:
  14. :param account_name:
  15. :return:
  16. """
  17. url = "http://192.168.100.31:8179/score_list"
  18. body = {
  19. "account_nickname_list": [account_name],
  20. "text_list": title_list,
  21. "max_time": None,
  22. "min_time": None,
  23. "interest_type": "by_avg",
  24. "sim_type": "mean",
  25. "rate": 0.1
  26. }
  27. response = requests.post(url=url, headers={}, json=body).json()
  28. return response