|
|
@ -34,7 +34,7 @@ batch_size = 32 |
|
|
# model_name = "drop_aigc_model_2" |
|
|
# model_name = "drop_aigc_model_2" |
|
|
# model_name = "drop_aigc_model_3" |
|
|
# model_name = "drop_aigc_model_3" |
|
|
# model_name = "/home/majiahui/project/models-llm/aigc_check_10" |
|
|
# model_name = "/home/majiahui/project/models-llm/aigc_check_10" |
|
|
model_name_sentence = "/home/majiahui/project/models-llm/weipu_aigc_512_11" |
|
|
model_name_sentence = "/home/majiahui/project/models-llm/weipu_aigc_512_8" |
|
|
model_name_short = "/home/majiahui/project/models-llm/weipu_aigc_512_5" |
|
|
model_name_short = "/home/majiahui/project/models-llm/weipu_aigc_512_5" |
|
|
pantten_biaoti_0 = '^[1-9一二三四五六七八九ⅠⅡⅢⅣⅤⅥⅦⅧⅨ][、.]\s{0,}?[\u4e00-\u9fa5a-zA-Z]+' |
|
|
pantten_biaoti_0 = '^[1-9一二三四五六七八九ⅠⅡⅢⅣⅤⅥⅦⅧⅨ][、.]\s{0,}?[\u4e00-\u9fa5a-zA-Z]+' |
|
|
pantten_biaoti_1 = '^第[一二三四五六七八九]章\s{0,}?[\u4e00-\u9fa5a-zA-Z]+' |
|
|
pantten_biaoti_1 = '^第[一二三四五六七八九]章\s{0,}?[\u4e00-\u9fa5a-zA-Z]+' |
|
|
@ -109,17 +109,17 @@ def model_preidct(model, text): |
|
|
output = torch.sigmoid(output[0]).tolist() |
|
|
output = torch.sigmoid(output[0]).tolist() |
|
|
print(output) |
|
|
print(output) |
|
|
|
|
|
|
|
|
if model_name_sentence == "drop_aigc_model_2": |
|
|
# if model_name_sentence == "drop_aigc_model_2": |
|
|
return_list = { |
|
|
# return_list = { |
|
|
"humen": output[0][1], |
|
|
# "humen": output[0][1], |
|
|
"robot": output[0][0] |
|
|
# "robot": output[0][0] |
|
|
} |
|
|
# } |
|
|
elif model_name_sentence == "AIGC_detector_zhv2": |
|
|
# elif model_name_sentence == "AIGC_detector_zhv2": |
|
|
return_list = { |
|
|
# return_list = { |
|
|
"humen": output[0][0], |
|
|
# "humen": output[0][0], |
|
|
"robot": output[0][1] |
|
|
# "robot": output[0][1] |
|
|
} |
|
|
# } |
|
|
else: |
|
|
# else: |
|
|
return_list = { |
|
|
return_list = { |
|
|
"humen": output[0][0], |
|
|
"humen": output[0][0], |
|
|
"robot": output[0][1] |
|
|
"robot": output[0][1] |
|
|
@ -179,20 +179,20 @@ def main(content_list: list): |
|
|
reference_bool = is_reference_sentence(sentence) |
|
|
reference_bool = is_reference_sentence(sentence) |
|
|
|
|
|
|
|
|
if reference_bool == False: |
|
|
if reference_bool == False: |
|
|
if res["robot"] > 0.9: |
|
|
if res["robot"] > 0.87: |
|
|
for _ in range(len(sentence)): |
|
|
for _ in range(len(sentence)): |
|
|
gpt_score_list.append(res["robot"]) |
|
|
gpt_score_list.append(res["robot"]) |
|
|
gpt_score_sentence_list.append(res["robot"]) |
|
|
gpt_score_sentence_list.append(res["robot"]) |
|
|
sim_word += len(sentence) |
|
|
sim_word += len(sentence) |
|
|
gpt_content.append( |
|
|
gpt_content.append( |
|
|
"<em class=\"similar\" id='score_{}'>".format(str(i)) + sentence + "\n" + "</em>") |
|
|
"<em class=\"similar\" id='score_{}'>".format(str(i)) + sentence + "\n" + "</em>") |
|
|
elif 0.9 >= res["robot"] > 0.5: |
|
|
# elif 0.9 >= res["robot"] > 0.5: |
|
|
for _ in range(len(sentence)): |
|
|
# for _ in range(len(sentence)): |
|
|
gpt_score_list.append(res["robot"]) |
|
|
# gpt_score_list.append(res["robot"]) |
|
|
gpt_score_sentence_list.append(res["robot"]) |
|
|
# gpt_score_sentence_list.append(res["robot"]) |
|
|
sim_word_5_9 += len(sentence) |
|
|
# sim_word_5_9 += len(sentence) |
|
|
gpt_content.append( |
|
|
# gpt_content.append( |
|
|
"<em class=\"color-gold\" id='score_{}'>".format(str(i)) + sentence + "\n" + "</em>") |
|
|
# "<em class=\"color-gold\" id='score_{}'>".format(str(i)) + sentence + "\n" + "</em>") |
|
|
else: |
|
|
else: |
|
|
for _ in range(len(sentence)): |
|
|
for _ in range(len(sentence)): |
|
|
gpt_score_list.append(0) |
|
|
gpt_score_list.append(0) |
|
|
|