浏览代码

1、模型没有返回数据例外处理

louhr 5 年之前
父节点
当前提交
e0e76dfb96
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcess.java

+ 2 - 0
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcess.java

@@ -46,6 +46,8 @@ public class EntityProcess {
         JSONArray entitys = annotation.getJSONArray("T");
         JSONArray relations = annotation.getJSONArray("R");
 
+        if (entitys == null || entitys.isEmpty()) return resultLemmaList;
+
         List<Lemma> allLemmaList = loadAllLemmaList(entitys);
         List<String> relationIds = new ArrayList<>();
         for (Lemma l : allLemmaList) {