|
@@ -20,15 +20,13 @@ public class RelationExtractionModelFromHttp extends AlgorithmCNNExecutor {
|
|
|
@Override
|
|
|
public List<Triad> execute(String content, List<Lemma> lemmas) {
|
|
|
String url = getUrl();
|
|
|
- String positions = makePositionsParam(lemmas);
|
|
|
-
|
|
|
// 句子长度不超过MAX_LEN,实体数超过两个
|
|
|
if (content.length() > this.MAX_LEN || lemmas.size() < 2) {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
- String sentence = content;
|
|
|
+ String positions = makePositionsParam(lemmas);
|
|
|
String indexPairAndRelations = HttpGetAndPost.sendPost(url,
|
|
|
- "sentence="+sentence+"&positions="+positions);
|
|
|
+ "sentence="+content+"&positions="+positions);
|
|
|
return mergePredictInfoToTriads(indexPairAndRelations, lemmas); // 合并信息到三元组中去
|
|
|
}
|
|
|
|