Commit 5839a104 authored by 夏敏伟's avatar 夏敏伟
parents b900e056 2efb1ca6
......@@ -12,7 +12,7 @@ export const entity = 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 {
if (this.form.text.trim() != '') {
entity({ action: "entity_extract", language: "zh", text: this.form.text.trim() }).then(res => {
this.form.result = res.score;
}).catch(err=>{
this.$message.warning(err.message);
})
} else {
alert('未识别到主体!');
this.$message.warning('识别文本不能为空');
}
} else if (this.form.technique == 2) {
if (this.form.text.trim() != '') {
hotWord({ action: "entity_extract", language: "zh", text: this.form.text.trim() }).then(res => {
this.form.result = res.score;
hotWord({ keywordInstanceId: 109, topk: 10, lang: "zh", text: this.form.text.trim() }).then(res => {
this.form.result = res.map(e=>e.keyword).join();
}).catch(err=>{
this.$message.warning(err.message);
})
} else {
alert('未识别到主体!');
this.$message.warning("识别文本不能为空!");
}
} else if (this.form.technique == 3) {
if (this.form.text.trim() != '') {
summary({ language: "zh", text: this.form.text.trim() }).then(res => {
this.form.result = res;
}).catch(err=>{
this.$message.warning(err.message);
})
} else {
alert('未识别到主体!');
this.$message.warning('识别文本不能为空');
}
} else if (this.form.technique == 4) {
if (this.form.text.trim() != '') {
emotionNews({ data: this.form.text.trim() }).then(res => {
this.form.result = JSON.parse(res.score);
}).catch(err=>{
this.$message.warning(err.message);
})
} else {
alert('未识别到主体!');
this.$message.warning('识别文本不能为空');
}
} else {
alert("敬请期待");
this.$message.success("敬请期待");
}
}
},
......
......@@ -91,7 +91,7 @@ module.exports = {
//后台代理
proxy: {
'/api/': {
target: 'http://192.168.168.213:8081',
target: 'http://192.168.168.106:8081',
ws: true,
secure: false,
changeOrigin: true,
......@@ -128,6 +128,12 @@ module.exports = {
pathRewrite: {
'^/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