diff --git a/.gitignore b/.gitignore index a547bf3..2ad6abc 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ dist-ssr *.njsproj *.sln *.sw? + +# rag core +rag_web_core diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..cbffb25 --- /dev/null +++ b/.npmrc @@ -0,0 +1,7 @@ + +engine-strict=true +# 将 npm 源设置为淘宝镜像 +registry=https://registry.npmmirror.com/ +# 为 Yarn 和 pnpm 设置相同的镜像源(确保一致性) +ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ +ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js index b19330b..e48fff1 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -6,7 +6,7 @@ import tseslint from 'typescript-eslint' import { defineConfig, globalIgnores } from 'eslint/config' export default defineConfig([ - globalIgnores(['dist']), + globalIgnores(['dist', 'rag_web_core']), { files: ['**/*.{ts,tsx}'], extends: [ @@ -19,5 +19,6 @@ export default defineConfig([ ecmaVersion: 2020, globals: globals.browser, }, + ignores: ['rag_web_core/**'], }, ]) diff --git a/index.html b/index.html index 1fa6aab..e7f4571 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ -
Metadata is in JSON format (not searchable). If any chunk of this document is included in the prompt, it will be added to the LLM's prompt.
+Example:
+Metadata is:
+{
+ "Author": "Alex Dowson",
+ "Date": "2024-11-12"
+}
+Document: the_name_of_document
+Author: Alex Dowson
+Date: 2024-11-12
+Related segments are as follows:
+Deleting the generated {{type}} results + will remove all derived entities and relationships from this dataset. + Your original files will remain unchanged.
+
+ Do you want to continue?
+ `,
+ extractRaptor: 'Extract Raptor from documents',
+ extractKnowledgeGraph: 'Extract knowledge graph from documents',
+ filterPlaceholder: 'Please input',
+ fileFilterTip: '',
+ fileFilter: 'Regex matching expression',
+ setDefaultTip: '',
+ setDefault: 'Set default',
+ eidtLinkDataPipeline: 'Edit data pipeline',
+ linkPipelineSetTip: 'Manage data pipeline links with this dataset',
+ default: 'Default',
+ dataPipeline: 'Data pipeline',
+ linkDataPipeline: 'Link data pipeline',
+ enableAutoGenerate: 'Enable auto generate',
+ teamPlaceholder: 'Please select team',
+ dataFlowPlaceholder: 'Please select data flow',
+ buildItFromScratch: 'Build it from scratch',
+ dataFlow: 'Data flow',
+ parseType: 'Chunk method',
+ manualSetup: 'Manual setup',
+ builtIn: 'Built-in',
+ titleDescription: 'Update your knowledge base details here, especially the chunk method.',
+ name: 'Knowledge base name',
+ photo: 'Knowledge base photo',
+ photoTip: 'You can upload files up to 4MB',
+ description: 'Description',
+ language: 'Document language',
+ languageMessage: 'Please input language',
+ languagePlaceholder: 'Please input language',
+ permissions: 'Permissions',
+ embeddingModel: 'Embedding model',
+ chunkTokenNumber: 'Suggested chunk size',
+ chunkTokenNumberMessage: 'Chunk token number is required',
+ embeddingModelTip:
+ 'The default embedding model used by the knowledge base. Once text chunks have been generated in the knowledge base, you will not be able to change the default embedding model unless you delete all text chunks in the knowledge base.',
+ permissionsTip:
+ 'If the knowledge base permission is set to "Team", all team members can operate the knowledge base.',
+ chunkTokenNumberTip:
+ 'The recommended token number threshold for generating text chunks. If the token number of the small text segment obtained by segmentation does not reach this threshold, it will continue to merge with subsequent text segments until merging the next text segment will exceed this threshold, and then a final text chunk will be generated. If the system never encounters a text segmentation delimiter when segmenting text segments, even if the token number of the text segment has exceeded this threshold, the system will not generate new text chunks.',
+ chunkMethod: 'Chunk method',
+ chunkMethodTip: 'The description is on the right.',
+ upload: 'Upload',
+ english: 'English',
+ chinese: 'Chinese',
+ embeddingModelPlaceholder: 'Please select embedding model',
+ chunkMethodPlaceholder: 'Please select chunk method',
+ save: 'Save',
+ me: 'Only me',
+ team: 'Team',
+ cancel: 'Cancel',
+ methodTitle: 'Chunk method description',
+ methodExamples: 'Examples',
+ methodExamplesDescription:
+ 'To help you understand better, we provide relevant screenshots for your reference.',
+ dialogueExamplesTitle: 'Dialogue examples',
+ methodEmpty: 'This will show a visual explanation of the knowledge base category',
+ book: `
Supported file formats are DOCX, PDF, TXT.
+ Since a book is very long, not all parts are useful. If it is a PDF, + please set page ranges for each book to eliminate negative effects and save analysis computing time.
`, + laws: `Supported file formats are DOCX, PDF, TXT.
+ Legal documents have very strict writing formats. We use text features to detect split points. +
+ The granularity of chunks is consistent with 'ARTICLE', and all upper-level text will be included in the chunk. +
`, + manual: `Only PDF is supported.
+ We assume that the manual has a hierarchical section structure. We use the lowest section title as the pivot for slicing the document. + Therefore, figures and tables in the same section will not be split, and the chunk size may be large. +
`, + naive: `Supported file formats are MD, MDX, DOCX, XLSX, XLS (Excel 97-2003), PPT, PDF, TXT, JPEG, JPG, PNG, TIF, GIF, CSV, JSON, EML, HTML.
+This method applies a simple approach to chunk files:
++
Only PDF files are supported.
+ If our model works well, the paper will be sliced by its sections, such as Abstract, 1.1, 1.2, etc.
+ The advantage of this is that the LLM can better summarize the content of relevant sections in the paper, + produce more comprehensive answers, and help readers better understand the paper. + The disadvantage is that it increases the context of LLM conversations and increases computational costs, + so during the conversation, you can consider reducing the 'topN' setting.
`, + presentation: `Supported file formats are PDF, PPTX.
+ Each page will be treated as a chunk. And thumbnails of each page will be stored.
+ All PPT files you upload will be automatically chunked using this method, without the need to set it for each PPT file.
`, + qa: `+ This chunk method supports excel and csv/txt file formats. +
++ + Text lines that fail to follow the above rules will be ignored, and + each Q&A pair will be considered a unique chunk. + +
`, + resume: `Supported file formats are DOCX, PDF, TXT. +
+ Resumes come in various formats, just like a person's personality, but we often have to organize them into structured data for easy searching. +
+ Instead of chunking resumes, we parse resumes into structured data. As an HR, you can throw away all resumes, + and you only need to talk to 'RAGFlow' to list all qualified candidates. +
+ `, + table: `Supports XLSX and CSV/TXT format files.
+ Here are some tips: +
+ Here are some examples of headers:
Supports image files. Video coming soon.
+ If there is text in the image, OCR is applied to extract the text as its text description. +
+ If the text extracted by OCR is not enough, you can use visual LLM to get the description. +
`, + one: ` +Supported file formats are MD, MDX, DOCX, XLSX, XLS (Excel 97-2003), PPT, PDF, TXT, JPEG, JPG, PNG, TIF, GIF, CSV, JSON, EML, HTML.
+This method treats the entire document as one chunk.
`, + email: `Supported file formats are EML.
+ Each email will be treated as a chunk. +
`, + knowledgeGraph: `Supported file formats are MD, MDX, DOCX, XLSX, XLS (Excel 97-2003), PPT, PDF, TXT, JPEG, JPG, PNG, TIF, GIF, CSV, JSON, EML, HTML.
+This method will extract entities and relationships from documents and store them in a knowledge graph.
`, + }, + dashboard: { + title: 'Dashboard', + knowledgeBaseStatus: 'Knowledge Base Status', + documents: 'Documents', + sources: 'Sources', + vectors: 'Vectors', + recentActivity: 'Recent Activity', + noActivity: 'No activity', + systemHealth: 'System Health', + healthy: 'Healthy', + warning: 'Warning', + error: 'Error', + }, + time: { + justNow: 'Just now', + minutesAgo: '{{count}} minutes ago', + hoursAgo: '{{count}} hours ago', + daysAgo: '{{count}} days ago', + weeksAgo: '{{count}} weeks ago', + monthsAgo: '{{count}} months ago', + yearsAgo: '{{count}} years ago', + }, + }, +}; \ No newline at end of file diff --git a/src/locales/index.ts b/src/locales/index.ts new file mode 100644 index 0000000..3cfcce7 --- /dev/null +++ b/src/locales/index.ts @@ -0,0 +1,54 @@ +import i18n from 'i18next'; +import LanguageDetector from 'i18next-browser-languagedetector'; +import { initReactI18next } from 'react-i18next'; +import dayjs from 'dayjs'; +import 'dayjs/locale/zh-cn'; +import 'dayjs/locale/en'; + +import en from './en'; +import zh from './zh'; + +export const LanguageAbbreviation = Object.freeze({ + En: 'en', + Zh: 'zh', +}) + +const resources = { + [LanguageAbbreviation.En]: en, + [LanguageAbbreviation.Zh]: zh, +}; + +// 语言变更时同步更新 dayjs 语言 +const updateDayjsLocale = (lng: string) => { + if (lng === LanguageAbbreviation.Zh) { + dayjs.locale('zh-cn'); + } else { + dayjs.locale('en'); + } +}; + +i18n + .use(initReactI18next) + .use(LanguageDetector) + .init({ + detection: { + lookupLocalStorage: 'lng', + order: ['localStorage', 'navigator', 'htmlTag'], + caches: ['localStorage'], + }, + supportedLngs: Object.values(LanguageAbbreviation), + resources, + fallbackLng: LanguageAbbreviation.En, + defaultNS: 'translation', + interpolation: { + escapeValue: false, + }, + }); + +// 监听语言变更 +i18n.on('languageChanged', updateDayjsLocale); + +// 初始化时设置 dayjs 语言 +updateDayjsLocale(i18n.language); + +export default i18n; \ No newline at end of file diff --git a/src/locales/zh.ts b/src/locales/zh.ts new file mode 100644 index 0000000..5e7ef46 --- /dev/null +++ b/src/locales/zh.ts @@ -0,0 +1,426 @@ +export default { + translation: { + common: { + noResults: '无结果。', + selectPlaceholder: '请选择', + selectAll: '全选', + delete: '删除', + deleteModalTitle: '确定删除吗?', + ok: '是', + cancel: '否', + total: '总共', + rename: '重命名', + name: '名称', + save: '保存', + namePlaceholder: '请输入名称', + next: '下一步', + create: '创建', + edit: '编辑', + upload: '上传', + english: '英文', + portugueseBr: '葡萄牙语 (巴西)', + chinese: '简体中文', + traditionalChinese: '繁体中文', + language: '语言', + languageMessage: '请输入语言', + languagePlaceholder: '请选择语言', + copy: '复制', + copied: '复制成功', + comingSoon: '即将推出', + download: '下载', + close: '关闭', + preview: '预览', + move: '移动', + warn: '提醒', + action: '操作', + s: '秒', + pleaseSelect: '请选择', + pleaseInput: '请输入', + submit: '提交', + clear: '清空', + embedIntoSite: '嵌入网站', + previousPage: '上一页', + nextPage: '下一页', + add: '添加', + remove: '移除', + search: '搜索', + noDataFound: '没有找到数据。', + noData: '暂无数据', + promptPlaceholder: '请输入或使用 / 快速插入变量。', + }, + login: { + login: '登录', + signUp: '注册', + loginDescription: '很高兴再次见到您!', + registerDescription: '很高兴您加入!', + emailLabel: '邮箱', + emailPlaceholder: '请输入邮箱地址', + passwordLabel: '密码', + passwordPlaceholder: '请输入密码', + rememberMe: '记住我', + signInTip: '没有帐户?', + signUpTip: '已经有帐户?', + nicknameLabel: '名称', + nicknamePlaceholder: '请输入名称', + register: '创建账户', + continue: '继续', + title: '开始构建您的智能助手', + description: + '免费注册以探索顶级 RAG 技术。 创建知识库和人工智能来增强您的业务', + review: '来自 500 多条评论', + }, + header: { + knowledgeBase: '知识库', + chat: '聊天', + register: '注册', + signin: '登录', + home: '首页', + setting: '用户设置', + logout: '登出', + fileManager: '文件管理', + flow: '智能体', + search: '搜索', + welcome: '欢迎来到', + dataset: '知识库', + }, + knowledgeList: { + welcome: '欢迎回来', + description: '今天我们要使用哪个知识库?', + createKnowledgeBase: '创建知识库', + name: '名称', + namePlaceholder: '请输入名称', + doc: '文档', + searchKnowledgePlaceholder: '搜索', + noMoreData: '没有更多数据了', + }, + knowledgeDetails: { + fileSize: '文件大小', + fileType: '文件类型', + uploadedBy: '创建者', + notGenerated: '未生成', + generatedOn: '生成于', + subbarFiles: '文件列表', + generate: '生成', + raptor: 'Raptor', + processingType: '处理类型', + dataPipeline: '数据管道', + operations: '操作', + taskId: '任务ID', + duration: '耗时', + details: '详情', + status: '状态', + task: '任务', + startDate: '开始时间', + source: '来源', + fileName: '文件名', + datasetLogs: '数据集日志', + fileLogs: '文件日志', + overview: '概览', + success: '成功', + failed: '失败', + completed: '已完成', + datasetLog: '知识库日志', + created: '创建于', + learnMore: '了解更多', + general: '通用', + chunkMethodTab: '切片方法', + testResults: '测试结果', + testSetting: '测试设置', + retrievalTesting: '知识检索测试', + retrievalTestingDescription: + '进行检索测试,检查 RAGFlow 是否能够为大语言模型(LLM)恢复预期的内容。', + Parse: '解析', + dataset: '知识库', + testing: '检索测试', + configuration: '配置', + knowledgeGraph: '知识图谱', + files: '个文件', + name: '名称', + namePlaceholder: '请输入名称', + doc: '文档', + datasetDescription: '解析成功后才能问答哦。', + addFile: '新增文件', + searchFiles: '搜索文件', + localFiles: '本地文件', + emptyFiles: '新建空文件', + webCrawl: '网页抓取', + chunkNumber: '分块数', + uploadDate: '上传日期', + chunkMethod: '切片方法', + enabled: '启用', + disabled: '禁用', + action: '动作', + parsingStatus: '解析状态', + parsingStatusTip: + '文本解析的时间取决于诸多因素。如果开启了知识图谱、RAPTOR、自动问题提取、自动关键词提取等功能,时间会更长。如果解析进度条长时间不更新,也可以参考这两条 FAQ:https://ragflow.io/docs/dev/faq#why-does-my-document-parsing-stall-at-under-one-percent。', + processBeginAt: '开始于', + processDuration: '持续时间', + progressMsg: '进度', + noTestResultsForRuned: '未找到相关结果,请尝试调整查询语句或参数', + noTestResultsForNotRuned: '尚未运行测试,结果会显示在这里', + testingDescription: + '请完成召回测试:确保你的配置可以从数据库召回正确的文本块。如果你调整了这里的默认设置,比如关键词相似度权重,请注意这里的改动不会被自动保存。请务必在聊天助手设置或者召回算子设置处同步更新相关设置。', + similarityThreshold: '相似度阈值', + similarityThresholdTip: + '我们使用混合相似度得分来评估两行文本之间的距离。 它是加权关键词相似度和向量余弦相似度。 如果查询和块之间的相似度小于此阈值,则该块将被过滤掉。默认设置为 0.2,也就是说文本块的混合相似度得分至少 20 才会被召回。', + vectorSimilarityWeight: '向量相似度权重', + vectorSimilarityWeightTip: + '我们使用混合相似性评分来评估两行文本之间的距离。它是加权关键字相似性和矢量余弦相似性或rerank得分(0〜1)。两个权重的总和为1.0。', + keywordSimilarityWeight: '关键词相似度权重', + keywordSimilarityWeightTip: + '我们使用混合相似性评分来评估两行文本之间的距离。它是加权关键字相似性和矢量余弦相似性或rerank得分(0〜1)。两个权重的总和为1.0。', + testText: '测试文本', + testTextPlaceholder: '请输入您的问题!', + testingLabel: '测试', + similarity: '混合相似度', + termSimilarity: '关键词相似度', + vectorSimilarity: '向量相似度', + hits: '命中数', + view: '看法', + filesSelected: '选定的文件', + upload: '上传', + run: '解析', + runningStatus0: '未解析', + runningStatus1: '解析中', + runningStatus2: '取消', + runningStatus3: '成功', + runningStatus4: '失败', + pageRanges: '页码范围', + pageRangesTip: + '页码范围:定义需要解析的页面范围。 不包含在这些范围内的页面将被忽略。', + fromPlaceholder: '从', + fromMessage: '缺少起始页码', + toPlaceholder: '到', + toMessage: '缺少结束页码(不包含)', + layoutRecognize: 'PDF解析器', + layoutRecognizeTip: + '使用视觉模型进行 PDF 布局分析,以更好地识别文档结构,找到标题、文本块、图像和表格的位置。 如果选择 Naive 选项,则只能获取 PDF 的纯文本。请注意该功能只适用于 PDF 文档,对其他文档不生效。欲了解更多信息,请参阅 https://ragflow.io/docs/dev/select_pdf_parser。', + taskPageSize: '任务页面大小', + taskPageSizeMessage: '请输入您的任务页面大小!', + taskPageSizeTip: `如果使用布局识别,PDF 文件将被分成连续的组。 布局分析将在组之间并行执行,以提高处理速度。 "任务页面大小"决定组的大小。 页面大小越大,将页面之间的连续文本分割成不同块的机会就越低。`, + addPage: '新增页面', + greaterThan: '当前值必须大于起始值!', + greaterThanPrevious: '当前值必须大于之前的值!', + selectFiles: '选择文件', + changeSpecificCategory: '更改特定类别', + uploadTitle: '点击或拖拽文件至此区域即可上传', + uploadDescription: + '支持单次或批量上传。本地部署的单次上传文件总大小上限为 1GB,单次批量上传文件数不超过 32,单个账户不限文件数量。对于 demo.ragflow.io:每次上传的总文件大小限制为 10MB,每个文件不得超过 10MB,每个账户最多可上传 128 个文件。严禁上传违禁文件。', + chunk: '解析块', + bulk: '批量', + cancel: '取消', + close: '关闭', + rerankModel: 'Rerank模型', + rerankPlaceholder: '请选择', + rerankTip: `非必选项:若不选择 rerank 模型,系统将默认采用关键词相似度与向量余弦相似度相结合的混合查询方式;如果设置了 rerank 模型,则混合查询中的向量相似度部分将被 rerank 打分替代。请注意:采用 rerank 模型会非常耗时。如需选用 rerank 模型,建议使用 SaaS 的 rerank 模型服务;如果你倾向使用本地部署的 rerank 模型,请务必确保你使用 docker-compose-gpu.yml 启动 RAGFlow。`, + topK: 'Top-K', + topKTip: `与 Rerank 模型配合使用,用于设置传给 Rerank 模型的文本块数量。`, + delimiter: `文本分段标识符`, + delimiterTip: + '支持多字符作为分隔符,多字符用两个反引号 \\`\\` 分隔符包裹。若配置成:\\n`##`; 系统将首先使用换行符、两个#号以及分号先对文本进行分割,随后再对分得的小文本块按照「建议文本块大小」设定的大小进行拼装。在设置文本分段标识符前请确保理解上述文本分段切片机制。', + html4excel: '表格转HTML', + html4excelTip: `与 General 切片方法配合使用。未开启状态下,表格文件(XLSX、XLS(Excel 97-2003))会按行解析为键值对。开启后,表格文件会被解析为 HTML 表格。若原始表格超过 12 行,系统会自动按每 12 行拆分为多个 HTML 表格。欲了解更多详情,请参阅 https://ragflow.io/docs/dev/enable_excel2html。`, + autoKeywords: '自动关键词提取', + autoKeywordsTip: `自动为每个文本块中提取 N 个关键词,用以提升查询精度。请注意:该功能采用"系统模型设置"中设置的默认聊天模型提取关键词,因此也会产生更多 Token 消耗。另外,你也可以手动更新生成的关键词。详情请见 https://ragflow.io/docs/dev/autokeyword_autoquestion。`, + autoQuestions: '自动问题提取', + autoQuestionsTip: `利用"系统模型设置"中设置的 chat model 对知识库的每个文本块提取 N 个问题以提高其排名得分。请注意,开启后将消耗额外的 token。您可以在块列表中查看、编辑结果。如果自动问题提取发生错误,不会妨碍整个分块过程,只会将空结果添加到原始文本块。详情请见 https://ragflow.io/docs/dev/autokeyword_autoquestion。`, + redo: '是否清空已有 {{chunkNum}}个 chunk?', + setMetaData: '设置元数据', + pleaseInputJson: '请输入JSON', + documentMetaTips: `元数据为 Json 格式(不可搜索)。如果提示中包含此文档的任何块,它将被添加到 LLM 的提示中。
+示例:
+元数据为:
+{
+ "作者": "Alex Dowson",
+ "日期": "2024-11-12"
+}
+文档:the_name_of_document
+作者:Alex Dowson
+日期:2024-11-12
+相关片段如下:
+删除生成的 {{type}} 结果 + 将从此数据集中移除所有派生实体和关系。 + 您的原始文件将保持不变。
+
+ 是否要继续?
+ `,
+ extractRaptor: '从文档中提取Raptor',
+ extractKnowledgeGraph: '从文档中提取知识图谱',
+ filterPlaceholder: '请输入',
+ fileFilterTip: '',
+ fileFilter: '正则匹配表达式',
+ setDefaultTip: '',
+ setDefault: '设置默认',
+ eidtLinkDataPipeline: '编辑数据流',
+ linkPipelineSetTip: '管理与此数据集的数据管道链接',
+ default: '默认',
+ dataPipeline: '数据流',
+ linkDataPipeline: '关联数据流',
+ enableAutoGenerate: '是否启用自动生成',
+ teamPlaceholder: '请选择团队',
+ dataFlowPlaceholder: '请选择数据流',
+ buildItFromScratch: '去Scratch构建',
+ dataFlow: '数据流',
+ parseType: '切片方法',
+ manualSetup: '手动设置',
+ builtIn: '内置',
+ titleDescription: '在这里更新您的知识库详细信息,尤其是切片方法。',
+ name: '知识库名称',
+ photo: '知识库图片',
+ photoTip: '你可以上传4MB的文件',
+ description: '描述',
+ language: '文档语言',
+ languageMessage: '请输入语言',
+ languagePlaceholder: '请输入语言',
+ permissions: '权限',
+ embeddingModel: '嵌入模型',
+ chunkTokenNumber: '建议文本块大小',
+ chunkTokenNumberMessage: '块Token数是必填项',
+ embeddingModelTip:
+ '知识库采用的默认嵌入模型。 一旦知识库内已经产生了文本块后,你将无法更改默认的嵌入模型,除非删除知识库内的所有文本块。',
+ permissionsTip:
+ '如果把知识库权限设为"团队",则所有团队成员都可以操作该知识库。',
+ chunkTokenNumberTip:
+ '建议的生成文本块的 token 数阈值。如果切分得到的小文本段 token 数达不到这一阈值就会不断与之后的文本段合并,直至再合并下一个文本段会超过这一阈值为止,此时产生一个最终文本块。如果系统在切分文本段时始终没有遇到文本分段标识符,即便文本段 token 数已经超过这一阈值,系统也不会生成新文本块。',
+ chunkMethod: '切片方法',
+ chunkMethodTip: '说明位于右侧。',
+ upload: '上传',
+ english: '英文',
+ chinese: '中文',
+ embeddingModelPlaceholder: '请选择嵌入模型',
+ chunkMethodPlaceholder: '请选择分块方法',
+ save: '保存',
+ me: '只有我',
+ team: '团队',
+ cancel: '取消',
+ methodTitle: '分块方法说明',
+ methodExamples: '示例',
+ methodExamplesDescription:
+ '为帮助您更好地理解,我们提供了相关截图供您参考。',
+ dialogueExamplesTitle: '对话示例',
+ methodEmpty: '这将显示知识库类别的可视化解释',
+ book: `
支持的文件格式为DOCX、PDF、TXT。
+ 由于一本书很长,并不是所有部分都有用,如果是 PDF, + 请为每本书设置页面范围,以消除负面影响并节省分析计算时间。
`, + laws: `支持的文件格式为DOCX、PDF、TXT。
+ 法律文件有非常严格的书写格式。 我们使用文本特征来检测分割点。 +
+ chunk的粒度与'ARTICLE'一致,所有上层文本都会包含在chunk中。 +
`, + manual: `仅支持PDF。
+ 我们假设手册具有分层部分结构。 我们使用最低的部分标题作为对文档进行切片的枢轴。 + 因此,同一部分中的图和表不会被分割,并且块大小可能会很大。 +
`, + naive: `支持的文件格式为MD、MDX、DOCX、XLSX、XLS (Excel 97-2003)、PPT、PDF、TXT、JPEG、JPG、PNG、TIF、GIF、CSV、JSON、EML、HTML。
+此方法将简单的方法应用于块文件:
++
仅支持PDF文件。
+ 如果我们的模型运行良好,论文将按其部分进行切片,例如摘要、1.1、1.2等。
+ 这样做的好处是LLM可以更好的概括论文中相关章节的内容, + 产生更全面的答案,帮助读者更好地理解论文。 + 缺点是它增加了 LLM 对话的背景并增加了计算成本, + 所以在对话过程中,你可以考虑减少'topN'的设置。
`, + presentation: `支持的文件格式为PDF、PPTX。
+ 每个页面都将被视为一个块。 并且每个页面的缩略图都会被存储。
+ 您上传的所有PPT文件都会使用此方法自动分块,无需为每个PPT文件进行设置。
`, + qa: `+ 此块方法支持 excel 和 csv/txt 文件格式。 +
++ + 未能遵循上述规则的文本行将被忽略,并且 + 每个问答对将被认为是一个独特的部分。 + +
`, + resume: `支持的文件格式为DOCX、PDF、TXT。 +
+ 简历有多种格式,就像一个人的个性一样,但我们经常必须将它们组织成结构化数据,以便于搜索。 +
+ 我们不是将简历分块,而是将简历解析为结构化数据。 作为HR,你可以扔掉所有的简历, + 您只需与'RAGFlow'交谈即可列出所有符合资格的候选人。 +
+ `, + table: `支持XLSX和CSV/TXT格式文件。
+ 以下是一些提示: +
+ 以下是标题的一些示例:
支持图像文件。 视频即将推出。
+ 如果图片中有文字,则应用 OCR 提取文字作为其文字描述。 +
+ 如果OCR提取的文本不够,可以使用视觉LLM来获取描述。 +
`, + one: ` +支持的文件格式为MD、MDX、DOCX、XLSX、XLS (Excel 97-2003)、PPT、PDF、TXT、JPEG、JPG、PNG、TIF、GIF、CSV、JSON、EML、HTML。
+此方法将整个文档视为一个块。
`, + email: `支持的文件格式为EML。
+ 每封电子邮件都将被视为一个块。 +
`, + knowledgeGraph: `支持的文件格式为MD、MDX、DOCX、XLSX、XLS (Excel 97-2003)、PPT、PDF、TXT、JPEG、JPG、PNG、TIF、GIF、CSV、JSON、EML、HTML。
+此方法将从文档中提取实体和关系,并将它们存储在知识图谱中。
`, + }, + dashboard: { + title: '仪表板', + knowledgeBaseStatus: '知识库状态', + documents: '文档', + sources: '来源', + vectors: '向量', + recentActivity: '最近活动', + noActivity: '暂无活动', + systemHealth: '系统健康', + healthy: '健康', + warning: '警告', + error: '错误', + }, + time: { + justNow: '刚刚', + minutesAgo: '{{count}} 分钟前', + hoursAgo: '{{count}} 小时前', + daysAgo: '{{count}} 天前', + weeksAgo: '{{count}} 周前', + monthsAgo: '{{count}} 个月前', + yearsAgo: '{{count}} 年前', + }, + }, +}; \ No newline at end of file diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 27431bf..aa83494 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -14,6 +14,8 @@ import { Typography, styled } from '@mui/material'; +import { useTranslation } from 'react-i18next'; +import LanguageSwitcher from '../components/LanguageSwitcher'; const StyledCard = styled(Card)({ height: '100%', @@ -93,8 +95,18 @@ const recentQueries = [ ]; const Home = () => { + const { t } = useTranslation(); + return ( -