Преглед на файлове

1、关系抽取中分词地址修改

louhr преди 5 години
родител
ревизия
424c7c3749

+ 16 - 0
push-web/src/main/java/org/diagbot/push/controller/ParticipleController.java

@@ -1,8 +1,13 @@
 package org.diagbot.push.controller;
 
+import org.diagbot.nlp.participle.ParticipleUtil;
+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.io.IOException;
 
 @Controller
 @RequestMapping("/participle")
@@ -14,4 +19,15 @@ public class ParticipleController extends BaseController {
     public String index() {
         return listView;
     }
+
+    @ResponseBody
+    @RequestMapping("/split_and_highlight")
+    public Response splitAndHighlight(String content) throws IOException {
+        Response response = new Response();
+        long start = System.currentTimeMillis();
+        response.setData(ParticipleUtil.participleAndHighlight(content));
+        long end = System.currentTimeMillis();
+        System.out.println("总耗时:........." + (end - start));
+        return response;
+    }
 }

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

@@ -343,7 +343,7 @@
                 function _ajax(url) {
                     $.support.cors = true;
                     $.ajax({
-                        url: nlp_web_url + '/participle/split_and_highlight',
+                        url: push_web_url + '/participle/split_and_highlight',
                         data: $("#participle_form").serialize(),
                         dataType: "json",
                         type: "post",