Commit 5839a104 authored by 夏敏伟's avatar 夏敏伟
parents b900e056 2efb1ca6
...@@ -12,7 +12,7 @@ export const entity = data => { ...@@ -12,7 +12,7 @@ export const entity = data => {
//热词 //热词
export const hotWord = data => { export const hotWord = data => {
return post_technique(`api_technique_hotWord/Segment`, data); return post_technique_entity(`api_technique_hotWord/general-nlp-api/keywords-api/keywords-new`, data);
} }
//总结 //总结
......
...@@ -57,37 +57,45 @@ export default { ...@@ -57,37 +57,45 @@ export default {
if (this.form.text.trim() != '') { if (this.form.text.trim() != '') {
entity({ action: "entity_extract", language: "zh", text: this.form.text.trim() }).then(res => { entity({ action: "entity_extract", language: "zh", text: this.form.text.trim() }).then(res => {
this.form.result = res.score; this.form.result = res.score;
}).catch(err=>{
this.$message.warning(err.message);
}) })
} else { } else {
alert('未识别到主体!'); this.$message.warning('识别文本不能为空');
} }
} else if (this.form.technique == 2) { } else if (this.form.technique == 2) {
if (this.form.text.trim() != '') { if (this.form.text.trim() != '') {
hotWord({ action: "entity_extract", language: "zh", text: this.form.text.trim() }).then(res => { hotWord({ keywordInstanceId: 109, topk: 10, lang: "zh", text: this.form.text.trim() }).then(res => {
this.form.result = res.score; this.form.result = res.map(e=>e.keyword).join();
}).catch(err=>{
this.$message.warning(err.message);
}) })
} else { } else {
alert('未识别到主体!'); this.$message.warning("识别文本不能为空!");
} }
} else if (this.form.technique == 3) { } else if (this.form.technique == 3) {
if (this.form.text.trim() != '') { if (this.form.text.trim() != '') {
summary({ language: "zh", text: this.form.text.trim() }).then(res => { summary({ language: "zh", text: this.form.text.trim() }).then(res => {
this.form.result = res; this.form.result = res;
}).catch(err=>{
this.$message.warning(err.message);
}) })
} else { } else {
alert('未识别到主体!'); this.$message.warning('识别文本不能为空');
} }
} else if (this.form.technique == 4) { } else if (this.form.technique == 4) {
if (this.form.text.trim() != '') { if (this.form.text.trim() != '') {
emotionNews({ data: this.form.text.trim() }).then(res => { emotionNews({ data: this.form.text.trim() }).then(res => {
this.form.result = JSON.parse(res.score); this.form.result = JSON.parse(res.score);
}).catch(err=>{
this.$message.warning(err.message);
}) })
} else { } else {
alert('未识别到主体!'); this.$message.warning('识别文本不能为空');
} }
} else { } else {
alert("敬请期待"); this.$message.success("敬请期待");
} }
} }
}, },
......
...@@ -91,7 +91,7 @@ module.exports = { ...@@ -91,7 +91,7 @@ module.exports = {
//后台代理 //后台代理
proxy: { proxy: {
'/api/': { '/api/': {
target: 'http://192.168.168.213:8081', target: 'http://192.168.168.106:8081',
ws: true, ws: true,
secure: false, secure: false,
changeOrigin: true, changeOrigin: true,
...@@ -128,6 +128,12 @@ module.exports = { ...@@ -128,6 +128,12 @@ module.exports = {
pathRewrite: { pathRewrite: {
'^/api_technique_emotion/': '/' '^/api_technique_emotion/': '/'
} }
},
'/api_technique_hotWord/': {
target: 'http://192.168.168.212:9930',
pathRewrite: {
'^/api_technique_hotWord/': '/'
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment