A method and device for obtaining text based on an interactive question and answer model and a medium

By extracting keywords from semantic analysis text in an interactive question-answering model, filtering and calculating word weights, and combining text library matching similarity and synonym replacement, the problem of inaccurate queries in interactive question-answering models is solved, and more reliable text feedback is achieved.

CN120123486BActive Publication Date: 2025-11-28TIANJIN YITIAN DIGITAL SERVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510597072.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-11-28
Estimated Expiration
2045-05-09

AI Technical Summary

Technical Problem

Existing interactive question-answering models output mostly existing technologies or common knowledge during training, which cannot accurately query technical texts in certain specialized fields, resulting in inaccurate queries.

Method used

By acquiring semantic analysis text from an interactive question-and-answer model, initial keywords are extracted, target keywords are selected and word weights are calculated, and the matching similarity of a pre-set text library is combined with a large language model to perform synonym replacement and duplicate text filtering to determine the target feedback text.

Benefits of technology

It improves the reliability and accuracy of queries from massive amounts of text, ensuring that the feedback text better meets user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123486B_ABST
    Figure CN120123486B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of text processing, in particular to a method and device for obtaining text based on an interactive question and answer model and a medium, the method comprising the following steps: obtaining first semantic analysis text output by a given interactive question and answer model based on input search text, extracting a plurality of initial keywords, screening a plurality of target keywords, obtaining a word weight corresponding to each target keyword, calculating the matching similarity between each preset strategy text and the plurality of target keywords based on the word weight, determining a plurality of first strategy texts according to the matching similarity, re-executing the above steps on the replacement text of the search text to obtain a plurality of second strategy texts, and determining a target feedback text according to the repetition of the first strategy texts and the second strategy texts; the application can utilize the powerful semantic analysis capability of the interactive question and answer model to output more accurate and more required target feedback texts from a plurality of preset strategy texts.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of text processing, in particular to a method and device for obtaining text based on an interactive question and answer model and a medium. BACKGROUND

[0002] With the increasing development of AI big data, more and more interactive question and answer models are widely used by users, which brings great convenience for users' problem query and use, but there are still some defects that have not been overcome, for example, the interactive question and answer model uses existing data as training data when training, and when the user inputs a query question, the output content is all existing technology or common knowledge, and for some special field technology, it cannot be queried, which is not conducive to the query of technical text by some enterprise staff, therefore, it is necessary to provide an external library to link with the interactive question and answer model, and how to accurately query the required text from the massive library is a problem to be solved at present. SUMMARY

[0003] In view of the above technical problems, the present application provides a method and device for obtaining text based on an interactive question and answer model and a medium, which can utilize the powerful semantic analysis capability of the interactive question and answer model to output more accurate and more required target feedback text from a plurality of preset strategy texts.

[0004] According to a first aspect of the present application, a method for obtaining text based on an interactive question and answer model is provided, comprising the following steps:

[0005] S100, based on the retrieval text input by the user to the given interactive question and answer model, obtaining the first semantic analysis text output by the given interactive question and answer model, and extracting a plurality of initial keywords from the first semantic analysis text.

[0006] S200, according to the relevance of each initial keyword to the retrieval text, screening a plurality of target keywords from the plurality of initial keywords, and obtaining a word weight corresponding to each target keyword.

[0007] S300, based on the word weight corresponding to each target keyword, calculating the matching similarity between each preset strategy text in the preset text library and the plurality of target keywords, and taking the preset strategy text corresponding to the matching similarity greater than the similarity threshold as the first strategy text.

[0008] S400, taking the replacement text corresponding to the retrieval text as a new retrieval text, returning to execute steps S100-S300 to obtain a plurality of second strategy texts; the replacement text corresponding to the retrieval text is a text obtained by performing synonym replacement on a given word object in the retrieval text through a preset large language model.

[0009] S500, when there is a repetition of the first policy text and the second policy text, all the first policy texts with repetition and all the second policy texts with repetition are matched with the corresponding policy text with the highest similarity as the target feedback text; otherwise, the corresponding policy text with the highest similarity among all the first policy texts and all the second policy texts is matched as the target feedback text.

[0010] According to a second aspect of the present application, a device for obtaining text based on an interactive question and answer model is provided, the device comprising:

[0011] The first obtaining module is configured to obtain first semantic analysis text output by the given interactive question and answer model based on the search text input by the user to the given interactive question and answer model, and extract a plurality of initial keywords from the first semantic analysis text.

[0012] The second obtaining module is configured to filter a plurality of target keywords from the plurality of initial keywords according to the relevance of each initial keyword to the search text, and obtain a word weight corresponding to each target keyword.

[0013] The first calculating module is configured to calculate the matching similarity between each preset policy text in the preset text library and the plurality of target keywords based on the word weight corresponding to each target keyword, and take the preset policy text with a matching similarity greater than a similarity threshold as a first policy text.

[0014] The processing module is configured to take the replacement text corresponding to the search text as a new search text, return to execute steps S100-S300 to obtain a plurality of second policy texts; the replacement text corresponding to the search text is a text obtained by performing synonym replacement on a given word object in the search text by the preset large language model.

[0015] The first determining module is configured to, when there is a repetition of the first policy text and the second policy text, take the policy text with the highest matching similarity among all the first policy texts with repetition and all the second policy texts with repetition as the target feedback text; otherwise, take the policy text with the highest matching similarity among all the first policy texts and all the second policy texts as the target feedback text.

[0016] According to a third aspect of the present application, a non-transitory computer readable storage medium is provided, the storage medium storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by a processor to implement the above-mentioned method for obtaining text based on an interactive question and answer model.

[0017] The present application has at least the following beneficial effects:

[0018] The application provides a method for obtaining text based on an interactive question and answer model. First, a first semantic analysis text output by a given interactive question and answer model based on input search text is obtained, and a plurality of initial keywords are extracted therefrom. In this process, the output result of the interactive question and answer model is not directly used, but the powerful semantic analysis capability of the model is used to obtain the keywords from the semantic analysis text. In this process, the accurate expansion of the keywords is realized, which is beneficial to query more reliable text from the mass text in the preset text. Then, a plurality of target keywords are screened out according to the relevance of the initial keywords and the search text, and a word weight corresponding to each target keyword is obtained. The matching similarity of each preset strategy text and the plurality of target keywords is calculated based on the word weight, so as to determine a plurality of first strategy texts that are more in line with the search requirements of the search text according to the matching similarity. The replacement text of the search text is re-executed to obtain a plurality of second strategy texts. The target feedback text is determined according to the repetition of the first strategy text and the second strategy text. In this way, the screening reliability of the target feedback text is improved as a whole. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0020] Figure 1 The flowchart of the method for obtaining text based on an interactive question and answer model provided by the first embodiment of the application;

[0021] Figure 2 The flowchart of the S200 step provided by the first embodiment of the application;

[0022] Figure 3 Another flowchart of the S200 step provided by the first embodiment of the application;

[0023] Figure 4 The flowchart of the S300 step provided by the first embodiment of the application;

[0024] Figure 5 The flowchart of the method for obtaining search text provided by the first embodiment of the application;

[0025] Figure 6 The structural schematic diagram of the device for obtaining text based on an interactive question and answer model provided by the second embodiment of the application;

[0026] Figure 7 The structural schematic diagram of the second acquisition module 200 provided by the second embodiment of the application;

[0027] Figure 8 Another structural schematic diagram of the second acquisition module 200 provided for the second embodiment of the present application is provided.

[0028] Figure 9 A structural schematic diagram of the first calculation module 300 provided for the second embodiment of the present application is provided. DETAILED DESCRIPTION

[0029] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0030] Embodiment one

[0031] As shown in the figure, the present embodiment one provides a method for acquiring text based on an interactive question and answer model, which includes the following steps: Figure 1

[0032] S100, based on the retrieval text input by the user to the given interactive question and answer model, a first semantic analysis text output by the given interactive question and answer model is acquired, and a plurality of initial keywords are extracted from the first semantic analysis text. In a specific implementation, the given interactive question and answer model outputs the first semantic analysis text and the result feedback text for the retrieval text, and the present application does not directly use the result feedback text, but only acquires the first semantic analysis text. For example, the given interactive question and answer model can be a deepseek large language model, and the output content thereof includes analysis logic and results.

[0033] As described above, since the reply results output by the question and answer model in the prior art are all prior art or common knowledge, in order to acquire the query text in the text library, the present application does not directly use the output results of the interactive question and answer model, but uses the powerful semantic analysis capability of the model to acquire the keywords from the semantic analysis text. In this process, the accurate expansion of the keywords is realized, so that more reliable text can be queried from the massive text in the preset text.

[0034] S200, a plurality of target keywords are selected from the plurality of initial keywords according to the relevance of each initial keyword to the retrieval text, and a word weight corresponding to each target keyword is acquired; it can be understood that: the initial keywords with high relevance to the retrieval text are selected as target keywords.

[0035] Specifically, as shown in the figure, the plurality of target keywords are selected from the plurality of initial keywords according to the relevance of each initial keyword to the retrieval text, which includes the following steps: Figure 2 S210, the relevance of each initial keyword to the retrieval text is calculated, and the relevance of each initial keyword to the retrieval text is calculated according to the following formula:​

[0036] S201, screen out initial keywords identical to any preset regular word from a plurality of initial keywords to obtain a plurality of first keywords; it can be understood that the preset regular word is a habitual word, and the relevance to the technical field where the retrieval text is located is low.

[0037] S202, according to the position information of each initial keyword in the first semantic analysis text, obtain the character reverse order of each first keyword corresponding to each first keyword, and adopt a preset activation function to normalize the order value corresponding to all first keywords of the character reverse order, to obtain the first keyword score corresponding to each first keyword; wherein the independent variable coefficient of the preset activation function is related to the total number of characters of the retrieval text.

[0038] Specifically, the preset activation function adopts a Sigmoid function.

[0039] Further, in the embodiment, the preset activation function meets the following conditions:

[0040] S=2 / (1+e -σx )-1, wherein x is the xth character reverse order, S is the normalized value corresponding to x, σ is the preset independent variable coefficient, the value range of σ is between 0 and 1, and σ is negatively related to the total number of characters of the retrieval text.

[0041] In a preferred embodiment, σ=2 / k, wherein k is the total number of characters of the retrieval text; that is, when k is larger, the first keyword score corresponding to the first keyword closer to 1.

[0042] S203, calculate the word frequency of each first keyword based on the first semantic analysis text, and determine the normalized value corresponding to the word frequency of each first keyword as the second keyword score corresponding to the first keyword itself.

[0043] S204, determine the product of the first keyword score and the second keyword score as the final score of the first keyword, and screen the first keyword corresponding to the final score greater than the preset score threshold as the target keyword; in the specific implementation, the corresponding weight of the first keyword score and the second keyword score can also be set, and the person skilled in the art sets the preset score threshold according to the actual demand, which will not be repeated here.

[0044] In the above, when considering the relevance of the first keyword and the search text, the position information and the word frequency corresponding to the first keyword are introduced. In the semantic analysis text, the front part of the text is usually the logical analysis keyword with high relevance to the search text, such as the decomposition of the question, and the latter part is the logical reasoning or the example of multiple possibilities. Therefore, the keyword closer to the front has a higher relevance to the search text, and the corresponding first keyword score is higher, and the word frequency is higher, which represents the importance of the keyword. Therefore, the two factors are introduced and combined in the present application, so that the target keyword screened out has higher relevance to the search text, so as to screen out the strategy text that meets the requirements.

[0045] In a specific embodiment, as shown in Figure 3 The word weight corresponding to each target keyword is obtained by the following steps:

[0046] S210, the normalized result of the final score corresponding to each target keyword is determined as the first word confidence corresponding to the target keyword itself.

[0047] S220, the search text sample is input into the given interactive question and answer model several times to obtain several second semantic analysis texts, and the TF-IDF value corresponding to each target keyword is calculated based on the several second semantic analysis texts, and the normalized result of the TF-IDF value corresponding to each target keyword is determined as the second word confidence corresponding to the target keyword itself. Those skilled in the art know the specific process of calculating the TF-IDF value corresponding to the keyword, which will not be repeated here.

[0048] S230, for any target keyword, the first word confidence and the second word confidence corresponding to the target keyword and the preset weight corresponding to the first word confidence and the second word confidence are weighted and calculated to obtain the word weight corresponding to the target keyword.

[0049] In the above, when calculating the word weight corresponding to each target keyword, the first semantic analysis text where the target keyword is located and the multiple second semantic analysis texts where the target keyword is located are considered, that is, the internal and external factors are combined, so that the calculated word weight is more reasonable and reliable.

[0050] S300, based on the word weight corresponding to each target keyword, the matching similarity between each preset strategy text in the preset text library and the several target keywords is calculated, and the preset strategy text corresponding to the matching similarity greater than the similarity threshold is taken as the first strategy text. Those skilled in the art can set the similarity threshold according to actual needs, which will not be repeated here.

[0051] Further, as shown in Figure 4 S300 step specifically includes the following steps:

[0052] S301, obtain a word vector corresponding to each target keyword, and calculate a matching similarity of each word vector and each preset policy text; the word vector corresponding to the target keyword and the word vector corresponding to the preset policy text have the same vector dimension.

[0053] S302, for any preset policy text, based on the word weight corresponding to each target keyword and the matching similarity of each word vector and each preset policy text, a weighted sum is calculated to obtain a matching similarity of each preset policy text and a plurality of target keywords.

[0054] In the above, when calculating the similarity of the target keyword and the predicted policy text, the importance of different keywords is considered. Since the word weight of the keyword with high relevance to the search text is also set to be high, the introduction of the word weight for calculating the matching similarity can obtain a policy text that is more in line with the search requirements of the search text.

[0055] S400, taking the replacement text corresponding to the search text as a new search text, returning to execute steps S100-S300 to obtain a plurality of second policy texts; the replacement text corresponding to the search text refers to the text obtained by performing synonym replacement on the given word object in the search text by the preset large language model; it can be understood that: a plurality of replacement texts corresponding to the search text are executed respectively in steps S100-S300, and each replacement text corresponds to obtain a second policy text.

[0056] The above considers that the user's subjectivity may lead to inaccurate word usage in the search text and affect the query result. The word object in the search text is replaced with multiple synonyms, so that the obtained second policy text is more comprehensive, which is conducive to obtaining a policy text that meets the reply requirements.

[0057] S500, when there are duplicate first policy texts and second policy texts, the first policy text with the highest matching similarity in all duplicate first policy texts and the second policy text with the highest matching similarity in all duplicate second policy texts are taken as the target feedback text; otherwise, the policy text with the highest matching similarity in all first policy texts and all second policy texts is taken as the target feedback text. For example, when there are two groups of the same first policy texts and second policy texts, the policy text with the highest matching similarity is selected from the two first policy texts and the two second policy texts as the target feedback text.

[0058] As mentioned above, since both the first and second strategy texts are strategy texts that meet the retrieval requirements and are found through retrieval text or synonymous transformations of retrieval text, when there is a case in the second strategy text that is the same as the first strategy text, it indicates that the text is more likely to meet the requirements. Therefore, the strategy text with higher matching similarity is selected as the target feedback text. When they are all different, the target feedback text can be selected only based on the matching similarity of each strategy text, which improves the overall reliability of the target feedback text selection.

[0059] In an extended embodiment, such as Figure 5 As shown, the following steps are included before step S100:

[0060] S10 processes the collected user voice data sequentially through framing, windowing, and discrete Fourier transform to convert it into a spectral signal, and constructs a target Gaussian filter based on the frequency distribution in the spectral signal.

[0061] S20, the target Gaussian filter is used to perform convolution operation on the spectrum signal to obtain the denoised speech spectrum.

[0062] S30 converts the denoised speech spectrum into a time-domain signal, and then uses speech recognition technology to convert the denoised time-domain signal into searchable text.

[0063] As mentioned above, when considering the possibility of users using voice input for retrieval, voice noise can easily occur due to user accents or surrounding environmental issues. By constructing a Gaussian filter and denoising the voice, more accurate and clear retrieval text can be obtained.

[0064] Example 2

[0065] like Figure 6 As shown, this second embodiment provides a device for acquiring text based on an interactive question-and-answer model, including:

[0066] The first acquisition module 100 is used to acquire the first semantic analysis text output by the given interactive question-answering model based on the retrieval text input by the user, and to extract several initial keywords from the first semantic analysis text. In specific implementations, the given interactive question-answering model outputs both the first semantic analysis text and the result feedback text for the retrieval text. However, this application does not directly use the result feedback text, but only acquires the first semantic analysis text. For example, the given interactive question-answering model can be the Deepseek large language model, whose output includes analysis logic and results.

[0067] As described above, since the reply results output by the question and answer model in the prior art are all prior art or common knowledge, in order to obtain the query text in the text library, the output result of the interactive question and answer model is not directly used, but the powerful semantic analysis capability of the model is used to obtain the keywords from the semantic analysis text, and in this process, the accurate expansion of the keywords is realized, so that more reliable text can be queried from the mass of preset text.

[0068] The second obtaining module 200 is configured to filter a plurality of target keywords from the plurality of initial keywords according to the relevance of each initial keyword to the search text, and obtain a word weight corresponding to each target keyword; it can be understood that the initial keywords with high relevance to the search text are filtered out as target keywords.

[0069] Specifically, as shown in Figure 7 The second obtaining module 200 includes:

[0070] The filtering module 201 is configured to filter out the initial keywords that are the same as any preset common word from the plurality of initial keywords, to obtain a plurality of first keywords; it can be understood that the preset common word is a common word, and the relevance to the technical field of the search text is low.

[0071] The second calculation module 202 is configured to obtain a character reverse order ranking of each first keyword according to the position information of each initial keyword in the first semantic analysis text, and normalize the order value corresponding to the character reverse order ranking of all first keywords by using a preset activation function, to obtain a first keyword score corresponding to each first keyword; wherein the argument coefficient of the preset activation function is related to the total number of characters of the search text.

[0072] Specifically, the preset activation function uses a Sigmoid function.

[0073] Further, in the embodiment, the preset activation function meets the following condition:

[0074] S=2 / (1+e -σx )-1, wherein x is the xth character reverse order ranking, S is the normalized value corresponding to x, σ is a preset argument coefficient, the value range of σ is between 0 and 1, and σ is negatively correlated with the total number of characters of the search text.

[0075] In a preferred embodiment, σ=2 / K, wherein k is the total number of characters of the search text; that is, when k is larger, the first keyword score corresponding to the first keyword closer to 1.

[0076] The third calculation module 203 is configured to calculate the word frequency of each first keyword based on the first semantic analysis text, and determine the normalized value corresponding to the word frequency of each first keyword as the second keyword score corresponding to the first keyword itself.

[0077] The screening module 204 is configured to determine the product of the first keyword score and the second keyword score as the final score of the first keyword, and screen the first keyword with a final score greater than a preset score threshold as the target keyword. In a specific implementation, the first keyword score and the second keyword score can also be respectively set with corresponding weights, and the preset score threshold can be set by a person skilled in the art according to actual needs, which will not be described here.

[0078] In the above, when considering the relevance of the first keyword to the search text, the position information and the word frequency corresponding to the first keyword are introduced. Since in the semantic analysis text, the front part of the text is usually a logical analysis keyword with high relevance to the search text, such as decomposition of a question, and the latter part is logical reasoning or an example of multiple possibilities, the keyword closer to the front has a higher relevance to the search text, and the corresponding first keyword score is higher, and the word frequency is greater, indicating that the importance of the keyword is higher. Therefore, in the present application, these two factors are introduced and combined, so that the target keyword screened has higher relevance to the search text, so as to screen a strategy text that meets the requirements.

[0079] In a specific implementation, as shown in Figure 8 The second acquisition module 200 further includes:

[0080] The second determination module 210 is configured to determine the normalized result of the final score corresponding to each target keyword as the first word confidence corresponding to the target keyword itself.

[0081] The third determination module 220 is configured to input the search text sample into a given interactive question and answer model for several times to obtain several second semantic analysis texts, calculate the TF-IDF value corresponding to each target keyword based on the several second semantic analysis texts, and determine the normalized result of the TF-IDF value corresponding to each target keyword as the second word confidence corresponding to the target keyword itself. A person skilled in the art knows the specific process of calculating the TF-IDF value corresponding to the keyword, which will not be described here.

[0082] The fourth calculation module 230 is configured to, for any target keyword, calculate the word weight corresponding to the target keyword according to the first word confidence, the second word confidence corresponding to the target keyword, and the preset weights respectively corresponding to the first word confidence and the second word confidence.

[0083] The above, when calculating the word weight corresponding to each target keyword, the first semantic analysis text where the target keyword is located and the plurality of second semantic analysis texts where the target keyword is located are considered, that is, the internal and external factors are combined, so that the calculated word weight is more reasonable and reliable.

[0084] The first calculation module 300 is configured to calculate a matching similarity between each preset strategy text in the preset text library and the target keywords based on the word weight corresponding to each target keyword, and take the preset strategy text corresponding to a matching similarity greater than a similarity threshold as a first strategy text. A similarity threshold can be set according to actual needs by a person skilled in the art, and thus no further description is given herein.

[0085] Further, as shown in Figure 9 The first calculation module 300 includes:

[0086] The fifth calculation module 301 is configured to obtain a word vector corresponding to each target keyword, and calculate a matching similarity between each word vector and each preset strategy text. The vector dimension of the word vector corresponding to the target keyword is the same as that of the word vector corresponding to the preset strategy text.

[0087] The sixth calculation module 302 is configured to, for any preset strategy text, calculate a matching similarity between the preset strategy text and the target keywords based on the word weight corresponding to each target keyword and the matching similarity between each word vector and each preset strategy text.

[0088] The above, when calculating the similarity between the target keywords and the prediction strategy text, the importance of different keywords is considered. Since the word weight of the keyword with high relevance to the search text is also set to be high, the introduction of the word weight for calculating the matching similarity can obtain a strategy text that meets the search requirements of the search text.

[0089] The processing module 400 is configured to take the replacement text corresponding to the search text as a new search text, return to execute the first acquisition module to the first calculation module, and obtain a plurality of second strategy texts. The replacement text corresponding to the search text refers to a text obtained by performing synonymous replacement on a given word object in the search text by using a preset large language model. It can be understood that: the plurality of replacement texts corresponding to the search text are respectively executed in steps S100-S300, and each replacement text corresponds to a second strategy text.

[0090] The above, considering that the user's subjectivity will lead to inaccurate use of words in the search text and affect the query result, a plurality of synonymous replacements are performed on the word object in the search text, so that the obtained second strategy text is more comprehensive, which is conducive to obtaining a strategy text meeting the reply requirements.

[0091] The first determining module 500 is configured to, when there is a repetition between the first policy text and the second policy text, select the policy text with the highest matching similarity from the repeated first policy text and the repeated second policy text as the target feedback text; otherwise, select the policy text with the highest matching similarity from all the first policy texts and all the second policy texts as the target feedback text. For example, when there are two groups of the same first policy text and second policy text, select the policy text with the highest matching similarity from the two first policy texts and the two second policy texts as the target feedback text.

[0092] In the above, since the first policy text and the second policy text are both policy texts meeting the search requirement searched by the search text or the synonym transformed search text, when there is a same first policy text in the second policy text, it indicates that the text has a higher possibility of meeting the requirement, and therefore, the policy text with the higher matching similarity is selected as the target feedback text, and when none of them is the same, the target feedback text is selected according to the matching similarity of each policy text, thereby improving the screening reliability of the target feedback text as a whole.

[0093] Embodiment three

[0094] The embodiments of the present application also provide a non-transitory computer readable storage medium, which can be arranged in an electronic device to save at least one instruction or at least one program related to a method in the method embodiments, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiments.

[0095] Although some specific embodiments of the present application have been described in detail by examples, those skilled in the art should understand that the above examples are only for illustration, but not for limiting the scope of the present application. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the present application. The scope of the present application is defined by the appended claims.

Claims

1. A method for acquiring text based on an interactive question-and-answer model, characterized in that, The method includes the following steps: S100: Based on the retrieval text input by the user into the given interactive question-answering model, obtain the first semantic analysis text output by the given interactive question-answering model, and extract several initial keywords from the first semantic analysis text; S200: Based on the relevance of each initial keyword to the search text, select several target keywords from the initial keywords and obtain the word weight corresponding to each target keyword. The step of selecting target keywords from a pool of initial keywords based on the relevance of each initial keyword to the search text includes the following steps: S201, filter out the initial keywords that are the same as any preset regular words from a number of initial keywords to obtain a number of remaining first keywords; S202, based on the position information of each initial keyword in the first semantic analysis text, obtain the reverse order of characters corresponding to each first keyword, and use a preset activation function to normalize the order values ​​corresponding to the reverse order of characters of all first keywords to obtain the first keyword score corresponding to each first keyword; wherein, the independent variable coefficient of the preset activation function is related to the total number of characters in the search text; S203, calculate the word frequency of each first keyword based on the first semantic analysis text, and determine the normalized value corresponding to the word frequency of each first keyword as the score of the second keyword corresponding to the first keyword itself; S204, the product of the first keyword score and the second keyword score is determined as the final score of the first keyword, and the first keywords with a corresponding final score greater than the preset score threshold are selected as target keywords; Obtain the keyword weight for each target keyword by following these steps: S210, the normalized result of the final score corresponding to each target keyword is determined as the first word confidence score corresponding to the target keyword itself; S220, input the retrieved text samples into the given interactive question-answering model several times to obtain several second semantic analysis texts, and calculate the TF-IDF value corresponding to each target keyword based on the several second semantic analysis texts, and determine the normalized result of the TF-IDF value corresponding to each target keyword as the second word confidence of the target keyword itself. S230: For any target keyword, calculate the word weight corresponding to the target keyword by performing a weighted sum based on the confidence scores of the first word, the second word, and the preset weights corresponding to the confidence scores of the first word and the second word respectively. S300: Based on the word weight corresponding to each target keyword, calculate the matching similarity between each preset strategy text in the preset text library and several target keywords, and take the preset strategy text with a matching similarity greater than the similarity threshold as the first strategy text. S400, take the replacement text corresponding to the search text as the new search text, return to the execution steps S100-S300, and obtain several second strategy texts; the replacement text corresponding to the search text refers to the text obtained by performing synonym replacement on the given word object in the search text through a preset large language model. S500, when there is a duplication between the first strategy text and the second strategy text, the strategy text with the highest matching similarity among all the duplicated first strategy texts and all the duplicated second strategy texts is taken as the target feedback text; otherwise, the strategy text with the highest matching similarity among all the first strategy texts and all the second strategy texts is taken as the target feedback text.

2. The method for obtaining text based on an interactive question-and-answer model according to claim 1, characterized in that, The S300 procedure includes the following steps: S301, obtain the word vector corresponding to each target keyword, and calculate the matching similarity between each word vector and each preset strategy text; the word vector corresponding to the target keyword and the word vector corresponding to the preset strategy text have the same vector dimension; S302, for any preset strategy text, calculate the matching similarity between each preset strategy text and several target keywords by performing a weighted sum based on the word weight corresponding to each target keyword and the matching similarity between each word vector and each preset strategy text.

3. The method for obtaining text based on an interactive question-and-answer model according to claim 1, characterized in that, The following steps are included before step S100: S10: The collected user voice data is sequentially processed by framing, windowing, and discrete Fourier transform to convert it into a spectrum signal, and a target Gaussian filter is constructed based on the frequency distribution in the spectrum signal. S20, the target Gaussian filter is used to perform convolution operation on the spectrum signal to obtain the denoised speech spectrum; S30 converts the denoised speech spectrum into a time-domain signal, and then uses speech recognition technology to convert the denoised time-domain signal into searchable text.

4. A device for acquiring text based on an interactive question-and-answer model, characterized in that, The device includes: The first acquisition module is used to acquire the first semantic analysis text output by the given interactive question-answering model based on the retrieval text input by the user into the given interactive question-answering model, and extract several initial keywords from the first semantic analysis text. The second acquisition module is used to select several target keywords from several initial keywords based on the relevance of each initial keyword to the search text, and to obtain the word weight corresponding to each target keyword. The first calculation module is used to calculate the matching similarity between each preset strategy text in the preset text library and several target keywords based on the word weight corresponding to each target keyword, and to take the preset strategy text with a matching similarity greater than the similarity threshold as the first strategy text. The processing module is used to take the replacement text corresponding to the searched text as the new searched text, and return to the execution of the first acquisition module to the first calculation module to obtain several second strategy texts; the replacement text corresponding to the searched text refers to the text obtained by performing synonym replacement on the given word object in the searched text through a preset large language model; The first determining module is used to determine the target feedback text when there is a duplication between the first strategy text and the second strategy text, and the strategy text with the highest matching similarity among all the duplicated first strategy texts and all the duplicated second strategy texts; otherwise, the strategy text with the highest matching similarity among all the first strategy texts and all the second strategy texts is used as the target feedback text. The second acquisition module includes: The filtering module is used to filter out initial keywords that are the same as any preset regular words from a number of initial keywords, so as to obtain a number of remaining first keywords; The second calculation module is used to obtain the reverse order of characters corresponding to each first keyword based on the position information of each initial keyword in the first semantic analysis text, and to normalize the order values ​​corresponding to the reverse order of characters of all first keywords using a preset activation function to obtain the first keyword score corresponding to each first keyword; wherein, the independent variable coefficient of the preset activation function is related to the total number of characters in the search text. The third calculation module is used to calculate the word frequency of each first keyword based on the first semantic analysis text, and to determine the normalized value corresponding to the word frequency of each first keyword as the score of the second keyword corresponding to the first keyword itself. The filtering module is used to determine the final score of the first keyword by multiplying the score of the first keyword and the score of the second keyword, and to filter the first keywords whose final scores are greater than a preset score threshold as target keywords. The second acquisition module also includes: The second determination module is used to determine the normalized result of the final score corresponding to each target keyword as the first word confidence score corresponding to the target keyword itself. The third determination module is used to input the retrieved text samples into a given interactive question-answering model several times to obtain several second semantic analysis texts, and calculate the TF-IDF value corresponding to each target keyword based on the several second semantic analysis texts. The normalized result of the TF-IDF value corresponding to each target keyword is determined as the second word confidence of the target keyword itself. The fourth calculation module is used to calculate the word weight of any target keyword by performing a weighted sum based on the confidence scores of the first and second words corresponding to the target keyword, as well as the preset weights corresponding to the confidence scores of the first and second words respectively.

5. The apparatus for acquiring text based on an interactive question-and-answer model according to claim 4, characterized in that, The first computing module includes: The fifth calculation module is used to obtain the word vector corresponding to each target keyword and calculate the matching similarity between each word vector and each preset strategy text; the word vector corresponding to the target keyword and the word vector corresponding to the preset strategy text have the same vector dimension; The sixth calculation module is used to calculate the matching similarity between each preset strategy text and several target keywords by performing a weighted sum based on the word weight corresponding to each target keyword and the matching similarity between each word vector and each preset strategy text for any preset strategy text.

6. A non-transitory computer-readable storage medium, wherein the storage medium stores at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the method for obtaining text based on an interactive question-and-answer model as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Semantic-based approximate text search method and device, computer equipment and medium

    CN113434636A

  • Semantic retrieval method and system for automatically extracting keywords

    CN118468881A