Bläddra i källkod

1、关系抽取链接地址修改到push-web下

louhr 5 år sedan
förälder
incheckning
c823d626d6

+ 19 - 0
push-web/src/main/java/org/diagbot/push/controller/RelationController.java

@@ -1,8 +1,14 @@
 package org.diagbot.push.controller;
 
+import org.diagbot.nlp.relation.analyze.StructureAnalyze;
+import org.diagbot.nlp.relation.util.OutputInfo;
+import org.diagbot.pub.api.Response;
 import org.diagbot.pub.web.BaseController;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.List;
 
 /**
  * @ClassName org.diagbot.push.controller.RelationController
@@ -26,4 +32,17 @@ public class RelationController extends BaseController {
     public String list() {
         return "/pages/label/list.html";
     }
+
+    @RequestMapping({"/extraction"})
+    @ResponseBody
+    public Response extraction(String content) throws Exception {
+        Response response = new Response();
+        response.start();
+//        RelationAnalyze relationAnalyze = new RelationAnalyze();
+//        List<OutputInfo> outputInfos = relationAnalyze.analyze(content, FeatureType.parse("1"));
+        StructureAnalyze structureAnalyze = new StructureAnalyze();
+        List<OutputInfo> outputInfos = structureAnalyze.extract(content);
+        response.setData(outputInfos);
+        return response;
+    }
 }

+ 6 - 6
push-web/src/main/resources/static/pages/algorithm/list.html

@@ -368,15 +368,15 @@
         if (diag != '' && symptom == '') {
             $('#diag_list').html("");
             startDiag('/algorithm/page_neural', '#symptom_list', '1', resourceType, '111', '1');
-            startDiag('/algorithm/page_neural', '#vital_list', '3,2', resourceType, '131', '3');
-            startDiag('/algorithm/page_neural', '#lis_list', '4,2', resourceType, '141', '4');
-            startDiag('/algorithm/page_neural', '#pacs_list', '5,2', resourceType, '151', '5');
+            startDiag('/algorithm/page_neural', '#vital_list', '3,2,7', resourceType, '131', '3');
+            startDiag('/algorithm/page_neural', '#lis_list', '4,2,7', resourceType, '141', '4');
+            startDiag('/algorithm/page_neural', '#pacs_list', '5,2,7', resourceType, '151', '5');
 
         } else {
             startDiag('/algorithm/page_neural', '#symptom_list', '1', resourceType, '11', '1');
-            startDiag('/algorithm/page_neural', '#vital_list', '3,2', resourceType, '31', '3');
-            startDiag('/algorithm/page_neural', '#lis_list', '4,2', resourceType, '41', '4');
-            startDiag('/algorithm/page_neural', '#pacs_list', '5,2', resourceType, '51', '5');
+            startDiag('/algorithm/page_neural', '#vital_list', '3,2,7', resourceType, '31', '3');
+            startDiag('/algorithm/page_neural', '#lis_list', '4,2,7', resourceType, '41', '4');
+            startDiag('/algorithm/page_neural', '#pacs_list', '5,2,7', resourceType, '51', '5');
 
             startDiagMapping('/algorithm/page_neural', '#diag_list', '2', resourceType, '21', '2');
         }

+ 1 - 1
push-web/src/main/resources/static/pages/relation/sample.html

@@ -353,7 +353,7 @@
                     });
 
                     $.ajax({
-                        url: nlp_web_url + url,
+                        url: push_web_url + url,
                         data: $("#participle_form").serialize(),
                         dataType: "json",
                         type: "post",