瀏覽代碼

20241127 语义检索

lwhhszx 10 月之前
父節點
當前提交
5eae01ac83

+ 2 - 1
src/main/java/cn/cslg/pas/service/business/CommonService.java

@@ -43,7 +43,8 @@ public class CommonService {
             //获取 applicationHome 内的路径 ...\target\classes 到这一层级下
             File fileTem = ah.getSource();
             //获取 file的parentFile 即最后一级之前的所有层级路径(包括盘符) 这里能获得到的最终层级为  ...\target 后续用FILE_SEPARATOR(系统路径分割通配符 即 "\") 以及fileName拼接生成存放文件的目录层级 即为根目录 root
-            String rootPath = fileTem.getParentFile().toString() + FileUtils.FILE_SEPARATOR+"jsons/";
+           // String rootPath = fileTem.getParentFile().toString() + FileUtils.FILE_SEPARATOR+"jsons/";
+            String rootPath =  "D:/PAS/target/"+"jsons/";
 //            String filePath = fileUtils.getPath("/11.docx");
             File file = new File(rootPath + fileName);
             Reader reader = new InputStreamReader(new FileInputStream(file), "utf-8");

文件差異過大導致無法顯示
+ 0 - 1
src/main/java/cn/cslg/pas/service/business/PatentService.java


+ 1 - 1
src/main/java/cn/cslg/pas/service/business/es/EsService.java

@@ -142,7 +142,7 @@ public class EsService {
      * @return
      */
     public PatentDTO esSearch(QueryRequest queryRequest) throws Exception {
-        this.judgeQueryPatentRoot(queryRequest);
+        //this.judgeQueryPatentRoot(queryRequest);
         PatentDTO dto = new PatentDTO();
         Integer taskId = queryRequest.getTaskId();
         String searchCondition = "";

+ 12 - 1
src/test/java/cn/cslg/pas/getSimilarTest.java

@@ -70,10 +70,17 @@ public class getSimilarTest {
        List<Float> floatList =pythonApiService.getStrVector(getVectorVO);
        System.out.println(floatList);
     }
+
+
+    public List<String> getSpiltList(String text, String split) throws Exception {
+        String[] a = text.split(split);
+        List<String> list = Arrays.asList(a);
+        return list;
+    }
     @Test
     public void testSimilar() throws Exception {
 
-        String path = "E:\\test\\keywordTest4000条bg.xls";
+        String path = "E:\\test\\keywordTest4000条xs.xls";
         File tempFile = new File(path);
 
         Sheet sheet = ReadExcelUtils.readExcel(tempFile);
@@ -83,6 +90,10 @@ public class getSimilarTest {
             Row needRow = sheet.getRow(i);
             String value = needRow.getCell(0).getStringCellValue();
             StringRequest stringRequest =new StringRequest();
+            stringRequest.setSize(100l);
+            stringRequest.setCurrent(1l);
+            stringRequest.setProjectId(470);
+            stringRequest.setSemanteme(value);
             PatentDTO patentDTO= esService.esSearch(stringRequest);
           List<PatentColumnDTO> columnDTOS= patentDTO.getPatents();
             String targetNoStr = needRow.getCell(1).getStringCellValue();