Просмотр исходного кода

修改主诉现病史不传入BUG

louhr 5 лет назад
Родитель
Сommit
4870d73545

+ 3 - 1
bigdata-web/src/main/java/org/diagbot/bigdata/work/AlgorithmCore.java

@@ -67,7 +67,9 @@ public class AlgorithmCore {
             }
 
             if (executor != null) {
-                featuresMap = executor.execute(bigDataSearchData.getInputs());;
+                if (bigDataSearchData.getInputs().get("sentence") != null) {
+                    featuresMap = executor.execute(bigDataSearchData.getInputs());
+                }
             } else {
                 continue;
             }

+ 15 - 3
common-push/src/main/java/org/diagbot/common/push/work/ParamsDataProxy.java

@@ -87,6 +87,11 @@ public class ParamsDataProxy {
         PropertiesUtil propertiesUtil = new PropertiesUtil("nlp.properties");
         featureNum = propertiesUtil.getProperty("push.feature.num");
         fa.setFeatureNum(featureNum);
+        if (!StringUtils.isEmpty(searchData.getChief())) {
+            //提取主诉
+            featuresList = fa.start(searchData.getChief(), FeatureType.FEATURE);
+            paramFeatureInit(searchData, featuresList);
+        }
         if (!StringUtils.isEmpty(searchData.getSymptom())) {
             //提取现病史
             featuresList = fa.start(searchData.getSymptom(), FeatureType.FEATURE);
@@ -145,9 +150,16 @@ public class ParamsDataProxy {
 //        }
         //模型需要病历文本信息传入
         Map<String, String> map = new HashMap<>();
-        map.put("sentence", searchData.getSymptom());
-        searchData.getInputs().put("sentence", map);
-
+        if (!StringUtils.isEmpty(searchData.getChief()) && !StringUtils.isEmpty(searchData.getSymptom())) {
+            map.put("sentence", searchData.getChief() + searchData.getSymptom());
+        } else if (!StringUtils.isEmpty(searchData.getChief())) {
+            map.put("sentence", searchData.getChief());
+        } else if (!StringUtils.isEmpty(searchData.getSymptom())) {
+            map.put("sentence", searchData.getSymptom());
+        }
+        if (map.get("sentence") != null) {
+            searchData.getInputs().put("sentence", map);
+        }
     }
 
     /**