Information acquisition method and system and electronic equipment

By obtaining and entering text and format information matching the target question from the knowledge base, the problem of the model identifying only text content is solved, and the accuracy of information acquisition is improved.

CN119312898APending Publication Date: 2025-01-14LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411545401.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

When users use the model, the model can only identify the text content in the file, resulting in a large amount of key information that may be lost, which will affect the accuracy of the information.

Method used

By determining the first reference information and the second reference information matching the target question from the pre-stored knowledge base, the second reference information includes format information that characterizes the first text information, and the target question, the first reference information and The second reference information is input to the target model so that the target model can reply based on the first text information and its format information.

Benefits of technology

The accuracy of the model's response to the target question is improved, so that the reply is based not only on the text content, but also on the format information of the text content, so as to respond to the target question more accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119312898A_ABST
    Figure CN119312898A_ABST
Patent Text Reader

Abstract

The invention discloses an information acquisition method and system and electronic equipment. The method comprises the following steps: acquiring a target question; based on the target question, first reference information and second reference information matched with the target question are determined from a pre-stored knowledge base, the first reference information comprises first text information, the second reference information comprises second text information, and the second text information is used for representing format information corresponding to the first text information; and inputting the target question, the first reference information and the second reference information into the target model to obtain a reply of the target model to the target question based on the first reference information and the second reference information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information processing, and in particular to an information acquisition method, system and electronic device. Background Art

[0002] When users use the model, the model can usually only recognize the text content in the file, which may result in the loss of more key information, thereby affecting the accuracy of the information. Summary of the invention

[0003] In view of this, the present application provides an information acquisition method, system and electronic device, and the specific scheme thereof is as follows:

[0004] A method for obtaining information, comprising:

[0005] Get the target question;

[0006] Determining first reference information and second reference information matching the target question from a pre-stored knowledge base based on the target question, wherein the first reference information includes first text information, and the second reference information includes second text information, and the second text information is used to represent format information corresponding to the first text information;

[0007] The target question, the first reference information, and the second reference information are input into a target model to obtain a response of the target model to the target question based on the first reference information and the second reference information.

[0008] Furthermore, it also includes:

[0009] Get the target file;

[0010] Extracting the first text information from the target file;

[0011] Obtaining the second text information according to the format information corresponding to the first text information in the target file;

[0012] The first reference information and the second reference information are formed in the knowledge base according to the first text information and the second text information.

[0013] Furthermore, the obtaining the second text information according to the format information corresponding to the first text information in the target file includes:

[0014] The target file is input into the target model to obtain the second text information generated by the target model, and the target model can generate corresponding output results according to natural language instructions.

[0015] Further, forming the first reference information and the second reference information in the knowledge base according to the first text information and the second text information includes:

[0016] Obtaining a target feature vector of the first text information;

[0017] Obtaining the first reference information according to the first text information;

[0018] Obtaining the second reference information according to the second text information;

[0019] The target feature vector, the first reference information and the second reference information are stored in the knowledge base, wherein the target feature vector and the first reference information have a first corresponding relationship, and the first reference information and the second reference information have a second corresponding relationship.

[0020] Furthermore, the second reference information includes rich text format information, and the second reference information also includes the first text information; the first text information is the text information in the rich text format information, and the second text information is the format tag information in the rich text format information.

[0021] Furthermore, the second text information is format information corresponding to the first text information represented by natural language.

[0022] Further, the determining, based on the target question, from a pre-stored knowledge base, first reference information and second reference information that match the target question includes:

[0023] Determining first reference information matching the target question from a pre-stored knowledge base based on the target question;

[0024] Second reference information associated with the first reference information in the knowledge base is determined.

[0025] An information acquisition system, comprising:

[0026] Acquisition unit, used to obtain target questions;

[0027] A determination unit, configured to determine, based on the target question, first reference information and second reference information matching the target question from a pre-stored knowledge base, wherein the first reference information includes first text information, and the second reference information includes second text information, and the second text information is used to represent format information corresponding to the first text information;

[0028] An input unit is used to input the target question, the first reference information and the second reference information into a target model to obtain a reply of the target model to the target question based on the first reference information and the second reference information.

[0029] An electronic device, comprising:

[0030] A processor is used to obtain a target question; based on the target question, determine first reference information and second reference information that match the target question from a pre-stored knowledge base, wherein the first reference information includes first text information, the second reference information includes second text information, and the second text information is used to characterize format information corresponding to the first text information; input the target question, the first reference information, and the second reference information into a target model to obtain a response of the target model to the target question based on the first reference information and the second reference information;

[0031] The memory is used to store the program required by the processor to execute the above processing process.

[0032] A readable storage medium for storing at least one set of instructions;

[0033] The instruction set is used to be called and at least execute any one of the information acquisition methods described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0035] Figure 1 A flowchart of an information acquisition method disclosed in an embodiment of the present application;

[0036] Figure 2 A schematic diagram of reference information stored in a knowledge base disclosed in an embodiment of the present application;

[0037] Figure 3 A flowchart of an information acquisition method disclosed in an embodiment of the present application;

[0038] Figure 4 A schematic diagram of a target file disclosed in an embodiment of the present application;

[0039] Figure 5 A schematic diagram of a first text message disclosed in an embodiment of the present application;

[0040] Figure 6 A schematic diagram of second reference information disclosed in an embodiment of the present application;

[0041] Figure 7 A flowchart of an information acquisition method disclosed in an embodiment of the present application;

[0042] Figure 8 A schematic diagram of the structure of an information acquisition system disclosed in an embodiment of the present application;

[0043] Fig. 9 A schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0044] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0045] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0046] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0047] The present application discloses an information acquisition method, the flow chart of which is as follows: Figure 1 As shown, including:

[0048] Step S11, obtaining a target question;

[0049] Step S12: determining first reference information and second reference information matching the target question from a pre-stored knowledge base based on the target question, wherein the first reference information includes first text information, and the second reference information includes second text information, and the second text information is used to represent format information corresponding to the first text information;

[0050] Step S13: input the target question, the first reference information and the second reference information into the target model to obtain a response of the target model to the target question based on the first reference information and the second reference information.

[0051] When users use the model, the model can usually only recognize the text content in the file, which may result in the loss of more key information, thus affecting the accuracy of the model.

[0052] Based on this, in this solution, reference information is stored in the knowledge base in advance. When a target question is obtained, the first reference information and the second reference information that match the target question are determined from the knowledge base based on the target question, and the target question, the first reference information and the second reference information are input into the target model, so that the target model can reply to the target question based on the first reference information and the second reference information. The first reference information includes first text information, and the second reference information includes second text information for characterizing the format information corresponding to the first text information. When replying to the target question, the target model can not only reply based on the first text information, but also supplement the first text information based on the format information corresponding to the first text information, so that the reply to the target question can be more accurate.

[0053] If there is a question that needs to be input into the target model, after obtaining the target question, the target question may be first analyzed to determine the first reference information and the second reference information that match the target question.

[0054] The first reference information includes the first text information, and the second reference information includes the second text information, and the second text information is used to represent the format information corresponding to the first text information. That is, the second text information included in the second reference information is used to represent the format information corresponding to the first text information, such as: the first part of the content in the first text information is in bold font, the second part of the content in the first text information is in red font, etc., which is used to explain the format in the first text information, so as to further emphasize or supplement the content in the first text information.

[0055] A knowledge base is set up, and a plurality of reference information is pre-stored in the knowledge base. The plurality of reference information stored in the knowledge base includes not only reference information including text information, but also reference information including format information corresponding to the text information. For example, a plurality of first reference information and a plurality of second reference information are pre-stored in the knowledge base. As long as the first text information included in the first reference information has corresponding format information, the corresponding second reference information will be stored in the knowledge base.

[0056] like Figure 2As shown, it is a schematic diagram of reference information stored in a knowledge base, which at least includes: first reference information 1, first reference information 2, first reference information 3, first reference information 4, first reference information 5, second reference information 1, second reference information 2, second reference information 3 and second reference information 4, wherein the first text information included in the first reference information 1 to the first reference information 4 all has corresponding format information, so each first reference information in the first reference information 1 to the first reference information 4 has corresponding second reference information, and the first text information included in the first reference information 5 does not have corresponding format information, therefore, the knowledge base does not include second reference information corresponding to the first reference information 5.

[0057] Of course, it can also be: as long as it is text information, there will be corresponding format information, then each first reference information stored in the knowledge base has its corresponding second reference information, and this example will not be repeated here.

[0058] When multiple reference information are pre-stored in the knowledge base, if a target question needs to be input into the target model, after obtaining the target question, the target question is first analyzed, and the first reference information and the second reference information that match the target question are determined from the knowledge base, such as: determining that the first reference information 2 and the second reference information 2 in the knowledge base match the target question; and another example: determining that the first reference information 5 in the knowledge base matches the target question, wherein the text information included in the first reference information 5 does not have associated format information stored in the knowledge base.

[0059] If the first reference information 2 and the second reference information 2 that match the target question are determined from the knowledge base, the target question, the first reference information 2 and the second reference information 2 are all input into the target model. At this time, the target model can analyze the first reference information 2 and the second reference information 2 based on the target question to obtain a reply to the target question, and output the reply to the target question, so that the reply of the target model to the target question is obtained based on the first reference information 2 and the second reference information 2, wherein the first reference information 2 includes the first text information, and the second reference information 2 includes the format information corresponding to the first text information. When the target model obtains a reply to the target question, it is based on the first text information and its corresponding format information, and can judge the key information or prominent information in the first text information through the format information, so that the obtained reply can be more consistent with the first reference information and the second reference information, that is, the reply to the target question is more accurate.

[0060] For example: the first text information includes two parallel parts, where the first part has a bold font format, while the second part has no other format. Then, when generating a reply to the target question using the first text information and its format information, it can be determined that the first part of the first text information is the key content, and the first part can be highlighted to make the reply to the target question more targeted.

[0061] In addition, it should be noted that if only the first reference information 5 matching the target question is determined from the knowledge base, and the second reference information 5 associated with the first reference information 5 is not determined, the target question and the first reference information 5 can be directly input into the target model. After obtaining the target question and the first reference information 5, the target model analyzes the first reference information 5 based on the target question to determine a response to the target question. At this time, the determined response to the target question is based on the first reference information 5, and has nothing to do with the format information corresponding to the first text information included in the first reference information 5.

[0062] The information acquisition method disclosed in this embodiment obtains a target question; based on the target question, the first reference information and the second reference information matching the target question are determined from a pre-stored knowledge base, the first reference information includes the first text information, the second reference information includes the second text information, and the second text information is used to characterize the format information corresponding to the first text information; the target question, the first reference information and the second reference information are input into the target model to obtain the target model's response to the target question based on the first reference information and the second reference information. When obtaining the target question, the scheme first determines the matching first reference information and the second reference information from the knowledge base based on the target question, and then inputs the target question, the first reference information and the second reference information into the target model, wherein the first reference information and the second reference information include not only the first text information, but also the format information corresponding to the first text information, so that the information input into the target model is more accurate, so that when the target model analyzes the target question, it can not only analyze based on the first text information, but also analyze based on the format information corresponding to the first text information, so as to improve the accuracy of the target model's response to the target question and improve the user experience.

[0063] This embodiment discloses a method for obtaining information, and its flow chart is as follows: Figure 3 As shown, including:

[0064] Step S31, obtaining a target file;

[0065] Step S32, extracting first text information from the target file;

[0066] Step S33, obtaining second text information according to the format information corresponding to the first text information in the target file;

[0067] Step S34, forming first reference information and second reference information in a knowledge base according to the first text information and the second text information;

[0068] Step S35, obtaining a target question;

[0069] Step S36: determining first reference information and second reference information matching the target question from a pre-stored knowledge base based on the target question, wherein the first reference information includes first text information, and the second reference information includes second text information, and the second text information is used to represent format information corresponding to the first text information;

[0070] Step S37: input the target question, the first reference information and the second reference information into the target model to obtain a response of the target model to the target question based on the first reference information and the second reference information.

[0071] Multiple first reference information and corresponding second reference information are stored in the knowledge base in advance, so that when the target model is needed to answer the target question, the matching first reference information and second reference information can be found from the knowledge base based on the target question, and the target question and the matching first reference information and second reference information are input into the target model, so that the target model can reply to the target question based on the first reference information and the second reference information.

[0072] Storing a plurality of first reference information and corresponding second reference information in the knowledge base may be extracting the first reference information and the corresponding second reference information from the target file and storing them in the knowledge base.

[0073] Specifically, a target file is obtained, the target file is analyzed, and first text information is extracted therefrom. The first text information is the plain text content in the target file. The plain text content in the target file is extracted as the first text information.

[0074] After extracting the first text information from the target file, the format information corresponding to the first text information in the target file is determined, and the second text information is obtained according to the format information corresponding to the first text information in the target file, that is, the second text information is the specific format information of the first text information in the target file.

[0075] After obtaining the first text information and the second text information, the first reference information and the second reference information in the knowledge base are generated according to the first text information and the second text information. The first reference information and the second reference information can be generated directly in the knowledge base according to the first text information and the second text information, or after generating the first reference information and the second reference information, the first reference information and the second reference information can be stored in the knowledge base.

[0076] Since the first reference information includes the first text information, the second reference information includes the second text information, and the second text information is generated according to the format information corresponding to the first text information in the target file, the first reference information and the second reference information stored in the knowledge base are associated with each other.

[0077] Among them, the first text information included in the first reference information is the plain text content in the target file, and the second text information included in the second reference information is the format information of the first text information in the target file. Then, the format information of the first text included in the second reference information in the target file can be rich text format information.

[0078] Plain text refers to text data without any formatting, and only contains basic text characters and control characters such as spaces and line breaks. For example, a .txt file is a typical example of plain text, which can be opened and edited in any text editor, but cannot contain images, diverse font styles, or complex page layouts.

[0079] Compared with plain text, rich text refers to text that contains formatting information, such as font style (bold, italic, etc.), color, hyperlinks, images, tables and other multimedia elements. In HTML, rich text usually refers to text containing HTML tags, which define various formats such as fonts, colors, alignment, etc.

[0080] The second reference information includes rich text format information, and displays the format information corresponding to the first text information in a rich text format. At this time, the second reference information should include not only the rich text format information but also the first text information. The first text information in the second reference information is not presented in the form of a complete text file, but is displayed in the rich text format information. It is displayed in the form of text in the rich text format information and is displayed corresponding to the format tag information in the rich text format information.

[0081] That is, in the rich text format information, first comes a paragraph or a sentence or at least part of the text in the first text information, followed by the format tag corresponding to the paragraph or sentence or at least part of the text in a sentence, and after the format tag corresponding to the part of the text is recorded, what continues to be recorded is the next paragraph or the next sentence or at least part of the text in the first text information, and the format tag corresponding to the at least part of the text is recorded.

[0082] like Figure 4 As shown in FIG. 1 , it is a schematic diagram of a target file, which includes text and images. Some text information corresponds to a special format. The target file is used to obtain first text information and second text information. The schematic diagram of the first text information can be as shown in FIG. Figure 5 As shown, it only includes the text information in the target file;

[0083] If the first text information is text information in rich text format information, the second text information is format tag information in rich text format information, and the second reference information includes rich text format information, that is, it includes both text information and format tag information, then Figure 6 As shown, it is a schematic diagram of the second reference information. Figure 6 The format tag includes the text information in the first text information and each piece of text information, so as to achieve the purpose of describing the format in the first text information.

[0084] In addition, in addition to the first reference information and the second reference information, the knowledge base may also include: image description information, that is, the target file includes not only text but also images, and the images are described. The description information of the images is stored in the knowledge base, so that when there is a target question that needs to retrieve the corresponding information in the knowledge base, if the information to be retrieved includes the image description information, what can be retrieved includes not only the first reference information and the second reference information, but also the image description information associated with the first reference information, so that when the target model responds to the target question, it can respond based on more comprehensive information, making the response to the target question more accurate.

[0085] Furthermore, in the information acquisition method disclosed in this embodiment, the second reference information may include rich text format information composed of first text information and second text information, wherein the first text information is the text information in the rich text format information, and the second text information is the format tag information in the rich text format information; in addition, the second reference information may also include the second text information, but the second text information is the format information corresponding to the first text information represented by natural language.

[0086] That is, the second reference information also includes the first text information and the second text information, but the second text information is information represented by natural language, and what is represented by natural language is the format information of the text information in the first text information.

[0087] For example: "target file" is a title, and "split everything" is the bold text contained in an ordinary paragraph, wherein "target file" and "split everything" are text contents in the first text information extracted from the target file, and "is a title" and "is the bold text contained in an ordinary paragraph" are format information corresponding to part of the text contents in the first text information in the target file, which is represented by natural language.

[0088] In the information acquisition method disclosed in this embodiment, regardless of whether the second reference information includes rich text format information or format information corresponding to the first text information represented by natural language, it is used to supplement the first text information so that the information obtained by the target model for responding to the target question is more complete, so that the target model's response to the target question is more accurate.

[0089] The information acquisition method disclosed in the present embodiment obtains a target file; extracts first text information from the target file; obtains second text information according to format information corresponding to the first text information in the target file; forms first reference information and second reference information in a knowledge base according to the first text information and the second text information; obtains a target question; based on the target question, determines first reference information and second reference information matching the target question from a pre-stored knowledge base, wherein the first reference information includes first text information, the second reference information includes second text information, and the second text information is used to characterize format information corresponding to the first text information; inputs the target question, the first reference information, and the second reference information into a target model to obtain a response of the target model to the target question based on the first reference information and the second reference information. When storing the first reference information and the second reference information in the knowledge base, this solution first obtains the target file, extracts the first text information from the target file, then obtains the format information corresponding to the first text information, and generates the first reference information and the second reference information based on this, thereby realizing the determination of the first reference information and the second reference information from the target file, so that the first reference information and the second reference information stored in the database are determined by the clear association relationship in the target file, and when the target model responds to the target question, the response is determined based on the first reference information and the second reference information stored in the knowledge base, thereby improving the accuracy of the target model's response to the target question.

[0090] Furthermore, in the information acquisition method disclosed in this embodiment, a target file is obtained, first text information is extracted from the target file, second text information is obtained based on format information corresponding to the first text information in the target file, and first reference information and second reference information are formed in a knowledge base based on the first text information and the second text information. The above steps can be performed by the target model.

[0091] That is, the target model can obtain the target file, generate the first reference information and the second reference information based on the target file, and store the generated first reference information and the second reference information in the knowledge base. Moreover, after obtaining the target question, the target question and the first reference information and the second reference information obtained from the knowledge base based on the target question can be input into the target model, so that the target model can output a reply to the target question; or, when there is a target question, the target question is directly input into the target model, so that the target model can first obtain the first reference information and the second reference information matching the target question from the knowledge base based on the target question, and then the target model uses the target question, the first reference information and the second reference information to determine the reply to the target question.

[0092] The first reference information and the second reference information are generated based on the target file and stored in the knowledge base. This step is performed by the target model so that the first reference information and the second reference information stored in the knowledge base can be more accurate and more consistent with the target file.

[0093] Alternatively, it can also be:

[0094] Obtain the target file, extract the first text information from the target file, this step is implemented by software or program, then input the target file into the target model so that the target model obtains the corresponding second text information in the target file, the second text information is the format information corresponding to the first text information. After the target model obtains the second text information, the first reference information and the second reference information in the knowledge base are obtained by using the first text information and the second text information, this step can be implemented by software or program, or by the target model.

[0095] Of course, the above steps can be implemented by the target model or by other models, which will not be elaborated here.

[0096] In addition, it is also possible to: obtain a target file, and form first reference information and second reference information in a knowledge base based on the target file, which can be implemented by software or a program without the need for a model.

[0097] This embodiment discloses a method for obtaining information, and its flow chart is as follows: Figure 7 Said, including:

[0098] Step S71, obtaining a target file;

[0099] Step S72, extracting first text information from the target file;

[0100] Step S73, obtaining second text information according to the format information corresponding to the first text information in the target file;

[0101] Step S74, obtaining a target feature vector of the first text information, obtaining first reference information according to the first text information, and obtaining second reference information according to the second text information;

[0102] Step S75: storing the target feature vector, the first reference information, and the second reference information in a knowledge base, wherein the target feature vector and the first reference information have a first corresponding relationship, and the first reference information and the second reference information have a second corresponding relationship;

[0103] Step S76, obtaining a target question;

[0104] Step S77: determining first reference information and second reference information matching the target question from a pre-stored knowledge base based on the target question, wherein the first reference information includes first text information, and the second reference information includes second text information, and the second text information is used to represent format information corresponding to the first text information;

[0105] Step S78: input the target question, the first reference information and the second reference information into the target model to obtain a response of the target model to the target question based on the first reference information and the second reference information.

[0106] The first reference information and the second reference information are formed in the knowledge base based on the target file, so that when a target question is obtained, the first reference information and the second reference information related to the target question can be extracted from the knowledge base, and the target question, the extracted first reference information and the second reference information are input into the target model, so that the target model outputs a response to the target question.

[0107] A target file is obtained, and after extracting the first text information from the target file, the second text information is obtained according to the format information corresponding to the first text information in the target file, and then the first reference information and the second reference information are formed in the knowledge base based on the first text information and the second text information.

[0108] Among them, forming the first reference information and the second reference information in the knowledge base based on the first text information and the second text information can be specifically as follows: obtaining a target feature vector of the first text information, obtaining the first reference information based on the first text information, obtaining the second reference information based on the second text information, and then storing the target feature vector, the first reference information and the second reference information in the knowledge base.

[0109] Obtaining a target feature vector of the first text information, that is, representing the first text information by the target feature vector;

[0110] Obtaining first reference information based on the first text information, wherein the first reference information may be the first text information directly, or may be information obtained after feature extraction of the first text information, or may be: using the first text information and the first corresponding relationship as the first reference information, the first corresponding relationship representing the corresponding relationship between the target feature vector and the first reference information;

[0111] The second reference information is obtained based on the second text information. The second reference information may be: when the second reference information includes rich text format information, the second reference information includes the first text information and the second text information representing the format tag corresponding to the first text information; or, when the second text information is the format information corresponding to the first text information represented by natural language, the second reference information includes the first text information and the second text information representing the format information corresponding to the first text information by natural language; or, in addition to the second text information, the second reference information also includes a second corresponding relationship, and the second corresponding relationship is the corresponding relationship between the first reference information and the second reference information.

[0112] Furthermore, first reference information and second reference information matching the target question are determined from a pre-stored knowledge base based on the target question, including: determining first reference information matching the target question from a pre-stored knowledge base based on the target question, and determining second reference information associated with the first reference information in the knowledge base.

[0113] When a target question is asked, firstly first reference information matching the target question is determined from the knowledge base, and then second reference information associated with the first reference information in the knowledge base is determined based on the correspondence between the first reference information and the second reference information.

[0114] If the knowledge base stores not only the first reference information, the second reference information and the second correspondence between the first reference information and the second reference information, but also stores the target feature vector of the first text information and the first correspondence between the target feature vector of the first text information and the first reference information, then, when there is a target question, firstly, the target feature vector corresponding to the target question is determined from the knowledge base based on the target question, then the first reference information in the knowledge base that has a first correspondence with the target question is determined, and finally, the second reference information in the knowledge base that has a second correspondence with the first reference information is determined. In this way, the target feature vector, the first reference information and the second reference information corresponding to the target question in the knowledge base can be determined, and the target question, the first reference information and the second reference information can be input into the target model to obtain the target model's response to the target question, thereby achieving the purpose of accurately obtaining the information corresponding to the target question in the knowledge base.

[0115] Among them, the target feature vector is only used to determine the first reference information corresponding to the target question in the knowledge base. When using the target model to determine the response to the target question, there is no need to input the target feature vector into the target model. Only the target question, the first reference information and the second reference information need to be input into the target model.

[0116] Among them, determining the target feature vector corresponding to the target question from the knowledge base based on the target question can be: determining the feature vector of the target question, then comparing the feature vector of the target question with multiple feature vectors stored in the knowledge base, determining a feature vector in the knowledge base that matches the feature vector of the target question, determining it as the target feature vector, then determining first reference information corresponding to the target feature vector based on a first corresponding relationship, and determining second reference information corresponding to the first reference information based on a second corresponding relationship.

[0117] For example: there is a target question 1, and based on the target question 1, the target feature vector 1 is determined from the knowledge base, and then the first reference information 1 corresponding to the target feature vector 1 in the knowledge base is determined based on the first correspondence, and the second reference information 1 corresponding to the first reference information 1 in the knowledge base is determined based on the second correspondence, and then the target question 1, the first reference information 1 and the second reference information 1 are input into the target model so that the target model can output an accurate response, and the first reference information and the second reference information matching the target question are determined in turn through the target feature vector, the first reference information, the second reference information, the first correspondence and the second correspondence, thereby ensuring that there is a clear correspondence between different information in the database.

[0118] In addition, in the information acquisition method disclosed in this embodiment, the first reference information and the second reference information are formed in the knowledge base based on the first text information and the second text information, which can also be:

[0119] Determine a target feature vector of the first text information, obtain first reference information based on the target feature vector of the first text information, obtain second reference information based on the second text information, store the first reference information and the second reference information in a knowledge base, and the knowledge base also stores a corresponding relationship between the first reference information and the second reference information.

[0120] After obtaining the target feature vector of the first text information, it is not directly stored in the knowledge base in correspondence with the first reference information. Instead, the target feature vector of the first text information is used as a part of the first reference information and the first reference information is determined together with the first text information, that is, the first reference information includes the first text information and the target feature vector of the first text information.

[0121] When there is a target question, the target feature vector in the first reference information corresponding to the target question is directly determined from the knowledge base based on the target question, thereby determining the first reference information, and then determining the second reference information based on the correspondence between the first reference information and the second reference information. The target question, the first reference information and the second reference information are input into the target model to obtain the target model's response to the target question, thereby achieving the purpose of accurately obtaining the information corresponding to the target question in the knowledge base.

[0122] For example: a target question 2 is obtained, and based on the target question 2, a target feature vector in the first reference information 2 is found from the knowledge base to match the target question 2, then it is determined that the first text information in the first reference information 2 corresponds to the target question 2, and based on the correspondence between the first reference information and the second reference information, the second reference information 2 corresponding to the first reference information 2 is determined, and the target question 2, the first reference information 2 and the second reference information 2 are input into the target model so that the target model can output a response to the target question 2.

[0123] The information acquisition method disclosed in the present embodiment needs to obtain a target feature vector of the first text information and first reference information and second reference information after obtaining the first text information and the second text information based on a target file, and then store the target feature vector, the first reference information and the second reference information in a knowledge base. In addition, the knowledge base records the correspondence between the target feature vector and the first reference information, and the correspondence between the first reference information and the second reference information, so that when the target feature vector in the knowledge base is found, the corresponding first reference information can be determined based on the target feature vector, and the second reference information corresponding to the first reference information can be determined, thereby making the information obtained from the knowledge base more complete and avoiding the problem of inaccurate responses to target questions due to incomplete information acquisition.

[0124] This embodiment discloses an information acquisition system, and its structural diagram is as follows: Figure 8 As shown, including:

[0125] An obtaining unit 81 , a determining unit 82 and an input unit 83 .

[0126] Wherein, the obtaining unit 81 is used to obtain the target question;

[0127] The determination unit 82 is used to determine, based on the target question, first reference information and second reference information matching the target question from a pre-stored knowledge base, wherein the first reference information includes first text information, and the second reference information includes second text information, and the second text information is used to represent format information corresponding to the first text information;

[0128] The input unit 83 is used to input the target question, the first reference information and the second reference information into the target model to obtain a reply of the target model to the target question based on the first reference information and the second reference information.

[0129] Furthermore, the information acquisition system disclosed in this embodiment may also include:

[0130] The generating unit is used to obtain a target file; extract first text information from the target file; obtain second text information according to format information corresponding to the first text information in the target file; and form first reference information and second reference information in a knowledge base according to the first text information and the second text information.

[0131] Furthermore, the generating unit is used to:

[0132] The target file is input into the target model to obtain the second text information generated by the target model. The target model can generate corresponding output results according to the natural language instructions.

[0133] Furthermore, the generating unit is used to:

[0134] Obtain a target feature vector of the first text information; obtain first reference information based on the first text information; obtain second reference information based on the second text information; store the target feature vector, the first reference information, and the second reference information in a knowledge base, wherein the target feature vector and the first reference information have a first corresponding relationship, and the first reference information and the second reference information have a second corresponding relationship.

[0135] Furthermore, the second reference information includes rich text format information, and the second reference information also includes first text information; the first text information is the text information in the rich text format information, and the second text information is the format tag information in the rich text format information.

[0136] Furthermore, the second text information is format information corresponding to the first text information represented by natural language.

[0137] Furthermore, the determination unit is used to:

[0138] Based on the target question, first reference information matching the target question is determined from a pre-stored knowledge base; and second reference information associated with the first reference information is determined in the knowledge base.

[0139] The information acquisition system disclosed in this embodiment is implemented based on the information acquisition method disclosed in the above embodiments, which will not be described in detail here.

[0140] The information acquisition system disclosed in this embodiment obtains a target question; based on the target question, the first reference information and the second reference information matching the target question are determined from a pre-stored knowledge base, the first reference information includes the first text information, the second reference information includes the second text information, and the second text information is used to characterize the format information corresponding to the first text information; the target question, the first reference information and the second reference information are input into the target model to obtain the target model's response to the target question based on the first reference information and the second reference information. When obtaining the target question, the scheme first determines the matching first reference information and the second reference information from the knowledge base based on the target question, and then inputs the target question, the first reference information and the second reference information into the target model, wherein the first reference information and the second reference information include not only the first text information, but also the format information corresponding to the first text information, so that the information input into the target model is more accurate, so that when the target model analyzes the target question, it can not only analyze based on the first text information, but also analyze based on the format information corresponding to the first text information, so as to improve the accuracy of the target model's response to the target question and improve the user experience.

[0141] This embodiment discloses an electronic device, and its structural diagram is as follows: Fig. 9 As shown, including:

[0142] Processor 91 and memory 92.

[0143] The processor 91 is used to obtain a target question; based on the target question, determine first reference information and second reference information matching the target question from a pre-stored knowledge base, wherein the first reference information includes first text information, the second reference information includes second text information, and the second text information is used to characterize format information corresponding to the first text information; input the target question, the first reference information, and the second reference information into the target model to obtain a response of the target model to the target question based on the first reference information and the second reference information;

[0144] The memory 92 is used to store the programs required by the processor to execute the above processing procedures.

[0145] The electronic device disclosed in this embodiment is implemented based on the information acquisition method disclosed in the above embodiments, which will not be described in detail here.

[0146] The electronic device disclosed in this embodiment obtains a target question; based on the target question, determines the first reference information and the second reference information matching the target question from a pre-stored knowledge base, the first reference information includes the first text information, the second reference information includes the second text information, and the second text information is used to characterize the format information corresponding to the first text information; the target question, the first reference information and the second reference information are input into the target model to obtain the target model's response to the target question based on the first reference information and the second reference information. When obtaining the target question, the scheme first determines the matching first reference information and the second reference information from the knowledge base based on the target question, and then inputs the target question, the first reference information and the second reference information into the target model, wherein the first reference information and the second reference information include not only the first text information, but also the format information corresponding to the first text information, so that the information input into the target model is more accurate, so that when the target model analyzes the target question, it can not only analyze based on the first text information, but also analyze based on the format information corresponding to the first text information, so as to improve the accuracy of the target model's response to the target question and improve the user experience.

[0147] An embodiment of the present application also provides a readable storage medium on which a computer program is stored. The computer program is loaded and executed by a processor to implement the steps of the above-mentioned information acquisition method. The specific implementation process can refer to the description of the corresponding part of the above-mentioned embodiment, and this embodiment will not repeat it.

[0148] The present application also proposes a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the electronic device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the electronic device executes the method provided in various optional implementations of the above-mentioned information acquisition method or information acquisition system. The specific implementation process can refer to the description of the above-mentioned corresponding embodiment, and will not be repeated.

[0149] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0150] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0151] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0152] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

Claims

1. A method for obtaining information, comprising: Get the target question; Determining first reference information and second reference information matching the target question from a pre-stored knowledge base based on the target question, wherein the first reference information includes first text information, and the second reference information includes second text information, and the second text information is used to represent format information corresponding to the first text information; The target question, the first reference information, and the second reference information are input into a target model to obtain a response of the target model to the target question based on the first reference information and the second reference information.

2. The method according to claim 1, further comprising: Get the target file; Extracting the first text information from the target file; Obtaining the second text information according to the format information corresponding to the first text information in the target file; The first reference information and the second reference information are formed in the knowledge base according to the first text information and the second text information.

3. The method according to claim 2, wherein obtaining the second text information according to the format information corresponding to the first text information in the target file comprises: The target file is input into the target model to obtain the second text information generated by the target model, and the target model can generate corresponding output results according to natural language instructions.

4. The method according to claim 2, wherein forming the first reference information and the second reference information in the knowledge base according to the first text information and the second text information comprises: Obtaining a target feature vector of the first text information; Obtaining the first reference information according to the first text information; Obtaining the second reference information according to the second text information; The target feature vector, the first reference information and the second reference information are stored in the knowledge base, wherein the target feature vector and the first reference information have a first corresponding relationship, and the first reference information and the second reference information have a second corresponding relationship.

5. According to the method of claim 1, the second reference information includes rich text format information, and the second reference information also includes the first text information; the first text information is the text information in the rich text format information, and the second text information is the format tag information in the rich text format information.

6. According to the method of claim 1, the second text information is format information corresponding to the first text information represented by natural language.

7. The method according to claim 1, wherein determining the first reference information and the second reference information matching the target question from a pre-stored knowledge base based on the target question comprises: Determining first reference information matching the target question from a pre-stored knowledge base based on the target question; Second reference information associated with the first reference information in the knowledge base is determined.

8. An information acquisition system, comprising: Acquisition unit, used to obtain target questions; A determination unit, configured to determine, based on the target question, first reference information and second reference information matching the target question from a pre-stored knowledge base, wherein the first reference information includes first text information, and the second reference information includes second text information, and the second text information is used to represent format information corresponding to the first text information; An input unit is used to input the target question, the first reference information and the second reference information into a target model to obtain a reply of the target model to the target question based on the first reference information and the second reference information.

9. An electronic device, comprising: A processor for obtaining a target question; Determine, based on the target question, first reference information and second reference information matching the target question from a pre-stored knowledge base, wherein the first reference information includes first text information, the second reference information includes second text information, and the second text information is used to characterize format information corresponding to the first text information; input the target question, the first reference information, and the second reference information into a target model to obtain a response of the target model to the target question based on the first reference information and the second reference information; The memory is used to store the program required by the processor to execute the above processing process.

10. A readable storage medium for storing at least one set of instruction sets; The instruction set is used to be called and at least execute the information acquisition method according to any one of claims 1 to 7.