|
|
|
@ -1,7 +1,7 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="main-top">
|
|
|
|
<div class="main-top">
|
|
|
|
<span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span>
|
|
|
|
<span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span>
|
|
|
|
<p style="font-weight: 400; font-size: 12px; color: #e6e6e6">(给出任务清单参考,做哪些数据的统计分析)Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar sic tempor. Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus pronin sapien nunc accuan eget.</p>
|
|
|
|
<p style="font-weight: 400; font-size: 12px; color: #e2e7ee !important">(给出任务清单参考,做哪些数据的统计分析)Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar sic tempor. Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus pronin sapien nunc accuan eget.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="main-but">
|
|
|
|
<div class="main-but">
|
|
|
|
<el-button @click="knowledgeImport">
|
|
|
|
<el-button @click="knowledgeImport">
|
|
|
|
@ -21,7 +21,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="metrics">
|
|
|
|
<div class="metrics">
|
|
|
|
<el-select v-model="n_dataTableQuery.tableName" placeholder="请选择数据" style="width: 180px" @change="selectType">
|
|
|
|
<el-select v-model="n_dataTableQuery.tableName" placeholder="请选择数据" style="width: 180px" @change="selectType">
|
|
|
|
<el-option v-for="item in algorithmStore.userDataLabel" :key="item" :label="item" :value="item" />
|
|
|
|
<el-option v-for="item in algorithmStore.userDataLabel2" :key="item" :label="item" :value="item" />
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="metrics-table" style="margin-top: 10px">
|
|
|
|
<div class="metrics-table" style="margin-top: 10px">
|
|
|
|
@ -107,15 +107,15 @@
|
|
|
|
<div class="div" v-if="preProcessText.text3 == '词云生成'">
|
|
|
|
<div class="div" v-if="preProcessText.text3 == '词云生成'">
|
|
|
|
<div id="mywordcloud_positive" style="width: 50%; height: 600px"></div>
|
|
|
|
<div id="mywordcloud_positive" style="width: 50%; height: 600px"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div ref="captureElement" v-if="preProcessText.text3 == '情感倾向分析' && n_emotiveTendency == 0 ? true : g_emotionAnalysis">
|
|
|
|
<div ref="captureElement" v-if="preProcessText.text3 == '情感倾向分析' && n_emotiveTendency == 0 ? true : n_emotiveTendency">
|
|
|
|
<div class="emotion_analysis">
|
|
|
|
<div class="emotion_analysis">
|
|
|
|
<div class="emotion_analysis-ani-in-le">
|
|
|
|
<div class="emotion_analysis-ani-in-le">
|
|
|
|
<span>正向情感</span>
|
|
|
|
<span>正向情感</span>
|
|
|
|
<img src="../../../assets/images/笑脸.png" alt="" />
|
|
|
|
<img src="../../../assets/images/笑脸.png" alt="" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<el-progress style="width: 480px" :text-inside="true" :stroke-width="20" :percentage="n_emotiveTendency" :color="'#ff540a'" />
|
|
|
|
<el-progress :class="[g_emotionAnalysis == 0 ? 'negPercentage ' : '']" style="width: 480px" :text-inside="true" :stroke-width="20" :percentage="n_emotiveTendency" :color="'#ff540a'" />
|
|
|
|
<div class="emotion_analysis-ani-in-ri">
|
|
|
|
<div class="emotion_analysis-ani-in-ri">
|
|
|
|
<img src="" alt="" />
|
|
|
|
<img src="../../../assets/images/哭脸.png" alt="" />
|
|
|
|
<span>负向情感</span>
|
|
|
|
<span>负向情感</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="emotion_analysis_title">{{ g_emotionAnalysis == 0 ? "情感偏负向" : g_emotionAnalysis == 1 ? "情感偏中性" : "情感偏正向" }}</div>
|
|
|
|
<div class="emotion_analysis_title">{{ g_emotionAnalysis == 0 ? "情感偏负向" : g_emotionAnalysis == 1 ? "情感偏中性" : "情感偏正向" }}</div>
|
|
|
|
@ -162,7 +162,7 @@
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="情感倾向分析: " label-width="120px">
|
|
|
|
<el-form-item label="情感倾向分析: " label-width="120px">
|
|
|
|
<el-radio-group v-model="formInline.emotional" style="margin-left: 31px">
|
|
|
|
<el-radio-group v-model="formInline.emotional" style="margin-left: 31px" fill="red" text-color="#ffffff">
|
|
|
|
<el-radio value="1" label="正向" size="large"></el-radio>
|
|
|
|
<el-radio value="1" label="正向" size="large"></el-radio>
|
|
|
|
<el-radio value="2" label="负向" size="large"></el-radio>
|
|
|
|
<el-radio value="2" label="负向" size="large"></el-radio>
|
|
|
|
</el-radio-group>
|
|
|
|
</el-radio-group>
|
|
|
|
@ -184,7 +184,7 @@
|
|
|
|
<popModel :showModel="b_algorithmKnowledge" title="情感分析" @closePop="b_algorithmKnowledge = false">
|
|
|
|
<popModel :showModel="b_algorithmKnowledge" title="情感分析" @closePop="b_algorithmKnowledge = false">
|
|
|
|
<template v-slot:content>
|
|
|
|
<template v-slot:content>
|
|
|
|
<!-- 情感分析 -->
|
|
|
|
<!-- 情感分析 -->
|
|
|
|
<div>
|
|
|
|
<div style="color: #000000 !important">
|
|
|
|
<p style="font-weight: 700; font-size: 22px">总览</p>
|
|
|
|
<p style="font-weight: 700; font-size: 22px">总览</p>
|
|
|
|
<p>
|
|
|
|
<p>
|
|
|
|
文本分析指对文本数据进行表示 (representation),处理(processing)和建模(modeling)来获得有用的见解(insight)。
|
|
|
|
文本分析指对文本数据进行表示 (representation),处理(processing)和建模(modeling)来获得有用的见解(insight)。
|
|
|
|
@ -413,7 +413,6 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script setup>
|
|
|
|
<script setup>
|
|
|
|
import popModel from "@/views/components/popModal.vue";
|
|
|
|
import popModel from "@/views/components/popModal.vue";
|
|
|
|
|
|
|
|
|
|
|
|
import { paginate } from "@/utils/index.js";
|
|
|
|
import { paginate } from "@/utils/index.js";
|
|
|
|
import * as echarts from "echarts";
|
|
|
|
import * as echarts from "echarts";
|
|
|
|
import * as XLSX from "XLSX";
|
|
|
|
import * as XLSX from "XLSX";
|
|
|
|
@ -424,7 +423,6 @@ import * as API from "@/api/AI.js";
|
|
|
|
import * as marketingAlgorithmApi from "@/api/marketing-algorithm.js";
|
|
|
|
import * as marketingAlgorithmApi from "@/api/marketing-algorithm.js";
|
|
|
|
import html2canvas from "html2canvas";
|
|
|
|
import html2canvas from "html2canvas";
|
|
|
|
import useAlgorithmStore from "@/store/modules/algorithm.js";
|
|
|
|
import useAlgorithmStore from "@/store/modules/algorithm.js";
|
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
|
|
|
|
|
import { getUserInfo } from "@/utils/auth";
|
|
|
|
import { getUserInfo } from "@/utils/auth";
|
|
|
|
// 算法知识
|
|
|
|
// 算法知识
|
|
|
|
const b_algorithmKnowledge = ref(false);
|
|
|
|
const b_algorithmKnowledge = ref(false);
|
|
|
|
@ -434,7 +432,6 @@ const loading2 = ref(false);
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
const algorithmStore = useAlgorithmStore();
|
|
|
|
const algorithmStore = useAlgorithmStore();
|
|
|
|
const multipleTableRef = ref(null);
|
|
|
|
const multipleTableRef = ref(null);
|
|
|
|
const b_introductionOfAlgorithmKnowledge = ref(false);
|
|
|
|
|
|
|
|
const n_dataTableQuery = ref({
|
|
|
|
const n_dataTableQuery = ref({
|
|
|
|
index: 1,
|
|
|
|
index: 1,
|
|
|
|
size: 5,
|
|
|
|
size: 5,
|
|
|
|
@ -487,7 +484,6 @@ const preProcessText = ref({
|
|
|
|
const aOriginalDataOfAnalysisResults2 = ref({});
|
|
|
|
const aOriginalDataOfAnalysisResults2 = ref({});
|
|
|
|
const nOriginalWordFrequency = ref([]); //词频原始数据
|
|
|
|
const nOriginalWordFrequency = ref([]); //词频原始数据
|
|
|
|
const nOriginalWordFrequencyNum = ref(0); //词频原始数据
|
|
|
|
const nOriginalWordFrequencyNum = ref(0); //词频原始数据
|
|
|
|
const nOriginalWordFrequencySearch = ref([]); //词频原始数据
|
|
|
|
|
|
|
|
const mWordFrequency = ref({
|
|
|
|
const mWordFrequency = ref({
|
|
|
|
index: 1,
|
|
|
|
index: 1,
|
|
|
|
size: 10,
|
|
|
|
size: 10,
|
|
|
|
@ -498,10 +494,13 @@ const mWordFrequency = ref({
|
|
|
|
// 分析变量
|
|
|
|
// 分析变量
|
|
|
|
const g_analyzeTheNumberOfDataItems = ref("");
|
|
|
|
const g_analyzeTheNumberOfDataItems = ref("");
|
|
|
|
// 模型参数
|
|
|
|
// 模型参数
|
|
|
|
const g_modelParameter = ref([]);
|
|
|
|
|
|
|
|
const n_emotiveTendency = ref(0);
|
|
|
|
const n_emotiveTendency = ref(0);
|
|
|
|
const g_emotionAnalysis = ref(0);
|
|
|
|
const g_emotionAnalysis = ref(0);
|
|
|
|
|
|
|
|
|
|
|
|
const aCommentOpinion = ref([]);
|
|
|
|
const aCommentOpinion = ref([]);
|
|
|
|
|
|
|
|
// 下载状态
|
|
|
|
|
|
|
|
const downloadStatus = ref(false);
|
|
|
|
|
|
|
|
// 下载
|
|
|
|
// 预处理
|
|
|
|
// 预处理
|
|
|
|
const preProcess = (tetx) => {
|
|
|
|
const preProcess = (tetx) => {
|
|
|
|
if (g_indicatorData.value.length == 0) {
|
|
|
|
if (g_indicatorData.value.length == 0) {
|
|
|
|
@ -523,7 +522,6 @@ const preProcess = (tetx) => {
|
|
|
|
const taskSubmit = () => {
|
|
|
|
const taskSubmit = () => {
|
|
|
|
dialogVisible.value = true;
|
|
|
|
dialogVisible.value = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const tableData = ref([]);
|
|
|
|
|
|
|
|
const headerCellStyle = () => {
|
|
|
|
const headerCellStyle = () => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
backgroundColor: "#1882DE !important", // 设置表头背景颜色
|
|
|
|
backgroundColor: "#1882DE !important", // 设置表头背景颜色
|
|
|
|
@ -544,47 +542,25 @@ const submit = () => {
|
|
|
|
if (g_indicatorData.value.length == 0) return proxy.$modal.msgWarning("请选择指标");
|
|
|
|
if (g_indicatorData.value.length == 0) return proxy.$modal.msgWarning("请选择指标");
|
|
|
|
loading.value = true;
|
|
|
|
loading.value = true;
|
|
|
|
marketingAlgorithmApi.getMarketingAlgorithm({ userId: n_dataTableQuery.value.userId, tableName: n_dataTableQuery.value.tableName, fieldList: g_indicatorData.value }).then((res) => {
|
|
|
|
marketingAlgorithmApi.getMarketingAlgorithm({ userId: n_dataTableQuery.value.userId, tableName: n_dataTableQuery.value.tableName, fieldList: g_indicatorData.value }).then((res) => {
|
|
|
|
|
|
|
|
// g_analyzeTheNumberOfDataItems.value =
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
|
|
|
res.data
|
|
|
|
|
|
|
|
.map((item) => (item ? item.text : ""))
|
|
|
|
|
|
|
|
.every((item) => {
|
|
|
|
|
|
|
|
return item !== "";
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
) {
|
|
|
|
g_analyzeTheNumberOfDataItems.value = res.data.map((item) => (item ? item.text : "")).join(",");
|
|
|
|
g_analyzeTheNumberOfDataItems.value = res.data.map((item) => (item ? item.text : "")).join(",");
|
|
|
|
analysisData.value = res.data.filter((item) => item !== null);
|
|
|
|
} else {
|
|
|
|
|
|
|
|
g_analyzeTheNumberOfDataItems.value = "";
|
|
|
|
loading.value = false;
|
|
|
|
loading.value = false;
|
|
|
|
proxy.$modal.msgSuccess("分析数据成功");
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
// 选择模型
|
|
|
|
|
|
|
|
const handlemodelSelectionChange = (type) => {
|
|
|
|
|
|
|
|
g_modelParameter.value = type.map((item) => item.name);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
//计算
|
|
|
|
|
|
|
|
const modelCalculation = () => {
|
|
|
|
|
|
|
|
if (analysisData.value.length == 0 && g_modelParameter.value.length == 0) {
|
|
|
|
|
|
|
|
proxy.$modal.msgWarning("请先分析数据/未选择模型参数!");
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const processedData = processArrayData(["text"], analysisData.value);
|
|
|
|
analysisData.value = res.data.filter((item) => item !== null);
|
|
|
|
marketingAlgorithmApi.getMarketingAlgorithmPreprocessing(JSON.stringify({ map: processedData, statistic: [preProcessText.value.text3 == "词云生成" ? "词频分析" : preProcessText.value.text3], userId: n_dataTableQuery.value.userId })).then((res) => {
|
|
|
|
loading.value = false;
|
|
|
|
aOriginalDataOfAnalysisResults2.value = res.data;
|
|
|
|
proxy.$modal.msgSuccess("分析数据成功");
|
|
|
|
tableData.value = res.data.map((item) => item.statistics);
|
|
|
|
|
|
|
|
if (res.data.length > 5) {
|
|
|
|
|
|
|
|
nNumberOfAnalysisResults.value = res.data.length;
|
|
|
|
|
|
|
|
aOriginalDataOfAnalysisResults.value = res.data.map((item) => item.statistics);
|
|
|
|
|
|
|
|
tableData.value = res.data.map((item) => item.statistics).slice(0, 5);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
function processArrayData(keys, data) {
|
|
|
|
|
|
|
|
// 创建结果对象
|
|
|
|
|
|
|
|
const result = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 遍历每个键
|
|
|
|
|
|
|
|
keys.forEach((key) => {
|
|
|
|
|
|
|
|
// 为每个键创建一个数组,包含 data 数组中该键的所有值
|
|
|
|
|
|
|
|
const values = data.map((item) => item[key]);
|
|
|
|
|
|
|
|
// 将键和对应的值数组添加到结果对象中
|
|
|
|
|
|
|
|
result[key] = values;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
getIndicator();
|
|
|
|
getIndicator();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -620,35 +596,42 @@ const submitTask = () => {
|
|
|
|
const restart = () => {
|
|
|
|
const restart = () => {
|
|
|
|
// 清空
|
|
|
|
// 清空
|
|
|
|
formInline.value = {
|
|
|
|
formInline.value = {
|
|
|
|
average: "",
|
|
|
|
|
|
|
|
median: "",
|
|
|
|
|
|
|
|
mode: "",
|
|
|
|
|
|
|
|
standardDeviation: "",
|
|
|
|
|
|
|
|
variance: "",
|
|
|
|
|
|
|
|
standardError: "",
|
|
|
|
|
|
|
|
kurtosis: "",
|
|
|
|
|
|
|
|
skewness: "",
|
|
|
|
|
|
|
|
max: "",
|
|
|
|
max: "",
|
|
|
|
min: "",
|
|
|
|
frequency: "",
|
|
|
|
summation: "",
|
|
|
|
text1: "",
|
|
|
|
observations: "",
|
|
|
|
text2: "",
|
|
|
|
|
|
|
|
emotional: "",
|
|
|
|
|
|
|
|
prominent: "",
|
|
|
|
};
|
|
|
|
};
|
|
|
|
analysisData.value = [];
|
|
|
|
analysisData.value = [];
|
|
|
|
|
|
|
|
g_analyzeTheNumberOfDataItems.value = "";
|
|
|
|
analysisHanderKry.value = [];
|
|
|
|
analysisHanderKry.value = [];
|
|
|
|
tableData.value = [];
|
|
|
|
|
|
|
|
g_indicatorData.value = [];
|
|
|
|
g_indicatorData.value = [];
|
|
|
|
g_modelParameter.value = [];
|
|
|
|
preProcessText.value = {
|
|
|
|
preProcessText.value.text2 = "";
|
|
|
|
text1: "数据去重",
|
|
|
|
n_dataTableQuery.value.tableName = "用户属性表";
|
|
|
|
text2: "",
|
|
|
|
getIndicator();
|
|
|
|
text3: "",
|
|
|
|
proxy.$modal.msgSuccess("重新开始成功");
|
|
|
|
};
|
|
|
|
|
|
|
|
aOriginalDataOfAnalysisResults2.value = {};
|
|
|
|
|
|
|
|
mWordFrequency.value = {
|
|
|
|
|
|
|
|
index: 1,
|
|
|
|
|
|
|
|
size: 10,
|
|
|
|
|
|
|
|
namenum: "",
|
|
|
|
|
|
|
|
frequency: "",
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
n_emotiveTendency.value = 0;
|
|
|
|
|
|
|
|
aCommentOpinion.value = [];
|
|
|
|
|
|
|
|
nOriginalWordFrequencyNum.value = 0;
|
|
|
|
|
|
|
|
aWordFrequency.value = [];
|
|
|
|
|
|
|
|
nOriginalWordFrequency.value = [];
|
|
|
|
|
|
|
|
s_commentType.value = "";
|
|
|
|
|
|
|
|
proxy.$modal.msgSuccess("重新开始!");
|
|
|
|
multipleTableRef.value.clearSelection();
|
|
|
|
multipleTableRef.value.clearSelection();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const captureElement = ref(null);
|
|
|
|
const captureElement = ref(null);
|
|
|
|
// 下载
|
|
|
|
// 下载
|
|
|
|
const download = async () => {
|
|
|
|
const download = async () => {
|
|
|
|
// let tableData = ["内容", "频次"];
|
|
|
|
if (!downloadStatus.value) return proxy.$modal.msgWarning("请先分析数据!");
|
|
|
|
// XLSX.utils.aoa_to_sheet(tableData);
|
|
|
|
|
|
|
|
if (preProcessText.value.text3 == "情感倾向分析" || preProcessText.value.text3 == "评论观点抽取") {
|
|
|
|
if (preProcessText.value.text3 == "情感倾向分析" || preProcessText.value.text3 == "评论观点抽取") {
|
|
|
|
if (captureElement.value) {
|
|
|
|
if (captureElement.value) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
@ -703,6 +686,33 @@ const sentimentAnalysis = () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (g_analyzeTheNumberOfDataItems.value == "") return proxy.$modal.msgWarning("请先选择指标/手动输入进行情感分析!");
|
|
|
|
if (g_analyzeTheNumberOfDataItems.value == "") return proxy.$modal.msgWarning("请先选择指标/手动输入进行情感分析!");
|
|
|
|
loading.value = true;
|
|
|
|
loading.value = true;
|
|
|
|
|
|
|
|
if (preProcessText.value.text3 === "情感倾向分析") {
|
|
|
|
|
|
|
|
marketingAlgorithmApi
|
|
|
|
|
|
|
|
.getMarketingAlgorithmSentimentAnalysis(JSON.stringify({ text: g_analyzeTheNumberOfDataItems.value }))
|
|
|
|
|
|
|
|
.then((res) => {
|
|
|
|
|
|
|
|
g_emotionAnalysisinfo = res.data;
|
|
|
|
|
|
|
|
const pos = parseFloat(g_emotionAnalysisinfo.pos);
|
|
|
|
|
|
|
|
const neg = parseFloat(g_emotionAnalysisinfo.neg);
|
|
|
|
|
|
|
|
const total = pos + neg;
|
|
|
|
|
|
|
|
const posPercentage = total !== 0 ? (pos / total) * 100 : 0;
|
|
|
|
|
|
|
|
const negPercentage = total !== 0 ? (neg / total) * 100 : 0;
|
|
|
|
|
|
|
|
if (posPercentage > negPercentage) {
|
|
|
|
|
|
|
|
g_emotionAnalysis.value = 2;
|
|
|
|
|
|
|
|
n_emotiveTendency.value = posPercentage;
|
|
|
|
|
|
|
|
} else if (negPercentage > posPercentage) {
|
|
|
|
|
|
|
|
g_emotionAnalysis.value = 0;
|
|
|
|
|
|
|
|
n_emotiveTendency.value = negPercentage;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (posPercentage == negPercentage) {
|
|
|
|
|
|
|
|
g_emotionAnalysis.value = 1;
|
|
|
|
|
|
|
|
n_emotiveTendency.value = 50;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
loading.value = false;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
|
|
|
loading.value = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
marketingAlgorithmApi
|
|
|
|
marketingAlgorithmApi
|
|
|
|
.getMarketingAlgorithmSentiment({ id: s_commentType.value, userId: n_dataTableQuery.value.userId, content: g_analyzeTheNumberOfDataItems.value, modelType: preProcessText.value.text3 == "词云生成" ? "词频分析" : preProcessText.value.text3 })
|
|
|
|
.getMarketingAlgorithmSentiment({ id: s_commentType.value, userId: n_dataTableQuery.value.userId, content: g_analyzeTheNumberOfDataItems.value, modelType: preProcessText.value.text3 == "词云生成" ? "词频分析" : preProcessText.value.text3 })
|
|
|
|
.then((res) => {
|
|
|
|
.then((res) => {
|
|
|
|
@ -713,11 +723,6 @@ const sentimentAnalysis = () => {
|
|
|
|
nOriginalWordFrequency.value = res.data;
|
|
|
|
nOriginalWordFrequency.value = res.data;
|
|
|
|
aWordFrequency.value = res.data.slice(0, 5);
|
|
|
|
aWordFrequency.value = res.data.slice(0, 5);
|
|
|
|
nOriginalWordFrequencyNum.value = res.data.length;
|
|
|
|
nOriginalWordFrequencyNum.value = res.data.length;
|
|
|
|
} else if (preProcessText.value.text3 === "情感倾向分析") {
|
|
|
|
|
|
|
|
g_emotionAnalysisinfo = JSON.parse(res.data);
|
|
|
|
|
|
|
|
g_emotionAnalysis.value = JSON.parse(res.data)?.items[0]?.sentiment;
|
|
|
|
|
|
|
|
n_emotiveTendency.value = Math.round(g_emotionAnalysisinfo.items[0].positive_prob * 100);
|
|
|
|
|
|
|
|
console.log(n_emotiveTendency.value, " n_emotiveTendency.value");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
aCommentOpinion.value = JSON.parse(res.data).items.reduce((groups, item) => {
|
|
|
|
aCommentOpinion.value = JSON.parse(res.data).items.reduce((groups, item) => {
|
|
|
|
// 如果该 sentiment 的组不存在,则创建
|
|
|
|
// 如果该 sentiment 的组不存在,则创建
|
|
|
|
@ -729,15 +734,18 @@ const sentimentAnalysis = () => {
|
|
|
|
return groups;
|
|
|
|
return groups;
|
|
|
|
}, {});
|
|
|
|
}, {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
downloadStatus.value = true;
|
|
|
|
loading.value = false;
|
|
|
|
loading.value = false;
|
|
|
|
proxy.$modal.msgSuccess("分析成功");
|
|
|
|
proxy.$modal.msgSuccess("分析成功");
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
.catch((err) => {
|
|
|
|
loading.value = false;
|
|
|
|
loading.value = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// 清空
|
|
|
|
// 清空
|
|
|
|
const clear = () => {
|
|
|
|
const clear = () => {
|
|
|
|
|
|
|
|
if (!g_analyzeTheNumberOfDataItems.value) return proxy.$modal.msgWarning("请先分析数据!");
|
|
|
|
g_analyzeTheNumberOfDataItems.value = "";
|
|
|
|
g_analyzeTheNumberOfDataItems.value = "";
|
|
|
|
aWordFrequency.value = [];
|
|
|
|
aWordFrequency.value = [];
|
|
|
|
proxy.$modal.msgSuccess("清空成功");
|
|
|
|
proxy.$modal.msgSuccess("清空成功");
|
|
|
|
@ -966,6 +974,24 @@ const switchingModels = () => {
|
|
|
|
.footer {
|
|
|
|
.footer {
|
|
|
|
padding-top: 20px;
|
|
|
|
padding-top: 20px;
|
|
|
|
text-align: center;
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
.el-button {
|
|
|
|
|
|
|
|
width: 110px;
|
|
|
|
|
|
|
|
height: 31px;
|
|
|
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
|
|
// 获取焦点
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
|
|
|
|
outline: none;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.el-button:nth-child(1) {
|
|
|
|
|
|
|
|
background: url("../../../assets/images/情感分析.png") no-repeat;
|
|
|
|
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.el-button:nth-child(2) {
|
|
|
|
|
|
|
|
background: url("../../../assets/images/取消.png") no-repeat;
|
|
|
|
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.metrics,
|
|
|
|
.metrics,
|
|
|
|
@ -1055,9 +1081,17 @@ const switchingModels = () => {
|
|
|
|
font-size: 24px;
|
|
|
|
font-size: 24px;
|
|
|
|
font-weight: normal;
|
|
|
|
font-weight: normal;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.el-progress) {
|
|
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
}
|
|
|
|
:deep(.el-progress-bar__outer) {
|
|
|
|
:deep(.el-progress-bar__outer) {
|
|
|
|
background-color: #036fe2;
|
|
|
|
background-color: #036fe2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.negPercentage) {
|
|
|
|
|
|
|
|
.el-progress-bar__inner {
|
|
|
|
|
|
|
|
background-color: #036fe2 !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.comment-opinion {
|
|
|
|
.comment-opinion {
|
|
|
|
padding: 30px 20px 0px 90px !important;
|
|
|
|
padding: 30px 20px 0px 90px !important;
|
|
|
|
@ -1152,8 +1186,8 @@ const switchingModels = () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
h4,
|
|
|
|
h4,
|
|
|
|
p {
|
|
|
|
p {
|
|
|
|
color: #ffffff !important;
|
|
|
|
// color: #ffffff !important;
|
|
|
|
font-size: 14px;
|
|
|
|
// font-size: 14px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
:deep(.pagination-container .el-pagination) {
|
|
|
|
:deep(.pagination-container .el-pagination) {
|
|
|
|
// 去除定位
|
|
|
|
// 去除定位
|
|
|
|
@ -1164,4 +1198,22 @@ p {
|
|
|
|
flex-wrap: nowrap !important;
|
|
|
|
flex-wrap: nowrap !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.el-radio-group) {
|
|
|
|
|
|
|
|
// 添加颜色类
|
|
|
|
|
|
|
|
.is-checked.el-radio__label {
|
|
|
|
|
|
|
|
color: #ffffff !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.el-radio__input.is-checked .el-radio__inner {
|
|
|
|
|
|
|
|
background: #2d5c8f !important;
|
|
|
|
|
|
|
|
border-color: #2d5c8f !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.el-radio__label {
|
|
|
|
|
|
|
|
color: #ffffff !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.el-radio__input .el-radio__inner {
|
|
|
|
|
|
|
|
background: #2d5c8f !important;
|
|
|
|
|
|
|
|
border-color: #2d5c8f !important;
|
|
|
|
|
|
|
|
border-color: #6fa8de !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
|