Method, electronic device and computer program product for generating an abstract
By combining intent recognition and summary extraction models, summary information that better matches the intent of the target text is generated, solving the problem of low accuracy of summary information in existing technologies and achieving efficient and accurate summary generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SF TECH CO LTD
- Filing Date
- 2024-12-10
- Publication Date
- 2026-06-12
Smart Images

Figure CN122197843A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, specifically to a method for generating summaries, an electronic device, and a computer program product. Background Technology
[0002] Abstracts (also known as summaries) are typically used to help readers quickly understand the topic and content of a text, and automatically generated abstracts have important applications in the field of natural language processing. However, current automatically generated abstracts have low accuracy and cannot accurately summarize the intent of the text, that is, they cannot accurately summarize the content described in the text.
[0003] Therefore, how to efficiently generate highly accurate summary information has become an urgent technical problem to be solved. Summary of the Invention
[0004] In view of this, embodiments of this application provide a method, electronic device, and computer program product for generating summaries, which can generate summary information that better matches the intent of the target text, thereby improving the accuracy of the summary information and the efficiency of obtaining the summary information.
[0005] In a first aspect, embodiments of this application provide a method for generating a summary, the method comprising: obtaining a target text from which summary information is to be extracted; performing intent recognition on the target text using an intent recognition model to obtain the text intent of the target text; obtaining a first intent template matching the text intent, wherein the first intent template includes at least one template information item for representing the scenario corresponding to the text intent; and obtaining summary information of the target text based on the first intent template and the target text.
[0006] Secondly, embodiments of this application provide a computationally readable storage medium storing a computer program for executing the digest generation method described in the first aspect above.
[0007] Thirdly, embodiments of this application provide an electronic device, including: a processor; and a memory for storing processor-executable instructions, wherein the processor is configured to perform the digest generation method described in the first aspect above.
[0008] Fourthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the digest generation method described in the first aspect above.
[0009] This application provides a method, electronic device, and computer program product for generating summaries. By using an intent recognition model to identify the intent of target text, the text intent of the target text is obtained. Then, a first intent template matching the text intent is obtained. Based on the first intent template and the target text, the summary information of the target text is obtained. This allows the present application to generate summary information that is more consistent with the intent of the target text, thereby improving the accuracy of the summary information. Attached Figure Description
[0010] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the embodiments of the present disclosure to explain the disclosure and do not constitute a limitation thereof. The above and other features and advantages will become more apparent to those skilled in the art from the detailed description of exemplary embodiments with reference to the accompanying drawings, in which:
[0011] Figure 1 This is a flowchart illustrating a method for generating a digest provided in an exemplary embodiment of this application.
[0012] Figure 2 This is a flowchart illustrating a method for generating a digest provided in another exemplary embodiment of this application.
[0013] Figure 3 This is a flowchart illustrating a method for generating a digest provided in another exemplary embodiment of this application.
[0014] Figure 4 This is a schematic diagram of the structure of an apparatus for generating a digest provided in an exemplary embodiment of this application.
[0015] Figure 5 This is a block diagram of an electronic device for generating a summary, provided in an exemplary embodiment of this application. Detailed Implementation
[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0017] Automatic text summarization has important applications in the field of natural language processing. Currently, summarization primarily involves providing the model with a general instruction, enabling it to output summary information according to the instruction's requirements, such as the zero-shot learning method; or providing the model with multiple examples and instructions, enabling it to output summary information according to the style of the examples and the instructions, such as the few-shot learning method. However, the summary information obtained through these methods cannot accurately summarize the content of the target text, resulting in low accuracy of the generated summary information.
[0018] To address the aforementioned problems, this application provides a method for generating abstracts. Various non-limiting embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0019] Figure 1 This is a flowchart illustrating a method for generating a digest provided in an exemplary embodiment of this application. Figure 1 The method is executed by a computing device, such as a server. The summary generation method provided in this application can be applied to extract summaries from AI-driven dialogue scenarios, such as intelligent customer service scenarios, intelligent question-and-answer scenarios, and automated meeting minutes scenarios.
[0020] like Figure 1 As shown, the method for generating the summary includes the following:
[0021] S110: Obtain the target text from which the summary information is to be extracted.
[0022] Specifically, the target text can be understood as the text that needs to be extracted, such as the text content from the front end that is to be extracted for the summary information.
[0023] In one embodiment, the target text may be a conversation between a user and artificial intelligence, such as a conversation in a logistics-related intelligent question-and-answer scenario.
[0024] S120: The intent of the target text is obtained by performing intent recognition on the target text through an intent recognition model.
[0025] In this step, before generating the summary, intent recognition needs to be performed on the target text to obtain the text intent corresponding to the target text. The text intent can be a business request for a specific service in a customer service Q&A scenario, such as forwarding a package. This embodiment does not specifically limit the content of the text intent indication. Intent recognition in this embodiment can be completed based on a preset intent recognition model. This intent recognition model can be a pre-trained neural network model or other models for identifying intent in target text, such as rule-based models (it should be noted that such models can identify intent in text by setting a series of rules. For example, they can determine the intent in target text through word matching, regular expressions, or specific grammatical patterns) or Naive Bayes classifiers. No limitation is made here.
[0026] In one specific embodiment, the intent recognition model is a pre-trained network model for extracting the intent of the target text. The intent recognition model can be a model with the same bidirectional encoder representation (i.e., BERT structure), such as the Bigbird-Chinese model, the RoBERTa-base-Chinese model, or the ALBERT-CHN model. This application does not specifically limit the intent recognition model.
[0027] In one embodiment, the target text is input into an intent recognition model for intent recognition, and the output of the intent recognition model is obtained as the text intent of the target text.
[0028] S130: Obtain the first intent template that matches the text intent.
[0029] In one embodiment, the first intent template (also referred to as the first instruction template) includes at least one template information item for representing the scenario corresponding to the text intent.
[0030] Specifically, different textual intentions correspond to different first intention templates, that is, the first intention template and the textual intention... Figure 1 One-to-one correspondence. That is, different text intents correspond to at least one different template information item. The first intent template can be JSON text, which can be understood as a dictionary-type data structure, with a format such as {scene_1:prompt_1,scene_2:prompt_2,...,scene_n:prompt_n}.
[0031] The template information item can be used to indicate the location of entity feature information that needs to be filled in the target text in the first intent template; that is, the template information item is used to indicate the location where entity feature information is filled. In other words, entity feature information (e.g., address information, number information, etc.) included in the target text can be used as the value of the template information item in the first intent template. The number of template information items can be one or more, and this application embodiment does not specifically limit the number of template information items.
[0032] In one embodiment, multiple first intent templates corresponding to multiple text intents are pre-stored in the server, and then the obtained text intent is matched with the multiple first intent templates to obtain the first intent template corresponding to the text intent.
[0033] S140: Based on the first intent template and the target text, obtain the summary information of the target text.
[0034] Specifically, at least one entity feature information is extracted from the target text based on preset rules. This at least one entity feature information is then set as the value of at least one template information item corresponding to it, i.e., at least one entity feature information is filled into at least one specified position in the first intent template, resulting in a second intent template. The second intent template and the target text are then fused (e.g., by performing concatenation operations) to obtain the fused target text. This fused target text is then input into a summary extraction model to obtain the summary information of the target text; that is, the output of the summary extraction model is the summary information.
[0035] It should be noted that for a detailed description of step S140, please refer to the following embodiments.
[0036] Therefore, it can be seen that the embodiments of this application use an intent recognition model to identify the intent of the target text, obtain the text intent of the target text, obtain a first intent template that matches the text intent, and obtain the summary information of the target text based on the first intent template and the target text. This enables the embodiments of this application to generate summary information that is more consistent with the intent of the target text and improves the accuracy of the summary information.
[0037] Figure 2 This is a flowchart illustrating a method for generating a digest provided in another exemplary embodiment of this application. Figure 2 The example is Figure 1 The similarities in the examples of the embodiments will not be repeated here; the focus is on describing the differences. For example... Figure 2 As shown, the method for generating the summary includes the following:
[0038] S210: Extract at least one entity feature information from the target text based on preset rules.
[0039] Specifically, entity feature information can be entity information included in the target text. At least one entity feature information may include one or more of address information, number information (e.g., telephone number and monthly account number), and fee information.
[0040] The preset rules can include multiple rules for different entity feature information. For example, when the entity feature information is address information, the preset rules can be rules for extracting address information.
[0041] In one embodiment, when at least one entity feature information includes address information, the target text can be processed based on an address resolution algorithm to obtain the address information.
[0042] In another embodiment, when at least one entity feature information includes number information, the target text can be processed based on the inherent features of the number information to obtain the number information.
[0043] In another embodiment, when at least one entity feature information includes cost information, keyword recognition can be performed on the target text to obtain the cost information.
[0044] S220: In the first intent template, at least one entity feature information is set to the value of at least one template information item corresponding to the at least one entity feature information to obtain the second intent template.
[0045] In one embodiment, at least one entity feature information may correspond to at least one template information item.
[0046] Specifically, the first intent template may include at least one template information item. After obtaining at least one entity feature information, the at least one entity feature information is then filled into the position indicated by the at least one template information item corresponding to the at least one entity feature information in the first intent template, as the value corresponding to the at least one template information item.
[0047] For example, if the entity feature information is a phone number, the extracted phone number (i.e., entity feature information) is filled into 11 positions after "No." in the first intent template, where the template information item can be one of the 11 positions after "No."
[0048] It should be noted that steps S210 and S220 can be understood as using a rule engine to extract the entity feature information required under the textual intent of the target text, and then filling it back into the first intent template. After extracting the entity feature information from the target text, the elements of the entity feature information can be element_1, element_2, ..., element_n. Filling the entity feature information back into the first intent template yields the second intent template, which can have the following format: xxxxxxxxxx{element_1}xxxxxxxxxx{element_2}...xxxxxxxxxx{element_n}.
[0049] S230: Obtain summary information based on the second intent template and the target text.
[0050] Specifically, the second intent template and the target text are fused to obtain the fused target text, which is then input into the summary extraction model to obtain the summary information of the target text. The fusion can include methods such as splicing and combination.
[0051] Therefore, it can be seen that the embodiments of this application extract entity information of the target text through preset rules and fill the entity information in the intent template, so that the summary extraction model can perceive the entity information in advance, thereby ensuring that the summary information can output the entity information more accurately.
[0052] In one embodiment of this application, obtaining summary information based on a second intent template and target text includes: fusing the second intent template and target text to obtain fused target text; and inputting the fused target text into a summary extraction model to obtain summary information.
[0053] Specifically, the method of fusing the second intent template and the target text can be splicing, combining, embedding, weighted synthesis, and replacement, etc., and the embodiments of this application do not specifically limit this.
[0054] In one embodiment of this application, fusing a second intent template and target text to obtain fused target text includes: concatenating the second intent template and target text to obtain concatenated target text. Then, inputting the fused target text into a summary extraction model to obtain summary information includes: inputting the concatenated target text into the summary extraction model and generating summary information based on the inference parameters in the generation configuration of the summary extraction model.
[0055] Specifically, the second intent template and the target text can be merged by splicing, where the splicing method can be addition.
[0056] The input to the summary extraction model is the fused target text (e.g., the target file concatenated with the second intent recognition model), and the output is the summary information of the target text. The summary extraction model can be a model trained with the Llama architecture (Large Language Model Meta AI) or a model trained based on an open-source pre-trained model (base version).
[0057] In this embodiment, the second intent template is concatenated with the target text and used as input to a Llama architecture (Transformer-Decoder Only) summary extraction model. The inference parameters of the summary extraction model are read and stored in generation_config, and the final generated summary information is used as the output result.
[0058] It should be noted that the training process of the summary extraction model may include: manually annotating the target text and summary information under each text intent, and then manually reviewing and filtering out incorrectly annotated text to obtain sample data for training the summary extraction model. Then, an initial summary extraction model (e.g., the open-source base-chat version model) is obtained, and the sample data is fed into this initial summary extraction model for instruction fine-tuning (SFT) training. Training for one complete cycle yields the desired summary extraction model.
[0059] Therefore, this application embodiment extracts the summary information of the target text by using two models: an intent recognition model and a summary extraction model. Compared with the traditional method of manually summarizing summary information, this application embodiment can eliminate the time cost of manually summarizing summary information, greatly improve work efficiency, and enable readers to quickly understand the information of the target text.
[0060] In one embodiment of this application, at least one entity feature information includes one or more of address information, number information, and fee information. The extraction of at least one entity feature information from the target text based on preset rules includes: performing data processing on the target text based on a preset algorithm and / or the inherent features of at least one entity feature information to obtain at least one entity feature information.
[0061] Specifically, at least one entity feature may include address information, which can be a third-level address indicating the province, city, or district. It should be noted that if the target text contains key information such as Chinese provinces, cities, or districts, the third-level address can be completed. The preset algorithm can be an address resolution algorithm.
[0062] In one embodiment, the target file is processed based on an address resolution algorithm to obtain address information.
[0063] Address resolution algorithms can be based on the CPCA (Chinese Province and City Address) library, a Python library for parsing and standardizing Chinese addresses. It is suitable for extracting structured information such as province, city, and district / county from text addresses. CPCA's core algorithm is based on pattern matching and dictionary rules, which can identify common Chinese address patterns and separate different geographical levels of information such as province, city, and county.
[0064] For example, a CPCA-based algorithm library can identify the three-level addresses of provinces, cities, and districts to obtain address information, which can be the three-level addresses of the provinces, cities, and districts obtained through identification.
[0065] Therefore, this application embodiment extracts entity information about addresses from the target text based on the CPCA algorithm library, enabling the summary extraction model to perceive the address information in advance, thereby ensuring that the summary information can output the address information more accurately.
[0066] In one embodiment, at least one entity feature information includes number information, wherein extracting at least one entity feature information from the target text based on preset rules includes: performing data processing on the target text based on the inherent features of the number information to obtain the number information.
[0067] Specifically, the number information can be an 11-digit phone number or a 10-digit monthly account number. Inherent characteristics are features inherent to the number itself. For example, the inherent characteristics of a phone number (i.e., the rules for an 11-digit phone number) include 11 consecutive digits and adherence to a specific format (e.g., country code, carrier code, and subscriber number portion). Similarly, the inherent characteristics of a monthly account number (i.e., the rules for a 10-digit monthly account number) include 10 consecutive digits and adherence to a specific format (e.g., specific prefixes and suffixes).
[0068] For example, entity feature information includes phone numbers. Based on rules governing 11-digit phone numbers, single or multiple phone numbers appearing in the target text are extracted to obtain one or more desired phone numbers.
[0069] For example, entity feature information includes the account number of a monthly billing account. Based on the rule of using 10-digit monthly billing account numbers, one or more monthly billing accounts appearing in the target text are extracted to obtain the desired account numbers for one or more monthly billing accounts.
[0070] Therefore, this application embodiment extracts entity information about the number in the target text by leveraging the inherent features of the number information, enabling the summary extraction model to perceive the number information in advance, thereby ensuring that the summary information can output the number information more accurately.
[0071] In one embodiment, at least one entity feature information includes cost information, wherein extracting at least one entity feature information from the target text based on preset rules includes: performing keyword recognition on the target text to obtain cost information.
[0072] Specifically, the fee information can also be called monetary information, which can be a specific fee, such as 10 yuan, 20 yuan, etc. Since fee information usually includes units, such as yuan, jiao, fen, kuai, and mao, these units can be used as keywords to identify the fee information, and the required fee information can be obtained based on keyword recognition. The preset algorithm can be an algorithm or technology used for keyword recognition, and this application embodiment does not specifically limit it.
[0073] In one embodiment, the target text is traversed to perform keyword recognition in order to obtain the amount appearing in the target text, thereby obtaining the expense information included in the target text.
[0074] For example, in this embodiment of the application, regular expression matching (i.e., a certain yuan, a certain block, etc.) is used to extract monetary information appearing in the target text.
[0075] Therefore, it can be seen that the embodiments of this application extract entity information about fees from the target text by keywords, so that the summary extraction model can perceive the amount of fees in advance, thereby ensuring that the generated summary information can output the amount more accurately.
[0076] In one embodiment of this application, at least one template information item includes a first template information item, and at least one entity feature information includes first entity feature information corresponding to the first template information item. The method further includes deleting the first template information item in the first intent template when the target text does not include the first entity feature information.
[0077] Specifically, the first intent template includes at least one template information item, which includes a first template information item, which may be a location for indicating the filling of fee information (or other fees, etc.).
[0078] The target text includes at least one entity feature information, which includes a first entity feature information. The first entity feature information may include fee information and / or address information, etc., which are not specifically limited in this application.
[0079] In one embodiment, based on the first template information item included in the first intent template, the first entity feature information corresponding to the first template information item in the target text is extracted, wherein if the target text does not include the first entity feature information, the first template information item in the first intent template is deleted.
[0080] Therefore, if the required entity feature information does not exist in the target text, the template information item corresponding to the entity feature information in the first intent template can be deleted to ensure complete and fluent natural language.
[0081] In one embodiment of this application, the intent of the target text is obtained by using an intent recognition model to identify the intent of the target text, including: identifying multiple predicted text intents of the target text; obtaining a score value corresponding to each predicted text intent among the multiple predicted text intents; and taking the predicted text intent with the highest score value as the text intent of the target text.
[0082] In one embodiment, the server may include an intent recognition module, which may include a pre-trained intent recognition model.
[0083] Preferably, the intent recognition model can be a trained Bigbird-Chinese model, which has the same structure as BERT, with a 6-layer transformer (i.e., Transformer) as the base and a linear classifier after the activation function.
[0084] Specifically, firstly, the target text is preprocessed, for example, by adding a first specified character (e.g., [CLS]token) to the beginning of the target text and a second specified character (e.g., [SEP]token) to the end of the target text, resulting in the processed target text. Then, the processed target text is tokenized, resulting in the preprocessed target text. The preprocessed target text is the input sequence.
[0085] Then, the preprocessed target text is input into the intent recognition model. The intent recognition model can predict multiple predicted text intents of the target text and score each of these predicted text intents to obtain a score value for each predicted text intent. The predicted text intent with the highest score is then taken as the text intent of the target text, that is, the predicted text intent with the highest score is taken as the output of the intent recognition model. The text intent output by the model can be represented in the form of a numeric index, that is, the numeric index can indicate the intent type of the intent recognition.
[0086] It should be noted that the training process of the intent recognition model includes the following steps: First, production data is retrieved using a list of keywords corresponding to each intent category, and then manually verified to obtain high-quality multi-class intent recognition data. Next, based on the obtained high-quality multi-class intent recognition data, a training set, a development set, and a test set with a ratio of 8:1:1 are constructed. An early-stop strategy is then used to train the initial Bigbird-Chinese model to avoid overfitting during training, thus obtaining the desired intent recognition model.
[0087] Therefore, it can be seen that the embodiments of this application improve the efficiency and accuracy of text intent recognition by using a pre-trained intent recognition model to recognize the intent of the target text, laying the foundation for the rapid generation of summary information in the future.
[0088] Figure 3 This is a flowchart illustrating a method for generating a digest provided in another exemplary embodiment of this application. Figure 3 The method described in the embodiments is executed by a server, and the method for generating the summary includes the following.
[0089] S310: Input the target text. S320: Input the target text into the intent recognition module. The intent recognition model in the intent recognition module obtains the text intent of the target text. S330: Match the text intent with multiple intent templates to obtain a first intent template that matches the target text. S340: Extract at least one entity feature from the target text using a preset rule module. S350: In the first intent template, set the extracted at least one entity feature as the value of at least one template information item corresponding to the at least one entity feature to obtain a filled second intent template. S360: Concatenate the second intent template and the target text to obtain the concatenated target text. S370: Input the concatenated target text into the summary extraction model to obtain the summary information of the target text.
[0090] It should be understood that the embodiments of this application identify the target text as a specific intent through the pre-intent recognition module, so as to match the target text with a specific first intent template. Then, the key entity feature information is extracted through the preset rule module and the extracted entity feature information is filled into the first intent template. Finally, the pre-trained summary extraction model is used as input to obtain the summary information of the target text.
[0091] Figure 4 This is a schematic diagram of the structure of an apparatus 400 for generating digests provided in an exemplary embodiment of this application. Figure 4As shown, the device 400 for generating summaries includes: a first acquisition module 410, an identification module 420, a second acquisition module 430, and a summaries generation module 440.
[0092] The first acquisition module 410 is used to acquire the target text from which the summary information is to be extracted; the recognition module 420 is used to perform intent recognition on the target text through an intent recognition model to obtain the text intent of the target text; the second acquisition module 430 is used to acquire a first intent template that matches the text intent, wherein the first intent template includes at least one template information item used to represent the scenario corresponding to the text intent; and the summary generation module 440 is used to obtain the summary information of the target text based on the first intent template and the target text.
[0093] This application provides an apparatus for generating summaries. It uses an intent recognition model to identify the intent of target text, obtains the text intent of the target text, obtains a first intent template that matches the text intent, and obtains summary information of the target text based on the first intent template and the target text. This allows the present application to generate summary information that is more consistent with the intent of the target text, thereby improving the accuracy of the summary information.
[0094] According to one embodiment of this application, the summary generation module 440 is used to extract at least one entity feature information from the target text based on preset rules; in the first intent template, at least one entity feature information is set to the value of at least one template information item corresponding to at least one entity feature information to obtain a second intent template; and based on the second intent template and the target text, summary information is obtained.
[0095] According to one embodiment of this application, the summary generation module 440 is used to fuse the second intent template and the target text to obtain the fused target text; and input the fused target text into the summary extraction model to obtain summary information.
[0096] According to one embodiment of this application, the summary generation module 440 is used to concatenate the second intent template with the target text to obtain the concatenated target text, input the concatenated target text into the summary extraction model, and generate summary information according to the inference parameters in the generation configuration of the summary extraction model.
[0097] According to one embodiment of this application, at least one entity feature information includes one or more of address information, number information, and cost information. The summary generation module 440 is used to perform data processing on the target text based on a preset algorithm and / or the inherent features of at least one entity feature information to obtain at least one entity feature information.
[0098] According to one embodiment of this application, at least one template information item includes a first template information item, and at least one entity feature information includes first entity feature information corresponding to the first template information item. The summary generation module 440 is used to delete the first template information item in the first intent template when the target text does not include the first entity feature information.
[0099] According to one embodiment of this application, the identification module 420 is used to identify multiple predicted text intentions of the target text; obtain the score value corresponding to each predicted text intention among the multiple predicted text intentions; and take the predicted text intention with the highest score value as the text intention of the target text.
[0100] It should be understood that the specific working process and functions of the first acquisition module 410, the identification module 420, the second acquisition module 430, and the summary generation module 440 in the above embodiments can be referred to the above. Figures 1 to 3 The description of the method for generating summaries provided in the embodiments will not be repeated here to avoid repetition.
[0101] Figure 5 This is a block diagram of an electronic device 500 for generating a summary, provided in an exemplary embodiment of this application.
[0102] Reference Figure 5 The electronic device 500 includes a processing component 510, which further includes one or more processors, and memory resources represented by memory 520 for storing instructions, such as application programs, that can be executed by the processing component 510. The application programs stored in memory 520 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 510 is configured to execute instructions to perform the above-described method for generating a summary.
[0103] Electronic device 500 may also include a power supply component configured to perform power management of electronic device 500, a wired or wireless network interface configured to connect electronic device 500 to a network, and an input / output (I / O) interface. Electronic device 500 can be operated based on an operating system stored in memory 520, such as Windows Server. TM Mac OSX TM Unix TM Linux TM FreeBSD TM Or similar.
[0104] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by the processor of the aforementioned electronic device 500, enables the electronic device 500 to perform a method for generating a summary, comprising: acquiring target text from which summary information is to be extracted; performing intent recognition on the target text using an intent recognition model to obtain the text intent of the target text; acquiring a first intent template matching the text intent, wherein the first intent template includes at least one template information item for representing the scenario corresponding to the text intent; and obtaining summary information of the target text based on the first intent template and the target text.
[0105] This application also provides a computer program product, including a computer program used to perform the steps of the digest generation method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0106] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0107] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0108] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0109] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0110] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0111] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0112] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program verification codes, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0113] It should be noted that in the description of this application, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0114] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications or equivalent substitutions made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for generating summaries, characterized in that, include: Obtain the target text from which the summary information is to be extracted; The intent of the target text is obtained by performing intent recognition on the target text using an intent recognition model. Obtain a first intent template that matches the text intent, wherein the first intent template includes at least one template information item for representing the scenario corresponding to the text intent; Based on the first intent template and the target text, a summary of the target text is obtained.
2. The method according to claim 1, characterized in that, The step of obtaining the summary information of the target text based on the first intent template and the target text includes: At least one entity feature information is extracted from the target text based on preset rules; In the first intent template, the at least one entity feature information is set to the value of at least one template information item corresponding to the at least one entity feature information to obtain the second intent template; The summary information is obtained based on the second intent template and the target text.
3. The method according to claim 2, characterized in that, The step of obtaining the summary information based on the second intent template and the target text includes: The second intent template and the target text are merged to obtain the merged target text; The fused target text is input into the summary extraction model to obtain the summary information.
4. The method according to claim 3, characterized in that, The step of fusing the second intent template and the target text to obtain the fused target text includes: The second intent template is concatenated with the target text to obtain the concatenated target text. The step of inputting the fused target text into the summary extraction model to obtain the summary information includes: The concatenated target text is input into the summary extraction model, and the summary information is generated according to the inference parameters in the generation configuration of the summary extraction model.
5. The method according to claim 2, characterized in that, The at least one entity feature information includes one or more of address information, number information, and fee information. The step of extracting at least one entity feature information from the target text based on preset rules includes: The target text is processed based on a preset algorithm and / or the inherent features of the at least one entity feature information to obtain the at least one entity feature information.
6. The method according to claim 2, characterized in that, The at least one template information item includes a first template information item, and the at least one entity feature information item includes first entity feature information corresponding to the first template information item. The method further includes: If the target text does not include the first entity feature information, delete the first template information item from the first intent template.
7. The method according to any one of claims 1 to 6, characterized in that, The step of performing intent recognition on the target text using an intent recognition model to obtain the text intent of the target text includes: Identify multiple predicted textual intents of the target text; Obtain the score value corresponding to each predicted text intent from the plurality of predicted text intents; The predicted text intent with the highest score is taken as the text intent of the target text.
8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for performing the method for generating a digest as described in any one of claims 1 to 7.
9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions. The processor is used to execute the method for generating a digest as described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method for generating a digest as described in any one of claims 1 to 7.