|
@@ -3,6 +3,7 @@ package org.diagbot.bigdata.work;
|
|
|
import org.algorithm.util.AlgorithmClassify;
|
|
|
import org.apache.commons.beanutils.BeanUtils;
|
|
|
import org.diagbot.bigdata.util.BigDataConstants;
|
|
|
+import org.diagbot.common.work.SearchData;
|
|
|
import org.diagbot.nlp.feature.FeatureAnalyze;
|
|
|
import org.diagbot.nlp.feature.FeatureType;
|
|
|
import org.diagbot.nlp.util.Constants;
|
|
@@ -21,7 +22,7 @@ import java.util.Map;
|
|
|
* @Version 1.0
|
|
|
**/
|
|
|
public class ParamsDataProxy {
|
|
|
- public void createSearchData(HttpServletRequest request, BigDataSearchData searchData) throws Exception {
|
|
|
+ public void createSearchData(HttpServletRequest request, SearchData searchData) throws Exception {
|
|
|
//消除空格
|
|
|
if (searchData.getSymptom() != null) {
|
|
|
searchData.setSymptom(searchData.getSymptom().trim());
|
|
@@ -45,8 +46,7 @@ public class ParamsDataProxy {
|
|
|
//一次推送多个类别信息
|
|
|
String[] featureTypes = searchData.getFeatureType().split(",");
|
|
|
searchData.setFeatureTypes(featureTypes);
|
|
|
- //featureType转算法模型类别
|
|
|
- searchData.setAlgorithmClassify(createAlgorithmClassify(searchData.getSysCode(), featureTypes, searchData));
|
|
|
+
|
|
|
//获取入参中的特征信息
|
|
|
FeatureAnalyze fa = new FeatureAnalyze();
|
|
|
|
|
@@ -71,7 +71,7 @@ public class ParamsDataProxy {
|
|
|
* @param featureTypes
|
|
|
* @param searchData
|
|
|
*/
|
|
|
- private AlgorithmClassify[] createAlgorithmClassify(String sysCode, String[] featureTypes, BigDataSearchData searchData) {
|
|
|
+ public AlgorithmClassify[] createAlgorithmClassify(String sysCode, String[] featureTypes, SearchData searchData) {
|
|
|
AlgorithmClassify[] classifies = new AlgorithmClassify[featureTypes.length];
|
|
|
//下了诊断且其他信息全为空 反推标识
|
|
|
boolean reverse = !StringUtils.isEmpty(searchData.getDiag()) && StringUtils.isEmpty(searchData.getSymptom());
|
|
@@ -175,13 +175,13 @@ public class ParamsDataProxy {
|
|
|
* @param searchData
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
- private void paramFeatureInit(BigDataSearchData searchData, List<Map<String, Object>> featuresList) throws Exception {
|
|
|
+ private void paramFeatureInit(SearchData searchData, List<Map<String, Object>> featuresList) throws Exception {
|
|
|
if (featuresList != null && featuresList.size() > 0) {
|
|
|
// BeanUtils.setProperty(searchData, property_list, featuresList);
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
Map<String, Object> featureMap = null;
|
|
|
for (int i = 0; i < featuresList.size(); i++) {
|
|
|
featureMap = featuresList.get(i);
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
for (Map.Entry<String, Object> entry : featureMap.entrySet()) {
|
|
|
map.put(entry.getKey(), String.valueOf(entry.getValue()));
|
|
|
}
|