Commit 6bbc9d67 authored by 李小芳's avatar 李小芳

gmai

parent 66a96d0d
......@@ -16,6 +16,7 @@ import time
import datetime
from django.conf import settings
import redis
from algorithm.text_classifical.base import model as alo_model
rpc = get_rpc_invoker()
......@@ -191,7 +192,14 @@ def get_answers(pks):
item["gossip_tag_ids"] = get_tag_v3_gossip_tag_ids(content_id=answer.id, content_type="answer")
item["gossip_tags"] = get_tag_v3_gossip_tag_ids(content_id=answer.id, content_type="answer", get_names=True)
# 首页精选增加内容分类和明星列表和网红列表
result_data = alo_model.run(answer.content)
item['selected_content_type'] = int(result_data.get("content_type", 0))
item['selected_internet_celebrity'] = [list(item.keys())[0] for item in result_data.get("celebrity", [])]
item['selected_stars'] = [list(item.keys())[0] for item in result_data.get("star", [])]
data.append(item)
except (Answer.DoesNotExist, Question.DoesNotExist):
pass
......
......@@ -20,6 +20,7 @@ from django.conf import settings
import redis
import re
import traceback
from algorithm.text_classifical.base import model as alo_model
def get_tractate(pks):
......@@ -230,8 +231,13 @@ def get_tractate(pks):
item["gossip_tags"] = get_tag_v3_gossip_tag_ids(content_id=tractate.id, content_type="tractate",
get_names=True)
data.append(item)
# 首页精选增加内容分类和明星列表和网红列表
result_data =alo_model.run(tractate.content)
item['selected_content_type'] = int(result_data.get("content_type", 0))
item['selected_internet_celebrity'] = [list(item.keys())[0] for item in result_data.get("celebrity", [])]
item['selected_stars'] = [list(item.keys())[0] for item in result_data.get("star", [])]
data.append(item)
logging.info("get data:%s" % data)
return data
except:
......
......@@ -42,6 +42,7 @@ git+ssh://git@git.wanmeizhensuo.com/system/gm-tracer.git@v0.1.3
git+ssh://git@git.wanmeizhensuo.com/backend/helios.git@v0.7.5
git+ssh://git@git.wanmeizhensuo.com/backend/gm-logging.git@v0.8.5
git+ssh://git@git.wanmeizhensuo.com/backend/gm-rpcd.git@v0.2.5
git+ssh://git@git.wanmeizhensuo.com/rank/gm-text-miner.git
sqlalchemy==1.3.20
six==1.15.0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment