|
@@ -5,6 +5,7 @@ import com.tzld.piaoquan.featurestools.dao.mapper.CreativeVideoSummarizeMapper;
|
|
|
import com.tzld.piaoquan.featurestools.dao.mapper.CreativeVideoUnderstanderMapper;
|
|
|
import com.tzld.piaoquan.featurestools.model.bo.EmbeddingResult;
|
|
|
import com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarize;
|
|
|
+import com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarizeExample;
|
|
|
import com.tzld.piaoquan.featurestools.model.po.CreativeVideoUnderstander;
|
|
|
import com.tzld.piaoquan.featurestools.model.po.CreativeVideoUnderstanderExample;
|
|
|
import com.tzld.piaoquan.featurestools.service.CreativeVideoSummarizeService;
|
|
@@ -41,6 +42,9 @@ public class SummarizeUnderstandingJob {
|
|
|
@Autowired
|
|
|
private CreativeVideoSummarizeService creativeVideoSummarizeService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CreativeVideoSummarizeMapper creativeVideoSummarizeMapper;
|
|
|
+
|
|
|
|
|
|
@XxlJob("summarizeUnderstandingJob")
|
|
|
public ReturnT<String> summarizeUnderstanding(String param) throws InterruptedException {
|
|
@@ -149,5 +153,27 @@ public class SummarizeUnderstandingJob {
|
|
|
valueCreativeVideoSummarize, urgencyCreativeVideoSummarize);
|
|
|
}
|
|
|
|
|
|
+ @XxlJob("refreshEmbeddingJob")
|
|
|
+ public ReturnT<String> refreshEmbedding(String param) throws InterruptedException {
|
|
|
+ long l = creativeVideoSummarizeMapper.countByExample(new CreativeVideoSummarizeExample());
|
|
|
+ int pageSize = 1000;
|
|
|
+ long pageNum = l / pageSize + 1;
|
|
|
+ for (int i = 0; i < pageNum; i++) {
|
|
|
+ CreativeVideoSummarizeExample example = new CreativeVideoSummarizeExample();
|
|
|
+ example.setPage(new Page<>(i + 1, pageSize));
|
|
|
+ List<CreativeVideoSummarize> creativeVideoSummarizes = creativeVideoSummarizeMapper.selectByExample(example);
|
|
|
+ if (CollectionUtils.isEmpty(creativeVideoSummarizes)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for (CreativeVideoSummarize creativeVideoSummarize : creativeVideoSummarizes) {
|
|
|
+ EmbeddingResult result = textEmbeddingService.getEmbedding(creativeVideoSummarize.getAiWordSplit());
|
|
|
+ creativeVideoSummarize.setEmbedding(result.getEmbeddingRes());
|
|
|
+ creativeVideoSummarize.setNlpWordSplit(result.getWords());
|
|
|
+ creativeVideoSummarizeMapper.updateByPrimaryKeyWithBLOBs(creativeVideoSummarize);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|