Multi-language translation website generation method, system, equipment and medium
By combining site graph analysis and semantic association graph construction with AI translation technology, the translation challenges of cross-domain content and deep links in existing technologies have been solved, achieving the integrity and consistency of multilingual translation websites.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies cannot effectively cover relevant content scattered across different websites, resulting in the omission of important content. Furthermore, multilingual translations cannot be synchronized in a timely manner, failing to address the translation challenges of cross-domain content and deep links.
By analyzing site graphs to identify cross-domain resources, a mapping table of website content sets and cross-domain reference relationships is constructed. A semantic association graph is built by combining the internal navigation structure and link relationships. A large AI translation model is used to perform multilingual translation, and the content is re-integrated according to semantic associations to generate a multilingual translation website.
Effectively uncover deep links and hidden pages within the website to ensure the complete functionality of the translated website, maintain consistency in terminology and visual layout, and achieve synchronization and consistency across multilingual translation websites.
Smart Images

Figure CN121658741A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and in particular relates to a method, system, device and medium for generating multilingual translation websites. Background Technology
[0002] As businesses grow, modern corporate websites are typically composed of multiple related websites, such as regional sub-sites under the same brand, independent sites for different business lines, and sites associated with third-party content providers. Therefore, multilingual translation of a single website can no longer meet the market demands of modern enterprises for multiple regions and multiple sites.
[0003] Existing website translation methods only crawl single domains or shallow pages, lacking a holistic consideration of the complex content architecture of a website. They cannot fully cover the relevant content of an enterprise scattered across different sites, thus failing to effectively uncover deep links and hidden pages within the website. This results in important content being forgotten during the translation process, and after the source website content is updated, multilingual translations cannot be synchronized in a timely manner, leading to information lag.
[0004] The aforementioned website translation methods cannot solve the translation challenges of cross-domain content and deep links. Therefore, a multilingual website generation method that supports cross-domain content and deep links is proposed. Summary of the Invention
[0005] This application provides a method, system, device, and medium for generating multilingual translation websites, which can solve one of the problems in the prior art mentioned above.
[0006] In a first aspect, embodiments of this application provide a method for generating a multilingual translation website, including: Obtain the webpage links of the source language website, identify the cross-domain resources of the source language website through site graph analysis, and construct a website content set and a cross-domain reference relationship mapping table; Based on the internal navigation structure and link relationships of the source language website, construct a semantic relationship graph between web pages; Based on the website content set and combined with the semantic association graph, multilingual translation is performed on the source language website; The translated content is re-integrated according to semantic relationships to generate a multilingual translation website, which is then published to the target environment.
[0007] Furthermore, the step of obtaining webpage links from the source language website, identifying cross-domain resources of the source language website through site graph analysis, and constructing a website content set and a cross-domain reference relationship mapping table includes: Parse the webpage links of the source language website to obtain the root information, which includes the protocol, main domain name, and initial path; Based on the aforementioned foundational information, cross-domain resource sites are obtained through a multi-channel discovery mechanism, and a site map is constructed. Content is crawled from the source language website and each of the cross-domain resource sites to generate a website content set, and a cross-domain reference relationship mapping table is established between the cross-domain site content and the source website content.
[0008] Furthermore, the multi-channel discovery mechanism includes subdomain enumeration, code analysis, and configuration file parsing, and in the multi-channel discovery mechanism, code analysis, configuration file parsing, and subdomain enumeration are performed sequentially. The subdomain enumeration is based on the main domain name, which is used to generate candidate subdomains by combining prefixes. These candidate subdomains are then combined with DNS resolution to determine cross-domain resource sites. The code analysis identifies cross-domain resource sites by querying code blocks related to site links in the source language website's code. The configuration file is parsed to obtain clues about related sites and identify cross-domain resource sites.
[0009] Furthermore, the construction of a semantic relationship graph between web pages based on the internal navigation structure and link relationships of the source language website includes: By analyzing the front-end code, the internal navigation structure of the source language website was extracted; The link relationships are determined by simulating user interaction events to trigger the interactive links of each navigation element in the internal navigation structure. Each interactive link is abstracted into a navigation node in turn, a semantic association graph is constructed, and the structural association degree and semantic similarity between each navigation node are calculated to generate a comprehensive association weight.
[0010] Furthermore, the multilingual translation of the source language website includes: The web page content in the website content collection is divided into multiple translation units according to the DOM structure, and these units are encapsulated into translation context packages. The translation context packages include in-page context, cross-page context, and page-level context. The terminology of each webpage in the website content set is processed, and a unique target language translation is assigned to each term to form a global terminology constraint table; The translation context and the global terminology constraint table are fed into the AI translation model for multilingual translation. During the translation process, based on the semantic association graph and the cross-domain reference relationship mapping table, related translation units are identified and processed collaboratively.
[0011] Furthermore, the multilingual translation of the source language website also includes: Based on the semantic association graph, cluster analysis is performed on each of the navigation nodes to obtain multiple content aggregation modules; Configure differentiated prompt word strategies for each of the content aggregation modules, and guide the AI translation model to use different language styles for translation through the prompt word strategies.
[0012] Furthermore, the process of re-integrating the translated content according to semantic relationships to generate a multilingual translation website includes: Based on the site graph and the cross-domain reference mapping table, the site architecture of the target language is reconstructed; Select the corresponding preset template for different content aggregation modules, integrate the translated content with the preset template and the site architecture to generate a multilingual website, and map the original language links of each navigation node in the multilingual website to the corresponding target language page.
[0013] Secondly, embodiments of this application provide a multilingual translation website generation system, including: The first processing module is used to obtain webpage links from the source language website, identify cross-domain resources of the source language website through site graph analysis, and construct a website content set and a cross-domain reference relationship mapping table. The second processing module is used to construct a semantic relationship graph between web pages based on the internal navigation structure and link relationships of the source language website. The third processing module is used to perform multilingual translation of the source language website based on the website content set and the semantic association graph. The fourth processing module is used to re-integrate the translated content according to semantic relationships, generate a multilingual translation website, and publish the multilingual translation website to the target environment.
[0014] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described multilingual translation website generation method.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium, including a computer program stored thereon, which, when executed by a processor, implements the aforementioned multilingual translation website generation method.
[0016] The beneficial effects of the embodiments in this application compared with the prior art are: This application discloses a method for generating a multilingual translation website. Through site graph analysis, it enables the discovery and integration of all sites related to the source language website, thereby effectively uncovering deep links and hidden pages within the website. This avoids content omissions from the source and ensures the functional integrity of the translated website. Furthermore, by analyzing the internal navigation structure and link relationships, a semantic association graph is constructed and content modules are divided, thereby understanding the internal organizational logic of the source language website. This transforms discrete pages into a structured network while ensuring terminology consistency during translation. The translated content is then re-integrated to construct a new site architecture, generating a multilingual translation website that guarantees visual layout and functional integrity and consistency. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating a method for generating a multilingual translation website according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a multilingual translation website generation system provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0019] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0020] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0021] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0022] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0023] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0024] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0025] Please see Figure 1 As shown, this invention provides a method for generating a multilingual translation website, comprising the following steps: S100. Obtain the webpage links of the source language website, identify the cross-domain resources of the source language website through site graph analysis, and construct a website content set and a cross-domain reference relationship mapping table. In this application, site graph analysis is used to discover and integrate all sites related to the source language website, thereby effectively uncovering deep links and hidden pages within the website, avoiding content omissions from the source, and ensuring the complete functionality of the translated website.
[0026] In some embodiments, step S100 above includes: Parse the webpage links of the source language website to obtain the root information, which includes the protocol, main domain name, and initial path; Based on the aforementioned foundational information, cross-domain resource sites are obtained through a multi-channel discovery mechanism, and a site map is constructed. Content is crawled from the source language website and each of the cross-domain resource sites to generate a website content set, and a cross-domain reference relationship mapping table is established between the cross-domain site content and the source website content.
[0027] In this embodiment, the user inputs the URL of the website for which multilingual translation is required, thereby obtaining the webpage link of the source language website. Then, the webpage link is parsed. For example, in one embodiment, the webpage link input by the user is: https: / / www.example.com / products / . Then, using a standard URI parsing library, it is decomposed into: protocol: https, main domain name: www.example.com, and initial path: products / . This information is used as the base information for the benchmark reference system of subsequent site relevance analysis and to define the policy boundaries, in order to distinguish between sites within the same domain and sites across domains.
[0028] More specifically, using the main domain name in the root information, a multi-channel discovery mechanism is used to find and verify cross-domain resource sites related to the main domain name, and a site graph is constructed based on this, which is used for contextual analysis in the subsequent translation process.
[0029] Furthermore, content is crawled from the source language website to obtain its content, and content is crawled from the cross-domain resource site to obtain its content. The source website content and the cross-domain site content are then encapsulated to generate a website content collection for subsequent translation. Specifically, the original content from all different sites is cleaned, deduplicated, and stored according to a unified metadata format. The URL of the source language website is used as the index root in the website content collection, and the content of each cross-domain site is logically associated with this index root for easy subsequent querying and management.
[0030] In some embodiments, when crawling content from source language websites and cross-domain resource sites, the crawling priority is determined by analyzing the correlation with the root information. For example, the main domain of the root information is given the highest priority, which means the source language website is given the highest priority. In the site graph, the closer the number of links to the main domain, the higher the priority of the site. At the same time, for cross-domain resource sites with the same main domain, the same session management strategy as the main domain is adopted to maintain the login status and thus obtain the site content under the login status. For cross-domain resource sites with different main domains, they are treated as third-party sites for content crawling.
[0031] In one embodiment, the source language website and cross-domain resource site are sequentially transformed into a standard data structure through the content object model. This standard data structure includes the original URL, site source, page title, body text, image link list, outbound link list, etc., thereby forming a website content collection.
[0032] Furthermore, while constructing the website content collection, all original links and their contexts for cross-domain references are recorded, generating a cross-domain reference relationship mapping table. This cross-domain reference relationship mapping table serves as the basis for subsequent translation and link rewriting, ensuring that the hyperlink structure of the original site can be reproduced during the subsequent generation process of the multilingual website. For example, in one embodiment, if the source language website https: / / www.example.com / products / has an outbound link pointing to a cross-domain resource site blog.example.com, then this reference link relationship is recorded in the cross-domain reference relationship mapping table. At the same time, this record also includes the URL of the source language website, the URL of the pointing link, and the context of the outbound link in the source language website, specifically the text description or images before and after the outbound link, etc., to ensure that the translated page link can still be correctly referenced when translating the outbound link of the source language website later.
[0033] In some embodiments, the multi-channel discovery mechanism includes subdomain enumeration, code analysis, and configuration file parsing, and in the multi-channel discovery mechanism, code analysis, configuration file parsing, and subdomain enumeration are performed sequentially. The subdomain enumeration is based on the main domain name, which is used to generate candidate subdomains by combining prefixes. These candidate subdomains are then combined with DNS resolution to determine cross-domain resource sites. The code analysis identifies cross-domain resource sites by querying code blocks related to site links in the source language website's code. The configuration file is parsed to obtain clues about related sites and identify cross-domain resource sites.
[0034] In this embodiment, the cross-domain resource sites obtained through the multi-channel discovery mechanism can generally be divided into sites with the same main domain and sites with different main domains. It can be understood that sites with the same main domain are subdomain sites under the main domain of the source language website, while sites with different main domains are sites with different main domains from the main domain of the source language website.
[0035] Specifically, the multi-channel discovery mechanism includes subdomain enumeration, code analysis, and configuration file parsing. When discovering cross-domain resource sites, the discovery sequence is: code analysis, configuration file parsing, and subdomain enumeration. Code analysis identifies cross-domain resource sites by querying code blocks related to site links. Configuration file parsing retrieves cross-domain resource sites by analyzing configuration files related to the source language website. Subdomain enumeration fills in the gaps in the code analysis and configuration file parsing mechanisms, overcoming the limitations of these mechanisms that only analyze code or configuration files. By analyzing the network infrastructure and management metadata behind the source language website, it discovers hidden sites closely related to the source language website but not yet crawled.
[0036] Specifically, based on the webpage link of the source language website provided by the user, the HTML document is parsed... 、 <link> 、 <script>、等标签的href和src属性,从而获取源语言网站的出站链接,并依据其域名进行归纳,分为主域站点和跨主域站点。
[0037] 进一步的,对于配置文件的解析,robots.txt和sitemap.xml是网站与爬虫通信的标准文件,通过解析上述配置文件可确定源语言网站的页面结构,还可获得相关的子域名站点或其他关联内容的站点地址,从而确定跨域资源站点。
[0038] 具体的,子域名枚举是基于主域名生成常见子域名前缀列表,并通过DNS解析验证其存在性与活性,具体的,加载一个包含数千至数百万常见子域名的词典,如一个词典中包含www、mail、blog、shop、api、dev、test等子域名,将主域名与该词典中的每个子域名进行前缀组合,生成完整的候选子域名,如api.example.com等,而后批量发起DNS A记录或CNAME记录查询,并将能够成功解析的域名认定为存在的子域名,将其作为同主域站点。
[0039] 在一个实施例中,对候选子域名中的所有候选域名,发起系统性的DNS查询,并基于返回的记录进行多维度关联性分析,具体的,查询各候选域名的A记录与AAAA记录,如果查询成功,确定该候选子域名存在,同时同步获取其对应的IPv4与IPv6地址,确定网站服务器物理位置和托管环境的基础,而后基于IP地址进行反向DNS解析与IP地理信息查询,并聚类分析,将多个域名解析到同一C段IP,如192.0.2.1和192.0.2.2,同时查询域名的WHOIS或RDAP信息,获取域名注册详情,其中域名注册详情包括注册人 / 组织名称、注册邮箱、注册地址以及注册电话等,通过构建一个加权评分模型,将上述存在的候选域名与通过代码分析或者配置文件分析后获得的域名进行加权评分计算,获得关联度评分,如一个实施例中,加权评分模型中设置,若两个域名之间为同一IP得10分,同一C段IP得8分,注册邮箱相同得9分,注册组织相同得7分等,通过对各项评分进行累加,获得关联度评分,若关联度评分超过预设阈值,则判定两者之间存在强关联,则对应的候选域名被标记为隐藏站点,同时其发起一个轻量级的HTTP请求,验证其是否存在及是否可访问,以避免该隐藏站点失效,而后将经过验证的候选域名作为跨域资源站点,并作为节点添加到站点图谱中,同时为其建立一条隐性关联边,该隐性关联边的权重为上述关联度评分。
[0040] S200、基于源语言网站的内部导航结构和链接关系,构建网页间的语义关联图谱;本申请中,通过分析内部导航结构和链接关系,构建语义关联图谱和进行内容模块划分,从而能够理解源语言网站的内在组织逻辑,将离散的页面转化为一个结构化的网络,同时确保翻译时保持术语一致性。
[0041] 在其中一些实施例中,上述步骤S200包括:通过分析前端代码,提取所述源语言网站的内部导航结构;通过模拟用户交互事件触发所述内部导航结构中各导航元素的交互链接,确定链接关系;将每个所述交互链接依次抽象为导航节点,构建语义关联图谱,并计算各导航节点之间的结构关联度和语义相似度,生成综合关联权重。
[0042] 本实施例中,对静态HTML进行解析,并通过结合DOM树结构分析与视觉渲染信息,精准识别并提取源语言网站中内部导航结构对应的所有链接,具体的,对内部导航结构等区域的提取,通过分析其HTML标签的语义、CSS类名规则及其在浏览器视口中的绝对定位坐标进行综合判定与提取,而后,对提取后的内部导航结构,通过模拟用户交互事件触发其进行渲染,而后捕获相应的交互链接,从而获取内部导航结构相应的链接关系。
[0043] 具体而言,内部导航结构包括主导航菜单、面包屑导航和页脚导航等,通过识别静态HTML中<nav>、<menu>、<header>、<footer>等具有明确语义的HTML5标签,同时通过预定义的正则表达式,匹配与内部导航结构相关的类名或者ID,如nav、menu、breadcrumb等,此外,还可根据各内部导航结构渲染后的绝对坐标确定相关的导航标签,通常主导航菜单位于页面顶部,面包屑导航位于标题上方,页脚导航位于最底部,通过上述静视觉渲染信息进行识别的方法,能有效识别未使用标准语义标签但视觉上明确的导航结构,进一步具体的,对于通过鼠标悬停或点击等用户交互后才能加载的下拉菜单、懒加载列表等,通过模拟相应的用户交互事件,并监听DOM树的变化,从而捕获动态生成的链接。
[0044] 在一些实施例中,还包括识别网站的内部搜索功能,并构建一个基于网站内容主题的搜索词库,通过自动提交多轮搜索请求并解析结果页,发现与源语言网站相关但内部导航结构未涵盖的深层内容。
[0045] 进一步的,基于上述通过内部导航结构的链接关系所确定的交互链接,构建一个语义关联图谱,具体的,将每个交互链接抽象为语义关联图谱中的一个节点,并计算节点之间的结构关联度和语义相似度,将结构关联度与语义相似度进行加权融合,生成综合关联权重,作为语义关联图谱的边属性。
[0046] 具体的,结构关联度权重W_struc的计算公式具体为:W_struc=w_0×k×d,其中,k表示链接文本相关性,如果交互链接对应的文本内容与源语言网站的内容高度相关,则通过k增加相应的权重;d表示链接深度,具体为从源语言网站到交互链接的页面所需的点击次数,如主导航菜单的交互链接的点击次数通常为1,而主导航菜单的交互链接对应的页面内的交互链接的点击次数为2,对应的d=2;w_0表示基础权重,根据导航节点在源语言网站的视觉位置重要性进行确定,如一个实施例中,主导航菜单的交互链接,因为其通常是源语言网站的核心链接,对于用户浏览网站和搜索引擎理解网站结构非常重要,因而其基础权重设为a,且a>1,页脚导航,因为其交互链接,通常是辅助链接,对网站核心结构和内容关联的贡献相对较小,因而其基础权重设为c,且0<c≤1,而对于位于主导航菜单与页脚导航之间的正文导航结构,其基础权重设为b,且1≤b<a。
[0047] 进一步具体的,从网站内容集合中,获得各交互链接的文本内容,如页面标题、正文文本等,使用BERT模型或其他类似的文本嵌入模型,如Sentence - BERT、RoBERTa等,将文本转换为高维向量,将各交互链接的高维向量与源语言网站的高维向量进行相似度计算,获得语义相似度W_semantic,最终,综合关联权重W_final=α*W_struc+β*W_semantic,其中α和β为可调参数。
[0048] S300、基于所述网站内容集合,结合所述语义关联图谱,对所述源语言网站进行多语言翻译;在其中一些实施例中,上述步骤S300包括:将所述网站内容集合中的各网页内容,按照DOM结构划分为多个翻译单元,并将其封装为翻译上下文包,所述翻译上下文包包括页面内上下文、跨页面上下文以及页面级上下文;对所述网站内容集合中各网页内容的术语进行处理,为每个术语确定唯一的目标语言翻译,形成全局术语约束表;将所述翻译上下包和所述全局术语约束表输送至AI翻译大模型进行多语言翻译。
[0049] 本实施例中,将网站内容集合中各站点所对应的页面内容,按照DOM结构划分为多个翻译单元,其中每个翻译单元对应一个具有独立语义的页面区块,并为其封装一个翻译上下文包,而翻译上下文包包括页面内上下文、跨页面上下文以及页面级上下文,其中页面内上下文为该翻译单元的纯文本内容以及语义角色标签,该语义角色标签为翻译单元对应的页面区块的语义标签,跨页面上下文为当前翻译单元存在的交互链接的网站内容,以及其在语义关联图谱中与源语言网站的属性关系,通过综合关联权重进行衡量,页面级上下文具体为该翻译单元所在的站点的标准化数据结构,如原始URL、站点来源、页面标题、正文文本、图片链接列表、出站链接列表等。
[0050] 本实施例中,在通过AI翻译大模型进行多语言翻译时,需将各翻译单元封装的翻译上下文包输入AI翻译大模型中,作为信息辅助,以保证AI翻译大模型翻译的准确性,同时实现对跨域站点上下文之间的信息同步。
[0051] 进一步具体的,还在网页内容集合中进行术语提取与消歧,保证该源语言网站以及跨域资源站点中的各术语在翻译过程中能够保持一致,具体的,基于所述网站内容集合,通过词频统计、命名实体识别与共现分析,找出产品名、组件名等实体,从而提取候选术语,同时提取候选术语出现的完整上下文,进行多义词的消歧,为每个术语确定唯一的目标语言翻译,最终生成全局术语约束表,并将该全局术语约束表输入AI翻译大模型中,在向AI翻译大模型发起对每个翻译单元的请求时,将全局术语约束表中与该翻译单元内容相关的部分作为不可违背的指令注入,强制AI翻译大模型在翻译中采用全局术语约束表中的预定翻译。
[0052] 在其中一些实施例中,所述对所述源语言网站进行多语言翻译,还包括:基于所述语义关联图谱,对各所述导航节点进行聚类分析,获得多个内容聚合模块;为各所述内容聚合模块配置差异化的提示词策略,通过所述提示词策略指导所述AI翻译大模型采用不同的语言风格进行翻译。
[0053] 本实施例中,将语义关联图谱作为输入,采用基于模块度优化的社区发现算法进行无监督聚类,通过语义关联图谱迭代优化,将语义关联图谱划分为若干个内部连接紧密、外部连接稀疏的节点社区,针对划分出的每个节点社区,提取该节点社区内所有的高频关键词集合,并过滤掉全站通用词汇,进一步的,基于关键词集合与预定义的模块类型特征库进行匹配,为每个节点社区分配一个主模块类型标识,最终生成内容聚合模块,其中,模块类型特征库包含多种类型的内容模块及其对应的关键词特征,包括但不限于"技术文档"、"产品介绍"、"营销内容"、"用户支持"、"公司信息"等。
[0054] 在一些实施例中,为每个识别出的内容聚合模块创建元数据描述,包括:模块唯一标识符、主模块类型、描述性标签、所包含的导航节点列表,该元数据作为上下文参数,被传递至AI翻译大模型中,用于指导差异化的处理策略,具体的,当AI翻译大模型在处理一个导航节点对应的页面时,可通过查询其导航节点所属的内容聚合模块,获得其模块类型,该模块类型将用于指导该导航节点对应页面的翻译风格。例如,一个被标识为"营销内容”类型的页面,AI翻译大模型中触发使用营销创意型提示词,用于指导翻译。
[0055] 进一步具体的,元数据描述中的导航节点列表定义了需要保持一致性的导航节点对应的页面范围,由此可以为同一模块下的所有页面应用统一的布局模板、导航样式或者色彩方案等,例如,"用户支持”模块的所有页面可以统一使用一个带有帮助中心侧边栏的模板,而"产品介绍”模块的页面则使用一个宽屏、视觉冲击力强的模板。
[0056] 在一些实施例中,社区发现算法为Louvain算法或Leiden算法等以优化模块度为目标的社区发现算法,其中,模块度是衡量网络社区划分质量的标准,其模块度的值越高表示社区内连接越紧密,社区间连接越稀疏,通过将成千上万个导航节点归类相应的节点社区中,从而使得每个社区内部的导航节点,无论是在链接跳转上还是在主题内容上,都表现出高度的内在一致性。
[0057] 具体而言,以Louvain算法为例,将各导航节点聚合为多个节点社区,具体包括模块度优化阶段和社区聚合阶段,通过不断迭代上述两个阶段,提高模块度,直至模块度不再明显增加。
[0058] 具体的,在模块度优化阶段,每个导航节点自成一个社区,即导航节点A、B、C、D、E分别属于不同的社区,对于每个节点,考虑将其移动到相邻节点所在的社区,计算其移动前后模块度的变化,即模块度增益,以节点A为例,尝试将其移动到相邻节点B所在的社区,移动前,计算节点A所在社区和B所在社区的模块度,移动后,A和B在同一个社区,此时重新计算A和B在同一社区的模块度,得到模块度增益,同样地,计算节点A移动到节点C所在社区时的模块度增益,最终选择使模块度增益最大的移动方式,将节点移动到相应的社区,而如果所有可能的移动都不能使模块度增加,则该节点保持在当前社区,可以理解的,对语义关联图谱中的所有节点依次进行上述操作,直到没有节点移动能使模块度增加为止。
[0059] 在一些实施例中,模块度的计算公式具体为:,其中,m是语义关联图谱中所有边的权重之和,是节点i和j之间边的权重,和分别是节点i和节点j的度,具体为与该节点相连的边的权重之和,而和分别是节点i和节点j所属的社区,表示当=时为1,否则为0。
[0060] 进一步具体的,在社区聚合阶段,将每个节点社区看作一个新的节点,社区内部节点之间的边权重之和作为新节点之间的自环权重,社区之间边的权重为原语义关联图谱中连接两个社区的边的权重之和,构建社区关联图谱,例如,经过上述模块度优化阶段后,A和B在一个社区,C、D、E各自在一个社区,则此时的社区关联图谱存在4个节点,分别为AB、C、D、E,计算新节点在原语义关联图谱中的边权重之和,如一个实施例中,若原语义关联图谱中,A与C之间有一条权重为2的边:w(A,C)=2,B与D之间有一条权重为3的边:w(B,D)=3,C与E之间有一条权重为1的边:w(C,E)=1,而其他节点间无直接连接,此时对于新的关联图谱中的每一个社区节点,在计算社区C1(A,B)与C2(C)的边权重过程中,连接C1(A,B)和C2(C)的边只有A-C,权重为2,则w(C1,C2)=2,而在计算C1(A,B)与C3(社D)的边权重过程中,连接C1(A,B)和C3(D)的边只有B-D,则权重为3,w(C1,C3) = 3,在计算C1(A,B)与C4(E)的边权重过程中,由于原语义关联图谱中无直接连接C1和C4的边,则w(C1,C4) = 0,同理,由于原语义关联图谱中无直接连接C2和C3的边,则w(C2,C3) = 0,以此获得社区关联图谱中各节点社区之间的边权重。
[0061] 进一步具体的,在上述社区关联图谱中重复模块度优化阶段的操作,继续提高模块度,当模块度不再明显增加时,迭代终止,此时的社区划分即为最终的聚类结果。
[0062] 进一步,对于每个节点社区,聚合其包含的所有导航节点的标题和正文文本,采用TF-IDF提取该节点社区的高频关键词,同时过滤掉像"首页”、"联系我们”等在全站普遍出现、无区分意义的通用词汇,生成关键词集合,此外,预定义的模块类型特征库中定义了各种常见网站内容模块类型及其典型的关键词特征,如模块类型为技术文档的实施例中,其特征关键词为["API", "安装", "配置", "参考", "接口", "SDK"],而模块类型为营销内容的实施例中,其特征关键词为["购买", "优惠", "新品", "限时", "解决方案", "成功案例"],通过将每个节点社区提取出的关键词集合与模块类型特征库中各模块类型的特征关键词进行匹配,计算相似度,并将相似度最高的模块类型分配给该社区,作为其主模块类型标识,由此,将聚类结果从"社区节点1、2、3...”转化为"技术文档模块”、"营销内容模块”等具有明确语义的内容聚合模块。
[0063] S400、将翻译后的内容按照语义关联进行重新集成,生成多语言翻译网站,并将所述多语言翻译网站发布至目标环境。
[0064] 本申请中,将翻译后的内容,进行重新集成,从而构建新的站点架构,生成多语言翻译网站,保证多语言翻译网站在视觉布局与功能完整性与统一性。
[0065] 在其中一些实施例中,上述步骤S400包括:基于所述站点图谱和所述跨域引用关系映射表,重建目标语言的站点架构;为不同所述内容聚合模块选择对应的预设模板,将翻译后的内容与所述预设模板,结合所述站点架构进行融合,生成多语言网站,并将所述多语言网站中各导航节点的原始语言链接映射到对应目标语言页面。
[0066] 本实施例中,基于站点图谱和引用关系映射表,重建目标语言的站点架构,具体为根据目标语言的阅读方向配置整体布局方向,为目标语言分配合适的子域名或目录路径,并保持原始站点的目录结构和跨域引用关系,同时根据内容聚合模块对应的模块元数据,为不同内容聚合模块选择对应的预设模板,以适配对应的翻译风格,如为技术文档模块选择支持代码高亮、目录导航的技术文档模板,为营销内容模块选择支持大图轮播、视频背景的视觉化模板,同时根据目标语言的文本特性自动调整字体大小、行高和段落间距等。
[0067] 具体的,基于预设配置,为目标语言的网站分配清晰的访问地址,便于用户和搜索引擎识别语言 / 地区,同时避免内容重复问题,预设配置包括子域名模式和目录路径模式,其中子域名模式的格式具体为语言代码.主域名,有利于分离语言版本,如一个实施例中,访问网址fr.example.com表示源语言网站的法国翻译版本,目录路径模式的格式具体为主域名 / 语言代码 / ,如一个实施例中,源语言网站的法国翻译的访问网址具体为example.com / fr / 。
[0068] 具体的,对于源语言网站中的各交互链接,在翻译过程中,需结合所选定的预设配置模式进行链接重写,以保证交互链接动态适配源语言网站的翻译。
[0069] 此外,目标语言的站点架构在重建过程中,需确保多语言翻译网站的目录层级、页面路径与源语言网站完全一致,在此过程中,根据源语言网站的站点路径,为站点图谱中的各站点生成对应语言的等价路径,且在生成过程中,结合所选定的预设配置模式进行语言前缀的替换,而不破坏原有信息架构,如一个实施例中,源语言网站为example.com / products / abc / specs / ,则多语言翻译网站的法语路径中,若选定为子域名模式,则为fr.example.com / products / abc / specs / ,若选定为目录路径模式,则为example.com / fr / products / abc / specs / 。
[0070] 进一步具体的,将翻译内容与上述选定的预设模板进行融合,对因文本长度变化导致的布局问题进行自动调整,对图片、图标等视觉元素进行文化适配替换,以确保响应式布局在不同设备上的显示效果。
[0071] 此外,基于多语言站点架构,对各导航节点的原始语言链接进行重写,从而将原始语言链接映射到对应目标语言页面,保持面包屑导航、分页导航等导航元素的语义一致性,确保源语言网站内各功能在目标语言环境下的正常工作,可以理解的,在对源语言网站翻译后生成静态HTML文件或动态渲染页面时,对源语言网站中的所有如的互动链接进行扫描,并将其替换为正确的新地址,例如,将重写为<ahref=" / fr / products / abc">。
[0072] 请参阅图2所示,本发明还提供一种多语言翻译网站生成系统,所述系统包括:第一处理模块201:用于获取源语言网站的网页链接,通过站点图谱分析识别所述源语言网站的跨域资源,构建网站内容集合以及跨域引用关系映射表;第二处理模块202:用于基于源语言网站的内部导航结构和链接关系,构建网页间的语义关联图谱;第三处理模块203:用于基于所述网站内容集合,结合所述语义关联图谱,对所述源语言网站进行多语言翻译;第四处理模块204:用于将翻译后的内容按照语义关联进行重新集成,生成多语言翻译网站,并将所述多语言翻译网站发布至目标环境。
[0073] 可以理解的是,如图1所示的多语言翻译网站生成方法实施例中的内容均适用于本多语言翻译网站生成系统实施例中,本多语言翻译网站生成系统实施例所具体实现的功能与如图1所示的多语言翻译网站生成方法实施例相同,并且达到的有益效果与如图1所示的多语言翻译网站生成方法实施例所达到的有益效果也相同。
[0074] 需要说明的是,上述系统之间的信息交互、执行过程等内容,由于与本发明方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。
[0075] 所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述系统的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
[0076] 请参阅图3所示,本发明实施例还提供了一种计算机设备3,包括:存储器302和处理器301及存储在存储器302上的计算机程序303,当所述计算机程序303在处理器301上被执行时,实现如上述方法中任一项所述的多语言翻译网站生成方法。
[0077] 所述计算机设备3可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。该计算机设备3可包括,但不仅限于,处理器301、存储器302。本领域技术人员可以理解,图3仅仅是计算机设备3的举例,并不构成对计算机设备3的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。
[0078] 所称处理器301可以是中央处理单元(Central Processing Unit,CPU),该处理器301还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
[0079] 所述存储器302在一些实施例中可以是所述计算机设备3的内部存储单元,例如计算机设备3的硬盘或内存。所述存储器302在另一些实施例中也可以是所述计算机设备3的外部存储设备,例如所述计算机设备3上配备的插接式硬盘,智能存储卡(Smart MediaCard, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器302还可以既包括所述计算机设备3的内部存储单元也包括外部存储设备。所述存储器302用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器302还可以用于暂时地存储已经输出或者将要输出的数据。
[0080] 本发明实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器运行时,实现如上述方法中任一项所述的多语言翻译网站生成方法。
[0081] 该实施例中,所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置 / 计算机设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。
[0082] 以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。< / script>
Claims
1. A method for generating a multilingual translation website, characterized in that, include: Obtain the webpage links of the source language website, identify the cross-domain resources of the source language website through site graph analysis, and construct a website content set and a cross-domain reference relationship mapping table; Based on the internal navigation structure and link relationships of the source language website, construct a semantic relationship graph between web pages; Based on the website content set and combined with the semantic association graph, multilingual translation is performed on the source language website; The translated content is re-integrated according to semantic relationships to generate a multilingual translation website, which is then published to the target environment.
2. The method as described in claim 1, characterized in that, The process of obtaining webpage links from source language websites, identifying cross-domain resources of the source language websites through site graph analysis, and constructing a website content set and a cross-domain reference relationship mapping table includes: Parse the webpage links of the source language website to obtain the root information, which includes the protocol, main domain name, and initial path; Based on the aforementioned foundational information, cross-domain resource sites are obtained through a multi-channel discovery mechanism, and a site map is constructed. Content is crawled from the source language website and each of the cross-domain resource sites to generate a website content set, and a cross-domain reference relationship mapping table is established between the cross-domain site content and the source website content.
3. The method as described in claim 2, characterized in that, The multi-channel discovery mechanism includes subdomain enumeration, code analysis, and configuration file parsing, and in the multi-channel discovery mechanism, code analysis, configuration file parsing, and subdomain enumeration are performed in sequence. The subdomain enumeration is based on the main domain name, which is used to generate candidate subdomains by combining prefixes. These candidate subdomains are then combined with DNS resolution to determine cross-domain resource sites. The code analysis identifies cross-domain resource sites by querying code blocks related to site links in the source language website's code. The configuration file is parsed to obtain clues about related sites and identify cross-domain resource sites.
4. The method as described in claim 2, characterized in that, The construction of a semantic relationship graph between web pages based on the internal navigation structure and link relationships of the source language website includes: By analyzing the front-end code, the internal navigation structure of the source language website was extracted; The link relationships are determined by simulating user interaction events to trigger the interactive links of each navigation element in the internal navigation structure. Each interactive link is abstracted into a navigation node in turn, a semantic association graph is constructed, and the structural association degree and semantic similarity between each navigation node are calculated to generate a comprehensive association weight.
5. The method as described in claim 1, characterized in that, The multilingual translation of the source language website includes: The web page content in the website content collection is divided into multiple translation units according to the DOM structure, and these units are encapsulated into translation context packages. The translation context packages include in-page context, cross-page context, and page-level context. The terminology of each webpage in the website content set is processed, and a unique target language translation is assigned to each term to form a global terminology constraint table; The translation context and the global terminology constraint table are fed into the AI translation model for multilingual translation. During the translation process, based on the semantic association graph and the cross-domain reference relationship mapping table, related translation units are identified and processed collaboratively.
6. The method as described in claim 5, characterized in that, The multilingual translation of the source language website also includes: Based on the semantic association graph, cluster analysis is performed on each of the navigation nodes to obtain multiple content aggregation modules; Configure differentiated prompt word strategies for each of the content aggregation modules, and guide the AI translation model to use different language styles for translation through the prompt word strategies.
7. The method as described in claim 6, characterized in that, The process of re-integrating the translated content according to semantic relationships to generate a multilingual translation website includes: Based on the site graph and the cross-domain reference mapping table, the site architecture of the target language is reconstructed; Select the corresponding preset template for different content aggregation modules, integrate the translated content with the preset template and the site architecture to generate a multilingual website, and map the original language links of each navigation node in the multilingual website to the corresponding target language page.
8. A multilingual translation website generation system, characterized in that, include: The first processing module is used to obtain webpage links from the source language website, identify cross-domain resources of the source language website through site graph analysis, and construct a website content set and a cross-domain reference relationship mapping table. The second processing module is used to construct a semantic relationship graph between web pages based on the internal navigation structure and link relationships of the source language website. The third processing module is used to perform multilingual translation of the source language website based on the website content set and the semantic association graph. The fourth processing module is used to re-integrate the translated content according to semantic relationships, generate a multilingual translation website, and publish the multilingual translation website to the target environment.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.