Parcourir la source

Merge branch 'dev-xym-add-deepseek' of Server/features-tools into master

xueyiming il y a 2 mois
Parent
commit
57eb7391be

+ 21 - 0
pom.xml

@@ -115,6 +115,27 @@
             <artifactId>fastjson</artifactId>
         </dependency>
 
+        <!-- https://mvnrepository.com/artifact/cn.hutool/hutool-all -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.8.33</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/cn.hutool/hutool-core -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-core</artifactId>
+            <version>5.8.33</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/cn.hutool/hutool-http -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-http</artifactId>
+            <version>5.8.33</version>
+        </dependency>
+
     </dependencies>
 
     <build>

+ 36 - 0
src/main/java/com/tzld/piaoquan/featurestools/dao/mapper/CreativeVideoSummarizeMapper.java

@@ -0,0 +1,36 @@
+package com.tzld.piaoquan.featurestools.dao.mapper;
+
+import com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarize;
+import com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarizeExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface CreativeVideoSummarizeMapper {
+    long countByExample(CreativeVideoSummarizeExample example);
+
+    int deleteByExample(CreativeVideoSummarizeExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(CreativeVideoSummarize record);
+
+    int insertSelective(CreativeVideoSummarize record);
+
+    List<CreativeVideoSummarize> selectByExampleWithBLOBs(CreativeVideoSummarizeExample example);
+
+    List<CreativeVideoSummarize> selectByExample(CreativeVideoSummarizeExample example);
+
+    CreativeVideoSummarize selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") CreativeVideoSummarize record, @Param("example") CreativeVideoSummarizeExample example);
+
+    int updateByExampleWithBLOBs(@Param("record") CreativeVideoSummarize record, @Param("example") CreativeVideoSummarizeExample example);
+
+    int updateByExample(@Param("record") CreativeVideoSummarize record, @Param("example") CreativeVideoSummarizeExample example);
+
+    int updateByPrimaryKeySelective(CreativeVideoSummarize record);
+
+    int updateByPrimaryKeyWithBLOBs(CreativeVideoSummarize record);
+
+    int updateByPrimaryKey(CreativeVideoSummarize record);
+}

+ 3 - 1
src/main/java/com/tzld/piaoquan/featurestools/job/CreativeVideoUnderstandJob.java

@@ -52,6 +52,7 @@ public class CreativeVideoUnderstandJob {
                             if (creativeVideoUnderstander == null) {
                                 break; // 退出当前线程
                             }
+                            System.out.println("creativeVideoUnderstander=" + creativeVideoUnderstander);
                             processCreativeVideoUnderstander(creativeVideoUnderstander);
                         } catch (Exception e) {
                             log.error("视频理解线程异常", e);
@@ -66,7 +67,7 @@ public class CreativeVideoUnderstandJob {
             long count = creativeVideoUnderstanderMapper.countByExample(example);
             int pageSize = 1000;
             int pageNum = (int) (count / pageSize) + 1;
-            for (int i = 0; i < pageNum; i++) {
+            for (int i = 1; i <= pageNum; i++) {
                 Page page = new Page<>(i, pageSize);
                 example.setPage(page);
                 List<CreativeVideoUnderstander> creativeVideoUnderstanderList = creativeVideoUnderstanderMapper.selectByExample(example);
@@ -84,6 +85,7 @@ public class CreativeVideoUnderstandJob {
         videoUnderstandParam.setUrl(creativeVideoUnderstander.getVideoUrl());
         videoUnderstandParam.setFileName(creativeVideoUnderstander.getVideoFileName());
         VideoUnderstandResult videoUnderstandResult = videoUnderstandService.getVideoUnderstandResult(videoUnderstandParam);
+        System.out.println("videoUnderstandResult=" + videoUnderstandResult);
         if (videoUnderstandResult == null) {
             addRetryCount(creativeVideoUnderstander);
             return;

+ 138 - 0
src/main/java/com/tzld/piaoquan/featurestools/job/SummarizeUnderstandingJob.java

@@ -0,0 +1,138 @@
+package com.tzld.piaoquan.featurestools.job;
+
+import com.alibaba.fastjson.JSONObject;
+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.CreativeVideoUnderstander;
+import com.tzld.piaoquan.featurestools.model.po.CreativeVideoUnderstanderExample;
+import com.tzld.piaoquan.featurestools.service.CreativeVideoSummarizeService;
+import com.tzld.piaoquan.featurestools.service.TextEmbeddingService;
+import com.tzld.piaoquan.featurestools.util.DeepSeekAPI;
+import com.tzld.piaoquan.featurestools.util.page.Page;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+import java.util.concurrent.*;
+
+@Slf4j
+@Component
+public class SummarizeUnderstandingJob {
+
+    private static final ThreadPoolExecutor understandingPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(5);
+
+    private static final ArrayBlockingQueue<CreativeVideoUnderstander> understandingQueue = new ArrayBlockingQueue<>(100000);
+
+
+    @Autowired
+    private CreativeVideoUnderstanderMapper creativeVideoUnderstanderMapper;
+
+    @Autowired
+    private TextEmbeddingService textEmbeddingService;
+
+    @Autowired
+    private CreativeVideoSummarizeService creativeVideoSummarizeService;
+
+
+    @XxlJob("summarizeUnderstandingJob")
+    public ReturnT<String> summarizeUnderstanding(String param) throws InterruptedException {
+        if (understandingPoolExecutor.getCorePoolSize() - understandingPoolExecutor.getActiveCount() > 0) {
+            int threadSize = understandingPoolExecutor.getCorePoolSize() - understandingPoolExecutor.getActiveCount();
+            log.info("threadNum={}", threadSize);
+            CountDownLatch countDownLatch = new CountDownLatch(threadSize);
+            // 启动消费者线程
+            for (int i = 0; i < threadSize; i++) {
+                understandingPoolExecutor.execute(new Thread(() -> {
+                    log.info("启动视频理解总结线程");
+                    while (true) {
+                        try {
+                            // 超过 5 分钟没有数据,销毁当前线程
+                            CreativeVideoUnderstander creativeVideoUnderstander = understandingQueue.poll(5, TimeUnit.MINUTES); // 等待最多 5 分钟
+                            log.info("videoQueue size={}", understandingQueue.size());
+                            if (creativeVideoUnderstander == null) {
+                                break; // 退出当前线程
+                            }
+                            System.out.println("creativeVideoUnderstander=" + creativeVideoUnderstander);
+                            processSummarizeUnderstanding(creativeVideoUnderstander);
+                        } catch (Exception e) {
+                            log.error("视频理解总结线程异常", e);
+                        }
+                    }
+                    log.info("视频理解总结线程结束");
+                    countDownLatch.countDown();
+                }));
+            }
+            CreativeVideoUnderstanderExample example = new CreativeVideoUnderstanderExample();
+            example.createCriteria().andStatusEqualTo(1);
+            long count = creativeVideoUnderstanderMapper.countByExample(example);
+            System.out.println("count = " + count);
+            int pageSize = 1000;
+            int pageNum = (int) (count / pageSize) + 1;
+            for (int i = 1; i <= pageNum; i++) {
+                Page page = new Page<>(i, pageSize);
+                example.setPage(page);
+                List<CreativeVideoUnderstander> creativeVideoUnderstanderList = creativeVideoUnderstanderMapper.selectByExampleWithBLOBs(example);
+                if (!CollectionUtils.isEmpty(creativeVideoUnderstanderList)) {
+                    understandingQueue.addAll(creativeVideoUnderstanderList);
+                }
+            }
+            countDownLatch.await();
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    private void processSummarizeUnderstanding(CreativeVideoUnderstander creativeVideoUnderstander) {
+        log.info("processSummarizeUnderstanding creativeVideoUnderstander = {}", creativeVideoUnderstander);
+        String understanderText = creativeVideoUnderstander.getUnderstanderText();
+        if (StringUtils.isEmpty(understanderText)) {
+            return;
+        }
+        String chat = DeepSeekAPI.chat(understanderText);
+        if (StringUtils.isEmpty(chat)) {
+            return;
+        }
+        JSONObject jsonObject = JSONObject.parseObject(chat);
+        String hook = String.join(",", jsonObject.getJSONArray("hook").toJavaList(String.class));
+        String value = String.join(",", jsonObject.getJSONArray("value").toJavaList(String.class));
+        String urgency = String.join(",", jsonObject.getJSONArray("urgency").toJavaList(String.class));
+        log.info("hook = " + hook);
+        log.info("value = " + value);
+        log.info("urgency = " + urgency);
+        if (StringUtils.isEmpty(hook) || StringUtils.isEmpty(value) || StringUtils.isEmpty(urgency)) {
+            return;
+        }
+        EmbeddingResult hookResult = textEmbeddingService.getEmbedding(hook);
+        EmbeddingResult valueResult = textEmbeddingService.getEmbedding(value);
+        EmbeddingResult urgencyResult = textEmbeddingService.getEmbedding(urgency);
+        log.info("hookResult = " + hookResult);
+        log.info("valueResult = " + valueResult);
+        log.info("urgencyResult = " + urgencyResult);
+        if (hookResult == null || valueResult == null || urgencyResult == null) {
+            return;
+        }
+        CreativeVideoSummarize hookCreativeVideoSummarize = new CreativeVideoSummarize(creativeVideoUnderstander.getId()
+                , creativeVideoUnderstander.getCreativeId(), "creative_hook_embedding", hook,
+                hookResult.getWords(), hookResult.getEmbeddingRes());
+
+        CreativeVideoSummarize valueCreativeVideoSummarize = new CreativeVideoSummarize(creativeVideoUnderstander.getId()
+                , creativeVideoUnderstander.getCreativeId(), "creative_why_embedding", value,
+                valueResult.getWords(), valueResult.getEmbeddingRes());
+
+        CreativeVideoSummarize urgencyCreativeVideoSummarize = new CreativeVideoSummarize(creativeVideoUnderstander.getId()
+                , creativeVideoUnderstander.getCreativeId(), "creative_action_embedding", urgency,
+                urgencyResult.getWords(), urgencyResult.getEmbeddingRes());
+
+        creativeVideoSummarizeService.saveRes(creativeVideoUnderstander, hookCreativeVideoSummarize,
+                valueCreativeVideoSummarize, urgencyCreativeVideoSummarize);
+    }
+
+
+}

+ 14 - 0
src/main/java/com/tzld/piaoquan/featurestools/model/bo/EmbeddingResult.java

@@ -0,0 +1,14 @@
+package com.tzld.piaoquan.featurestools.model.bo;
+
+import lombok.Data;
+import lombok.ToString;
+
+@Data
+@ToString
+public class EmbeddingResult {
+
+    private String embeddingRes;
+
+    private String words;
+
+}

+ 128 - 0
src/main/java/com/tzld/piaoquan/featurestools/model/po/CreativeVideoSummarize.java

@@ -0,0 +1,128 @@
+package com.tzld.piaoquan.featurestools.model.po;
+
+import java.util.Date;
+
+public class CreativeVideoSummarize {
+
+    public CreativeVideoSummarize() {
+    }
+
+    public CreativeVideoSummarize(Long creativeVideoUnderstanderId, Long creativeId, String featureName,
+                                  String aiWordSplit, String nlpWordSplit, String embedding) {
+        this.creativeVideoUnderstanderId = creativeVideoUnderstanderId;
+        this.creativeId = creativeId;
+        this.featureName = featureName;
+        this.aiWordSplit = aiWordSplit;
+        this.nlpWordSplit = nlpWordSplit;
+        this.embedding = embedding;
+    }
+
+    private Long id;
+
+    private Long creativeVideoUnderstanderId;
+
+    private Long creativeId;
+
+    private String featureName;
+
+    private String aiWordSplit;
+
+    private String nlpWordSplit;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    private String embedding;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getCreativeVideoUnderstanderId() {
+        return creativeVideoUnderstanderId;
+    }
+
+    public void setCreativeVideoUnderstanderId(Long creativeVideoUnderstanderId) {
+        this.creativeVideoUnderstanderId = creativeVideoUnderstanderId;
+    }
+
+    public Long getCreativeId() {
+        return creativeId;
+    }
+
+    public void setCreativeId(Long creativeId) {
+        this.creativeId = creativeId;
+    }
+
+    public String getFeatureName() {
+        return featureName;
+    }
+
+    public void setFeatureName(String featureName) {
+        this.featureName = featureName;
+    }
+
+    public String getAiWordSplit() {
+        return aiWordSplit;
+    }
+
+    public void setAiWordSplit(String aiWordSplit) {
+        this.aiWordSplit = aiWordSplit;
+    }
+
+    public String getNlpWordSplit() {
+        return nlpWordSplit;
+    }
+
+    public void setNlpWordSplit(String nlpWordSplit) {
+        this.nlpWordSplit = nlpWordSplit;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getEmbedding() {
+        return embedding;
+    }
+
+    public void setEmbedding(String embedding) {
+        this.embedding = embedding;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", creativeVideoUnderstanderId=").append(creativeVideoUnderstanderId);
+        sb.append(", creativeId=").append(creativeId);
+        sb.append(", featureName=").append(featureName);
+        sb.append(", aiWordSplit=").append(aiWordSplit);
+        sb.append(", nlpWordSplit=").append(nlpWordSplit);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", embedding=").append(embedding);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 723 - 0
src/main/java/com/tzld/piaoquan/featurestools/model/po/CreativeVideoSummarizeExample.java

@@ -0,0 +1,723 @@
+package com.tzld.piaoquan.featurestools.model.po;
+
+import com.tzld.piaoquan.featurestools.util.page.Page;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class CreativeVideoSummarizeExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public CreativeVideoSummarizeExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Long value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Long value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Long value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Long value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Long value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Long> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Long> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Long value1, Long value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Long value1, Long value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeVideoUnderstanderIdIsNull() {
+            addCriterion("creative_video_understander_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeVideoUnderstanderIdIsNotNull() {
+            addCriterion("creative_video_understander_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeVideoUnderstanderIdEqualTo(Long value) {
+            addCriterion("creative_video_understander_id =", value, "creativeVideoUnderstanderId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeVideoUnderstanderIdNotEqualTo(Long value) {
+            addCriterion("creative_video_understander_id <>", value, "creativeVideoUnderstanderId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeVideoUnderstanderIdGreaterThan(Long value) {
+            addCriterion("creative_video_understander_id >", value, "creativeVideoUnderstanderId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeVideoUnderstanderIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("creative_video_understander_id >=", value, "creativeVideoUnderstanderId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeVideoUnderstanderIdLessThan(Long value) {
+            addCriterion("creative_video_understander_id <", value, "creativeVideoUnderstanderId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeVideoUnderstanderIdLessThanOrEqualTo(Long value) {
+            addCriterion("creative_video_understander_id <=", value, "creativeVideoUnderstanderId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeVideoUnderstanderIdIn(List<Long> values) {
+            addCriterion("creative_video_understander_id in", values, "creativeVideoUnderstanderId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeVideoUnderstanderIdNotIn(List<Long> values) {
+            addCriterion("creative_video_understander_id not in", values, "creativeVideoUnderstanderId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeVideoUnderstanderIdBetween(Long value1, Long value2) {
+            addCriterion("creative_video_understander_id between", value1, value2, "creativeVideoUnderstanderId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeVideoUnderstanderIdNotBetween(Long value1, Long value2) {
+            addCriterion("creative_video_understander_id not between", value1, value2, "creativeVideoUnderstanderId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeIdIsNull() {
+            addCriterion("creative_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeIdIsNotNull() {
+            addCriterion("creative_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeIdEqualTo(Long value) {
+            addCriterion("creative_id =", value, "creativeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeIdNotEqualTo(Long value) {
+            addCriterion("creative_id <>", value, "creativeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeIdGreaterThan(Long value) {
+            addCriterion("creative_id >", value, "creativeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("creative_id >=", value, "creativeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeIdLessThan(Long value) {
+            addCriterion("creative_id <", value, "creativeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeIdLessThanOrEqualTo(Long value) {
+            addCriterion("creative_id <=", value, "creativeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeIdIn(List<Long> values) {
+            addCriterion("creative_id in", values, "creativeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeIdNotIn(List<Long> values) {
+            addCriterion("creative_id not in", values, "creativeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeIdBetween(Long value1, Long value2) {
+            addCriterion("creative_id between", value1, value2, "creativeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreativeIdNotBetween(Long value1, Long value2) {
+            addCriterion("creative_id not between", value1, value2, "creativeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andFeatureNameIsNull() {
+            addCriterion("feature_name is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andFeatureNameIsNotNull() {
+            addCriterion("feature_name is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andFeatureNameEqualTo(String value) {
+            addCriterion("feature_name =", value, "featureName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFeatureNameNotEqualTo(String value) {
+            addCriterion("feature_name <>", value, "featureName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFeatureNameGreaterThan(String value) {
+            addCriterion("feature_name >", value, "featureName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFeatureNameGreaterThanOrEqualTo(String value) {
+            addCriterion("feature_name >=", value, "featureName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFeatureNameLessThan(String value) {
+            addCriterion("feature_name <", value, "featureName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFeatureNameLessThanOrEqualTo(String value) {
+            addCriterion("feature_name <=", value, "featureName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFeatureNameLike(String value) {
+            addCriterion("feature_name like", value, "featureName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFeatureNameNotLike(String value) {
+            addCriterion("feature_name not like", value, "featureName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFeatureNameIn(List<String> values) {
+            addCriterion("feature_name in", values, "featureName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFeatureNameNotIn(List<String> values) {
+            addCriterion("feature_name not in", values, "featureName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFeatureNameBetween(String value1, String value2) {
+            addCriterion("feature_name between", value1, value2, "featureName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFeatureNameNotBetween(String value1, String value2) {
+            addCriterion("feature_name not between", value1, value2, "featureName");
+            return (Criteria) this;
+        }
+
+        public Criteria andAiWordSplitIsNull() {
+            addCriterion("ai_word_split is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAiWordSplitIsNotNull() {
+            addCriterion("ai_word_split is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAiWordSplitEqualTo(String value) {
+            addCriterion("ai_word_split =", value, "aiWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andAiWordSplitNotEqualTo(String value) {
+            addCriterion("ai_word_split <>", value, "aiWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andAiWordSplitGreaterThan(String value) {
+            addCriterion("ai_word_split >", value, "aiWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andAiWordSplitGreaterThanOrEqualTo(String value) {
+            addCriterion("ai_word_split >=", value, "aiWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andAiWordSplitLessThan(String value) {
+            addCriterion("ai_word_split <", value, "aiWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andAiWordSplitLessThanOrEqualTo(String value) {
+            addCriterion("ai_word_split <=", value, "aiWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andAiWordSplitLike(String value) {
+            addCriterion("ai_word_split like", value, "aiWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andAiWordSplitNotLike(String value) {
+            addCriterion("ai_word_split not like", value, "aiWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andAiWordSplitIn(List<String> values) {
+            addCriterion("ai_word_split in", values, "aiWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andAiWordSplitNotIn(List<String> values) {
+            addCriterion("ai_word_split not in", values, "aiWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andAiWordSplitBetween(String value1, String value2) {
+            addCriterion("ai_word_split between", value1, value2, "aiWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andAiWordSplitNotBetween(String value1, String value2) {
+            addCriterion("ai_word_split not between", value1, value2, "aiWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andNlpWordSplitIsNull() {
+            addCriterion("nlp_word_split is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNlpWordSplitIsNotNull() {
+            addCriterion("nlp_word_split is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNlpWordSplitEqualTo(String value) {
+            addCriterion("nlp_word_split =", value, "nlpWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andNlpWordSplitNotEqualTo(String value) {
+            addCriterion("nlp_word_split <>", value, "nlpWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andNlpWordSplitGreaterThan(String value) {
+            addCriterion("nlp_word_split >", value, "nlpWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andNlpWordSplitGreaterThanOrEqualTo(String value) {
+            addCriterion("nlp_word_split >=", value, "nlpWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andNlpWordSplitLessThan(String value) {
+            addCriterion("nlp_word_split <", value, "nlpWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andNlpWordSplitLessThanOrEqualTo(String value) {
+            addCriterion("nlp_word_split <=", value, "nlpWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andNlpWordSplitLike(String value) {
+            addCriterion("nlp_word_split like", value, "nlpWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andNlpWordSplitNotLike(String value) {
+            addCriterion("nlp_word_split not like", value, "nlpWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andNlpWordSplitIn(List<String> values) {
+            addCriterion("nlp_word_split in", values, "nlpWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andNlpWordSplitNotIn(List<String> values) {
+            addCriterion("nlp_word_split not in", values, "nlpWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andNlpWordSplitBetween(String value1, String value2) {
+            addCriterion("nlp_word_split between", value1, value2, "nlpWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andNlpWordSplitNotBetween(String value1, String value2) {
+            addCriterion("nlp_word_split not between", value1, value2, "nlpWordSplit");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNull() {
+            addCriterion("update_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNotNull() {
+            addCriterion("update_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeEqualTo(Date value) {
+            addCriterion("update_time =", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotEqualTo(Date value) {
+            addCriterion("update_time <>", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThan(Date value) {
+            addCriterion("update_time >", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("update_time >=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThan(Date value) {
+            addCriterion("update_time <", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("update_time <=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIn(List<Date> values) {
+            addCriterion("update_time in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotIn(List<Date> values) {
+            addCriterion("update_time not in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
+            addCriterion("update_time between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("update_time not between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 9 - 0
src/main/java/com/tzld/piaoquan/featurestools/service/CreativeVideoSummarizeService.java

@@ -0,0 +1,9 @@
+package com.tzld.piaoquan.featurestools.service;
+
+import com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarize;
+import com.tzld.piaoquan.featurestools.model.po.CreativeVideoUnderstander;
+
+public interface CreativeVideoSummarizeService {
+    void saveRes(CreativeVideoUnderstander creativeVideoUnderstander, CreativeVideoSummarize hookCreativeVideoSummarize,
+                 CreativeVideoSummarize valueCreativeVideoSummarize, CreativeVideoSummarize urgencyCreativeVideoSummarize);
+}

+ 8 - 0
src/main/java/com/tzld/piaoquan/featurestools/service/TextEmbeddingService.java

@@ -0,0 +1,8 @@
+package com.tzld.piaoquan.featurestools.service;
+
+import com.tzld.piaoquan.featurestools.model.bo.EmbeddingResult;
+
+public interface TextEmbeddingService {
+
+    EmbeddingResult getEmbedding(String sampleText);
+}

+ 32 - 0
src/main/java/com/tzld/piaoquan/featurestools/service/impl/CreativeVideoSummarizeServiceImpl.java

@@ -0,0 +1,32 @@
+package com.tzld.piaoquan.featurestools.service.impl;
+
+import com.tzld.piaoquan.featurestools.dao.mapper.CreativeVideoSummarizeMapper;
+import com.tzld.piaoquan.featurestools.dao.mapper.CreativeVideoUnderstanderMapper;
+import com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarize;
+import com.tzld.piaoquan.featurestools.model.po.CreativeVideoUnderstander;
+import com.tzld.piaoquan.featurestools.service.CreativeVideoSummarizeService;
+import com.tzld.piaoquan.featurestools.service.VideoUnderstandService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service
+public class CreativeVideoSummarizeServiceImpl implements CreativeVideoSummarizeService {
+
+    @Autowired
+    private CreativeVideoUnderstanderMapper creativeVideoUnderstanderMapper;
+
+    @Autowired
+    private CreativeVideoSummarizeMapper creativeVideoSummarizeMapper;
+
+
+    @Transactional
+    public void saveRes(CreativeVideoUnderstander creativeVideoUnderstander, CreativeVideoSummarize hookCreativeVideoSummarize,
+                        CreativeVideoSummarize valueCreativeVideoSummarize, CreativeVideoSummarize urgencyCreativeVideoSummarize) {
+        creativeVideoSummarizeMapper.insertSelective(hookCreativeVideoSummarize);
+        creativeVideoSummarizeMapper.insertSelective(valueCreativeVideoSummarize);
+        creativeVideoSummarizeMapper.insertSelective(urgencyCreativeVideoSummarize);
+        creativeVideoUnderstander.setStatus(3);
+        creativeVideoUnderstanderMapper.updateByPrimaryKeySelective(creativeVideoUnderstander);
+    }
+}

+ 130 - 0
src/main/java/com/tzld/piaoquan/featurestools/service/impl/TextEmbeddingServiceImpl.java

@@ -0,0 +1,130 @@
+package com.tzld.piaoquan.featurestools.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.tzld.piaoquan.featurestools.model.bo.EmbeddingResult;
+import com.tzld.piaoquan.featurestools.service.TextEmbeddingService;
+import com.tzld.piaoquan.featurestools.util.HttpClientUtil;
+import com.tzld.piaoquan.featurestools.util.HttpPoolClientUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class TextEmbeddingServiceImpl implements TextEmbeddingService {
+
+    private static final HttpPoolClientUtil httpPoolClientUtil = HttpClientUtil.create(5000, 50000, 10, 20, 3, 3000);
+
+    private static final String STOPWORDS_FILE = "stopwords_cn.txt";
+    private static final String EMBED_URL = "http://192.168.203.4:6060/embed";
+    private final Set<String> stopwords = new HashSet<>();
+
+    @PostConstruct
+    public void init() throws IOException {
+        // 创建 ClassPathResource 对象,指定资源文件路径
+        ClassPathResource resource = new ClassPathResource("stopwords_cn.txt");
+        // 获取文件输入流
+        BufferedReader reader = new BufferedReader(new InputStreamReader(resource.getInputStream()));
+        String line;
+        while ((line = reader.readLine()) != null) {
+            stopwords.add(line.trim());
+        }
+
+    }
+
+    @Override
+    public EmbeddingResult getEmbedding(String sampleText) {
+        JSONObject result = sendEmbedRequest(sampleText);
+        if (result == null) {
+            return null;
+        }
+        JSONArray embeddings = result.getJSONArray("embeddings");
+        List<String> words = result.getJSONArray("tokens").toJavaList(String.class);
+
+        List<List<Double>> filteredEmbeddings = basicFilterEmbeddings(words, embeddings);
+        List<String> filterWords = basicFilterWords(words);
+        List<Double> doubleList = averageEmbeddings(filteredEmbeddings);
+        String embeddingStr = doubleList.stream()
+                .map(String::valueOf)
+                .collect(Collectors.joining("|"));
+        String wordStr = String.join(",", filterWords);
+
+        EmbeddingResult embeddingResult = new EmbeddingResult();
+        embeddingResult.setEmbeddingRes(embeddingStr);
+        embeddingResult.setWords(wordStr);
+        return embeddingResult;
+    }
+
+
+
+
+
+
+
+    public List<List<Double>> basicFilterEmbeddings(List<String> words, JSONArray embeddingsArray) {
+        List<List<Double>> saveEmbeddings = new ArrayList<>();
+        for (int i = 0; i < embeddingsArray.size(); i++) {
+            List<Double> embeddings = embeddingsArray.getJSONArray(i).toJavaList(Double.class);
+            String word = words.get(i);
+            if (!stopwords.contains(word)) {
+                saveEmbeddings.add(embeddings);
+            }
+        }
+        return saveEmbeddings;
+    }
+
+    public List<String> basicFilterWords(List<String> words) {
+        List<String> saveWord = new ArrayList<>();
+        for (String word : words) {
+            if (!stopwords.contains(word)) {
+                saveWord.add(word);
+            }
+        }
+        return saveWord;
+    }
+
+    public List<Double> averageEmbeddings(List<List<Double>> embeddings) {
+        if (embeddings.isEmpty()) {
+            return new ArrayList<>();
+        }
+        int length = embeddings.get(0).size();
+        double[] sums = new double[length];
+        for (List<Double> embedding : embeddings) {
+            for (int i = 0; i < length; i++) {
+                sums[i] += embedding.get(i);
+            }
+        }
+        int numArrays = embeddings.size();
+        List<Double> averages = new ArrayList<>();
+        for (double sum : sums) {
+            averages.add(sum / numArrays);
+        }
+        return averages;
+    }
+
+    public JSONObject sendEmbedRequest(String textContent) {
+        try {
+            JSONObject param = new JSONObject();
+            param.put("text", textContent);
+            String post = httpPoolClientUtil.post(EMBED_URL, param.toJSONString());
+            if (StringUtils.isNotEmpty(post)) {
+                return JSONObject.parseObject(post);
+            }
+        } catch (Exception e) {
+            log.error("sendEmbedRequest error", e);
+        }
+        return null;
+    }
+
+
+}

+ 120 - 0
src/main/java/com/tzld/piaoquan/featurestools/util/DeepSeekAPI.java

@@ -0,0 +1,120 @@
+package com.tzld.piaoquan.featurestools.util;
+
+import cn.hutool.http.HttpRequest;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+public class DeepSeekAPI {
+
+    /**
+     * 聊天端点
+     */
+    static String chatEndpoint = "https://api.deepseek.com/chat/completions";
+    /**
+     * api密匙
+     */
+    static String apiKey = "Bearer sk-cfd2df92c8864ab999d66a615ee812c5";
+
+    private static final String systemPrompt = "请基于广告视频分析报告进行结构化关键词提取,按照以下要求输出JSON:\n" +
+            "\n" +
+            "1. 仅分为钩子、价值、逼单三个模块\n" +
+            "2. 每个模块直接输出关键词数组\n" +
+            "3. 合并专属与泛化词汇不做区分\n" +
+            "4. 只保留和广告相关的关键性词汇\n" +
+            "5. 保留原始模块定义:\n" +
+            "   钩子 - 吸引注意的元素\n" +
+            "   价值 - 产品提供的核心利益\n" +
+            "   逼单 - 促成转化的手段\n" +
+            "\n" +
+            "输出结构:\n" +
+            "{\n" +
+            "  \"hook\": [],\n" +
+            "  \"value\": [],\n" +
+            "  \"urgency\": []\n" +
+            "}\n" +
+            "\n" +
+            "提取规则:\n" +
+            "- 从文案/画面/行为中提炼核心概念\n" +
+            "- 保留数字、特殊表述等关键信息\n" +
+            "- 每个关键词不超过8个汉字\n" +
+            "- 总条目数控制在15-20个";
+
+
+    /**
+     * 发送消息
+     *
+     * @param txt 内容
+     * @return {@link String}
+     */
+    public static String chat(String txt) {
+        Map<String, Object> paramMap = new HashMap<>();
+        paramMap.put("model", "deepseek-chat");
+        paramMap.put("temperature", 0.3);
+        Map<String, String> responseFormat = new HashMap<>();
+        responseFormat.put("type", "json_object");
+        paramMap.put("response_format", responseFormat);
+        List<Map<String, String>> dataList = new ArrayList<>();
+        dataList.add(new HashMap<String, String>() {{
+            put("role", "system");
+            put("content", systemPrompt);
+        }});
+        dataList.add(new HashMap<String, String>() {{
+            put("role", "user");
+            put("content", txt);
+        }});
+        paramMap.put("messages", dataList);
+        JSONObject message = null;
+        try {
+            String body = HttpRequest.post(chatEndpoint)
+                    .header("Authorization", apiKey)
+                    .header("Content-Type", "application/json")
+                    .body(JSONObject.toJSONString(paramMap))
+                    .timeout(200000)
+                    .execute()
+                    .body();
+            JSONObject jsonObject = JSONObject.parseObject(body);
+            JSONArray choices = jsonObject.getJSONArray("choices");
+            JSONObject result = choices.getJSONObject(0);
+            message = result.getJSONObject("message");
+            return message.getString("content");
+        } catch (Exception e) {
+            log.error("deepseek chat error", e);
+        }
+        return "";
+    }
+
+    public static void main(String[] args) {
+        String txt = "好的,下面是对您上传的广告视频的分析报告。\n" +
+                "\n" +
+                "广告视频分析报告\n" +
+                "\n" +
+                "一、钩子 (吸引观众注意力的部分)\n" +
+                "\n" +
+                "   文案:“人呐,一旦开始练习站桩,身体会发生哪些变化呢?”\n" +
+                "   画面:视频一开始呈现两位中年人在绿地上练习站桩的画面,一位穿蓝色中式服装的男士在指导一位穿红色中式服装的女士。画面色彩鲜明,背景是绿色的草地和带有倒影的窗户,营造出一种轻松自然的感觉。\n" +
+                "   吸引注意的方式:提出问题。视频通过提问“人呐,一旦开始练习站桩,身体会发生哪些变化呢?”直接引发观众的好奇心,尤其是对于有健康养生需求的40岁以上人群,更能激起他们了解站桩益处的兴趣。\n" +
+                "\n" +
+                "二、价值 (视频传递的产品/服务信息)\n" +
+                "\n" +
+                "   产品/服务:视频宣传的是“站桩入门课”,由千尺学堂提供,适合40岁以上人群。\n" +
+                "   核心卖点:站桩的核心在于通过内部运动带动外部,吸收周围能量,将散掉的精气重新收回体内,从而达到身体轻松,排出湿气,心情舒畅的效果。\n" +
+                "   解决痛点:视频旨在解决中老年人群普遍存在的身体疲惫、湿气重、心情烦闷等问题。通过站桩练习,可以改善身体状况,提升精神状态。\n" +
+                "\n" +
+                "三、逼单 (引导用户下单的部分)\n" +
+                "\n" +
+                "   营销话术:“现在报名5天的课程,一分钱不用花。”\n" +
+                "   行动引导:视频通过画面上的红色箭头和文案提示,引导用户点击视频下方的链接来领取课程。这种引导方式简洁直接,易于操作。\n" +
+                "   紧迫感营造:视频没有明显的紧迫感营造手段,但是免费课程本身具有一定的吸引力,可能会促使感兴趣的观众尽快点击链接了解详情。";
+
+        System.out.println(chat(txt));
+    }
+
+}

+ 330 - 0
src/main/resources/mapper/CreativeVideoSummarizeMapper.xml

@@ -0,0 +1,330 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.tzld.piaoquan.featurestools.dao.mapper.CreativeVideoSummarizeMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarize">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="creative_video_understander_id" jdbcType="BIGINT" property="creativeVideoUnderstanderId" />
+    <result column="creative_id" jdbcType="BIGINT" property="creativeId" />
+    <result column="feature_name" jdbcType="VARCHAR" property="featureName" />
+    <result column="ai_word_split" jdbcType="VARCHAR" property="aiWordSplit" />
+    <result column="nlp_word_split" jdbcType="VARCHAR" property="nlpWordSplit" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarize">
+    <result column="embedding" jdbcType="LONGVARCHAR" property="embedding" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, creative_video_understander_id, creative_id, feature_name, ai_word_split, nlp_word_split, 
+    create_time, update_time
+  </sql>
+  <sql id="Blob_Column_List">
+    embedding
+  </sql>
+  <select id="selectByExampleWithBLOBs" parameterType="com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarizeExample" resultMap="ResultMapWithBLOBs">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from creative_video_understander_summarize
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarizeExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from creative_video_understander_summarize
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
+    select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from creative_video_understander_summarize
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from creative_video_understander_summarize
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarizeExample">
+    delete from creative_video_understander_summarize
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarize">
+    insert into creative_video_understander_summarize (id, creative_video_understander_id, creative_id, 
+      feature_name, ai_word_split, nlp_word_split, 
+      create_time, update_time, embedding
+      )
+    values (#{id,jdbcType=BIGINT}, #{creativeVideoUnderstanderId,jdbcType=BIGINT}, #{creativeId,jdbcType=BIGINT}, 
+      #{featureName,jdbcType=VARCHAR}, #{aiWordSplit,jdbcType=VARCHAR}, #{nlpWordSplit,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{embedding,jdbcType=LONGVARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarize">
+    insert into creative_video_understander_summarize
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="creativeVideoUnderstanderId != null">
+        creative_video_understander_id,
+      </if>
+      <if test="creativeId != null">
+        creative_id,
+      </if>
+      <if test="featureName != null">
+        feature_name,
+      </if>
+      <if test="aiWordSplit != null">
+        ai_word_split,
+      </if>
+      <if test="nlpWordSplit != null">
+        nlp_word_split,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+      <if test="embedding != null">
+        embedding,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="creativeVideoUnderstanderId != null">
+        #{creativeVideoUnderstanderId,jdbcType=BIGINT},
+      </if>
+      <if test="creativeId != null">
+        #{creativeId,jdbcType=BIGINT},
+      </if>
+      <if test="featureName != null">
+        #{featureName,jdbcType=VARCHAR},
+      </if>
+      <if test="aiWordSplit != null">
+        #{aiWordSplit,jdbcType=VARCHAR},
+      </if>
+      <if test="nlpWordSplit != null">
+        #{nlpWordSplit,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="embedding != null">
+        #{embedding,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarizeExample" resultType="java.lang.Long">
+    select count(*) from creative_video_understander_summarize
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update creative_video_understander_summarize
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.creativeVideoUnderstanderId != null">
+        creative_video_understander_id = #{record.creativeVideoUnderstanderId,jdbcType=BIGINT},
+      </if>
+      <if test="record.creativeId != null">
+        creative_id = #{record.creativeId,jdbcType=BIGINT},
+      </if>
+      <if test="record.featureName != null">
+        feature_name = #{record.featureName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.aiWordSplit != null">
+        ai_word_split = #{record.aiWordSplit,jdbcType=VARCHAR},
+      </if>
+      <if test="record.nlpWordSplit != null">
+        nlp_word_split = #{record.nlpWordSplit,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.embedding != null">
+        embedding = #{record.embedding,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExampleWithBLOBs" parameterType="map">
+    update creative_video_understander_summarize
+    set id = #{record.id,jdbcType=BIGINT},
+      creative_video_understander_id = #{record.creativeVideoUnderstanderId,jdbcType=BIGINT},
+      creative_id = #{record.creativeId,jdbcType=BIGINT},
+      feature_name = #{record.featureName,jdbcType=VARCHAR},
+      ai_word_split = #{record.aiWordSplit,jdbcType=VARCHAR},
+      nlp_word_split = #{record.nlpWordSplit,jdbcType=VARCHAR},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      embedding = #{record.embedding,jdbcType=LONGVARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update creative_video_understander_summarize
+    set id = #{record.id,jdbcType=BIGINT},
+      creative_video_understander_id = #{record.creativeVideoUnderstanderId,jdbcType=BIGINT},
+      creative_id = #{record.creativeId,jdbcType=BIGINT},
+      feature_name = #{record.featureName,jdbcType=VARCHAR},
+      ai_word_split = #{record.aiWordSplit,jdbcType=VARCHAR},
+      nlp_word_split = #{record.nlpWordSplit,jdbcType=VARCHAR},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarize">
+    update creative_video_understander_summarize
+    <set>
+      <if test="creativeVideoUnderstanderId != null">
+        creative_video_understander_id = #{creativeVideoUnderstanderId,jdbcType=BIGINT},
+      </if>
+      <if test="creativeId != null">
+        creative_id = #{creativeId,jdbcType=BIGINT},
+      </if>
+      <if test="featureName != null">
+        feature_name = #{featureName,jdbcType=VARCHAR},
+      </if>
+      <if test="aiWordSplit != null">
+        ai_word_split = #{aiWordSplit,jdbcType=VARCHAR},
+      </if>
+      <if test="nlpWordSplit != null">
+        nlp_word_split = #{nlpWordSplit,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="embedding != null">
+        embedding = #{embedding,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarize">
+    update creative_video_understander_summarize
+    set creative_video_understander_id = #{creativeVideoUnderstanderId,jdbcType=BIGINT},
+      creative_id = #{creativeId,jdbcType=BIGINT},
+      feature_name = #{featureName,jdbcType=VARCHAR},
+      ai_word_split = #{aiWordSplit,jdbcType=VARCHAR},
+      nlp_word_split = #{nlpWordSplit,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
+      embedding = #{embedding,jdbcType=LONGVARCHAR}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.featurestools.model.po.CreativeVideoSummarize">
+    update creative_video_understander_summarize
+    set creative_video_understander_id = #{creativeVideoUnderstanderId,jdbcType=BIGINT},
+      creative_id = #{creativeId,jdbcType=BIGINT},
+      feature_name = #{featureName,jdbcType=VARCHAR},
+      ai_word_split = #{aiWordSplit,jdbcType=VARCHAR},
+      nlp_word_split = #{nlpWordSplit,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 1 - 1
src/main/resources/mybatis-generator-config.xml

@@ -50,7 +50,7 @@
             <property name="enableSubPackages" value="true"/>
         </javaClientGenerator>
 
-        <table tableName="creative_video_understander" domainObjectName="CreativeVideoUnderstander" alias=""/>
+        <table tableName="creative_video_understander_summarize" domainObjectName="CreativeVideoSummarize" alias=""/>
 
     </context>
 

+ 2312 - 0
src/main/resources/stopwords_cn.txt

@@ -0,0 +1,2312 @@
+"
+#
+$
+&
+'
+(
+)
+*
++
+,
+-
+--
+.
+...
+......
+...................
+./
+.一
+.数
+.日
+/
+//
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+:
+://
+::
+;
+<
+=
+>
+?
+@
+Lex
+ZT
+ZZ
+[
+]
+_
+a's
+able
+about
+above
+according
+accordingly
+across
+actually
+after
+afterwards
+again
+against
+ain't
+all
+allow
+allows
+almost
+alone
+along
+already
+also
+although
+always
+am
+among
+amongst
+an
+and
+another
+any
+anybody
+anyhow
+anyone
+anything
+anyway
+anyways
+anywhere
+apart
+appear
+appreciate
+appropriate
+are
+aren't
+around
+as
+aside
+ask
+asking
+associated
+at
+available
+away
+awfully
+be
+became
+because
+become
+becomes
+becoming
+been
+before
+beforehand
+behind
+being
+believe
+below
+beside
+besides
+best
+better
+between
+beyond
+both
+brief
+but
+by
+c'mon
+c's
+came
+can
+can't
+cannot
+cant
+cause
+causes
+certain
+certainly
+changes
+clearly
+co
+com
+come
+comes
+concerning
+consequently
+consider
+considering
+contain
+containing
+contains
+corresponding
+could
+couldn't
+course
+currently
+definitely
+described
+despite
+did
+didn't
+different
+do
+does
+doesn't
+doing
+don't
+done
+down
+downwards
+during
+each
+edu
+eg
+eight
+either
+else
+elsewhere
+enough
+entirely
+especially
+et
+etc
+even
+ever
+every
+everybody
+everyone
+everything
+everywhere
+ex
+exactly
+example
+except
+exp
+far
+few
+fifth
+first
+five
+followed
+following
+follows
+for
+former
+formerly
+forth
+four
+from
+further
+furthermore
+get
+gets
+getting
+given
+gives
+go
+goes
+going
+gone
+got
+gotten
+greetings
+had
+hadn't
+happens
+hardly
+has
+hasn't
+have
+haven't
+having
+he
+he's
+hello
+help
+hence
+her
+here
+here's
+hereafter
+hereby
+herein
+hereupon
+hers
+herself
+hi
+him
+himself
+his
+hither
+hopefully
+how
+howbeit
+however
+i'd
+i'll
+i'm
+i've
+ie
+if
+ignored
+immediate
+in
+inasmuch
+inc
+indeed
+indicate
+indicated
+indicates
+inner
+insofar
+instead
+into
+inward
+is
+isn't
+it
+it'd
+it'll
+it's
+its
+itself
+just
+keep
+keeps
+kept
+know
+known
+knows
+last
+lately
+later
+latter
+latterly
+least
+less
+lest
+let
+let's
+like
+liked
+likely
+little
+look
+looking
+looks
+ltd
+mainly
+many
+may
+maybe
+me
+mean
+meanwhile
+merely
+might
+more
+moreover
+most
+mostly
+much
+must
+my
+myself
+name
+namely
+nd
+near
+nearly
+necessary
+need
+needs
+neither
+never
+nevertheless
+new
+next
+nine
+no
+nobody
+non
+none
+noone
+nor
+normally
+not
+nothing
+novel
+now
+nowhere
+obviously
+of
+off
+often
+oh
+ok
+okay
+old
+on
+once
+one
+ones
+only
+onto
+or
+other
+others
+otherwise
+ought
+our
+ours
+ourselves
+out
+outside
+over
+overall
+own
+particular
+particularly
+per
+perhaps
+placed
+please
+plus
+possible
+presumably
+probably
+provides
+que
+quite
+qv
+rather
+rd
+re
+really
+reasonably
+regarding
+regardless
+regards
+relatively
+respectively
+right
+said
+same
+saw
+say
+saying
+says
+second
+secondly
+see
+seeing
+seem
+seemed
+seeming
+seems
+seen
+self
+selves
+sensible
+sent
+serious
+seriously
+seven
+several
+shall
+she
+should
+shouldn't
+since
+six
+so
+some
+somebody
+somehow
+someone
+something
+sometime
+sometimes
+somewhat
+somewhere
+soon
+sorry
+specified
+specify
+specifying
+still
+sub
+such
+sup
+sure
+t's
+take
+taken
+tell
+tends
+th
+than
+thank
+thanks
+thanx
+that
+that's
+thats
+the
+their
+theirs
+them
+themselves
+then
+thence
+there
+there's
+thereafter
+thereby
+therefore
+therein
+theres
+thereupon
+these
+they
+they'd
+they'll
+they're
+they've
+think
+third
+this
+thorough
+thoroughly
+those
+though
+three
+through
+throughout
+thru
+thus
+to
+together
+too
+took
+toward
+towards
+tried
+tries
+truly
+try
+trying
+twice
+two
+un
+under
+unfortunately
+unless
+unlikely
+until
+unto
+up
+upon
+us
+use
+used
+useful
+uses
+using
+usually
+value
+various
+very
+via
+viz
+vs
+want
+wants
+was
+wasn't
+way
+we
+we'd
+we'll
+we're
+we've
+welcome
+well
+went
+were
+weren't
+what
+what's
+whatever
+when
+whence
+whenever
+where
+where's
+whereafter
+whereas
+whereby
+wherein
+whereupon
+wherever
+whether
+which
+while
+whither
+who
+who's
+whoever
+whole
+whom
+whose
+why
+will
+willing
+wish
+with
+within
+without
+won't
+wonder
+would
+wouldn't
+yes
+yet
+you
+you'd
+you'll
+you're
+you've
+your
+yours
+yourself
+yourselves
+zero
+zt
+zz
+}
+~~~~
+×××
+φ.
+—
+——
+———
+‘
+’
+’‘
+“
+”
+”,
+……
+…………………………………………………③
+′∈
+′|
+℃
+Ⅲ
+↑
+→
+∈[
+∪φ∈
+≈
+①
+②
+②c
+③
+③]
+④
+⑤
+⑥
+⑦
+⑧
+⑨
+⑩
+──
+■
+▲
+、
+。
+〉
+《
+》
+》),
+」
+『
+』
+【
+】
+〔
+〕
+〕〔
+㈧
+一
+一.
+一一
+一下
+一个
+一些
+一何
+一切
+一则
+一则通过
+一天
+一定
+一方面
+一旦
+一时
+一来
+一样
+一次
+一片
+一番
+一直
+一致
+一般
+一起
+一转眼
+一边
+一面
+万一
+三天两头
+三番两次
+三番五次
+上
+上下
+上升
+上去
+上来
+上述
+上面
+下
+下列
+下去
+下来
+下面
+不
+不一
+不下
+不久
+不了
+不亦乐乎
+不仅
+不仅仅
+不仅仅是
+不会
+不但
+不光
+不免
+不再
+不力
+不单
+不变
+不只
+不可
+不可开交
+不可抗拒
+不同
+不外
+不外乎
+不够
+不大
+不如
+不妨
+不定
+不对
+不少
+不尽
+不尽然
+不巧
+不已
+不常
+不得
+不得不
+不得了
+不得已
+不必
+不怎么
+不怕
+不惟
+不成
+不拘
+不择手段
+不敢
+不料
+不断
+不日
+不时
+不是
+不曾
+不止
+不止一次
+不比
+不消
+不满
+不然
+不然的话
+不特
+不独
+不由得
+不知不觉
+不管
+不管怎样
+不经意
+不胜
+不能
+不能不
+不至于
+不若
+不要
+不论
+不起
+不足
+不过
+不迭
+不问
+不限
+与
+与其
+与其说
+与否
+与此同时
+专门
+且
+且不说
+且说
+两者
+严格
+严重
+个
+个人
+个别
+中小
+中间
+丰富
+临
+临到
+为
+为主
+为了
+为什么
+为什麽
+为何
+为止
+为此
+为着
+主张
+主要
+举凡
+举行
+乃
+乃至
+乃至于
+么
+之
+之一
+之前
+之后
+之後
+之所以
+之类
+乌乎
+乎
+乘
+乘势
+乘机
+乘虚
+乘隙
+也
+也好
+也就是说
+也是
+也罢
+了
+了解
+争取
+二来
+二话不说
+二话没说
+于
+于是
+于是乎
+云云
+云尔
+互相
+些
+交口
+亦
+产生
+亲口
+亲手
+亲眼
+亲自
+亲身
+人
+人人
+人们
+人家
+什么
+什么样
+什麽
+今
+今后
+今天
+今年
+今後
+介于
+仍
+仍旧
+仍然
+从
+从不
+从严
+从中
+从事
+从今以后
+从优
+从古到今
+从古至今
+从头
+从宽
+从小
+从新
+从无到有
+从早到晚
+从未
+从来
+从此
+从此以后
+从而
+从轻
+从速
+从重
+他
+他人
+他们
+他是
+他的
+代替
+以
+以上
+以下
+以为
+以便
+以免
+以前
+以及
+以后
+以外
+以後
+以故
+以期
+以来
+以至
+以至于
+以致
+们
+任
+任何
+任凭
+任务
+企图
+伙同
+会
+伟大
+传说
+传闻
+似乎
+似的
+但
+但凡
+但愿
+但是
+何
+何乐而不为
+何以
+何况
+何处
+何妨
+何尝
+何必
+何时
+何止
+何苦
+何须
+余外
+作为
+你
+你们
+你是
+你的
+使
+使得
+使用
+例如
+依
+依据
+依照
+依靠
+便于
+促进
+保持
+俺
+俺们
+倍加
+倍感
+倒不如
+倒不如说
+倒是
+倘
+倘使
+倘或
+倘然
+倘若
+借
+借以
+借此
+假使
+假如
+假若
+偏偏
+做到
+偶尔
+偶而
+傥然
+像
+儿
+允许
+元/吨
+充其极
+充其量
+充分
+先不先
+先后
+先後
+先生
+光是
+全体
+全力
+全年
+全然
+全身心
+全部
+全都
+全面
+八成
+公然
+兮
+共同
+共总
+关于
+其
+其一
+其中
+其二
+其他
+其余
+其后
+其它
+其实
+其次
+具体
+具体地说
+具体来说
+具体说来
+具有
+兼之
+内
+再
+再其次
+再则
+再有
+再次
+再者
+再者说
+再说
+冒
+冲
+决不
+决定
+决非
+况且
+准备
+凑巧
+凝神
+几
+几乎
+几度
+几时
+几番
+几经
+凡
+凡是
+凭
+凭借
+出于
+出去
+出来
+出现
+分别
+分头
+分期分批
+切不可
+切切
+切勿
+切莫
+则
+则甚
+刚好
+刚巧
+刚才
+别
+别人
+别处
+别是
+别的
+别管
+别说
+到
+到了儿
+到处
+到头
+到头来
+到底
+到目前为止
+前后
+前此
+前者
+前进
+前面
+加上
+加之
+加以
+加入
+加强
+动不动
+动辄
+勃然
+匆匆
+十分
+千万千万
+单单
+单纯
+即
+即令
+即使
+即便
+即刻
+即如
+即将
+即或
+即是说
+即若
+却
+却不
+原来
+去
+又
+又及
+及
+及其
+及时
+及至
+双方
+反之
+反之亦然
+反之则
+反倒
+反倒是
+反应
+反手
+反映
+反而
+反过来
+反过来说
+取得
+取道
+受到
+变成
+另
+另一个
+另一方面
+另外
+另悉
+另方面
+另行
+只
+只当
+只怕
+只是
+只有
+只消
+只要
+只限
+叫
+叫做
+召开
+叮咚
+可
+可以
+可好
+可是
+可能
+可见
+各
+各个
+各人
+各位
+各地
+各式
+各种
+各级
+各自
+合理
+同
+同一
+同时
+同样
+后
+后来
+后者
+后面
+向
+向使
+向着
+吓
+吗
+否则
+吧
+吧哒
+吱
+呀
+呃
+呆呆地
+呕
+呗
+呜
+呜呼
+呢
+周围
+呵
+呵呵
+呸
+呼哧
+呼啦
+咋
+和
+咚
+咦
+咧
+咱
+咱们
+咳
+哇
+哈
+哈哈
+哉
+哎
+哎呀
+哎哟
+哗
+哗啦
+哟
+哦
+哩
+哪
+哪个
+哪些
+哪儿
+哪天
+哪年
+哪怕
+哪样
+哪边
+哪里
+哼
+哼唷
+唉
+唯有
+啊
+啊呀
+啊哈
+啊哟
+啐
+啥
+啦
+啪达
+啷当
+喂
+喏
+喔唷
+喽
+嗡
+嗡嗡
+嗬
+嗯
+嗳
+嘎
+嘎嘎
+嘎登
+嘘
+嘛
+嘻
+嘿
+嘿嘿
+因
+因为
+因了
+因此
+因着
+因而
+固然
+在
+在下
+在于
+地
+坚决
+坚持
+基于
+基本
+基本上
+处在
+处处
+处理
+复杂
+多
+多么
+多亏
+多多
+多多少少
+多多益善
+多少
+多年前
+多年来
+多数
+多次
+够瞧的
+大
+大不了
+大举
+大体上
+大凡
+大力
+大多
+大多数
+大大
+大家
+大张旗鼓
+大批
+大抵
+大概
+大略
+大约
+大致
+大都
+大量
+大面儿上
+失去
+奋勇
+她
+她们
+她是
+她的
+好
+好在
+好的
+好象
+如
+如上
+如上所述
+如下
+如今
+如何
+如其
+如前所述
+如同
+如常
+如是
+如期
+如果
+如次
+如此
+如此等等
+如若
+始而
+姑且
+存在
+存心
+孰料
+孰知
+宁
+宁可
+宁愿
+宁肯
+它
+它们
+它们的
+它是
+它的
+安全
+完全
+完成
+实现
+实际
+宣布
+容易
+密切
+对
+对于
+对应
+对待
+对方
+对比
+将
+将才
+将要
+将近
+小
+少数
+尔
+尔后
+尔尔
+尔等
+尚且
+尤其
+就
+就地
+就是
+就是了
+就是说
+就此
+就算
+就要
+尽
+尽可能
+尽如人意
+尽心尽力
+尽心竭力
+尽快
+尽早
+尽然
+尽管
+尽管如此
+尽量
+局外
+居然
+届时
+属于
+屡屡
+屡次
+屡次三番
+岂但
+岂止
+岂非
+川流不息
+左右
+巨大
+巩固
+差一点
+差不多
+己
+已
+已矣
+已经
+巴
+巴巴
+帮助
+常常
+常言说
+常言说得好
+常言道
+平素
+年复一年
+并
+并不
+并不是
+并且
+并排
+并无
+并没
+并没有
+并肩
+并非
+广大
+广泛
+应当
+应用
+应该
+庶乎
+庶几
+开外
+开始
+开展
+引起
+弹指之间
+强烈
+强调
+归
+归根到底
+归根结底
+归齐
+当
+当下
+当中
+当儿
+当前
+当即
+当口儿
+当地
+当场
+当头
+当庭
+当时
+当然
+当真
+当着
+形成
+彻夜
+彻底
+彼
+彼时
+彼此
+往
+往往
+待
+待到
+很
+很多
+很少
+後来
+後面
+得
+得了
+得出
+得到
+得天独厚
+得起
+心里
+必定
+必将
+必然
+必要
+必须
+快要
+忽地
+忽然
+怎
+怎么
+怎么办
+怎么样
+怎奈
+怎样
+怎麽
+急匆匆
+怪不得
+总之
+总是
+总的来看
+总的来说
+总的说来
+总结
+总而言之
+恍然
+恐怕
+恰似
+恰好
+恰如
+恰巧
+恰恰
+恰恰相反
+恰逢
+您
+您们
+您是
+惟其
+惯常
+意思
+愤然
+愿意
+慢说
+成为
+成年累月
+成心
+我
+我们
+我是
+我的
+或
+或则
+或多或少
+或是
+或曰
+或者
+或许
+战斗
+截然
+截至
+所
+所以
+所在
+所幸
+所有
+所谓
+才
+才能
+扑通
+打
+打从
+打开天窗说亮话
+扩大
+把
+抑或
+抽冷子
+拦腰
+拿
+按
+按时
+按期
+按照
+按理
+按说
+挨个
+挨家挨户
+挨次
+挨着
+挨门挨户
+挨门逐户
+换句话说
+换言之
+据
+据实
+据悉
+据我所知
+据此
+据称
+据说
+掌握
+接下来
+接着
+接著
+接连不断
+故
+故意
+故此
+故而
+敞开儿
+敢于
+敢情
+数/
+整个
+断然
+方便
+方才
+方能
+方面
+旁人
+无
+无宁
+无法
+无论
+既
+既往
+既是
+既然
+日复一日
+日渐
+日益
+日臻
+日见
+时候
+昂然
+明显
+明确
+是
+是不是
+是以
+是否
+是的
+显然
+显著
+普通
+普遍
+暗中
+暗地里
+暗自
+更为
+更加
+更进一步
+曾
+曾经
+替
+替代
+最
+最后
+最大
+最好
+最後
+最近
+最高
+有
+有些
+有关
+有利
+有力
+有及
+有所
+有效
+有时
+有点
+有的
+有的是
+有着
+有著
+望
+朝
+朝着
+末##末
+本
+本人
+本地
+本着
+本身
+权时
+来
+来不及
+来得及
+来看
+来着
+来自
+来讲
+来说
+极为
+极了
+极其
+极力
+极大
+极度
+极端
+构成
+果然
+果真
+某
+某个
+某些
+某某
+根据
+根本
+格外
+次第
+欢迎
+欤
+正值
+正在
+正如
+正巧
+正常
+正是
+此
+此中
+此后
+此地
+此处
+此外
+此时
+此次
+此间
+毋宁
+每
+每个
+每天
+每年
+每当
+每时每刻
+每每
+每逢
+比
+比及
+比如
+比如说
+比方
+比照
+比起
+比较
+毕竟
+毫不
+毫无
+毫无例外
+毫无保留地
+沙沙
+没奈何
+没有
+沿
+沿着
+注意
+深入
+清楚
+满足
+漫说
+焉
+然则
+然后
+然後
+然而
+照
+照着
+牢牢
+特别是
+特殊
+特点
+犹且
+犹自
+独自
+猛然
+猛然间
+率尔
+率然
+现代
+现在
+理应
+理当
+理该
+瑟瑟
+甚且
+甚么
+甚或
+甚而
+甚至
+甚至于
+用
+用来
+甭
+由
+由于
+由是
+由此
+由此可见
+略为
+略加
+略微
+的
+的确
+的话
+皆可
+目前
+直到
+直接
+相似
+相信
+相反
+相同
+相对
+相对而言
+相应
+相当
+相等
+省得
+看
+看上去
+看出
+看到
+看来
+看样子
+看看
+看见
+看起来
+真是
+真正
+眨眼
+着
+着呢
+矣
+矣乎
+矣哉
+知道
+砰
+确定
+碰巧
+离
+种
+积极
+移动
+究竟
+穷年累月
+突出
+突然
+立刻
+立即
+立地
+立时
+立马
+竟然
+竟而
+第
+第二
+等
+等到
+等等
+策略地
+简直
+简而言之
+简言之
+管
+类如
+精光
+紧接着
+累年
+累次
+纯粹
+纵
+纵令
+纵使
+纵然
+练习
+组成
+经
+经常
+经过
+结合
+结果
+给
+绝不
+绝对
+绝非
+绝顶
+继之
+继后
+继续
+继而
+维持
+综上所述
+缕缕
+罢了
+老是
+老老实实
+考虑
+者
+而
+而且
+而况
+而又
+而后
+而外
+而已
+而是
+而言
+而论
+联系
+联袂
+背地里
+背靠背
+能
+能否
+能够
+腾
+自
+自个儿
+自从
+自各儿
+自后
+自家
+自己
+自打
+自身
+至
+至于
+至今
+至若
+致
+般的
+良好
+若
+若夫
+若是
+若果
+若非
+范围
+莫不
+莫不然
+莫如
+莫若
+莫非
+获得
+藉以
+虽
+虽则
+虽然
+虽说
+行为
+行动
+表明
+表示
+被
+要
+要不
+要不是
+要不然
+要么
+要是
+要求
+规定
+觉得
+譬喻
+譬如
+认为
+认真
+认识
+让
+许多
+论
+论说
+设使
+设或
+设若
+诚如
+诚然
+话说
+该
+该当
+说明
+说来
+说说
+请勿
+诸
+诸位
+诸如
+谁
+谁人
+谁料
+谁知
+豁然
+贼死
+赖以
+赶
+赶快
+赶早不赶晚
+起
+起先
+起初
+起头
+起来
+起见
+起首
+趁
+趁便
+趁势
+趁早
+趁机
+趁热
+趁着
+越是
+距
+跟
+路经
+转动
+转变
+转贴
+轰然
+较
+较为
+较之
+较比
+边
+达到
+达旦
+迅速
+过
+过于
+过去
+过来
+运用
+近几年来
+近年来
+近来
+还
+还是
+还有
+还要
+这
+这一来
+这个
+这么
+这么些
+这么样
+这么点儿
+这些
+这会儿
+这儿
+这就是说
+这时
+这样
+这次
+这点
+这种
+这般
+这边
+这里
+这麽
+进入
+进去
+进来
+进步
+进而
+进行
+连
+连同
+连声
+连日
+连日来
+连袂
+连连
+迟早
+迫于
+适应
+适当
+适用
+逐步
+逐渐
+通常
+通过
+造成
+遇到
+遭到
+遵循
+遵照
+避免
+那
+那个
+那么
+那么些
+那么样
+那些
+那会儿
+那儿
+那时
+那末
+那样
+那般
+那边
+那里
+那麽
+部分
+都
+鄙人
+采取
+里面
+重大
+重新
+重要
+鉴于
+针对
+长期以来
+长此下去
+长话短说
+问题
+间或
+防止
+阿
+附近
+限制
+陡然
+除
+除了
+除却
+除去
+除外
+除开
+除此
+除此之外
+除此以外
+除此而外
+除非
+随
+随后
+随时
+随着
+随著
+隔夜
+隔日
+难得
+难怪
+难说
+难道
+难道说
+集中
+需要
+非但
+非常
+非徒
+非得
+非特
+非独
+靠
+顶多
+顷刻
+顷刻之间
+顷刻间
+顺
+顺着
+顿时
+风雨无阻
+首先
+马上
+高低
+高兴
+默然
+默默地
+!
+#
+%
+&
+'
+(
+)
+)÷(1-
+)、
+*
++
++ξ
+++
+,
+,也
+-
+-β
+--
+-[*]-
+.
+/
+0:2
+1.
+12%
+2.3%
+5:0
+:
+;
+<
+<±
+<Δ
+<λ
+<φ
+<<
+=
+=″
+=☆
+=(
+=-
+=[
+={
+>
+>λ
+?
+A
+LI
+R.L.
+ZXFITL
+[
+[①①]
+[①②]
+[①③]
+[①④]
+[①⑤]
+[①⑥]
+[①⑦]
+[①⑧]
+[①⑨]
+[①A]
+[①B]
+[①C]
+[①D]
+[①E]
+[①]
+[①a]
+[①c]
+[①d]
+[①e]
+[①f]
+[①g]
+[①h]
+[①i]
+[①o]
+[②
+[②①]
+[②②]
+[②③]
+[②④
+[②⑤]
+[②⑥]
+[②⑦]
+[②⑧]
+[②⑩]
+[②B]
+[②G]
+[②]
+[②a]
+[②b]
+[②c]
+[②d]
+[②e]
+[②f]
+[②g]
+[②h]
+[②i]
+[②j]
+[③①]
+[③⑩]
+[③F]
+[③]
+[③a]
+[③b]
+[③c]
+[③d]
+[③e]
+[③g]
+[③h]
+[④]
+[④a]
+[④b]
+[④c]
+[④d]
+[④e]
+[⑤]
+[⑤]]
+[⑤a]
+[⑤b]
+[⑤d]
+[⑤e]
+[⑤f]
+[⑥]
+[⑦]
+[⑧]
+[⑨]
+[⑩]
+[*]
+[-
+[]
+]
+]∧′=[
+][
+_
+a]
+b]
+c]
+e]
+f]
+ng昉
+{-
+}
+}>
+~
+~±
+~+

+ 47 - 1
src/test/java/com/tzld/piaoquan/featurestools/FeaturesToolsApplicationTests.java

@@ -1,13 +1,59 @@
 package com.tzld.piaoquan.featurestools;
 
+import com.tzld.piaoquan.featurestools.job.CreativeVideoUnderstandJob;
+import com.tzld.piaoquan.featurestools.job.SummarizeUnderstandingJob;
+import com.tzld.piaoquan.featurestools.service.TextEmbeddingService;
 import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.core.io.ClassPathResource;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.HashSet;
+import java.util.Set;
+
 
 @SpringBootTest
 class FeaturesToolsApplicationTests {
 
+    @Autowired
+    private CreativeVideoUnderstandJob creativeVideoUnderstandJob;
+
+    @Autowired
+    private SummarizeUnderstandingJob summarizeUnderstandingJob;
+
+    @Autowired
+    private TextEmbeddingService textEmbeddingService;
+
+    @Test
+    void contextLoads() throws InterruptedException {
+        creativeVideoUnderstandJob.videoUnderstander("");
+    }
+
     @Test
-    void contextLoads() {
+    void contextLoads1() throws InterruptedException {
+//        System.out.println(textEmbeddingService.getEmbedding("福利来了,绿树成荫,健康自然,亲切自信"));
+        summarizeUnderstandingJob.summarizeUnderstanding("");
+    }
+
+    private static final Set<String> stopwords = new HashSet<String>();
+
+    @Test
+    void cc() throws IOException {
+        // 创建 ClassPathResource 对象,指定资源文件路径
+        ClassPathResource resource = new ClassPathResource("stopwords_cn.txt");
+        // 获取文件输入流
+        BufferedReader reader = new BufferedReader(new InputStreamReader(resource.getInputStream()));
+        String line;
+        while ((line = reader.readLine()) != null) {
+            stopwords.add(line.trim());
+        }
+
+        System.out.println("stopwords = " + stopwords);
+
     }
 
 }