Search

CN-122021667-A - Translation method and device based on large language model and electronic equipment

CN122021667ACN 122021667 ACN122021667 ACN 122021667ACN-122021667-A

Abstract

The application relates to a translation method and device based on a large language model and electronic equipment. The method comprises the steps of obtaining text information to be translated and user input information, wherein the user input information is used for indicating translation requirements for translating the text information to be translated, obtaining corresponding target prompt words according to the user input information, inputting the text information to be translated and the target prompt words into a preset large language model, and outputting target translation results matched with the user input information. According to the scheme provided by the application, the target prompt word corresponding to the text information to be translated can be extracted from the user input information, and the translation process of the large language model is guided by utilizing the target prompt word, so that the translation result is attached to the translation requirement of a specific field, and the accuracy of the translation result is effectively improved.

Inventors

  • JIANG SHIMING
  • LI HAIMING
  • HUANG ZHAOHUI

Assignees

  • 广州力挚网络科技有限公司

Dates

Publication Date
20260512
Application Date
20241111

Claims (10)

  1. 1. A method for large language model based translation, comprising: acquiring text information to be translated and user input information, wherein the user input information is used for indicating the translation requirement for translating the text information to be translated; acquiring a corresponding target prompt word according to the user input information; And inputting the text information to be translated and the target prompt word into a preset large language model, and outputting a target translation result matched with the user input information.
  2. 2. The method of claim 1, wherein the obtaining the corresponding target prompt word according to the user input information includes: extracting prompt word information in the user input information according to the user input information, wherein the prompt word information comprises at least one of file content description information, field description information and translation requirement information; and generating a target prompt word according to the prompt word information.
  3. 3. The method of claim 1, wherein outputting the target translation result that matches the user input information comprises: And outputting a target translation result which corresponds to the paragraph and is matched with the user input information in sequence according to the paragraph information in the text information to be translated.
  4. 4. The method according to claim 1, wherein the text information to be translated is obtained by: Receiving a file to be processed; Text recognition is carried out on the content of the file to be processed by adopting an OCR text recognition method to obtain text information to be translated, wherein the format of the file to be processed comprises any one of a PDF format, a Word format, an Excel format and an image format, or The method comprises the steps of receiving address information, wherein the address information is used for indicating the storage position of a file to be processed; and acquiring a corresponding file to be processed according to the address information, performing text recognition on the content of the file to be processed by adopting an OCR text recognition method to acquire text information to be translated, wherein the format of the file to be processed comprises any one of a PDF format, a word format, an Excel format and an image format.
  5. 5. The method of claim 4, wherein prior to said outputting a target translation result that matches said user input information, the method further comprises: According to the file to be processed, obtaining a background picture matched with the text information to be translated; the outputting the target translation result matched with the user input information comprises the following steps: And according to paragraph information in the text information to be translated, sequentially outputting target translation results which are covered on the background picture and matched with the user input information by adopting a segmentation output mode.
  6. 6. The method of claim 5, wherein prior to said outputting a target translation result that matches said user input information, the method further comprises: acquiring paragraph background colors matched with the text information to be translated according to the file to be processed; the target translation result output process of each paragraph comprises the following steps: according to paragraph information in the text information to be translated, covering a preset shape area with corresponding paragraph background color at a position corresponding to the paragraph on the background picture; And after adding the text box in the preset shape area, filling the text information corresponding to the target translation result into the text box.
  7. 7. The method according to claim 5 or 6, characterized in that the method further comprises: The modification instruction indicates to activate an editing function for editing the target translation result of the corresponding segment; displaying a modification interaction interface of the target translation result of the corresponding segment according to the modification instruction; and modifying the target translation result according to the input content of the modification interaction interface.
  8. 8. The method according to claim 1, characterized in that the method further comprises: the export instruction indicates that part or all of the target translation result is exported; and according to the export instruction, exporting part or all of the target translation result into a target file, wherein the format of the target file comprises any one of PDF format and image format.
  9. 9. A large language model based translation device, comprising: The information acquisition module is used for acquiring text information to be translated and user input information, wherein the user input information is used for indicating the requirement of translating the text information to be translated; A prompt word acquisition module for acquiring corresponding target prompt words according to the user input information, and And the result output module is used for inputting the text information to be translated and the target prompt word into a preset large language model and outputting a target translation result matched with the user input information.
  10. 10. An electronic device, comprising: Processor, and A memory having executable code stored thereon, which when executed by the processor, causes the processor to perform the method of any of claims 1-8.

Description

Translation method and device based on large language model and electronic equipment Technical Field The present application relates to the field of artificial intelligence technologies, and in particular, to a translation method and apparatus based on a large language model, and an electronic device. Background The principle of document translation is to analyze and process the text in the source language by using a computer program, and then generate a translation result in the target language according to a pre-trained model. In the related art, a general machine translation model is generally used to directly translate text in a source language to a target language. However, the traditional machine translation model lacks understanding of specific contents such as industry terms, industry specifications and the like in specific fields, and only simple conversion and combination are carried out on words and phrases through the model according to preset rules and algorithms, so that problems such as translation errors, translation inconformity and the like are easy to occur during translation, and accuracy of a translation result is affected. Disclosure of Invention In order to solve or partially solve the problems in the related art, the application provides a translation method, a translation device and electronic equipment based on a large language model, which can extract target prompt words corresponding to text information to be translated from user input information, and utilize the target prompt words to guide the translation process of the large language model, so that a translation result is tightly attached to the translation requirement of a specific field, and the accuracy of the translation result is effectively improved. The application provides a translation method based on a large language model, which is used for acquiring text information to be translated and user input information, wherein the user input information is used for indicating the translation requirement of translating the text information to be translated; acquiring a corresponding target prompt word according to the user input information; And inputting the text information to be translated and the target prompt word into a preset large language model, and outputting a target translation result matched with the user input information. In some embodiments, the obtaining, according to the user input information, a corresponding target prompt word includes: extracting prompt word information in the user input information according to the user input information, wherein the prompt word information comprises at least one of file content description information, field description information and translation requirement information; and generating a target prompt word according to the prompt word information. In some embodiments, the outputting the target translation result that matches the user input information includes: And outputting a target translation result which corresponds to the paragraph and is matched with the user input information in sequence according to the paragraph information in the text information to be translated. In some embodiments, the text information to be translated is obtained by: Receiving a file to be processed; Text recognition is carried out on the content of the file to be processed by adopting an OCR text recognition method to obtain text information to be translated, wherein the format of the file to be processed comprises any one of a PDF format, a Word format, an Excel format and an image format, or The method comprises the steps of receiving address information, wherein the address information is used for indicating the storage position of a file to be processed; and acquiring a corresponding file to be processed according to the address information, performing text recognition on the content of the file to be processed by adopting an OCR text recognition method to acquire text information to be translated, wherein the format of the file to be processed comprises any one of a PDF format, a word format, an Excel format and an image format. In some embodiments, before the outputting the target translation result that matches the user input information, the method further comprises: According to the file to be processed, obtaining a background picture matched with the text information to be translated; the outputting the target translation result matched with the user input information comprises the following steps: And according to paragraph information in the text information to be translated, sequentially outputting target translation results which are covered on the background picture and matched with the user input information by adopting a segmentation output mode. In some embodiments, before the outputting the target translation result that matches the user input information, the method further comprises: acquiring paragraph background colors matched with the text information to be tra