|
@@ -6,6 +6,8 @@ import org.algorithm.core.neural.dataset.NNDataSet;
|
|
import org.algorithm.core.neural.dataset.NNDataSetImpl;
|
|
import org.algorithm.core.neural.dataset.NNDataSetImpl;
|
|
import org.diagbot.pub.utils.PropertiesUtil;
|
|
import org.diagbot.pub.utils.PropertiesUtil;
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @Author: bijl
|
|
* @Author: bijl
|
|
* @Date: 2019/1/22 14:49
|
|
* @Date: 2019/1/22 14:49
|
|
@@ -20,12 +22,13 @@ public class RelationExtractionModelImpl extends RelationExtractionModel {
|
|
|
|
|
|
String modelPath = prop.getProperty("basicPath"); // 模型基本路径
|
|
String modelPath = prop.getProperty("basicPath"); // 模型基本路径
|
|
String modelVersion = prop.getProperty("relationExtraction");
|
|
String modelVersion = prop.getProperty("relationExtraction");
|
|
|
|
+ String dataSetPath = modelPath.substring(0, modelPath.indexOf("model_version_replacement"));
|
|
modelPath = modelPath.replace("model_version_replacement", modelVersion); // 生成模型路径
|
|
modelPath = modelPath.replace("model_version_replacement", modelVersion); // 生成模型路径
|
|
|
|
|
|
- String exportDir = null;
|
|
|
|
- RelationExtractionDataSet dataSet = new RelationExtractionDataSet(modelPath + System.getProperty("line.separator")
|
|
|
|
- + "char2id.json");
|
|
|
|
- this.init(exportDir);
|
|
|
|
|
|
+ dataSetPath = dataSetPath + File.separator + modelVersion + File.separator + "char2id.json";
|
|
|
|
+
|
|
|
|
+ RelationExtractionDataSet dataSet = new RelationExtractionDataSet(dataSetPath);
|
|
|
|
+ this.init(modelPath);
|
|
this.dataSet = dataSet;
|
|
this.dataSet = dataSet;
|
|
}
|
|
}
|
|
}
|
|
}
|