article_account.py 749 B

1234567891011121314151617181920212223242526272829303132333435
  1. """
  2. @author: luojunhui
  3. """
  4. import json
  5. import requests
  6. from applications.config import port
  7. class ArticleRank(object):
  8. """
  9. 账号排序
  10. """
  11. url = "http://localhost:{}/score_list".format(port)
  12. @classmethod
  13. def rank(cls, account_list, text_list):
  14. """
  15. Rank
  16. :param account_list:
  17. :param text_list:
  18. :return:
  19. """
  20. body = {
  21. "account_nickname_list": account_list,
  22. "text_list": text_list,
  23. "max_time": None,
  24. "min_time": None,
  25. "interest_type": "avg",
  26. "sim_type": "mean",
  27. "rate": 0.1
  28. }
  29. response = requests.post(url=cls.url, headers={}, json=body).json()
  30. return response