|
|
@ -597,6 +597,7 @@ public class TripleConversionPipelineImpl implements TripleConversionPipeline {
|
|
|
|
.peek(ere->{
|
|
|
|
.peek(ere->{
|
|
|
|
// 对实体名称进行同义词转换
|
|
|
|
// 对实体名称进行同义词转换
|
|
|
|
List<EntityExtractionDTO> entities = ere.getEntities();
|
|
|
|
List<EntityExtractionDTO> entities = ere.getEntities();
|
|
|
|
|
|
|
|
List<RelationExtractionDTO> relations = ere.getRelations();
|
|
|
|
for (EntityExtractionDTO entity : entities) {
|
|
|
|
for (EntityExtractionDTO entity : entities) {
|
|
|
|
String name = entity.getName();
|
|
|
|
String name = entity.getName();
|
|
|
|
String standardTerm = keywordSynonymService.getStandardTerm(name, synonymDTOS);
|
|
|
|
String standardTerm = keywordSynonymService.getStandardTerm(name, synonymDTOS);
|
|
|
@ -604,6 +605,18 @@ public class TripleConversionPipelineImpl implements TripleConversionPipeline {
|
|
|
|
entity.setName(standardTerm);
|
|
|
|
entity.setName(standardTerm);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (RelationExtractionDTO relation : relations) {
|
|
|
|
|
|
|
|
String sourceName = relation.getSource();
|
|
|
|
|
|
|
|
String targetName = relation.getTarget();
|
|
|
|
|
|
|
|
String sourceStandardTerm = keywordSynonymService.getStandardTerm(sourceName, synonymDTOS);
|
|
|
|
|
|
|
|
String targetStandardTerm = keywordSynonymService.getStandardTerm(targetName, synonymDTOS);
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(sourceStandardTerm)) {
|
|
|
|
|
|
|
|
relation.setSource(sourceStandardTerm);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(targetStandardTerm)) {
|
|
|
|
|
|
|
|
relation.setTarget(targetStandardTerm);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
Map<String, EntityExtractionDTO> entityMap = new HashMap<>();
|
|
|
|
Map<String, EntityExtractionDTO> entityMap = new HashMap<>();
|
|
|
|