CN117609461A - Text generation method, intelligent question-answering device, electronic equipment and medium - Google Patents
Text generation method, intelligent question-answering device, electronic equipment and medium Download PDFInfo
- Publication number
- CN117609461A CN117609461A CN202311621289.4A CN202311621289A CN117609461A CN 117609461 A CN117609461 A CN 117609461A CN 202311621289 A CN202311621289 A CN 202311621289A CN 117609461 A CN117609461 A CN 117609461A
- Authority
- CN
- China
- Prior art keywords
- text
- slice
- slices
- information
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 74
- 238000004590 computer program Methods 0.000 claims description 13
- 238000010586 diagram Methods 0.000 description 10
- 230000006835 compression Effects 0.000 description 4
- 238000007906 compression Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 230000014509 gene expression Effects 0.000 description 4
- 238000010276 construction Methods 0.000 description 3
- 230000009193 crawling Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 241000239290 Araneae Species 0.000 description 1
- 241000257303 Hymenoptera Species 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 239000013598 vector Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3344—Query execution using natural language analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Databases & Information Systems (AREA)
- Computational Linguistics (AREA)
- Human Computer Interaction (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application provides a text generation method, an intelligent question-answering device, electronic equipment and a medium. The text generation method comprises the following steps: acquiring initial text content; slicing the initial text content to obtain a plurality of first text slices; combining the first text slices with the similarity exceeding a first threshold value in the plurality of first text slices to obtain at least one combined text slice; and splicing each merged text slice with the corresponding question information in the at least one merged text slice to obtain at least one target text, wherein an answer of the question information is positioned in the merged text slice corresponding to the question information. The method and the device can improve the quality of the generated target text.
Description
Technical Field
The application relates to the technical field of computers, in particular to a text generation method, an intelligent question-answering device, electronic equipment and a medium.
Background
With the development of computer technology, intelligent question-answering technology is applied in many fields. Currently, in the process of building an intelligent question-answering system, a database is generally required to be built, so that answers corresponding to questions can be searched in the built database later. The construction process of the database is generally as follows: a large number of original texts are acquired first, then slicing processing is performed on the original texts, and the database comprises a large number of text slices. In the following intelligent question-answering process, a question slice corresponding to a question is generally acquired first, and then a corresponding answer is generated based on the acquired text slice. However, since in slicing the original text, a simple slicing is usually performed according to the text length, many slices may be caused to include only partial answers to a certain question, thereby affecting the effect of the subsequently generated answers. In the related art, the text in the database of the intelligent question-answering scene has the problem of poor quality.
Disclosure of Invention
According to the text generation method, the intelligent question-answering device, the electronic equipment and the medium, the quality of the generated target text can be improved.
In a first aspect, an embodiment of the present application provides a text generating method, including:
acquiring initial text content;
slicing the initial text content to obtain a plurality of first text slices;
combining the first text slices with the similarity exceeding a first threshold value in the plurality of first text slices to obtain at least one combined text slice;
and splicing each merged text slice with the corresponding question information in the at least one merged text slice to obtain at least one target text, wherein an answer of the question information is positioned in the merged text slice corresponding to the question information.
In a second aspect, an embodiment of the present application provides an intelligent question-answering method, where the method includes:
acquiring questioning information;
inquiring in a target database based on the questioning information to obtain at least one candidate text, wherein the candidate text in the target database is a text generated based on the text generation method of the first aspect;
and generating reply information corresponding to the question information based on the at least one candidate text.
In a third aspect, an embodiment of the present application provides a text generating apparatus, including:
the acquisition module is used for acquiring initial text content;
the slicing module is used for slicing the initial text content to obtain a plurality of first text slices;
the merging module is used for merging the first text slices with the similarity exceeding a first threshold value in the plurality of first text slices to obtain at least one merged text slice;
and the splicing module is used for splicing each merged text slice with the corresponding question information in the at least one merged text slice to obtain at least one target text, and the answer of the question information is positioned in the merged text slice corresponding to the question information.
In a fourth aspect, an embodiment of the present application provides an intelligent question-answering device, including:
the acquisition module is used for acquiring the questioning information;
the query module is used for querying in a target database based on the questioning information to obtain at least one candidate text, wherein the candidate text in the target database is a text generated based on the text generation method in claims 1-4;
and the generating module is used for generating reply information corresponding to the question information based on the at least one candidate text.
In a fifth aspect, embodiments of the present application also provide an electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program implementing the method steps of the first aspect or the second aspect as described above when being executed by the processor.
In a sixth aspect, embodiments of the present application further provide a computer readable storage medium having a computer program stored thereon, the computer program implementing the method steps of the first or second aspect as described above when executed by a processor.
In the embodiment of the present application, after slicing the initial text content in the process of text generation, the first text slices with the similarity exceeding the first threshold value among the plurality of first text slices are combined, and the target text is spliced based on the combined text slices and the question information.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a text generation method provided in an embodiment of the present application;
FIG. 2 is one of the flowcharts of the intelligent question-answering method provided in the embodiments of the present application;
FIG. 3 is a second flowchart of a method for intelligent question answering according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an intelligent question-answering system according to an embodiment of the present application;
fig. 5 is one of schematic structural diagrams of a text generating device provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of an intelligent question-answering device according to an embodiment of the present application;
fig. 7 is a second schematic structural diagram of the text generating device according to the embodiment of the present application;
fig. 8 is a second schematic structural diagram of the intelligent answering device according to the embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
Referring to fig. 1, fig. 1 is a flow chart of a text generation method provided in the present application, where the text generation method includes:
step 101, acquiring initial text content;
102, slicing the initial text content to obtain a plurality of first text slices;
103, merging the first text slices with the similarity exceeding a first threshold value from the plurality of first text slices to obtain at least one merged text slice;
and 104, splicing each merged text slice with the corresponding question information in the at least one merged text slice to obtain at least one target text, wherein an answer of the question information is positioned in the merged text slice corresponding to the question information.
The initial text content may be text obtained through various approaches. For example, the crawled web page content may be crawled for information about a target web site by a web crawler. Wherein, the web crawler: also called web spider, web robot, is a program or script that automatically captures web information according to certain rules. Other names that are not commonly used are ants, auto-indexes, simulators, or worms. In particular, the initial text content may include the entire content of one web page.
The slicing the initial text content may specifically be: and slicing the initial text content according to a certain text length, wherein the certain text length is a certain number of characters, for example, 500 characters, 1000 characters and the like.
The similarity may refer to: cosine similarity between vectors corresponding to the first text slice. Alternatively, the similarity may also refer to a text similarity, which is determined according to the number of identical words included in the text.
The first threshold may be set according to actual requirements, for example, when the value range of the similarity is between 0 and 1, the first threshold may be a relatively high value such as 0.7, 0.8 or 0.9.
The merging processing of the first text slices with the similarity exceeding the first threshold value in the plurality of first text slices may specifically be: and performing splicing processing on the first text slices with the similarity exceeding a first threshold value in the plurality of first text slices.
It may be appreciated that the problem information may be problem information determined by analyzing text content included in each merged text section in advance, for example, when content included in a certain merged text section is an introduction of an a product, the corresponding problem information may include: what is the product a? Or what is the a product, etc.
It can be appreciated that the generated target text can be stored in a target database, wherein the target database can be used as a database in an intelligent text scene, so that in the process of intelligent question-answering, a merged text slice corresponding to the user question can be found in the target database according to the user question, and the answer included in the merged text slice is more comprehensive than that of a single first text slice, so that the quality of reply content generated based on the merged text slice is improved.
In this embodiment, after slicing the initial text content in the text generation process, the first text slices with the similarity exceeding the first threshold value among the plurality of first text slices are combined, and the target text is spliced based on the combined text slices and the question information.
Optionally, the merging processing is performed on the first text slices with the similarity exceeding the first threshold value in the plurality of first text slices to obtain at least one merged text slice, which includes:
dividing the first text slices with the similarity exceeding the first threshold value into the same group to obtain at least one slice group;
performing de-duplication processing on the slice group based on the semantic similarity between the first text slices in the slice group to obtain a target slice group corresponding to the at least one slice group one by one, wherein the semantic similarity between any two first text slices in the target slice group is greater than a second threshold;
and merging all the first text slices in each target slice group to obtain at least one merged text slice.
Specifically, semantic recognition can be performed on each first text slice in the slice group to obtain semantic information corresponding to each first text slice, and then similarity between the semantic information corresponding to each first text slice is calculated, so that the semantic similarity is obtained. The calculating the similarity between the semantic information corresponding to each first text slice may specifically refer to: and calculating cosine similarity between semantic information corresponding to each first text slice.
The second threshold may be set according to actual requirements, for example, when the value range of the semantic similarity is between 0 and 1, the second threshold may be a relatively high value such as 0.7, 0.8, or 0.9.
The performing the deduplication processing on the slice group based on the semantic similarity between the first text slices in the slice group may specifically include: for the first text slices with semantic similarity exceeding two in the slice group, only one of the first text slices is reserved.
In this embodiment, the processing of de-duplication is performed on the slice group based on the semantic similarity between the first text slices in the slice group, so that text contents with the same or similar semantics in the merged text slice can be removed, thereby avoiding the text length of the merged text slice from being too long, and further improving the quality of the generated target text.
Optionally, the dividing the first text slices with the similarity exceeding the first threshold value from the plurality of first text slices into the same group, to obtain at least one slice group includes:
performing similarity recognition on the plurality of first text slices based on the large model to obtain similarity recognition information, wherein the similarity recognition information comprises similarity among the plurality of first text slices;
and dividing the first text slices with the similarity exceeding the first threshold value in the plurality of first text slices into the same group based on the similarity identification information to obtain at least one slice group.
The large model may refer to: the large language model based on the generated architecture in the natural language processing field can be, for example, a GPT-3 model, a GPT, a Bloom series, etc. The large model may automatically generate text rather than merely classifying or predicting a given input. The method is characterized by comprising the following steps: generating capability, context awareness, no need for predefined rules, learning patterns and rules of language by unsupervised learning on massive data. Whereas discriminant models correspond to generative models, another common type of machine learning model, relying on supervised learning, they do not generate new text, but rather map inputs to predefined output categories.
In this embodiment, the similarity recognition is performed on the plurality of first text sections based on the large model, so that the accuracy of the generated similarity recognition information is advantageously improved.
Optionally, the splicing each merged text slice with the corresponding question information to obtain at least one target text includes:
determining at least two different question information corresponding to each merged text slice;
and respectively splicing each merged text slice with each corresponding problem information to obtain at least two target texts corresponding to each merged text slice.
Specifically, in determining the problem information corresponding to each merged text slice, more than two pieces of problem information may be determined for one merged text slice, for example, when a certain merged text slice describes the product details and functions of the B product, the at least two pieces of problem information corresponding may include: what the B product is, what the B product has, what the B product profile is, what the B product has benefits, etc.
It can be understood that at least two target texts corresponding to each generated merged text slice can be stored in the target database, so that different expressions aiming at the same problem of a user can be positioned to the target texts in the process of carrying out intelligent question answering, and the reply effect in the process of carrying out intelligent question answering is improved.
Referring to fig. 2, fig. X is an intelligent question-answering method provided in an embodiment of the present application, where the intelligent question-answering method includes:
step 201, acquiring questioning information;
step 202, inquiring in a target database based on the question information to obtain at least one candidate text, wherein the candidate text in the target database is generated based on the text generation method in the embodiment;
and 203, generating reply information corresponding to the question information based on the at least one candidate text.
The intelligent question-answering method can be applied to various automatic answer robots or other various intelligent question-answering scenes. The following further explains the intelligent question-answering method in a scenario applied to an automatic answer robot:
the question information may be a question of the user to the automatic reply robot in the intelligent question-answering scenario. The reply information is reply content which is sent to the user by the automatic reply robot aiming at the question.
It can be understood that when the above target database is constructed, a large number of web page texts can be acquired, and then, a plurality of corresponding target texts are generated for each web page text by adopting the text generation method, and the generated target texts are stored in the target database.
In this embodiment, since the candidate text in the target database is a text generated based on the text generation method described in the above embodiment, the intelligent question-answering method can implement each process of the text generation method, and has the same beneficial effects, and in order to avoid repetition, a detailed description is omitted here.
Optionally, the generating, based on the at least one candidate text, the reply message corresponding to the question information includes:
inputting the questioning information and the at least one candidate text into a large model to generate an answer, and obtaining reply content corresponding to the questioning information, wherein the reply content is generated by the large model based on a target candidate text in the at least one candidate text;
and generating the reply information based on the reply content and the target candidate text, wherein the reply information comprises the reply content and the target candidate text.
Wherein the large model may be the large model described in the above embodiment. In the process of generating the answer, the large model can firstly determine the target candidate text with the highest matching degree with the question information in the at least one candidate text, and then generate the answer content by utilizing the target candidate text based on the large model.
Specifically, before the question information and the at least one candidate text are input into the large model to generate an answer, the question information and the at least one candidate text may be spliced to form the following form: "\n user } \n candidate: the answer { [ candid_1, candid_2, … …, candid_n ] } \n: n related candidates: ". Wherein, ask is the concrete content of the question information, and candate_1, candate_2, … …, candate_n are n candidate texts, "n answer: "reply content generated for large model," related candidates: "target candidate text determined for the model to be large.
It will be appreciated that the reply content may be different from the target candidate text, for example, when the "question information" is: what is the 22 year birth population in city C? The target candidate text is: with D institution statistics, C City belongs to the south of D province, whose birth population for the past 5 years is as follows: the total birth population in 2018 is X ten thousand, the total birth population in 2019 is Y ten thousand, the total birth population in 2020 is Z ten thousand, the total birth population in 2021 is T ten thousand, and the total birth population in 2022 is n ten thousand, the reply content generated by the large model can be: the 22-year birth population of city C is n ten thousand. Thus, the reply content generated on the basis of the target candidate text through the large model can reply to the question of the user more accurately.
However, since the reply content is new content generated by the large model on the basis of the target candidate text, and the expression in the original text (i.e. the target candidate text) may be changed by the data generated by the large model, but some expressions should not be changed for certain professional scenes, and in such scenes, the generated reply content expression may be inaccurate.
Referring to fig. 3, a flow chart of an intelligent question-answering method provided in an embodiment of the present application is shown, and the method includes the following steps:
crawling a target website to obtain a large amount of initial text content;
slice compression, specifically comprising: slicing the initial text content, splicing the slices according to the similarity, and performing de-duplication compression on the first text slices in the same slice group according to the semantic similarity before splicing, wherein the similarity between the first text slices can be determined by using a large model in the process;
the generalization storage specifically comprises the following steps: respectively splicing each merged text slice with at least two corresponding problem information to obtain at least two target texts corresponding to each merged text slice, and storing the obtained target texts in a target database to complete the construction process of the target database, wherein in the process, the problem information can be subjected to generalization processing based on a large model to obtain more problem information;
it should be noted that the above steps belong to preparation work before intelligent question-answering, and after the construction of the target database is completed, all subsequent question-answering processes can be used for answer generation based on the constructed target database. The following steps are the following steps of intelligent question and answer:
receiving a user question;
recall at least one candidate, i.e., candidate text, based on the user question;
at least one candidate item and a user question are input into a large model to generate answers and trace the sources, so that reply information is obtained;
and sending the reply information to the client for sending the user questions to carry out front-end display.
Referring to fig. 4, a schematic structural diagram of an intelligent question-answering system according to an embodiment of the present application is provided, which includes:
the target website crawling module is used for crawling target websites to acquire a large amount of initial text contents;
the slice compression module is used for slicing the initial text content, splicing the slices according to the similarity, and performing de-duplication compression on the first text slices in the same slice group according to the semantic similarity before splicing;
the generalization storage module is used for respectively splicing each merged text slice with at least two corresponding problem information to obtain at least two target texts corresponding to each merged text slice, and storing the obtained target texts in the target database;
a recall candidate item module, which is used for recalling at least one candidate item, namely a candidate text, based on the user question;
and the answer generation and tracing module is used for carrying out answer generation and tracing on at least one candidate item and the user question input large model to obtain reply information.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a text generating apparatus 500 according to an embodiment of the present application, where the text generating apparatus 500 includes:
an obtaining module 501, configured to obtain initial text content;
the slicing module 502 is configured to perform slicing processing on the initial text content to obtain a plurality of first text slices;
a merging module 503, configured to merge the first text slices with a similarity exceeding a first threshold value from the plurality of first text slices to obtain at least one merged text slice;
and a splicing module 504, configured to splice each merged text slice with the corresponding question information in the at least one merged text slice, so as to obtain at least one target text, where an answer of the question information is located in the merged text slice corresponding to the question information.
Optionally, the merging module 503 includes:
a dividing sub-module, configured to divide, from the plurality of first text slices, the first text slices with the similarity exceeding the first threshold into the same group, to obtain at least one slice group;
the de-duplication sub-module is used for de-duplication processing the slice group based on the semantic similarity between the first text slices in the slice group to obtain a target slice group corresponding to the at least one slice group one by one, wherein the semantic similarity between any two first text slices in the target slice group is larger than a second threshold;
and the merging sub-module is used for merging all the first text slices in each target slice group to obtain at least one merged text slice.
Optionally, the dividing submodule includes:
the identification unit is used for carrying out similarity identification on the plurality of first text slices based on the large model to obtain similarity identification information, wherein the similarity identification information comprises the similarity among the plurality of first text slices;
and the dividing unit is used for dividing the first text slices with the similarity exceeding the first threshold value in the plurality of first text slices into the same group based on the similarity identification information to obtain at least one slice group.
The splicing module 504 includes:
the determining submodule is used for determining at least two different problem information corresponding to each combined text slice;
and the splicing sub-module is used for respectively splicing each merged text slice with each corresponding problem information to obtain at least two target texts corresponding to each merged text slice.
The text generating device 500 provided in the embodiment of the present application can implement each process in the embodiment of the text generating method, and in order to avoid repetition, a description is omitted here.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an intelligent question-answering device 600 provided in an embodiment of the present application, where the intelligent question-answering device 600 includes:
an obtaining module 601, configured to obtain question information;
the query module 602 is configured to query in a target database based on the question information to obtain at least one candidate text, where the candidate text in the target database is a text generated based on the text generation method in the above embodiment;
and the generating module 603 is configured to generate reply information corresponding to the question information based on the at least one candidate text.
Optionally, the generating module 603 is specifically configured to input the question information and the at least one candidate text into a large model to generate an answer, so as to obtain reply content corresponding to the question information, where the reply content is reply content generated by the large model based on a target candidate text in the at least one candidate text;
the generating module 603 is specifically further configured to generate the reply message based on the reply content and the target candidate text, where the reply message includes the reply content and the target candidate text.
The intelligent question-answering device 600 provided in the embodiment of the present application can implement each process in the above-mentioned intelligent question-answering method embodiment, and in order to avoid repetition, the description is omitted here.
Referring to fig. 7, fig. 7 is a block diagram of a text generating apparatus 700 according to another embodiment of the present application, and as shown in fig. 7, the text generating apparatus 700 includes: the processor 701, the memory 702, and a computer program stored on the memory 702 and executable on the processor, the respective components in the text generating apparatus 700 being coupled together by a bus interface 703, the computer program when executed by the processor 701 implementing the steps of:
acquiring initial text content;
slicing the initial text content to obtain a plurality of first text slices;
combining the first text slices with the similarity exceeding a first threshold value in the plurality of first text slices to obtain at least one combined text slice;
and splicing each merged text slice with the corresponding question information in the at least one merged text slice to obtain at least one target text, wherein an answer of the question information is positioned in the merged text slice corresponding to the question information.
Optionally, the merging processing is performed on the first text slices with the similarity exceeding the first threshold value in the plurality of first text slices to obtain at least one merged text slice, which includes:
dividing the first text slices with the similarity exceeding the first threshold value into the same group to obtain at least one slice group;
performing de-duplication processing on the slice group based on the semantic similarity between the first text slices in the slice group to obtain a target slice group corresponding to the at least one slice group one by one, wherein the semantic similarity between any two first text slices in the target slice group is greater than a second threshold;
and merging all the first text slices in each target slice group to obtain at least one merged text slice.
Optionally, the dividing the first text slices with the similarity exceeding the first threshold value from the plurality of first text slices into the same group, to obtain at least one slice group includes:
performing similarity recognition on the plurality of first text slices based on the large model to obtain similarity recognition information, wherein the similarity recognition information comprises similarity among the plurality of first text slices;
and dividing the first text slices with the similarity exceeding the first threshold value in the plurality of first text slices into the same group based on the similarity identification information to obtain at least one slice group.
Optionally, the splicing each merged text slice with the corresponding question information to obtain at least one target text includes:
determining at least two different question information corresponding to each merged text slice;
and respectively splicing each merged text slice with each corresponding problem information to obtain at least two target texts corresponding to each merged text slice.
Referring to fig. 8, fig. 8 is a block diagram of an intelligent question-answering apparatus 800 according to another embodiment of the present application, and as shown in fig. 8, the intelligent question-answering apparatus 800 includes: processor 801, memory 802, and a computer program stored in memory 802 and executable on the processor, the various components of intelligent question and answer device 800 are coupled together by bus interface 803, the computer program when executed by processor 801 performs the steps of:
acquiring questioning information;
inquiring in a target database based on the questioning information to obtain at least one candidate text, wherein the candidate text in the target database is generated based on the text generation method in the embodiment;
and generating reply information corresponding to the question information based on the at least one candidate text.
Optionally, the generating, based on the at least one candidate text, the reply message corresponding to the question information includes:
inputting the questioning information and the at least one candidate text into a large model to generate an answer, and obtaining reply content corresponding to the questioning information, wherein the reply content is generated by the large model based on a target candidate text in the at least one candidate text;
and generating the reply information based on the reply content and the target candidate text, wherein the reply information comprises the reply content and the target candidate text.
The embodiment of the application further provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program when executed by the processor implements each process of the above method embodiment, and the same technical effects can be achieved, so that repetition is avoided, and no redundant description is provided herein.
The embodiment of the application further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the processes of the above method embodiment, and can achieve the same technical effects, so that repetition is avoided, and no further description is given here. Among them, a computer readable storage medium such as Read-Only Memory (ROM), random access Memory (Random Access Memory RAM), magnetic disk or optical disk, and the like.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), including several instructions for causing an electronic device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method of the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those of ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are also within the protection of the present application.
Claims (10)
1. A text generation method, comprising:
acquiring initial text content;
slicing the initial text content to obtain a plurality of first text slices;
combining the first text slices with the similarity exceeding a first threshold value in the plurality of first text slices to obtain at least one combined text slice;
and splicing each merged text slice with the corresponding question information in the at least one merged text slice to obtain at least one target text, wherein an answer of the question information is positioned in the merged text slice corresponding to the question information.
2. The method of claim 1, wherein merging a first text slice of the plurality of first text slices having a similarity exceeding a first threshold value to obtain at least one merged text slice comprises:
dividing the first text slices with the similarity exceeding the first threshold value into the same group to obtain at least one slice group;
performing de-duplication processing on the slice group based on the semantic similarity between the first text slices in the slice group to obtain a target slice group corresponding to the at least one slice group one by one, wherein the semantic similarity between any two first text slices in the target slice group is greater than a second threshold;
and merging all the first text slices in each target slice group to obtain at least one merged text slice.
3. The method of claim 2, wherein the dividing the first text slices of the plurality of first text slices that have the similarity exceeding the first threshold into the same group results in at least one slice group, comprising:
performing similarity recognition on the plurality of first text slices based on the large model to obtain similarity recognition information, wherein the similarity recognition information comprises similarity among the plurality of first text slices;
and dividing the first text slices with the similarity exceeding the first threshold value in the plurality of first text slices into the same group based on the similarity identification information to obtain at least one slice group.
4. The method of claim 1, wherein the splicing each merged text slice with the corresponding question information to obtain at least one target text includes:
determining at least two different question information corresponding to each merged text slice;
and respectively splicing each merged text slice with each corresponding problem information to obtain at least two target texts corresponding to each merged text slice.
5. An intelligent question-answering method, characterized in that the method comprises the following steps:
acquiring questioning information;
inquiring in a target database based on the questioning information to obtain at least one candidate text, wherein the candidate text in the target database is generated based on the text generation method in claims 1-4;
and generating reply information corresponding to the question information based on the at least one candidate text.
6. The method of claim 5, wherein generating reply information corresponding to the question information based on the at least one candidate text comprises:
inputting the questioning information and the at least one candidate text into a large model to generate an answer, and obtaining reply content corresponding to the questioning information, wherein the reply content is generated by the large model based on a target candidate text in the at least one candidate text;
and generating the reply information based on the reply content and the target candidate text, wherein the reply information comprises the reply content and the target candidate text.
7. A text generating apparatus, comprising:
the acquisition module is used for acquiring initial text content;
the slicing module is used for slicing the initial text content to obtain a plurality of first text slices;
the merging module is used for merging the first text slices with the similarity exceeding a first threshold value in the plurality of first text slices to obtain at least one merged text slice;
and the splicing module is used for splicing each merged text slice with the corresponding question information in the at least one merged text slice to obtain at least one target text, and the answer of the question information is positioned in the merged text slice corresponding to the question information.
8. An intelligent question-answering device, comprising:
the acquisition module is used for acquiring the questioning information;
the query module is used for querying in a target database based on the questioning information to obtain at least one candidate text, wherein the candidate text in the target database is a text generated based on the text generation method in claims 1-4;
and the generating module is used for generating reply information corresponding to the question information based on the at least one candidate text.
9. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, which when executed by the processor performs the method steps of any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, implements the method steps of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311621289.4A CN117609461A (en) | 2023-11-30 | 2023-11-30 | Text generation method, intelligent question-answering device, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311621289.4A CN117609461A (en) | 2023-11-30 | 2023-11-30 | Text generation method, intelligent question-answering device, electronic equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117609461A true CN117609461A (en) | 2024-02-27 |
Family
ID=89943942
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311621289.4A Pending CN117609461A (en) | 2023-11-30 | 2023-11-30 | Text generation method, intelligent question-answering device, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117609461A (en) |
-
2023
- 2023-11-30 CN CN202311621289.4A patent/CN117609461A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109325040B (en) | FAQ question-answer library generalization method, device and equipment | |
CN111182162B (en) | Telephone quality inspection method, device, equipment and storage medium based on artificial intelligence | |
CN109408821B (en) | Corpus generation method and device, computing equipment and storage medium | |
CN110765235B (en) | Training data generation method, device, terminal and readable medium | |
CN112085091B (en) | Short text matching method, device, equipment and storage medium based on artificial intelligence | |
CN116882372A (en) | Text generation method, device, electronic equipment and storage medium | |
CN113868419B (en) | Text classification method, device, equipment and medium based on artificial intelligence | |
CN112069833B (en) | Log analysis method, log analysis device and electronic equipment | |
CN111552800A (en) | Abstract generation method and device, electronic equipment and medium | |
CN114647713A (en) | Knowledge graph question-answering method, device and storage medium based on virtual confrontation | |
CN112115252A (en) | Intelligent auxiliary writing processing method and device, electronic equipment and storage medium | |
CN117473034A (en) | Interactive text processing method and device, electronic equipment and storage medium | |
CN118070072A (en) | Problem processing method, device, equipment and storage medium based on artificial intelligence | |
CN117668180A (en) | Document question-answering method, document question-answering device, and readable storage medium | |
CN115270746A (en) | Question sample generation method and device, electronic equipment and storage medium | |
CN114676705B (en) | Dialogue relation processing method, computer and readable storage medium | |
CN113434631A (en) | Emotion analysis method and device based on event, computer equipment and storage medium | |
CN117556057A (en) | Knowledge question-answering method, vector database construction method and device | |
CN116719950A (en) | Intelligent question-answering method and system based on knowledge graph sub-graph retrieval | |
CN115757720A (en) | Project information searching method, device, equipment and medium based on knowledge graph | |
CN117609461A (en) | Text generation method, intelligent question-answering device, electronic equipment and medium | |
CN112115362B (en) | Programming information recommendation method and device based on similar code recognition | |
CN114372478A (en) | Knowledge distillation-based question and answer method, terminal equipment and storage medium | |
CN114021555A (en) | Method, device and equipment for automatically labeling knowledge points and readable storage medium | |
CN113656545A (en) | Intelligent interviewing method and device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |