Text conversion method and device based on large model, electronic equipment and storage medium

Through the large model-based text conversion method, the target scene is determined based on the attributes and operation information of the input text, and adaptive processing is performed. This solves the problem of low conversion quality caused by scene incompatibility in the existing system and improves the accuracy of text conversion. and user experience.

CN118734870AInactive Publication Date: 2024-10-01BAIDU (CHINA) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411107551.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-10-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing text conversion system lacks scene adaptability and cannot adjust the processing logic according to different scenarios. As a result, the conversion results cannot meet specific needs. Especially when facing professional texts or multi-lingual texts, the conversion quality is poor and affects the user experience.

Method used

Using a text conversion method based on a large model, by inputting the attribute information of the text and the operation information of the object, the target scene is determined from multiple candidate scenes, and the input text is processed logically according to the target scene to obtain the first conversion result, and for The sub-text in the first conversion result is further processed to generate a second conversion result to improve conversion quality and user experience.

Benefits of technology

It realizes targeted text processing according to different scenarios, improves conversion quality and user experience, and is especially suitable for multi-language translation and professional text conversion to meet the needs of high-quality translation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734870A_ABST
    Figure CN118734870A_ABST
Patent Text Reader

Abstract

The invention provides a text conversion method and device based on a large model, electronic equipment and a storage medium, belongs to the technical field of artificial intelligence, and particularly relates to the field of large language models and the like. The specific implementation scheme is as follows: determining a target scene from a plurality of candidate scenes according to attribute information of an input text and operation information of an object; according to processing logic corresponding to the target scene, processing the input text to obtain a first conversion result; determining a second conversion result of the sub-text based on the context of the sub-text for the sub-text meeting a predetermined condition in the first conversion result; and outputting the first conversion result and the second conversion result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to the field of large language models. More specifically, the present disclosure provides a text conversion method, device, electronic device, storage medium and computer program product based on a large model. Background Art

[0002] In work and life, users sometimes need to convert text, such as translating English text into Chinese text. Summary of the invention

[0003] The present disclosure provides a text conversion method, device, electronic device, storage medium and computer program product based on a large model.

[0004] According to one aspect of the present disclosure, a large model-based text conversion method is provided, including: determining a target scene from multiple candidate scenes based on attribute information of an input text and operation information of an object; processing the input text according to a processing logic corresponding to the target scene to obtain a first conversion result; for a sub-text in the first conversion result that meets a predetermined condition, determining a second conversion result of the sub-text based on the context of the sub-text; and outputting the first conversion result and the second conversion result.

[0005] According to another aspect of the present disclosure, a text conversion device is provided, comprising: a scene determination module, a first result determination module, a second result determination module, and an output module. The scene determination module is used to determine a target scene from a plurality of candidate scenes according to attribute information of an input text and operation information of an object. The first result determination module is used to process the input text according to a processing logic corresponding to the target scene to obtain a first conversion result. The second result determination module is used to determine a second conversion result of a sub-text that meets a predetermined condition in the first conversion result based on the context of the sub-text. The output module is used to output the first conversion result and the second conversion result.

[0006] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method provided by the present disclosure.

[0007] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method provided by the present disclosure.

[0008] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method provided by the present disclosure is implemented.

[0009] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0011] Figure 1 is a schematic diagram of an application scenario of the text conversion method and device according to an embodiment of the present disclosure;

[0012] Figure 2 is a schematic flow chart of a text conversion method according to an embodiment of the present disclosure;

[0013] Figure 3A is a schematic diagram of determining a first conversion result according to an embodiment of the present disclosure;

[0014] Figure 3B is a schematic diagram of determining a second conversion result according to an embodiment of the present disclosure;

[0015] Figure 4 is a schematic structural block diagram of a text conversion device according to an embodiment of the present disclosure; and

[0016] Figure 5 It is a structural block diagram of an electronic device used to implement the text conversion method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0017] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0018] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0019] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.

[0020] Some text conversion systems use a unified processing logic to process input text, thereby processing the input text into a conversion result.

[0021] However, the above text conversion system lacks scenario adaptability and cannot adjust the processing logic according to different scenarios, resulting in the conversion results failing to meet specific needs. For example, when faced with professional text or complex pages containing multiple languages, the translation system cannot effectively identify the scenario and adjust the corresponding processing logic, resulting in poor text conversion quality and affecting user experience.

[0022] In addition, in actual applications, some text conversion systems are unable to effectively convert professional vocabulary and abbreviations. For example, if the input text includes "OCR", the converted text is still "OCR", which also leads to poor text conversion quality and affects the user experience.

[0023] The present disclosure aims to provide a text conversion method, which can be implemented based on a large model. The method can determine a target scene according to the attribute information of the input text and the operation information of the object, and then use the processing logic corresponding to the target scene to process the input text to obtain a first conversion result. The method can automatically select and execute the appropriate processing logic without the need for manual switching by the user, thereby providing a more convenient user experience and improving the quality of text conversion. In addition, for some sub-texts in the first conversion result, the sub-texts can be further processed to obtain a second conversion result, thereby providing the user with more accurate and context-related information, further improving the quality of text conversion and improving the user experience.

[0024] The disclosed embodiments are applicable to online translation tools, multilingual content management systems, business communication platforms, etc., and are particularly applicable to multilingual publishing, international conferences, internal communications of multinational companies, and other occasions that require high-quality translation.

[0025] The technical solution provided by the present disclosure will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0026] Figure 1 It is a schematic diagram of an application scenario of the text conversion method and device according to an embodiment of the present disclosure.

[0027] It should be noted that Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0028] like Figure 1As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0029] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptops, desktop computers, etc.

[0030] The server 105 may be a server that provides various services, such as a background management server that supports websites browsed by users using the terminal devices 101, 102, and 103 (for example only). The background management server may analyze and process the received data such as user requests, and feed back the processing results to the terminal device. For example, the server 105 is used to perform text conversion processing such as translation, and the server 105 may generate a first conversion result and a second conversion result based on the input text and the operation information of the object.

[0031] It should be noted that, in some embodiments, the terminal devices 101, 102, 103 may also perform text conversion processing such as translation. In this case, the terminal devices 101, 102, 103 generate the first conversion result and the second conversion result based on the input text and the operation information of the object.

[0032] It should be noted that the text conversion method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the text conversion device provided in the embodiment of the present disclosure can generally be set in the server 105. The text conversion method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the text conversion device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.

[0033] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0034] Figure 2 is a schematic flow chart of a text conversion method according to an embodiment of the present disclosure.

[0035] like Figure 2 As shown, the text conversion method 200 may include operations S210 to S240. The text conversion method 200 may be implemented based on a large model, and the large model may be a large language model (LLM).

[0036] In operation S210, a target scene is determined from a plurality of candidate scenes according to attribute information of an input text and operation information of an object.

[0037] For example, the attribute information of the input text may include character length, text type, etc. The text type may include the type of language, such as Chinese, English, etc.

[0038] For example, the object may be a user, and the operation information of the object may include operations such as selection and clicking. The selection may be selecting part of the text in the input text, or may be selecting certain options in the page.

[0039] For example, the candidate scenarios may include a first scenario, a second scenario, and a third scenario. The first scenario may be used to convert the entire input text, the second scenario may be used to convert the target text selected from the input text, and the third scenario may be used to convert the target text based on the knowledge base.

[0040] For example, the correspondence between the attribute information of the input text, the operation information of the object and the target scene may be preconfigured, and then the target scene may be selected from a plurality of candidate scenes based on the correspondence.

[0041] In operation S220, the input text is processed according to a processing logic corresponding to the target scenario to obtain a first conversion result.

[0042] For example, the input text is an English paper, and the user selects part of the text in the input text as the target text. The target text can be a sentence, a paragraph, or several paragraphs in the input text. The processing logic of the first scenario can convert the full text of the first paper into a text in Chinese or other languages. The processing logic of the second scenario can convert the selected target text, for example, convert the selected target text into a text in Chinese or other languages. In addition, the processing logic of the second scenario may not use the knowledge base in the text conversion process. For example, the processing logic of the third scenario can search for some content related to the target text from the knowledge base, and then convert the target text based on the searched content.

[0043] In operation S230 , for the subtext that meets a predetermined condition in the first conversion result, a second conversion result of the subtext is determined based on the context of the subtext.

[0044] For example, the predetermined condition may include at least one of the following multiple sub-conditions. When the predetermined condition includes multiple sub-conditions, it means that the sub-text needs to meet multiple sub-conditions at the same time. For example, a sub-condition may include: the input text includes the same text as the sub-text. A sub-text that meets this sub-condition means that in the process of determining the first conversion result, the sub-text has not been effectively converted. For example, the sub-text included in the input text is "OCR", and the first conversion text also contains "OCR", that is, "OCR" has not been effectively converted. This sub-condition can be used to perform a secondary conversion on the sub-text that has not been effectively converted, thereby improving the accuracy of text conversion through the second conversion result and improving the user experience. For another example, another sub-condition may include: the sub-text is a pre-configured character, and the pre-configured character can be a professional vocabulary, etc.

[0045] For example, the context of the subtext may include the context of the subtext in the input text, or may include the context of the subtext in the first conversion result. The context of the subtext may be determined by analyzing the structure of the input text. The context of the text may be determined by the context of the subtext, so that the subtext may be accurately converted.

[0046] For example, the subtext, the context of the subtext, and a predetermined prompt information template (prompt) may be input into the large language model, and the large language model may transform the subtext according to the context of the subtext to obtain a second transformation result.

[0047] In operation S240, the first conversion result and the second conversion result are output.

[0048] For example, the first conversion result and the second conversion result may be output to a display device, a voice device, or the like, so that the first conversion result and the second conversion result are output in a visual or auditory manner.

[0049] According to the text conversion method provided by the embodiment of the present disclosure, the method can determine the target scene according to the attribute information of the input text and the operation information of the object, and then use the processing logic corresponding to the target scene to process the input text to obtain a first conversion result. In this way, a more targeted processing logic can be used for input texts of different scenes in a multi-scene adaptive manner, thereby improving the accuracy of the first conversion result. In addition, for some sub-texts in the first conversion result, the sub-texts can be further processed to obtain a second conversion result, thereby providing users with more accurate and context-related information, further improving the quality of text conversion, and improving user experience.

[0050] According to another embodiment of the present disclosure, the plurality of candidate scenarios include a first scenario, and the first scenario can be used to convert the entire text of the input text. Next, the first scenario and the corresponding processing logic are described.

[0051] In the process of determining the target scene, when it is determined that the character length of the input text is greater than or equal to the first length threshold, and the operation information of the object indicates that the target text in the input text is not selected, the first scene can be determined as the target scene. For example, the user inputs a longer input text and does not select part of the text from the input text. At this time, the target scene can be determined to be the first scene. It can be seen that this embodiment describes the first condition that needs to be met to determine the first scene as the target scene. In other examples, the first scene can also be determined as the target scene when other first conditions are met. Other first conditions are, for example, the user selects the option of the first scene in the front-end operation interface. This embodiment does not limit the first condition. It should be noted that the first condition is independent of the processing logic corresponding to the first scene.

[0052] For example, in the first scenario, the entire text of the input text can be converted, and the text conversion can be, for example, converting a foreign text such as English into Chinese text. In the actual conversion process, the input text can be first split into multiple text segments according to character length or paragraph, and then the multiple text segments can be converted in parallel to ensure the conversion speed. After that, the multiple translations obtained by the parallel conversion can be displayed according to the arrangement order of each text segment in the input text, and the multiple translations are the first conversion results.

[0053] In addition, if the input text is simply replaced with the first conversion result, the user needs to frequently switch between the input text and the first conversion result, which leads to a poor reading experience. Therefore, in the actual display process, the original text and the translation can be displayed in comparison, for example, the corresponding translation of each paragraph is displayed below the original text, so that the user can directly compare the original text and the translation on the page to improve the reading experience.

[0054] This embodiment illustrates the first scenario and the corresponding processing logic. The first scenario is suitable for academic research, language learning and other needs, and users can understand and compare the original text and the translation more conveniently.

[0055] According to another embodiment of the present disclosure, the plurality of candidate scenes include a second scene, and the second scene can be used to convert the target text. Next, the second scene and the corresponding processing logic are described.

[0056] In the process of determining the target scene, when it is determined that the character length of the input text is less than the first length threshold, and the operation information of the object indicates that the target text in the input text has been selected, and the identity of the object is outside the predetermined identification range, the second scene can be determined as the target scene. It can be seen that this embodiment describes the second condition that needs to be met to determine the second scene as the target scene. In other examples, the second scene can also be determined as the target scene when other second conditions are met. Other second conditions are, for example, the user selecting the option of the second scene in the front-end operation interface. This embodiment does not limit the second condition. It should be noted that the second condition has nothing to do with the processing logic corresponding to the second scene.

[0057] For example, in the second scenario, text segmentation technology and semantic recognition algorithms can be used to identify the length of the target text selected by the object, so as to select different strategies.

[0058] When the character length of the target text is less than the first length threshold and greater than or equal to the second length threshold, it means that the target text is long. At this time, the target text can be converted to obtain the translation of the target text, and the first conversion result includes the translation of the target text. It can be seen that this embodiment adopts full-text conversion for the longer target text, thereby improving the integrity of the context.

[0059] When the character length of the target text is less than the second length threshold, it means that the target text is shorter. For example, the target text is a short text such as a word or a short sentence. At this time, the target text can be converted to obtain the translation of the target text. Vocabulary can also be selected from the target text, and then the vocabulary is converted to obtain the vocabulary information of the vocabulary. The vocabulary information includes at least one of the following: the definition, pronunciation and example sentences of the vocabulary. The first conversion result includes the translation of the target text and the vocabulary information of the vocabulary. It can be seen that this embodiment adopts full-text conversion and vocabulary conversion for shorter target texts, providing users with more detailed vocabulary information and improving user experience.

[0060] This embodiment illustrates the second scenario and the corresponding processing logic. The second scenario is suitable for daily reading, browsing foreign language materials and other needs. The second scenario can provide users with more appropriate conversion services, allowing users to understand the main idea of ​​the target text and the vocabulary information of the vocabulary.

[0061] According to another embodiment of the present disclosure, in the process of determining the target scene, when it is determined that the character length of the input text is less than the first length threshold, and the operation information of the object represents that the target text in the input text has been selected, and the identity of the object is within a predetermined identification range, the third scene is determined as the target scene, and the third scene can be used to convert the target text based on the knowledge base. For example, the identity of the object may include the domain name used by the object, and the predetermined identification range may include a predetermined domain name range. It can be seen that this embodiment describes the third condition that needs to be met to determine the third scene as the target scene. In other examples, the first scene can also be determined as the target scene when other third conditions are met. Other third conditions are, for example, the user selects the option of the third scene in the front-end operation interface. This embodiment does not limit the third condition. It should be noted that the third condition is independent of the processing logic corresponding to the third scene.

[0062] Next, taking the target scene as the third scene among the candidate scenes as an example, the processing logic of the third scene is explained.

[0063] For example, in the third scenario, target professional terms and target entity information matching the target text can be determined in the knowledge base according to the target text. Then, the translation for the target text is determined based on the context of the target text, the target professional terms and the target entity information using the large model, and the first conversion result includes the translation.

[0064] For example, the knowledge base may include relevant explanations of target professional terms, and may also include target entity information of entities. The entities may include enterprises, and the target entity information may include relevant information within the enterprise.

[0065] In the process of determining the target professional terminology in the knowledge base, the initial professional terminology related to the target text can be retrieved in the knowledge base according to the target text, and then the target professional terminology can be determined in the initial professional terminology based on the similarity between the initial professional terminology and the target text. In this way, the target professional terminology that is relatively relevant to the target text can be searched in the knowledge base, thereby improving the accuracy of subsequent text conversion.

[0066] In the process of determining the target entity information from the knowledge base, the initial entity information related to the target text can be retrieved from the knowledge base according to the target text, and then the target entity information can be determined from the initial entity information based on the similarity between the initial entity information and the target text. In this way, the target entity information that is relatively relevant to the target text can be searched from the knowledge base, thereby improving the accuracy of subsequent text conversion.

[0067] After obtaining the target professional terminology and target entity information, the large language model can be used to perform text conversion. For example, the context of the target text in the input text, the target professional terminology, the target entity information and the preset prompt information template can be combined into input information, and then the input information is input into the large language model, and the large language model converts the target text in combination with the context, the target professional terminology and the target entity information to obtain a first conversion result.

[0068] This embodiment describes the third scenario and the corresponding processing logic. The third scenario converts highly professional texts in combination with target professional terms and context, which can improve the accuracy of the first conversion result. The third scenario is suitable for corporate users, such as professionals in the fields of law, medicine, and technology, who require high translation accuracy and professionalism when processing professional documents and technical materials.

[0069] Figure 3A is a schematic diagram of determining a first conversion result according to an embodiment of the present disclosure, Figure 3B is a schematic diagram of determining the second conversion result according to an embodiment of the present disclosure.

[0070] like Figure 3A As shown, scene recognition can be performed first, for example, the target scene can be determined from multiple candidate scenes according to the attribute information of the input text and the operation information of the object. The multiple candidate scenes can include a first scene 301, a second scene 302 and a third scene 303.

[0071] If the target scenario is a first scenario 301 for converting the full text of an input text, the input text may be split into multiple text segments, and then the multiple text segments may be converted in parallel to obtain multiple translations 304 of the multiple text segments, and then the multiple translations 304 may be combined in sequence into a translation 305 of the input text. It can be seen that the translation 305 of the input text is the first conversion result under the first scenario 301. The input text and the first conversion result may then be compared and displayed.

[0072] If the target scenario is a second scenario 302 for converting the target text selected in the input text. It can be determined whether the target text is greater than or equal to the second length threshold. If so, it means that the length of the target text is longer. At this time, the target text can be converted to obtain a translation 306 of the target text, and the translation 306 of the target text is the first conversion result of the long text under the second scenario 302. If not, it means that the length of the target text is shorter. At this time, in addition to determining the translation 306 of the target text, vocabulary can also be extracted from the target text, and the vocabulary can be converted to obtain vocabulary information 307, such as the interpretation, pronunciation and examples of the vocabulary. At this time, the first conversion result of the short text under the second scenario 302 includes the translation 306 of the target text and the vocabulary information 307 of the vocabulary.

[0073] If the target scenario is the third scenario 303 for converting the target text based on the knowledge base, the target professional terminology 308 and the target entity information 309 can be determined from the knowledge base, and the context 310 of the target text can be obtained from the input text. Then, the target text is converted based on the target professional terminology 308, the target entity information 309 and the context 310 of the target text using a large language model to obtain a translation 311 of the target text. The translation 311 of the target text is the first conversion result under the third scenario.

[0074] like Figure 3B As shown, after obtaining the first conversion result, a subtext 312 may be extracted from the first conversion result. The subtext 312 may be an unconverted text or a pre-configured vocabulary, which may be a professional vocabulary, easily confused vocabulary, abbreviation, etc. Then, the large language model may be used to perform a secondary conversion on the subtext 312 based on the context 313 of the subtext, thereby obtaining a second conversion result 314.

[0075] This embodiment can identify the target scene, and use the corresponding processing logic to process the input text based on the target scene to obtain the first conversion result. In addition, the unconverted text or pre-configured vocabulary in the first conversion result is processed to obtain the second conversion result. Therefore, the accuracy of text conversion can be improved, thereby improving the user experience.

[0076] Figure 4 It is a schematic structural block diagram of a text conversion device according to an embodiment of the present disclosure.

[0077] like Figure 4 As shown, the large model-based text conversion device 400 may include a scene determination module 410 , a first result determination module 420 , a second result determination module 430 , and an output module 440 .

[0078] The scene determination module 410 is used to determine a target scene from a plurality of candidate scenes according to the attribute information of the input text and the operation information of the object.

[0079] The first result determination module 420 is used to process the input text according to the processing logic corresponding to the target scenario to obtain a first conversion result.

[0080] The second result determination module 430 is used to determine, for a sub-text that meets a predetermined condition in the first conversion result, a second conversion result of the sub-text based on the context of the sub-text.

[0081] The output module 440 is used to output the first conversion result and the second conversion result.

[0082] According to another embodiment of the present disclosure, the attribute information includes character length; the scene determination module includes: a first scene determination submodule, a second scene determination submodule and a third scene determination submodule. The first scene determination submodule is used to determine the scene for converting the full text of the input text as the target scene in response to determining that the character length is greater than or equal to the first length threshold, and the operation information indicates that the target text in the input text is not selected. The second scene determination submodule is used to determine the scene for converting the target text as the target scene in response to determining that the character length is less than the first length threshold, and the operation information indicates that the target text has been selected, and the identity of the object is outside the predetermined identification range. The third scene determination submodule is used to determine the scene for converting the target text based on the knowledge base as the target scene in response to determining that the character length is less than the first length threshold, and the operation information indicates that the target text has been selected, and the identity is within the predetermined identification range.

[0083] According to another embodiment of the present disclosure, the target scenario is a scenario for converting a target text selected from the input text based on a knowledge base; the first result determination module includes: a first determination submodule and a second determination submodule. The first determination submodule is used to determine, in the knowledge base, target professional terms and target entity information that match the target text based on the target text. The second determination submodule is used to use a large model to determine a translation for the target text based on the context of the target text, the target professional terms and the target entity information; wherein the first conversion result includes the translation.

[0084] According to another embodiment of the present disclosure, the first determination submodule includes: a retrieval unit, a term determination unit and an entity determination unit. The retrieval unit is used to retrieve initial professional terms and initial entity information related to the target text in the knowledge base according to the target text. The term determination unit is used to determine the target professional term in the initial professional term based on the similarity between the initial professional term and the target text. The entity determination unit is used to determine the target entity information in the initial entity information based on the similarity between the initial entity information and the target text.

[0085] According to another embodiment of the present disclosure, the target scenario is a scenario for converting the target text selected from the input text; the first result determination module includes: a third determination submodule and a fourth determination submodule. The third determination submodule is used to convert the target text in response to determining that the character length is less than the first length threshold and greater than or equal to the second length threshold, to obtain a translation of the target text, wherein the first conversion result includes the translation; wherein the first length threshold is greater than the second length threshold. The fourth determination submodule is used to convert the target text and the vocabulary included in the target text respectively in response to determining that the character length is less than the second length threshold, to obtain the translation and the vocabulary information of the vocabulary, wherein the first conversion result includes: the translation and the vocabulary information.

[0086] According to another embodiment of the present disclosure, the vocabulary information includes at least one of the following: a definition, a pronunciation, and an example sentence of the vocabulary.

[0087] According to another embodiment of the present disclosure, the predetermined condition includes: the input text includes text that is the same as the subtext.

[0088] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, including at least one processor; and a memory communicatively connected to the at least one processor; the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned text conversion method.

[0089] According to an embodiment of the present disclosure, the present disclosure further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the above-mentioned text conversion method.

[0090] According to an embodiment of the present disclosure, the present disclosure further provides a computer program product, including a computer program, and the computer program implements the above text conversion method when executed by a processor.

[0091] Figure 51 is a block diagram of an electronic device for implementing the text conversion method of an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0092] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0093] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0094] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as the text conversion method. For example, in some embodiments, the text conversion method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the text conversion method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the text conversion method in any other appropriate manner (e.g., by means of firmware).

[0095] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0096] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0097] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0098] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0099] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0100] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0101] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0102] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A text conversion method based on a large model, comprising: Determine a target scene from multiple candidate scenes according to attribute information of the input text and operation information of the object; Processing the input text according to a processing logic corresponding to the target scenario to obtain a first conversion result; For a subtext that meets a predetermined condition in the first conversion result, determining a second conversion result of the subtext based on the context of the subtext; and The first conversion result and the second conversion result are output.

2. The method according to claim 1, wherein: The attribute information includes character length; Determining the target scene from a plurality of candidate scenes according to the attribute information of the input text and the operation information of the object includes: In response to determining that the character length is greater than or equal to a first length threshold, and the operation information indicates that a target text in the input text is not selected, determining a scene for converting the entire text of the input text as the target scene; In response to determining that the character length is less than the first length threshold, and the operation information indicates that the target text has been selected, and the identity of the object is outside a predetermined identification range, determining a scene for converting the target text as the target scene; and In response to determining that the character length is less than the first length threshold, and the operation information indicates that the target text has been selected, and the identity identifier is within the predetermined identifier range, a scenario for converting the target text based on a knowledge base is determined as the target scenario.

3. The method according to claim 1, wherein: The target scenario is a scenario for converting the target text selected from the input text based on the knowledge base; The processing of the input text according to the processing logic corresponding to the target scenario to obtain a first conversion result includes: According to the target text, determining target professional terms and target entity information matching the target text in a knowledge base; and Determine a translation for the target text based on the context of the target text, the target professional terminology and the target entity information by using a large model; The first conversion result includes the translation.

4. The method according to claim 3, wherein: Determining target professional terms and target entity information matching the target text in a knowledge base according to the target text includes: According to the target text, searching the knowledge base for initial professional terms and initial entity information related to the target text; Determining the target professional term in the initial professional term based on the similarity between the initial professional term and the target text; and Based on the similarity between the initial entity information and the target text, the target entity information is determined in the initial entity information.

5. The method according to claim 1, wherein: The target scene is a scene for converting the target text selected from the input text; The processing of the input text according to the processing logic corresponding to the target scenario to obtain a first conversion result includes: In response to determining that the character length is less than a first length threshold and greater than or equal to a second length threshold, converting the target text to obtain a translation of the target text, wherein the first conversion result includes the translation; wherein the first length threshold is greater than the second length threshold; and In response to determining that the character length is less than the second length threshold, the target text and the vocabulary included in the target text are converted respectively to obtain the translation and the vocabulary information of the vocabulary, wherein the first conversion result includes: the translation and the vocabulary information.

6. The method according to claim 5, wherein: The vocabulary information includes at least one of the following: a definition, a pronunciation, and an example sentence of the vocabulary.

7. The method according to claim 1, wherein: The predetermined conditions include: The input text includes text that is the same as the subtext.

8. A text conversion device based on a large model, comprising: A scene determination module, used to determine a target scene from multiple candidate scenes according to attribute information of the input text and operation information of the object; A first result determination module, configured to process the input text according to a processing logic corresponding to the target scenario to obtain a first conversion result; A second result determination module, configured to determine, for a sub-text satisfying a predetermined condition in the first conversion result, a second conversion result of the sub-text based on the context of the sub-text; as well as An output module is used to output the first conversion result and the second conversion result.

9. The device according to claim 8, wherein: The attribute information includes character length; the scene determination module includes: A first scene determination submodule is configured to, in response to determining that the character length is greater than or equal to a first length threshold and the operation information indicates that a target text in the input text is not selected, determine a scene for converting the entire text of the input text as the target scene; a second scene determination submodule, configured to, in response to determining that the character length is less than the first length threshold, the operation information indicates that the target text has been selected, and the identity identifier of the object is outside a predetermined identification range, determine a scene for converting the target text as the target scene; and The third scene determination submodule is used to determine the scene for converting the target text based on the knowledge base as the target scene in response to determining that the character length is less than the first length threshold, the operation information indicates that the target text has been selected, and the identity identifier is within the predetermined identifier range.

10. The device according to claim 8, wherein: The target scenario is a scenario for converting the target text selected from the input text based on the knowledge base; The first result determination module comprises: A first determination submodule is used to determine, according to the target text, target professional terms and target entity information matching the target text in a knowledge base; and A second determination submodule is used to determine a translation for the target text based on the context of the target text, the target professional terminology and the target entity information by using a large model; The first conversion result includes the translation.

11. The device according to claim 10, wherein: The first determining submodule includes: A retrieval unit, configured to retrieve initial professional terms and initial entity information related to the target text in a knowledge base according to the target text; a term determination unit, configured to determine the target professional term in the initial professional term based on the similarity between the initial professional term and the target text; and The entity determination unit is used to determine the target entity information in the initial entity information based on the similarity between the initial entity information and the target text.

12. The device according to claim 8, wherein: The target scene is a scene for converting the target text selected from the input text; The first result determination module comprises: a third determination submodule, configured to, in response to determining that the character length is less than a first length threshold and greater than or equal to a second length threshold, convert the target text to obtain a translation of the target text, wherein the first conversion result includes the translation; wherein the first length threshold is greater than the second length threshold; and The fourth determination submodule is used to convert the target text and the vocabulary included in the target text respectively in response to determining that the character length is less than the second length threshold, so as to obtain the translation and the vocabulary information of the vocabulary, wherein the first conversion result includes: the translation and the vocabulary information.

13. The device according to claim 12, wherein: The vocabulary information includes at least one of the following: a definition, a pronunciation, and an example sentence of the vocabulary.

14. The device according to claim 8, wherein: The predetermined conditions include: The input text includes text that is the same as the subtext.

15. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

17. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Cboth translation method, device and equipment, medium and program product

    CN119721059A

  • Advertising translation method, apparatus, device, medium, and program product

    CN119721059B