diff --git a/src/vue2/public/favicon.ico b/src/vue2/public/favicon.ico new file mode 100644 index 0000000..df36fcf Binary files /dev/null and b/src/vue2/public/favicon.ico differ diff --git a/src/vue2/public/index.html b/src/vue2/public/index.html new file mode 100644 index 0000000..3e5a139 --- /dev/null +++ b/src/vue2/public/index.html @@ -0,0 +1,17 @@ + + + + + + + + <%= htmlWebpackPlugin.options.title %> + + + +
+ + + diff --git a/src/vue2/src/App.vue b/src/vue2/src/App.vue new file mode 100644 index 0000000..f8c576a --- /dev/null +++ b/src/vue2/src/App.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/src/vue2/src/api/analysis.js b/src/vue2/src/api/analysis.js new file mode 100644 index 0000000..872ff78 --- /dev/null +++ b/src/vue2/src/api/analysis.js @@ -0,0 +1,71 @@ +import request from './index' +import Mock from '../utils/mock' + +// 是否使用模拟数据 +const useMock = process.env.NODE_ENV === 'development' + +// 获取词频列表 +export function getTermFrequencies() { + if (useMock) { + return new Promise(resolve => { + setTimeout(() => { + resolve(Mock.getTermFrequencies()) + }, 800) + }) + } + + return request({ + url: '/analysis/terms', + method: 'get' + }) +} + +// 获取词的上下文 +export function getTermContexts(term) { + if (useMock) { + return new Promise(resolve => { + setTimeout(() => { + resolve(Mock.getTermContexts(term)) + }, 800) + }) + } + + return request({ + url: '/analysis/contexts', + method: 'get', + params: { term } + }) +} + +// 获取词的搭配词 +export function getTermCollocates(term) { + if (useMock) { + return new Promise(resolve => { + setTimeout(() => { + resolve(Mock.getTermCollocates(term)) + }, 800) + }) + } + + return request({ + url: '/analysis/collocates', + method: 'get', + params: { term } + }) +} + +// 获取文档段落数据 +export function getDocumentSegments() { + if (useMock) { + return new Promise(resolve => { + setTimeout(() => { + resolve(Mock.getDocumentSegments()) + }, 800) + }) + } + + return request({ + url: '/analysis/segments', + method: 'get' + }) +} \ No newline at end of file diff --git a/src/vue2/src/api/index.js b/src/vue2/src/api/index.js new file mode 100644 index 0000000..eee1246 --- /dev/null +++ b/src/vue2/src/api/index.js @@ -0,0 +1,37 @@ +import axios from 'axios' +import store from '../store' + +// 创建axios实例 +const service = axios.create({ + baseURL: process.env.VUE_APP_BASE_API || '/api', + timeout: 10000 +}) + +// 请求拦截器 +service.interceptors.request.use( + config => { + // 在发送请求前显示加载状态 + store.dispatch('app/setLoading', true) + return config + }, + error => { + store.dispatch('app/setLoading', false) + return Promise.reject(error) + } +) + +// 响应拦截器 +service.interceptors.response.use( + response => { + store.dispatch('app/setLoading', false) + return response.data + }, + error => { + store.dispatch('app/setLoading', false) + const errorMsg = error.response?.data?.message || error.message + store.dispatch('app/setError', errorMsg) + return Promise.reject(error) + } +) + +export default service \ No newline at end of file diff --git a/src/vue2/src/api/process.js b/src/vue2/src/api/process.js new file mode 100644 index 0000000..7e77a91 --- /dev/null +++ b/src/vue2/src/api/process.js @@ -0,0 +1,96 @@ +import request from './index' +import Mock from '../utils/mock' + +// 是否使用模拟数据 +const useMock = process.env.NODE_ENV === 'development' + +// 上传文件API +export function uploadFile(file) { + if (useMock) { + return new Promise(resolve => { + setTimeout(() => { + resolve(Mock.getUploadData()) + }, 1000) + }) + } + + const formData = new FormData() + formData.append('file', file) + + return request({ + url: '/upload', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }) +} + +// 预处理数据API +export function preprocessData(data) { + if (useMock) { + return new Promise(resolve => { + setTimeout(() => { + resolve(Mock.getPreprocessData()) + }, 1500) + }) + } + + return request({ + url: '/preprocess', + method: 'post', + data + }) +} + +// 合并格式API +export function mergeFormat(data) { + if (useMock) { + return new Promise(resolve => { + setTimeout(() => { + resolve(Mock.getMergeData()) + }, 1500) + }) + } + + return request({ + url: '/merge', + method: 'post', + data + }) +} + +// 单词纠错API +export function correctWords(data) { + if (useMock) { + return new Promise(resolve => { + setTimeout(() => { + resolve(Mock.getCorrectionData()) + }, 1500) + }) + } + + return request({ + url: '/correct', + method: 'post', + data + }) +} + +// 大模型分析API +export function analyzeText(data) { + if (useMock) { + return new Promise(resolve => { + setTimeout(() => { + resolve(Mock.getAnalysisData()) + }, 2000) + }) + } + + return request({ + url: '/analyze', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/vue2/src/assets/css/global.css b/src/vue2/src/assets/css/global.css new file mode 100644 index 0000000..3cfcc6d --- /dev/null +++ b/src/vue2/src/assets/css/global.css @@ -0,0 +1,34 @@ +/* 全局样式 */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +html, body, #app { + height: 100%; + width: 100%; + font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif; +} + +body { + background-image: url('../images/background.png'); + background-size: cover; + background-position: center; + background-repeat: no-repeat; + background-attachment: fixed; +} + +.container { + max-width: 1200px; + margin: 0 auto; + padding: 20px; +} + +/* 过渡动画 */ +.fade-enter-active, .fade-leave-active { + transition: opacity 0.3s; +} +.fade-enter, .fade-leave-to { + opacity: 0; +} \ No newline at end of file diff --git a/src/vue2/src/assets/images/background.png b/src/vue2/src/assets/images/background.png new file mode 100644 index 0000000..000dd09 Binary files /dev/null and b/src/vue2/src/assets/images/background.png differ diff --git a/src/vue2/src/assets/logo.png b/src/vue2/src/assets/logo.png new file mode 100644 index 0000000..f3d2503 Binary files /dev/null and b/src/vue2/src/assets/logo.png differ diff --git a/src/vue2/src/components/HelloWorld.vue b/src/vue2/src/components/HelloWorld.vue new file mode 100644 index 0000000..879051a --- /dev/null +++ b/src/vue2/src/components/HelloWorld.vue @@ -0,0 +1,58 @@ + + + + + + diff --git a/src/vue2/src/components/base/ErrorMessage.vue b/src/vue2/src/components/base/ErrorMessage.vue new file mode 100644 index 0000000..a718291 --- /dev/null +++ b/src/vue2/src/components/base/ErrorMessage.vue @@ -0,0 +1,61 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/components/base/GlobalLoading.vue b/src/vue2/src/components/base/GlobalLoading.vue new file mode 100644 index 0000000..6e33e0a --- /dev/null +++ b/src/vue2/src/components/base/GlobalLoading.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/components/layout/Header.vue b/src/vue2/src/components/layout/Header.vue new file mode 100644 index 0000000..47ec616 --- /dev/null +++ b/src/vue2/src/components/layout/Header.vue @@ -0,0 +1,63 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/components/layout/MainLayout.vue b/src/vue2/src/components/layout/MainLayout.vue new file mode 100644 index 0000000..93628bc --- /dev/null +++ b/src/vue2/src/components/layout/MainLayout.vue @@ -0,0 +1,42 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/components/process/DataPreprocess.vue b/src/vue2/src/components/process/DataPreprocess.vue new file mode 100644 index 0000000..e136f24 --- /dev/null +++ b/src/vue2/src/components/process/DataPreprocess.vue @@ -0,0 +1,627 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/components/process/DataPreprocessing.vue b/src/vue2/src/components/process/DataPreprocessing.vue new file mode 100644 index 0000000..0fb0e43 --- /dev/null +++ b/src/vue2/src/components/process/DataPreprocessing.vue @@ -0,0 +1,283 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/components/process/FileUpload.vue b/src/vue2/src/components/process/FileUpload.vue new file mode 100644 index 0000000..2026259 --- /dev/null +++ b/src/vue2/src/components/process/FileUpload.vue @@ -0,0 +1,326 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/components/process/FormatMerge.vue b/src/vue2/src/components/process/FormatMerge.vue new file mode 100644 index 0000000..f549174 --- /dev/null +++ b/src/vue2/src/components/process/FormatMerge.vue @@ -0,0 +1,618 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/components/process/MergeFormat.vue b/src/vue2/src/components/process/MergeFormat.vue new file mode 100644 index 0000000..6449f3b --- /dev/null +++ b/src/vue2/src/components/process/MergeFormat.vue @@ -0,0 +1,289 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/components/process/ModelAnalysis.vue b/src/vue2/src/components/process/ModelAnalysis.vue new file mode 100644 index 0000000..7a5c64c --- /dev/null +++ b/src/vue2/src/components/process/ModelAnalysis.vue @@ -0,0 +1,813 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/components/process/PreProcess.vue b/src/vue2/src/components/process/PreProcess.vue new file mode 100644 index 0000000..db4220c --- /dev/null +++ b/src/vue2/src/components/process/PreProcess.vue @@ -0,0 +1,243 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/components/process/ProcessPage.vue b/src/vue2/src/components/process/ProcessPage.vue new file mode 100644 index 0000000..695090f --- /dev/null +++ b/src/vue2/src/components/process/ProcessPage.vue @@ -0,0 +1,284 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/components/process/ProcessStep.vue b/src/vue2/src/components/process/ProcessStep.vue new file mode 100644 index 0000000..12e7141 --- /dev/null +++ b/src/vue2/src/components/process/ProcessStep.vue @@ -0,0 +1,225 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/components/process/WordCorrection.vue b/src/vue2/src/components/process/WordCorrection.vue new file mode 100644 index 0000000..2a41ff6 --- /dev/null +++ b/src/vue2/src/components/process/WordCorrection.vue @@ -0,0 +1,831 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/main.js b/src/vue2/src/main.js new file mode 100644 index 0000000..24d9f3a --- /dev/null +++ b/src/vue2/src/main.js @@ -0,0 +1,16 @@ +import Vue from 'vue' +import App from './App.vue' +import router from './router' +import store from './store' +import ElementUI from 'element-ui' +import 'element-ui/lib/theme-chalk/index.css' +import './assets/css/global.css' + +Vue.config.productionTip = false +Vue.use(ElementUI) + +new Vue({ + router, + store, + render: h => h(App), +}).$mount('#app') diff --git a/src/vue2/src/router/index.js b/src/vue2/src/router/index.js new file mode 100644 index 0000000..de50ef3 --- /dev/null +++ b/src/vue2/src/router/index.js @@ -0,0 +1,33 @@ +import Vue from 'vue' +import VueRouter from 'vue-router' + +Vue.use(VueRouter) + +const routes = [ + { + path: '/', + redirect: '/process' + }, + { + path: '/process', + name: 'ProcessView', + component: () => import('../views/Process.vue') + }, + { + path: '/analysis', + name: 'AnalysisView', + component: () => import('../views/Analysis.vue') + }, + { + path: '*', + redirect: '/process' + } +] + +const router = new VueRouter({ + mode: 'history', + base: process.env.BASE_URL, + routes +}) + +export default router \ No newline at end of file diff --git a/src/vue2/src/store/index.js b/src/vue2/src/store/index.js new file mode 100644 index 0000000..c2eb0da --- /dev/null +++ b/src/vue2/src/store/index.js @@ -0,0 +1,15 @@ +import Vue from 'vue' +import Vuex from 'vuex' +import app from './modules/app' +import process from './modules/process' +import analysis from './modules/analysis' + +Vue.use(Vuex) + +export default new Vuex.Store({ + modules: { + app, + process, + analysis + } +}) \ No newline at end of file diff --git a/src/vue2/src/store/modules/analysis.js b/src/vue2/src/store/modules/analysis.js new file mode 100644 index 0000000..26edba7 --- /dev/null +++ b/src/vue2/src/store/modules/analysis.js @@ -0,0 +1,84 @@ +// 分析页面相关状态模块 +const state = { + selectedTerms: [], + termFrequencies: [], + documentSegments: [], + contexts: {}, + collocates: {} +} + +const mutations = { + SET_TERM_FREQUENCIES(state, terms) { + state.termFrequencies = terms + }, + SET_SELECTED_TERMS(state, terms) { + state.selectedTerms = terms + }, + ADD_SELECTED_TERM(state, term) { + if (!state.selectedTerms.includes(term)) { + state.selectedTerms.push(term) + } + }, + REMOVE_SELECTED_TERM(state, term) { + state.selectedTerms = state.selectedTerms.filter(t => t !== term) + }, + SET_DOCUMENT_SEGMENTS(state, segments) { + state.documentSegments = segments + }, + SET_CONTEXTS(state, { term, contexts }) { + state.contexts = { ...state.contexts, [term]: contexts } + }, + SET_COLLOCATES(state, { term, collocates }) { + state.collocates = { ...state.collocates, [term]: collocates } + } +} + +const actions = { + setTermFrequencies({ commit }, terms) { + commit('SET_TERM_FREQUENCIES', terms) + }, + setSelectedTerms({ commit }, terms) { + commit('SET_SELECTED_TERMS', terms) + }, + addSelectedTerm({ commit }, term) { + commit('ADD_SELECTED_TERM', term) + }, + removeSelectedTerm({ commit }, term) { + commit('REMOVE_SELECTED_TERM', term) + }, + setDocumentSegments({ commit }, segments) { + commit('SET_DOCUMENT_SEGMENTS', segments) + }, + fetchContexts({ commit }, term) { + // 这里会有API调用,暂时模拟 + const contexts = [ + { left: '...文本', keyword: term, right: '文本...' }, + { left: '...另一段', keyword: term, right: '文本...' } + ] + commit('SET_CONTEXTS', { term, contexts }) + }, + fetchCollocates({ commit }, term) { + // 这里会有API调用,暂时模拟 + const collocates = [ + { word: '相关词1', frequency: 10 }, + { word: '相关词2', frequency: 8 } + ] + commit('SET_COLLOCATES', { term, collocates }) + } +} + +const getters = { + termFrequencies: state => state.termFrequencies, + selectedTerms: state => state.selectedTerms, + documentSegments: state => state.documentSegments, + contexts: state => term => state.contexts[term] || [], + collocates: state => term => state.collocates[term] || [] +} + +export default { + namespaced: true, + state, + mutations, + actions, + getters +} \ No newline at end of file diff --git a/src/vue2/src/store/modules/app.js b/src/vue2/src/store/modules/app.js new file mode 100644 index 0000000..d3a749e --- /dev/null +++ b/src/vue2/src/store/modules/app.js @@ -0,0 +1,39 @@ +// 全局应用状态模块 +const state = { + loading: false, + error: null +} + +const mutations = { + SET_LOADING(state, loading) { + state.loading = loading + }, + SET_ERROR(state, error) { + state.error = error + } +} + +const actions = { + setLoading({ commit }, loading) { + commit('SET_LOADING', loading) + }, + setError({ commit }, error) { + commit('SET_ERROR', error) + }, + clearError({ commit }) { + commit('SET_ERROR', null) + } +} + +const getters = { + isLoading: state => state.loading, + error: state => state.error +} + +export default { + namespaced: true, + state, + mutations, + actions, + getters +} \ No newline at end of file diff --git a/src/vue2/src/store/modules/process.js b/src/vue2/src/store/modules/process.js new file mode 100644 index 0000000..1d5dfe0 --- /dev/null +++ b/src/vue2/src/store/modules/process.js @@ -0,0 +1,107 @@ +// 处理流程相关状态模块 +const state = { + currentStep: 1, + uploadedFiles: [], + fileData: null, + preprocessResults: null, + mergeResults: null, + correctionResults: null, + analysisResults: null, + stepStatus: { + upload: 'pending', + preprocess: 'pending', + merge: 'pending', + correction: 'pending', + analysis: 'pending' + } +} + +const mutations = { + SET_CURRENT_STEP(state, step) { + state.currentStep = step + }, + SET_UPLOADED_FILES(state, files) { + state.uploadedFiles = files + }, + SET_FILE_DATA(state, data) { + state.fileData = data + }, + SET_PREPROCESS_RESULTS(state, results) { + state.preprocessResults = results + }, + SET_MERGE_RESULTS(state, results) { + state.mergeResults = results + }, + SET_CORRECTION_RESULTS(state, results) { + state.correctionResults = results + }, + SET_ANALYSIS_RESULTS(state, results) { + state.analysisResults = results + }, + UPDATE_STEP_STATUS(state, { step, status }) { + state.stepStatus[step] = status + } +} + +const actions = { + setCurrentStep({ commit }, step) { + commit('SET_CURRENT_STEP', step) + }, + uploadFiles({ commit }, files) { + commit('SET_UPLOADED_FILES', files) + commit('UPDATE_STEP_STATUS', { step: 'upload', status: 'completed' }) + }, + setFileData({ commit }, data) { + commit('SET_FILE_DATA', data) + }, + processPreprocess({ commit }, results) { + commit('SET_PREPROCESS_RESULTS', results) + commit('UPDATE_STEP_STATUS', { step: 'preprocess', status: 'completed' }) + }, + processMerge({ commit }, results) { + commit('SET_MERGE_RESULTS', results) + commit('UPDATE_STEP_STATUS', { step: 'merge', status: 'completed' }) + }, + processCorrection({ commit }, results) { + commit('SET_CORRECTION_RESULTS', results) + commit('UPDATE_STEP_STATUS', { step: 'correction', status: 'completed' }) + }, + processAnalysis({ commit }, results) { + commit('SET_ANALYSIS_RESULTS', results) + commit('UPDATE_STEP_STATUS', { step: 'analysis', status: 'completed' }) + }, + resetProcess({ commit }) { + commit('SET_CURRENT_STEP', 1) + commit('SET_UPLOADED_FILES', []) + commit('SET_FILE_DATA', null) + commit('SET_PREPROCESS_RESULTS', null) + commit('SET_MERGE_RESULTS', null) + commit('SET_CORRECTION_RESULTS', null) + commit('SET_ANALYSIS_RESULTS', null) + + const steps = ['upload', 'preprocess', 'merge', 'correction', 'analysis'] + steps.forEach(step => { + commit('UPDATE_STEP_STATUS', { step, status: 'pending' }) + }) + } +} + +const getters = { + currentStep: state => state.currentStep, + uploadedFiles: state => state.uploadedFiles, + fileData: state => state.fileData, + preprocessResults: state => state.preprocessResults, + mergeResults: state => state.mergeResults, + correctionResults: state => state.correctionResults, + analysisResults: state => state.analysisResults, + stepStatus: state => state.stepStatus, + isStepCompleted: state => step => state.stepStatus[step] === 'completed' +} + +export default { + namespaced: true, + state, + mutations, + actions, + getters +} \ No newline at end of file diff --git a/src/vue2/src/utils/mock.js b/src/vue2/src/utils/mock.js new file mode 100644 index 0000000..7bcc2ab --- /dev/null +++ b/src/vue2/src/utils/mock.js @@ -0,0 +1,176 @@ +// 模拟数据生成工具 + +// 文件上传模拟数据 +export function getUploadData() { + return { + success: true, + data: { + fileName: 'sample.xlsx', + rows: 150, + columns: 5, + preview: [ + { id: 1, content: '示例内容1', date: '2023-05-10', source: '来源A', type: '类型1' }, + { id: 2, content: '示例内容2', date: '2023-05-11', source: '来源B', type: '类型2' }, + { id: 3, content: '示例内容3', date: '2023-05-12', source: '来源A', type: '类型1' } + ] + } + } +} + +// 预处理模拟数据 +export function getPreprocessData() { + return { + success: true, + data: { + processed: 150, + invalidRows: 2, + normalizedFields: ['date', 'content'], + preview: [ + { id: 1, content: '规范化后的内容1', date: '2023-05-10', source: '来源A', type: '类型1' }, + { id: 2, content: '规范化后的内容2', date: '2023-05-11', source: '来源B', type: '类型2' }, + { id: 3, content: '规范化后的内容3', date: '2023-05-12', source: '来源A', type: '类型1' } + ] + } + } +} + +// 合并格式模拟数据 +export function getMergeData() { + return { + success: true, + data: { + merged: 148, + format: 'standardized', + preview: [ + { id: 1, content: '合并格式后的内容1', date: '2023-05-10', source: '来源A', type: '类型1' }, + { id: 2, content: '合并格式后的内容2', date: '2023-05-11', source: '来源B', type: '类型2' }, + { id: 3, content: '合并格式后的内容3', date: '2023-05-12', source: '来源A', type: '类型1' } + ] + } + } +} + +// 纠错模拟数据 +export function getCorrectionData() { + return { + success: true, + data: { + corrected: 148, + corrections: 25, + preview: [ + { id: 1, content: '纠错后的内容1', date: '2023-05-10', source: '来源A', type: '类型1' }, + { id: 2, content: '纠错后的内容2', date: '2023-05-11', source: '来源B', type: '类型2' }, + { id: 3, content: '纠错后的内容3', date: '2023-05-12', source: '来源A', type: '类型1' } + ] + } + } +} + +// 分析模拟数据 +export function getAnalysisData() { + return { + success: true, + data: { + termFrequencies: getTermFrequencies().data, + documentSegments: getDocumentSegments().data, + summary: { + totalWords: 12568, + uniqueWords: 3452, + averageSentenceLength: 15.7, + documentCount: 148 + } + } + } +} + +// 词频列表模拟数据 +export function getTermFrequencies() { + return { + success: true, + data: [ + { term: '数据', frequency: 189, rank: 1 }, + { term: '分析', frequency: 156, rank: 2 }, + { term: '模型', frequency: 143, rank: 3 }, + { term: '学习', frequency: 122, rank: 4 }, + { term: '算法', frequency: 118, rank: 5 }, + { term: '机器', frequency: 105, rank: 6 }, + { term: '深度', frequency: 92, rank: 7 }, + { term: '训练', frequency: 87, rank: 8 }, + { term: '人工智能', frequency: 76, rank: 9 }, + { term: '神经网络', frequency: 65, rank: 10 }, + { term: '预测', frequency: 58, rank: 11 }, + { term: '精度', frequency: 51, rank: 12 }, + { term: '特征', frequency: 45, rank: 13 }, + { term: '计算', frequency: 40, rank: 14 }, + { term: '优化', frequency: 35, rank: 15 } + ] + } +} + +// 上下文模拟数据 +export function getTermContexts(term) { + return { + success: true, + data: [ + { left: '使用各种', keyword: term, right: '方法处理大规模数据集' }, + { left: '通过深度学习改进', keyword: term, right: '结果的准确性和可靠性' }, + { left: '传统的统计学习方法在某些', keyword: term, right: '任务中仍然表现良好' }, + { left: '研究表明,增加训练数据可以提高', keyword: term, right: '模型的泛化能力' }, + { left: '在数据处理过程中,', keyword: term, right: '步骤起到了关键作用' } + ] + } +} + +// 搭配词模拟数据 +export function getTermCollocates(term) { + // 根据不同的term返回不同的搭配词 + const baseData = [ + { word: '深度', frequency: 23, score: 0.85 }, + { word: '机器', frequency: 19, score: 0.82 }, + { word: '数据', frequency: 18, score: 0.78 }, + { word: '模型', frequency: 17, score: 0.75 }, + { word: '算法', frequency: 15, score: 0.72 }, + { word: '训练', frequency: 12, score: 0.68 }, + { word: '优化', frequency: 10, score: 0.65 }, + { word: '预测', frequency: 9, score: 0.62 }, + { word: '特征', frequency: 8, score: 0.58 }, + { word: '精度', frequency: 7, score: 0.55 } + ] + + // 在数据中添加关联到term的信息 + const result = baseData.map(item => ({ + ...item, + relatedTo: term // 使用term参数 + })) + + return { + success: true, + data: result + } +} + +// 文档段落模拟数据 +export function getDocumentSegments() { + return { + success: true, + data: [ + { id: 1, name: '段落1', wordCount: 850 }, + { id: 2, name: '段落2', wordCount: 920 }, + { id: 3, name: '段落3', wordCount: 780 }, + { id: 4, name: '段落4', wordCount: 860 }, + { id: 5, name: '段落5', wordCount: 910 } + ] + } +} + +export default { + getUploadData, + getPreprocessData, + getMergeData, + getCorrectionData, + getAnalysisData, + getTermFrequencies, + getTermContexts, + getTermCollocates, + getDocumentSegments +} \ No newline at end of file diff --git a/src/vue2/src/views/Analysis.vue b/src/vue2/src/views/Analysis.vue new file mode 100644 index 0000000..419bbfb --- /dev/null +++ b/src/vue2/src/views/Analysis.vue @@ -0,0 +1,197 @@ + + + + + \ No newline at end of file diff --git a/src/vue2/src/views/Process.vue b/src/vue2/src/views/Process.vue new file mode 100644 index 0000000..d3ca714 --- /dev/null +++ b/src/vue2/src/views/Process.vue @@ -0,0 +1,130 @@ + + + + + \ No newline at end of file