|
@@ -1,5 +1,6 @@
|
|
package org.diagbot.nlp.relation;
|
|
package org.diagbot.nlp.relation;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
import org.algorithm.core.cnn.AlgorithmCNNExecutor;
|
|
import org.algorithm.core.cnn.AlgorithmCNNExecutor;
|
|
import org.algorithm.core.cnn.model.Triad;
|
|
import org.algorithm.core.cnn.model.Triad;
|
|
import org.diagbot.nlp.feature.FeatureType;
|
|
import org.diagbot.nlp.feature.FeatureType;
|
|
@@ -18,9 +19,10 @@ import java.util.List;
|
|
**/
|
|
**/
|
|
public class RelationAnalyze {
|
|
public class RelationAnalyze {
|
|
public void analyze(String content, FeatureType featureType) throws Exception {
|
|
public void analyze(String content, FeatureType featureType) throws Exception {
|
|
- LexemePath<Lexeme> lexemes = ParticipleUtil.participle(content);
|
|
|
|
-
|
|
|
|
|
|
+ LexemePath<Lexeme> lexemes = ParticipleUtil.participle(content, true);
|
|
AlgorithmCNNExecutor executor = new AlgorithmCNNExecutor();
|
|
AlgorithmCNNExecutor executor = new AlgorithmCNNExecutor();
|
|
- List<Triad> triads = executor.execute(content);
|
|
|
|
|
|
+
|
|
|
|
+ String json_content = JSON.toJSONString(lexemes);
|
|
|
|
+ List<Triad> triads = executor.execute(content, json_content);
|
|
}
|
|
}
|
|
}
|
|
}
|