|
@@ -27,7 +27,14 @@ public class RelationExtractionModelFromHttp extends AlgorithmCNNExecutor {
|
|
String positions = makePositionsParam(lemmas);
|
|
String positions = makePositionsParam(lemmas);
|
|
String indexPairAndRelations = HttpGetAndPost.sendPost(url,
|
|
String indexPairAndRelations = HttpGetAndPost.sendPost(url,
|
|
"sentence="+content+"&positions="+positions);
|
|
"sentence="+content+"&positions="+positions);
|
|
- return mergePredictInfoToTriads(indexPairAndRelations, lemmas); // 合并信息到三元组中去
|
|
|
|
|
|
+
|
|
|
|
+ // 模型服务异常统一标识:ModelServiceError
|
|
|
|
+ if ("ModelServiceError".equals(indexPairAndRelations)){
|
|
|
|
+ System.err.println("Error happen in Model service.");
|
|
|
|
+ return new ArrayList<>();
|
|
|
|
+ }
|
|
|
|
+ // 合并信息到三元组中
|
|
|
|
+ return mergePredictInfoToTriads(indexPairAndRelations, lemmas);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|