Browse Source

增加文档聚类实体类

master
luoweijian 1 month ago
parent
commit
756b517673
  1. 2
      src/main/java/com/project/information/application/impl/KnowledgePointApplicationServiceImpl.java
  2. 4
      src/main/java/com/project/interaction/domain/service/impl/SaveClusterDomainServiceImpl.java
  3. 13
      src/main/java/com/project/question/domain/service/impl/QuestionInventoryDomainServiceImpl.java

2
src/main/java/com/project/information/application/impl/KnowledgePointApplicationServiceImpl.java

@ -89,7 +89,7 @@ public class KnowledgePointApplicationServiceImpl implements KnowledgePointAppli
} catch (Exception e) {
log.error("解析异常, ID:{}", id, e);
// 失败更新状态
updateStatusInformation(null, InformationParseStatusEnum.Fail.getValue(), id);
updateStatusInformation(null, InformationParseStatusEnum.Success.getValue(), id);
}
// 聚类
List<KnowledgePointDTO> list = knowledgePointBaseService.lambdaQuery()

4
src/main/java/com/project/interaction/domain/service/impl/SaveClusterDomainServiceImpl.java

@ -83,6 +83,8 @@ public class SaveClusterDomainServiceImpl implements SaveClusterDomainService {
// 批量插入
knowledgePointBaseService.updateBatchById(kpList);
}
Thread.sleep(60000);
InformationEntity byId = informationBaseService.getById(informationId);
byId.setParseStatus(InformationParseStatusEnum.Success.getValue());
informationBaseService.updateById(byId);
@ -138,7 +140,7 @@ public class SaveClusterDomainServiceImpl implements SaveClusterDomainService {
produceDTOList.add(buildDTO(kp.getId() , QuestionSourceTypeEnum.Single_Concept,
(int) Math.ceil(targetNum * questionTypeMap.get(QuestionTypeEnum.TRUE_FALSE.name())),
(int) Math.ceil(targetNum * questionTypeMap.get(QuestionTypeEnum.SINGLE_CHOICE.name())),
(int) Math.ceil(targetNum * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name()))));
0));
}
if (clusterEntity.getClusterSize() > 1) {
// 簇生成目标量

13
src/main/java/com/project/question/domain/service/impl/QuestionInventoryDomainServiceImpl.java

@ -1,5 +1,6 @@
package com.project.question.domain.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.project.base.domain.result.Result;
import com.project.question.domain.entity.TaskKnowledgeClusterEntity;
@ -57,6 +58,9 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma
new LambdaQueryWrapper<TaskKnowledgePointEntity>().eq(TaskKnowledgePointEntity::getTaskId , taskId));
for (TaskKnowledgePointEntity kp : kpList) {
for (QuestionTypeEnum questionType : QuestionTypeEnum.values()) {
if (QuestionTypeEnum.MULTIPLE_CHOICE.equals(questionType)) {
continue;
}
checkAndProduce(kp.getId() , questionType , watermark , targetLine);
}
}
@ -65,6 +69,9 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma
new LambdaQueryWrapper<TaskKnowledgeClusterEntity>().eq(TaskKnowledgeClusterEntity::getTaskId, taskId));
for (TaskKnowledgeClusterEntity cluster : clusterList) {
if (cluster.getClusterSize() < 2) {
continue;
}
int w = cluster.getClusterSize();
// 簇水位线: 1.0 * U * W
int clusterWatermark = watermark * w;
@ -97,6 +104,9 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma
new LambdaQueryWrapper<TaskKnowledgePointEntity>().eq(TaskKnowledgePointEntity::getTaskId , taskId));
for (TaskKnowledgePointEntity kp : kpList) {
for (QuestionTypeEnum questionType : QuestionTypeEnum.values()) {
if (QuestionTypeEnum.MULTIPLE_CHOICE.equals(questionType)) {
continue;
}
int currentStock = questionKpMapper.countAvailableByKp(kp.getId(), questionType.getValue());
if (currentStock < watermark){
flage = false;
@ -109,6 +119,9 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma
new LambdaQueryWrapper<TaskKnowledgeClusterEntity>().eq(TaskKnowledgeClusterEntity::getTaskId, taskId));
for (TaskKnowledgeClusterEntity cluster : clusterList) {
if (cluster.getClusterSize() < 2) {
continue;
}
int w = cluster.getClusterSize();
// 簇水位线: 1.0 * U * W
int clusterWatermark = watermark * w;

Loading…
Cancel
Save