Task processing method and device
By obtaining and analyzing the text to be detected, generating prompt instructions and calling a large language model, the problem of difficulty in detecting translation quality in automated translation systems is solved, and more efficient and accurate translation quality detection is achieved.
Patent Information
- Application Number
- CN202411772115.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-18
AI Technical Summary
In the prior art, it is difficult for automated translation systems to effectively detect translation quality, resulting in uneven quality of translation content.
By obtaining the text to be detected by the target, determining its language type, and generating prompt instructions based on the content identification, original content, translated content and language type, invoking the large language model to perform translation quality detection.
It improves the efficiency of translation quality detection, enhances the accuracy of translated content, and ensures the controllability of translation quality.
Smart Images

Figure CN119647487A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of computer technology, and more particularly to a task processing method and device. Background Art
[0002] With the development of technology and the integration of cultures, many documents contain not only the original language version, but also versions in multiple languages translated from the original language. Due to the high cost and low efficiency of manual translation, most text translations are currently done using automated translation systems.
[0003] However, the limitations of the translation system can easily lead to uneven quality of the translated content, making it difficult to control the quality of the translation. Therefore, there is an urgent need for a method to effectively detect the quality of the translation. Summary of the invention In view of this, an embodiment of this specification provides a task processing method. One or more embodiments of this specification also relate to a task processing device, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.
[0004] According to a first aspect of an embodiment of this specification, a task processing method is provided, including: Obtaining a target text to be detected of a target task, wherein the target text to be detected includes at least one group of content to be detected, and the content to be detected includes original content, content identifier of the original content, and at least one translated content; Determine the language type of each translated content; Generate prompt instructions corresponding to the content to be detected according to the content identifier, original content, translated content and language type; Call the large language model and obtain the task processing result corresponding to the target task based on the prompt instructions.
[0005] According to a second aspect of an embodiment of this specification, there is provided a task processing device, including: An acquisition module is configured to acquire a target text to be detected of a target task, wherein the target text to be detected includes at least one group of content to be detected, and the content to be detected includes original content, content identifier of the original content, and at least one translated content; A determination module, configured to determine the language type of each translation content; A generation module is configured to generate a prompt instruction corresponding to the content to be detected according to the content identifier, the original content, the translated content and the language type; The calling module is configured to call the large language model and obtain the task processing result corresponding to the target task based on the prompt instruction.
[0006] According to a third aspect of an embodiment of this specification, a computing device is provided, including: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the above-mentioned task processing method are implemented.
[0007] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned task processing method are implemented.
[0008] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instruction, which implements the steps of the above-mentioned task processing method when executed by a processor.
[0009] An embodiment of the present specification implements obtaining a target text to be detected for a target task, wherein the target text to be detected includes at least one group of contents to be detected, and the contents to be detected include original content, content identifiers of the original content, and at least one translated content; determining the language type of each translated content; generating prompt instructions corresponding to the contents to be detected based on the content identifiers, original content, translated content, and language types; and calling a large language model to obtain a task processing result corresponding to the target task based on the prompt instructions.
[0010] In this way, by obtaining the target text to be detected of the target task, it is possible to generate prompt instructions for the large language model to perform the detection task for at least one group of contents to be detected in the target text to be detected, thereby enabling the large language model to perform quality detection on the translated content of the original content based on the original contents in the text, thereby improving the efficiency of translation quality detection, which is conducive to improving the accuracy of the translated content. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 is an architecture diagram of a task processing system provided by an embodiment of this specification; Figure 2 is an architecture diagram of another task processing system provided by an embodiment of this specification; Figure 3 is a flowchart of a task processing method provided by an embodiment of this specification; Figure 4 This is a task information query diagram of a task processing method provided by an embodiment of this specification; Figure 5 It is a detection result query schematic diagram of a task processing method provided by an embodiment of this specification; Figure 6is a structural diagram of a task processing device provided by an embodiment of this specification; Figure 7 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0012] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0013] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0014] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0015] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0016] First, the terms involved in one or more embodiments of this specification are explained.
[0017] Large Language Model (LLM): is a deep learning-based neural network model that can process and generate human language and perform various natural language processing (NLP) tasks by training massive text data.
[0018] git commitid: also known as commit hash value, SHA value or object ID, is a string used to uniquely identify each commit record in the Git version control system.
[0019] JSON: It is a data format that is easy for humans to read and write, and easy for machines to parse and generate. Therefore, it is suitable as a format for data exchange between different systems or applications.
[0020] Prompt: It is a clear and specific task or instruction given by the user to the AI model, which aims to guide the model to generate text that meets user needs or perform specific tasks.
[0021] In this specification, a task processing method is provided. This specification also relates to a task processing apparatus, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0022] See also Figure 1 , Figure 1 The task processing system 100 includes a continuous integration tool 102 , a server 104 , a web page 106 and an LLM, wherein the server 104 also includes a database 1042 .
[0023] The continuous integration tool 102 is used to obtain the text to be detected in the project directory through a python script, compress the text to be detected into a zip package, and send it to the server 104.
[0024] Specifically, the text to be detected is a text file (txt format) of the project dimension, including various original texts in the project, content identifiers of the original texts, and at least one translation text of the original texts.
[0025] The server 104 is used to receive the zip package sent by the continuous integration tool 102 through the file receiving interface, create a temporary directory, decompress the text to be detected in the zip package to the temporary directory, and write a task record in the database 1042.
[0026] Optionally, the server 104 may include servers that provide various services, such as servers that provide communication services to multiple clients, servers for background training that support models used on clients, and servers that process data sent by clients. It should be noted that the server 104 can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server can also be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server (cloud-side device) for basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0027] The server 104 is also used to query the database 1042 at fixed intervals for target tasks with a task status of waiting, and obtain the target text to be detected for the target task; scan the target text to be detected, and aggregate the original content, content identifier and translated text in the target text to be detected into a json file; traverse the json file, obtain each group of original content, content identifier, translated text and language type of the translated text (such as zh_CN, zh_TW, ja_JP, ko_KR, en_US, etc.), and fill the information into a preset prompt template; call the LLM interface and request one by one through the celery message queue.
[0028] LLM: used to execute the target task and obtain the task processing result according to the message request sent by the server 104; and return the task processing result to the server 104.
[0029] The server 104 is also used to store the task processing results in the database 1042 and provide the task information query service of the web page 106 through the web page interface.
[0030] Web page terminal 106: used to provide interactive Web pages, receive user input data, and query task processing results based on the input data.
[0031] See also Figure 2 , Figure 2 The architecture diagram of another task processing system provided by an embodiment of the present specification is shown. Specifically, the task processing system 200 includes a continuous integration tool 202, a server 204, a web page 206 and an LLM, wherein the server 204 also includes an interface server 2042, an analysis server cluster 2044 and a database 2046. The analysis server cluster 2044 includes multiple analysis servers.
[0032] Continuous integration tool 202: used to obtain the text to be detected in the project directory through a python script, compress the text to be detected into a zip package, and send it to the interface server 2042.
[0033] The interface server 2042 is used to receive the zip package sent by the continuous integration tool 202 through the file receiving interface, create a temporary directory, decompress the text to be detected in the zip package to the temporary directory, and write a task record in the database 2046.
[0034] Optionally, the interface server 2042 is mainly used to provide various types of interface service support for the task processing system 200. The interface provided by the interface server 2042 may specifically include a file receiving interface, a web page interface, and an LLM interface, etc.
[0035] Analysis server cluster 2044: used to query the target task with the task status of "waiting" in the database 2046 at regular intervals, and obtain the target text to be detected for the target task; scan the target text to be detected, and aggregate the original content, content identifier and translated text in the target text to be detected into a json file; traverse the json file, obtain each group of original content, content identifier, translated text and language type of the translated text, fill the information into a pre-set prompt template, and obtain a prompt instruction; send the prompt instruction to the interface server 2042.
[0036] Optionally, each analysis server in the analysis server cluster 2044 is used to poll and query data at a fixed time and perform data analysis locally.
[0037] Interface server 2042: also used to call the LLM interface and request one by one through the celery message queue.
[0038] LLM: used to execute the target task and obtain the task processing result according to the message request sent by the interface server 2042; and return the task processing result to the interface server 2042.
[0039] The interface server 2042 is also used to store the task processing results in the database 2046 and provide the task information query service of the web page 206 through the web page interface.
[0040] Web page end 206: used to provide interactive Web pages, receive user input data, and query task processing results based on the input data.
[0041] See also Figure 3 , Figure 3 A flowchart of a task processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.
[0042] Step 302: Obtain a target text to be detected for a target task, wherein the target text to be detected includes at least one group of content to be detected, and the content to be detected includes original content, content identifier of the original content, and at least one translated content.
[0043] In one or more optional embodiments of the present specification, the task processing method is applied to a server, and the server can be implemented as a distributed server cluster consisting of multiple servers, or as a single server.
[0044] Optionally, if the server is implemented as a distributed server cluster consisting of multiple servers, in an optional embodiment, the server may include an interface server and multiple analysis servers. The interface server may be used to provide a variety of different types of interface services, such as interface services for large language models, interface services for web backends, and file receiving services for integrated tools. The analysis server is used to provide data analysis functions, and can poll, view data status, and perform data analysis.
[0045] Optionally, if the service end is implemented as a single server, the server can implement both the interface service function and the data analysis function.
[0046] The following takes the example that the server includes one interface server and multiple analysis servers to explain the task processing method provided in this specification in detail.
[0047] Specifically, the target task is the task currently processed by the server. The target task can be understood as a task for translation quality detection of the translation content. One target task can correspond to one target text to be detected. The task processing result of the target task can be understood as the text detection result corresponding to the target text to be detected, or the translation quality detection result of the target text to be detected.
[0048] The target text to be detected may include various text contents in the target project. The text content may include phrases, sentences, paragraphs, etc. The target project may be a complete game project developed by developers. Specifically, the target text to be detected includes original content, content identifier corresponding to the original content, and at least one translated content. Among them, the original content is the text content of the original language type; the content identifier is the variable name corresponding to the original content in the program code, and the variable name can also be called a string Key; the translated content is the text content obtained by translating the original content according to at least one other language type.
[0049] For example, the original content may be a Chinese sentence, and the translated content may include a Japanese sentence, a Korean sentence, an English sentence, etc. translated from the Chinese sentence.
[0050] According to an optional embodiment of the present specification, the target task can be obtained by the server polling the task information in the database. Further, the server can be any one of multiple analysis servers. The task information can be written into the database by the interface server.
[0051] According to an optional embodiment of the present specification, before obtaining the target text to be detected of the target task, the following steps may also be included: receiving a text processing request, wherein the text processing request carries a text to be detected and a text identifier of the text to be detected; Create a file directory based on the text identifier and save the text to be detected to the file directory; Based on the text identifier and the task status, a task record for the text to be detected is generated, and the task record is written into a database, wherein the task status represents the current processing status of the text to be detected.
[0052] Specifically, a text processing request can be understood as a request to process the text to be detected.
[0053] Optionally, the text processing request may be generated by a continuous integration tool and sent to an interface server on the server side.
[0054] The text processing request may carry the text to be detected and the text identifier of the text to be detected, and may also carry other information related to the text to be detected. Specifically, the text identifier may include a project identifier and a commit identifier, and other information may include a repository branch name, request time, etc. Among them, the project identifier may represent the project to which the text to be detected belongs, and the commit identifier may represent the time when the text to be detected is submitted to the repository (such as Git).
[0055] It should be noted that the commit identifier, or git commitid, can facilitate subsequent information display on the web page; it is convenient for troubleshooting historical problems; it can also deduplicate the problems that have been fixed in the past when displaying problems, so that only the current version problems or only the problems that have not been fixed in the past are displayed. For problems that are the same as historical problems, they can also be marked with special tags, so that the reviewer can intuitively know in which versions the problem has appeared and been fixed before.
[0056] Optionally, the text to be detected can be obtained by a script (such as a python script) connected to the continuous integration tool. The format of the text to be detected can be a txt format. The text identifier can be used to uniquely identify the text to be detected.
[0057] Optionally, the continuous integration tool can integrate a text integration function, which can scan each directory of the target project, obtain and integrate the text content under each directory, and summarize it into a project-level text to be detected. That is, the text to be detected can include all the text content of the target project and the translation content corresponding to the text content.
[0058] It should be noted that since the text content is a natural language, and the code often references the text content through variable names, strings and other data, each text content has its corresponding variable name, which can be used as the content identifier of each text content, that is, the string Key, which is used to uniquely identify each text content.
[0059] According to an optional embodiment of the present specification, the continuous integration tool can integrate the content identification, original content, and translated content of each text content in the target project into the same txt file, obtain the text to be detected corresponding to the target project, and save the text to be detected in the directory of the target project; obtain the text to be detected from the directory of the target project through a python script, and send the text to be detected and the corresponding request data to the interface server.
[0060] Specifically, the request data may include project ID, submission ID, repository branch name, request time, and other data.
[0061] According to another optional embodiment of the present specification, after the continuous integration tool obtains the text to be detected from the directory of the target project through a python script, it can also package the text to be detected into a zip package and send the zip package and request data to the interface server.
[0062] Optionally, the continuous integration tool can send data to the interface server via http.
[0063] In one or more optional embodiments of the present specification, the text to be detected may include at least one line of content, and each line of content includes a content identifier, original content, and a translation content corresponding to the original content. Each line of content can be called a group of content to be detected. The first column in the text to be detected can be a column corresponding to the content identifier, the second column can be a column corresponding to the original content, the third column can be a column corresponding to the translation content of language type 1, the fourth column can be a column corresponding to the translation content of language type 2, and so on. It should be noted that language types 1 to n are different from the language types of the original content, and the translation content is obtained by translation based on the original content.
[0064] Optionally, creating a file directory based on the text identifier and saving the text to be detected in the file directory may include: the interface server receives a zip package and request data, creates a temporary directory based on the project identifier and the submission identifier, and saves the text to be detected in the temporary directory.
[0065] Specifically, the project identifier may be a project key, and the commit identifier may be a git commitid. Based on the project key and the git commitid, a temporary directory may be created, and the zip package may be decompressed into the temporary directory.
[0066] Optionally, based on the text identifier and the task status, generating a task record for the text to be detected, and writing the task record into a database may include: In response to the text processing request, the interface server writes a task record corresponding to the text processing request into the database, where the task record includes a project ID, a submission ID, a warehouse branch name, a request time, and a task status.
[0067] Specifically, the task status represents the current processing status of the text to be detected. When writing a task record, the task status is generally "waiting".
[0068] By applying this embodiment, by receiving a text processing request, a file directory can be created based on the text identifier in the request and the text to be detected can be saved in the directory, so as to facilitate the subsequent acquisition of the text to be detected based on the text identifier; by generating a task record for the text to be detected based on the text identifier and the task status, and writing the task record into a database, it is convenient to analyze the server polling task data and process the waiting tasks, thereby realizing the detection and analysis of the text to be detected.
[0069] In actual applications, the interface server receives text processing requests sent by the tool, stores the text to be detected, and writes task records in the database. The analysis server can poll, check the task status and perform data analysis.
[0070] According to an optional embodiment of the present specification, obtaining the target text to be detected of the target task may include the following steps: Query the task records in the database to obtain the target task, wherein the target task status of the target task is waiting; The target task status is updated to in progress, and according to the target identification information in the target task record, the target to-be-detected text of the target task is obtained from the target file directory corresponding to the target identification information, wherein the target task record is a task record of the target task.
[0071] Specifically, the target task is a task in the database that is in the waiting state.
[0072] Optionally, querying the task records in the database may include: analyzing the server periodically querying the task status of each task record in the database.
[0073] Further, the analysis server can query at regular intervals every day or at preset intervals, which can be determined according to the needs of actual applications. In an optional implementation, each analysis server can query the task status in the database every 30 minutes.
[0074] Specifically, the target task status is the task status of the target task. The target task record is the task record of the target task, and the target task record includes target identification information and target task status, and may also include information such as target warehouse branch and target request time. The target identification information includes target project identification and target submission identification.
[0075] Optionally, when the analysis server obtains the target task, the analysis server starts processing the target task, and updates the target task status from "waiting" to "in progress". Based on the target project identifier and the target submission identifier, the analysis server obtains the target to-be-detected text corresponding to the target task from the target file directory in the interface server.
[0076] By applying this embodiment, by querying the task records in the database, the analysis server can obtain new tasks and perform data analysis when new tasks are written to the database, thereby improving task processing efficiency and realizing analysis of the text to be detected.
[0077] Step 304: Determine the language type of each translated content.
[0078] In practical applications, when the target text to be detected of the target task is obtained, data analysis can be performed on each group of content to be detected in the text to be detected.
[0079] Specifically, the language type can be understood as the type of language used by the text of the content, that is, the type of natural description language used by the text of the content.
[0080] Influenced by factors such as geographical environment, regional barriers, and cultural customs, human language has formed many different language types in the long process of development. For the same meaning, different language types correspond to different text expressions.
[0081] Optionally, the original content may correspond to a plurality of translated contents in different language types, and the language types between the original content and each translated content are different, and the language types between each translated content are different.
[0082] It should be noted that the actual content meanings of the original content and the translated content are the same. Based on the actual content meanings of the original content, the original content can be translated into translated content of multiple different language types through different types of natural description languages.
[0083] For example, the language type of the original content may be Chinese, and the original content may be translated into translated content in different language types such as English, Japanese, Korean, etc. according to the requirements of actual applications.
[0084] According to an optional embodiment of the present specification, in order to facilitate machine parsing and data transmission between interfaces, data analysis is performed on each group of to-be-detected content in the to-be-detected text, which may include: Scan the target text to be detected, obtain each group of content to be detected in the text to be detected, and aggregate the content to be detected into a json file.
[0085] That is to say, before analyzing each content to be detected, the content in the text to be detected can be converted from txt format to json format, so as to facilitate subsequent operations and improve subsequent data analysis and transmission efficiency.
[0086] Optionally, each group of to-be-detected content in the target to-be-detected text may be scanned, and data such as content identifiers, original content, and translated content in each group of to-be-detected content may be extracted and aggregated into a json file. The json file may be named all_lang_cache.json.
[0087] Furthermore, the json file can be traversed to obtain each content identifier in the json file, the original content corresponding to the content identifier, the translated content corresponding to the original content, and the language type of the translated content, and these data are filled into the prompt template of the large language model.
[0088] Step 306: Generate a prompt instruction corresponding to the content to be detected according to the content identifier, original content, translated content and language type.
[0089] Specifically, the prompt instruction can be understood as a prompt of the large language model, which can provide clear and specific task instructions to the large language model, thereby guiding the large language model to perform specific tasks based on user needs. The prompt instruction is used to instruct the large language model to perform translation quality detection on the translation content corresponding to the original content based on the original content, and output the detection results. Furthermore, the detection results may include various types of errors and error types in the translation content, and may also include error causes and modification prompt information generated for the errors, etc.
[0090] In actual applications, the analysis server may send the prompt instruction to the interface server, and the interface server calls the interface of the large language model to send the prompt instruction to the large language model.
[0091] Since large language models have usage costs, and calling the interface to wait for the large model to execute a task and return the task result also takes a certain amount of time, the analysis server can also determine whether historical task results are cached in the cache service before generating the prompt instruction.
[0092] According to an optional embodiment of the present specification, before generating a prompt instruction corresponding to the content to be detected according to the content identifier, the original content, the translated content and the language type, the following steps may also be included: Generate a first summary corresponding to the content to be detected according to the original content, the content identifier and the translated content; Determining whether there is a second digest matching the first digest in the cache; If so, the first detection result corresponding to the second summary is obtained from the cache, and the first detection result is determined as the task processing result corresponding to the target task.
[0093] Specifically, the first summary can be understood as a hash value generated based on the original content, content identifier, and translated content. The second summary can be understood as a hash value generated based on the historical original content, historical content identifier, and historical translated content during the historical execution of the large language model. The first test result can be understood as the historical task result of the large language model.
[0094] The historical task results obtained by the large language model historical execution task and the corresponding second summary can be stored in the cache service (redis). During this task, if the original content, translated content, and content identifier have not changed, there is no need to generate a prompt instruction to call the large language model to execute the task. The historical task results can be directly obtained from the cache service as the task results of this task.
[0095] By applying this embodiment, a first summary corresponding to the content to be detected is generated based on the original content, content identification and translated content, and the first summary is matched with the second summary in the cache. Therefore, the task execution results of the historical tasks can be obtained from the cache when the original content, content identification and translated content have not changed, without calling the large model, thereby improving the task execution efficiency, avoiding repeated interface calls, and saving task costs.
[0096] According to an optional embodiment of the present specification, generating a prompt instruction corresponding to the content to be detected according to the content identifier, the original content, the translated content and the language type may include the following steps: Determine the prompt template for the large language model; Fill the text identifier, original content, translated content and language type into the prompt template to obtain the prompt instruction corresponding to the content to be detected.
[0097] Specifically, the prompt template of the large language model can be a prompt template, which can be prepared in advance according to the target task. The prompt template is used to instruct the large language model to determine whether there are translation errors in the translated content of each language type based on the original content, and output data such as the error type, error cause, and modification prompt information. The error type can include typos, grammatical errors, logical errors, inappropriate words, etc.
[0098] By applying this embodiment, by determining the prompt template of the large language model; filling the text identifier, original content, translated content and language type into the prompt template, and obtaining the prompt instruction corresponding to the content to be detected, the task execution efficiency and task processing effect of the large model can be improved, and it helps to enable the large model to better perform translation quality detection tasks through prompt instructions and obtain more accurate task results.
[0099] In an optional embodiment of the present specification, the text identifier, original content, translated content and language type are filled into the prompt template. The text identifier, original content, translated content and language type in the json file can be filled into a prompt template to obtain a prompt instruction.
[0100] According to another optional embodiment of the present specification, filling the content identifier, original content, translated content and language type into the prompt template to obtain the prompt instruction corresponding to the content to be detected may include the following steps: The target original content included in the target content to be detected, the target content identifier corresponding to the target original content and at least one target translation content, and the target language type of each target translation content are filled into the prompt template to obtain the target prompt instruction corresponding to the target content to be detected, wherein the target content to be detected is any one of at least one group of content to be detected.
[0101] In actual applications, a prompt instruction may be generated for each group of content to be detected. That is, if the text to be detected includes N groups of content to be detected, N prompt instructions may be generated accordingly.
[0102] Optionally, the analysis server can generate prompt instructions corresponding to each group of content to be detected based on each group of content to be detected in the json file (the content to be detected includes content identification, original content, and at least one translation content), thereby obtaining multiple prompt instructions for the text to be detected, and sending the multiple prompt instructions to the interface server. Further, the interface server can call the interface of the large language model and send the multiple prompt instructions to the large language model.
[0103] In an optional embodiment of the present specification, the interface server may carry multiple prompt instructions in one request and send it to the large language model.
[0104] In another optional embodiment of the present specification, the interface server can send multiple prompt instructions to the large language model one by one. Further, the prompt instructions can be sent one by one through message queues, asynchronous sending, message agents / middleware, etc.
[0105] By applying this embodiment, a prompt instruction is generated for each group of content to be detected in the text to be detected, which can improve the task processing efficiency and task processing success rate of the large model, avoid missing data of the large model, effectively improve the accuracy of the task processing results, and facilitate subsequent caching and organization of the task processing results.
[0106] Step 308: Call the large language model and obtain the task processing result corresponding to the target task based on the prompt instruction.
[0107] Specifically, the target task can be understood as a translation quality detection task, and the task processing result can be understood as a translation quality detection result. The task processing result can include the error type, error cause, modification prompt information, etc. of each group of content to be detected.
[0108] According to an optional embodiment of the present specification, calling a large language model and obtaining a task processing result corresponding to a target task based on a prompt instruction may include the following steps: Based on the target prompt instruction, obtaining at least one request message corresponding to the content to be detected, wherein the request message carries the target prompt instruction; At least one request message is sent to the large language model through the calling interface of the large language model to obtain a second detection result output by the large language model, and the second detection result is determined as a task processing result corresponding to the target task.
[0109] Specifically, the request message can be understood as being generated based on the prompt instruction corresponding to each group of to-be-detected content, that is, each group of to-be-detected content in a to-be-detected file corresponds to a request message. The to-be-detected file may correspond to multiple request messages.
[0110] The second detection result can be understood as the task result output by the large language model for the target task.
[0111] Optionally, on the basis of obtaining the task processing result, a summary may be generated based on the erroneous translation content, the original content corresponding to the translation content, and the content identifier, and the error information and the summary may be cached in a cache service.
[0112] By applying this embodiment, at least one request message is sent to the large language model through the calling interface of the large language model, and the task processing result of the large language model can be obtained through the message request, thereby realizing the translation quality detection of the text to be detected, which is beneficial to improving the detection efficiency and the accuracy of the detection results.
[0113] In practical applications, in order to improve the success rate of tasks and the stability of large language models in executing tasks, request messages can be sent to the large language model one by one through message queues.
[0114] According to an optional embodiment of the present specification, sending at least one request message to the large language model through the calling interface of the large language model to obtain the second detection result output by the large language model may include the following steps: Add each request message to the target message queue; Read each request message from the target message queue one by one, and send the target request message to the large language model by calling the interface to obtain a second detection result output by the large language model, wherein the target request message is the request message currently read in the target message queue.
[0115] Specifically, the target message queue may be a message queue in the interface server. A request message carries a prompt instruction.
[0116] Optionally, request messages can be read one by one from the target message queue. Each time a message is read, it is sent to the large language model by calling the interface. When the output result returned by the large language model is received, the next request message is sent to the large language model until all request messages corresponding to the text to be detected obtain the output result returned by the large language model.
[0117] By applying this embodiment, each request message is added to the target message queue; each request message is read from the target message queue one by one, and the target request message is sent to the large language model by calling the interface. This can improve the reliability and stability of prompt instruction transmission through the message queue, improve the success rate of task execution, achieve a more uniform load distribution in the system, and improve task processing efficiency.
[0118] In actual applications, when all request messages in the target message queue are sent to the large language model and all output results returned by the large language model are received, all the contents to be detected in the target text to be detected are detected.
[0119] Furthermore, the number of translations, number of errors, and error rate corresponding to the target task can be counted, and the error information of all translated original texts and the output of the large language model can be written into the database.
[0120] Optionally, the number of translations corresponding to the target task can be determined based on the number of translations in the text to be detected; the number of errors can be determined based on the output results of the large language model; the error rate can be determined based on the number of translations and the number of errors. The translated original text and the error information output by the large language model can be written into the target task record corresponding to the target task. The target task status in the target task record can be updated to "completed" accordingly.
[0121] Optionally, the web page can provide a query service based on task information such as project, branch, version, time, etc. Users can query the detection results of the translation content based on any one or more of the task information such as project, branch, version, time, etc. The detection results may include the task detection status, the total number of translations, the translation error rate, the error rate of each language, etc. The web page can also support online review. Auditors and repairers can mark the content as [unconfirmed, false positive, to be repaired, repairing, repaired, ignored, accepted] and other statuses on the web page, and mark the corresponding modifiers.
[0122] Furthermore, if the repairer fixes the erroneous content, he or she can also resubmit the repaired content to Git, and generate the next round of detection tasks for each text content of the target project based on the new git commitid and text content.
[0123] See also Figure 4 , Figure 4 FIG. 1 is a diagram showing a task information query of a task processing method provided by an embodiment of the present specification. Figure 4 As shown, by entering the code version number, time and other information, you can query various task information such as warehouse branch, version, task time, code submission time, task status, total translation error rate, total number of translations, language error rate, etc.
[0124] See also Figure 5 , Figure 5 FIG. 1 is a schematic diagram showing a detection result query of a task processing method provided by an embodiment of this specification. Figure 4 As shown, by querying the task information, the corresponding original text, source, original translation, AI suggestion, repair status and other information can be obtained, so that the reviewer or repairer can intuitively view the problematic translation text and the corresponding problem, repair status and other information from the web page.
[0125] An embodiment of the present specification implements obtaining a target text to be detected for a target task, wherein the target text to be detected includes at least one group of contents to be detected, and the contents to be detected include original content, content identifiers of the original content, and at least one translated content; determining the language type of each translated content; generating prompt instructions corresponding to the contents to be detected based on the content identifiers, original content, translated content, and language types; and calling a large language model to obtain a task processing result corresponding to the target task based on the prompt instructions.
[0126] In this way, by obtaining the target text to be detected of the target task, it is possible to generate prompt instructions for the large language model to perform the detection task for at least one group of contents to be detected in the target text to be detected, thereby enabling the large language model to perform quality detection on the translated content of the original content based on the original contents in the text, thereby improving the efficiency of translation quality detection, which is conducive to improving the accuracy of the translated content.
[0127] Furthermore, since the task record carries task information such as project ID, submission ID, repository branch, and request time, the web page can provide a service for querying results based on the above information, making it easier for users to review the detection results and modify errors, manage the translation content, and improve the translation quality.
[0128] Corresponding to the above method embodiment, this specification also provides a task processing device embodiment, Figure 6 FIG. 1 shows a schematic diagram of a task processing device provided by an embodiment of the present specification. Figure 6 As shown, the device comprises: The acquisition module 602 is configured to acquire a target text to be detected of a target task, wherein the target text to be detected includes at least one group of content to be detected, and the content to be detected includes original content, content identifier of the original content and at least one translation content.
[0129] Determination module 604: configured to determine the language type of each translation content.
[0130] The generating module 606 is configured to generate a prompt instruction corresponding to the content to be detected according to the content identifier, the original content, the translated content and the language type.
[0131] The calling module 608 is configured to call the large language model and obtain the task processing result corresponding to the target task based on the prompt instruction.
[0132] Optionally, the acquisition module 602 is further configured to: receiving a text processing request, wherein the text processing request carries a text to be detected and a text identifier of the text to be detected; Create a file directory based on the text identifier and save the text to be detected to the file directory; Based on the text identifier and the task status, a task record for the text to be detected is generated, and the task record is written into a database, wherein the task status represents the current processing status of the text to be detected.
[0133] Optionally, the acquisition module 602 is further configured to: Query the task records in the database to obtain the target task, wherein the target task status of the target task is waiting; The target task status is updated to in progress, and according to the target identification information in the target task record, the target to-be-detected text of the target task is obtained from the target file directory corresponding to the target identification information, wherein the target task record is a task record of the target task.
[0134] Optionally, the task processing device further includes a cache module configured to: Generate a first summary corresponding to the content to be detected according to the original content, the content identifier and the translated content; Determining whether there is a second digest matching the first digest in the cache; If so, the first detection result corresponding to the second summary is obtained from the cache, and the first detection result is determined as the task processing result corresponding to the target task.
[0135] Optionally, the generating module 606 is further configured to: Determine the prompt template for the large language model; Fill the content identifier, original content, translated content and language type into the prompt template to obtain the prompt instruction corresponding to the content to be detected.
[0136] Optionally, the generating module 606 is further configured to: The target original content included in the target content to be detected, the target content identifier corresponding to the target original content and at least one target translation content, and the target language type of each target translation content are filled into the prompt template to obtain the target prompt instruction corresponding to the target content to be detected, wherein the target content to be detected is any one of at least one group of content to be detected.
[0137] Optionally, the calling module 608 is further configured to: Based on the target prompt instruction, obtaining at least one request message corresponding to the content to be detected, wherein the request message carries the target prompt instruction; At least one request message is sent to the large language model through the calling interface of the large language model to obtain a second detection result output by the large language model, and the second detection result is determined as a task processing result corresponding to the target task.
[0138] Optionally, the calling module 608 is further configured to: Add each request message to the target message queue; Each request message is read one by one from the target message queue, and the target request message is sent to the large language model by calling the interface to obtain a second detection result output by the large language model, wherein the target request message is the request message currently read in the target message queue.
[0139] By applying this embodiment, by obtaining the target text to be detected of the target task, it is possible to generate prompt instructions for the large language model to perform the detection task for at least one group of contents to be detected in the target text to be detected, thereby enabling the large language model to perform quality detection on the translation content of the original content based on the original contents in the text, thereby improving the detection efficiency of the translation quality, which is conducive to improving the accuracy of the translated content.
[0140] The above is a schematic scheme of a task processing device of this embodiment. It should be noted that the technical scheme of the task processing device and the technical scheme of the above task processing method belong to the same concept, and the details of the technical scheme of the task processing device that are not described in detail can all be referred to the description of the technical scheme of the above task processing method.
[0141] Figure 7 The block diagram of a computing device 700 according to an embodiment of the present specification is shown. The components of the computing device 700 include but are not limited to a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and the database 750 is used to store data.
[0142] The computing device 700 also includes an access device 740 that enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 740 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).
[0143] In one embodiment of the present specification, the above components of the computing device 700 and Figure 7 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 7 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0144] The computing device 700 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 700 may also be a mobile or stationary server.
[0145] The processor 720 is used to execute the following computer executable instructions, which implement the steps of the above-mentioned task processing method when executed by the processor.
[0146] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned task processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned task processing method.
[0147] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which can implement the steps of the above-mentioned task processing method when executed by a processor.
[0148] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned task processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned task processing method.
[0149] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned task processing method when executed by a processor.
[0150] The above is a schematic solution of a computer program product of this embodiment. It should be noted that the technical solution of the computer program product and the technical solution of the above-mentioned task processing method belong to the same concept, and the details not described in detail in the technical solution of the computer program product can be referred to the description of the technical solution of the above-mentioned task processing method.
[0151] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0152] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0153] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0154] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0155] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. A task processing method, characterized in that: include: Acquire a target text to be detected of a target task, wherein the target text to be detected includes at least one group of content to be detected, and the content to be detected includes original content, a content identifier of the original content, and at least one translated content; Determining the language type of each of the translated contents; Generate a prompt instruction corresponding to the content to be detected according to the content identifier, the original content, the translated content and the language type; The large language model is called to obtain a task processing result corresponding to the target task based on the prompt instruction.
2. The method according to claim 1, characterized in that Before obtaining the target text to be detected of the target task, the method further includes: receiving a text processing request, wherein the text processing request carries a text to be detected and a text identifier of the text to be detected; According to the text identifier, a file directory is created, and the text to be detected is saved in the file directory; Based on the text identifier and the task status, a task record for the text to be detected is generated, and the task record is written into a database, wherein the task status represents a current processing status of the text to be detected.
3. The method according to claim 2, characterized in that The step of obtaining the target text to be detected for the target task includes: Querying the task record in the database to obtain a target task, wherein the target task status of the target task is waiting; The target task status is updated to in progress, and according to the target identification information in the target task record, the target text to be detected of the target task is obtained from the target file directory corresponding to the target identification information, wherein the target task record is the task record of the target task.
4. The method according to claim 1, characterized in that: Before generating a prompt instruction corresponding to the content to be detected according to the content identifier, the original content, the translated content and the language type, the method further includes: Generate a first summary corresponding to the content to be detected according to the original content, the content identifier and the translated content; Determining whether there is a second digest matching the first digest in the cache; If so, a first detection result corresponding to the second summary is obtained from the cache, and the first detection result is determined as a task processing result corresponding to the target task.
5. The method according to claim 1, characterized in that The step of generating a prompt instruction corresponding to the content to be detected according to the content identifier, the original content, the translated content and the language type includes: Determining a prompt template for the large language model; The content identifier, the original content, the translated content and the language type are filled into the prompt template to obtain a prompt instruction corresponding to the content to be detected.
6. The method according to claim 5, characterized in that The step of filling the text identifier, the original content, the translated content and the language type into the prompt template to obtain a prompt instruction corresponding to the content to be detected includes: The target original content included in the target content to be detected, the target content identifier corresponding to the target original content and at least one target translated content, and the target language type of each target translated content are filled into the prompt template to obtain a target prompt instruction corresponding to the target content to be detected, wherein the target content to be detected is any one of the at least one group of contents to be detected.
7. The method according to claim 6, characterized in that The calling of the large language model to obtain the task processing result corresponding to the target task based on the prompt instruction includes: Based on the target prompt instruction, obtaining at least one request message corresponding to the content to be detected, wherein the request message carries the target prompt instruction; The at least one request message is sent to the large language model through the calling interface of the large language model, a second detection result output by the large language model is obtained, and the second detection result is determined as the task processing result corresponding to the target task.
8. The method according to claim 7, characterized in that The step of sending the at least one request message to the large language model through the calling interface of the large language model to obtain a second detection result output by the large language model includes: Add each of the request messages to a target message queue; Each of the request messages is read one by one from the target message queue, and the target request message is sent to the large language model through the calling interface to obtain a second detection result output by the large language model, wherein the target request message is the request message currently read in the target message queue.
9. A task processing device, characterized in that: include: An acquisition module is configured to acquire a target text to be detected of a target task, wherein the target text to be detected includes at least one group of content to be detected, and the content to be detected includes original content, a content identifier of the original content, and at least one translation content; A determination module, configured to determine the language type of each of the translation contents; A generating module, configured to generate a prompt instruction corresponding to the content to be detected according to the content identifier, the original content, the translated content and the language type; The calling module is configured to call the large language model and obtain the task processing result corresponding to the target task based on the prompt instruction.
10. A computing device, characterized in that include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the task processing method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium, characterized in that: It stores a computer program / instruction, which, when executed by a processor, implements the steps of the task processing method described in any one of claims 1 to 8.
12. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the steps of the task processing method according to any one of claims 1 to 8.
Citation Information
Cited By
Cloud function configuration detection method based on large language model
CN120822615A
A cloud function configuration detection method based on a large language model
CN120822615B