Commit 32b8b51c authored by 李小芳's avatar 李小芳

get_highlight_v2

parent e8648681
......@@ -17,6 +17,7 @@ import datetime
from django.conf import settings
import redis
import logging
import re
from algorithm.text_classifical.base import model as alo_model
from gm_types.doris import SELECTED_CONTENT_TYPE
......@@ -44,7 +45,10 @@ def get_answers(pks):
item['title'] = answer.question.title
item['desc'] = answer.question.content
item['question_type'] = answer.question.question_type
item['answer'] = answer.content
ss = answer.content.encode('utf-16', 'surrogatepass').decode('utf-16')
dr = re.compile(r"<[^>]+>", re.S)
str_re = dr.sub("", ss)
item['answer'] = str_re
item['keynote_sentence'] = get_keynote_sentence(answer.content) if int(float(answer.level)) >= 3 else ""
item['content_length'] = len(item['answer'])
item['has_picture'] = answer.get_has_picture()
......
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