Commit 28045e38 by liuyu

2023年05/09 自动标注bug修复

parent ace24bf1
......@@ -196,13 +196,13 @@ public class TaskServiceCommon extends BaseTaskTypePair<TaskServiceCommon.TaskCo
Map<String, Object> similarMap = similarMapInfo(titleVoMap, title, group);
if (!similarMap.isEmpty()) {
// 填充数据
String aggreTitle = String.valueOf(similarMap.get("aggreTitle"));
String aggreTitle = String.valueOf(similarMap.get("aggreeTitle"));
TemplateTitleVo templateTitleVo = titleVoMap.get(aggreTitle);
String aggreTag = templateTitleVo.getMtag();
sourceObj.put(GenericAttribute.ES_M_TAG, aggreTag);
String aggreeTag = templateTitleVo.getMtag();
sourceObj.put(GenericAttribute.ES_M_TAG, aggreeTag);
sourceObj.put(GenericAttribute.ES_M_PERSON, "自动化机器人");
sourceObj.put(GenericAttribute.ES_M_TIME, new Date().getTime());
log.info("项目:{} 模板标题:{} MarkSum:{} Tag:{}被标注标题:{}相似度:{}", group, aggreTitle, templateTitleVo.getMarkSum(), aggreTag,
log.info("项目:{} 模板标题:{} MarkSum:{} Tag:{}被标注标题:{}相似度:{}", group, aggreTitle, templateTitleVo.getMarkSum(), aggreeTag,
title, similarMap.get("similar"));
// 刷新一下标注量和标注时间,
......
package com.zhiwei.middleware.automatic.son.util;
import com.alibaba.fastjson.JSONObject;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import java.io.*;
import java.util.*;
......@@ -9,20 +11,20 @@ public class CosineSimilarity {
private static final List<String> BRAND_WORDS = new ArrayList<>();
private static final String path = "classpath:static/brandWords.json";
private static final String path = "static/brandWords.json";
static {
try {
InputStream inputStream = new FileInputStream(path);
String jsonStr = readJsonFile(inputStream);
Resource resource = new ClassPathResource(path);
String jsonStr = readJsonFile(resource.getInputStream());
if (null != jsonStr) {
List<List> array = JSONObject.parseArray(jsonStr, List.class);
for (List str : array) {
BRAND_WORDS.addAll(str);
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (Exception x) {
x.printStackTrace();
}
}
......
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