|
@@ -3,6 +3,7 @@ package org.diagbot.common.push.work;
|
|
|
import org.algorithm.core.cnn.entity.Lemma;
|
|
|
import org.algorithm.core.cnn.entity.Triad;
|
|
|
import org.diagbot.common.push.bean.SearchData;
|
|
|
+import org.diagbot.common.push.cache.ApplicationCacheUtil;
|
|
|
import org.diagbot.common.push.util.PushConstants;
|
|
|
import org.diagbot.nlp.participle.ParticipleUtil;
|
|
|
import org.diagbot.nlp.participle.word.Lexeme;
|
|
@@ -58,17 +59,34 @@ public class RelationExtractionUtil {
|
|
|
for (String content : contents) {
|
|
|
sb.append(content);
|
|
|
}
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("featureType", "4");
|
|
|
- map.put("featureName", sb.toString());
|
|
|
- map.put("property", "17");
|
|
|
- map.put("concept", sb.toString());
|
|
|
- //全是有
|
|
|
- map.put("negative", Constants.default_negative);
|
|
|
- if (searchData.getInputs().get(map.get("featureName")) == null) {
|
|
|
- searchData.getInputs().put(map.get("featureName"), map);
|
|
|
+ if (IsExist(sb.toString())) {
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("featureType", "5");
|
|
|
+ map.put("featureName", sb.toString());
|
|
|
+ map.put("property", "17");
|
|
|
+ map.put("concept", sb.toString());
|
|
|
+ //全是有
|
|
|
+ map.put("negative", Constants.default_negative);
|
|
|
+ if (searchData.getInputs().get(map.get("featureName")) == null) {
|
|
|
+ searchData.getInputs().put(map.get("featureName"), map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 关系抽取输出的content是否在已有诊断依据中存在
|
|
|
+ * @param content
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public boolean IsExist(String content){
|
|
|
+ Map<String, Map<String, String>> kl_diagnose_detail_filter_map = ApplicationCacheUtil.getKl_diagnose_detail_filter_map();
|
|
|
+ if (kl_diagnose_detail_filter_map.get("4") != null){
|
|
|
+ if (kl_diagnose_detail_filter_map.get("4").containsKey(content)){
|
|
|
+ return true;
|
|
|
}
|
|
|
}
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
}
|