Text processing method and device, electronic equipment, storage medium and program product
By extracting and updating address information in the pending dialogue text, the problem of low accuracy in address information recognition and acquisition is solved, and higher address extraction accuracy and completeness are achieved.
Patent Information
- Application Number
- CN202411778947.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-25
AI Technical Summary
In the prior art, there is a problem of low accuracy in the identification and acquisition of address information, especially when the user's answer is vague or input is incorrect.
By extracting the first address information in the pending dialogue text, and determining whether the address value is missing, if it is missing, the first address item of the missing address value is determined, the supplementary address text is obtained, and the pending dialogue text is updated until the extracted address information is not missing.
Improve the accuracy and completeness of address extraction, and even when the address value is missing, supplementary address text can be obtained to complete the acquisition of address information.
Smart Images

Figure CN119691150A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a text processing method and device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the development of science and technology and the fast pace of life, artificial intelligence is becoming more and more deeply integrated into people's daily lives. The recognition and acquisition of address information is mostly achieved through artificial intelligence. For example, when an outbound call robot conducts a voice conversation with the user and asks the user for the address, the accuracy of the acquired address may be low due to the user's vague answers or irrelevant answers. For another example, when the user manually enters the address, the accuracy of the acquired address may be low due to input errors, missing information, etc. Summary of the invention
[0003] The present disclosure provides a text processing method and device, an electronic device, a computer-readable storage medium, and a computer program product.
[0004] In a first aspect, the present disclosure provides a text processing method, comprising: obtaining a conversation text to be processed, wherein the conversation text to be processed includes address information; extracting first address information from the conversation text to be processed, wherein the first address information includes multiple levels of address items, and the address items include address values; in the case where the first address information has a missing address value, determining the first address item in the first address information that is missing the address value; according to the first address item, obtaining supplementary address text for the first address information; based on the supplementary address text, updating the conversation text to be processed, and executing the step of extracting the first address information from the conversation text to be processed on the updated conversation text to be processed, until the extracted first address information has no missing address value, and the target address information is obtained.
[0005] Optionally, extracting the first address information from the conversation text to be processed includes: adding the conversation text to be processed to a preset prompt word template to generate an extraction prompt word, wherein the extraction prompt word is used to assist in extracting the address information from the conversation text to be processed; inputting the extraction prompt word into an address extraction model to obtain second address information output by the address extraction model; and correcting the second address information according to standard address information in a preset address library to obtain the first address information of the conversation text to be processed.
[0006] Optionally, the first address information also includes an address fusion mark field, and the address fusion mark field is used to indicate a processing method for the first address information; the method also includes: determining a target processing method for the first address information according to the address fusion mark field; when the target processing method is address information fusion, fusing the first address information with the recorded first address information to obtain the fused first address information, and judging whether the fused first address information has any missing address value; when the target processing method is address information judgment, judging whether the first address information has any missing address value.
[0007] Optionally, based on the first address item, obtaining supplementary address text of the first address information includes: generating an address rhetorical question of the first address item based on the first address item; obtaining an address answer text of the address rhetorical question; and determining the address rhetorical question and the address answer text as supplementary address text of the first address information.
[0008] Optionally, obtaining the conversation text to be processed includes: judging whether the user conversation text includes address information according to a preset address keyword; and if the user conversation text includes address information, using the user conversation text as the conversation text to be processed.
[0009] Optionally, the method further includes: acquiring user conversation voice; and converting the user conversation voice into user conversation text.
[0010] In a second aspect, the present disclosure provides a text processing device, comprising: a first acquisition module, configured to acquire a conversation text to be processed, wherein the conversation text to be processed includes address information; an extraction module, configured to extract first address information from the conversation text to be processed, wherein the first address information includes multiple levels of address items, and the address items include address values; a determination module, configured to determine a first address item in the first address information that is missing an address value when the first address information has a missing address value; a second acquisition module, configured to acquire supplementary address text for the first address information based on the first address item; an update module, configured to update the conversation text to be processed based on the supplementary address text, and execute the step of extracting the first address information from the conversation text to be processed on the updated conversation text to be processed, until the extracted first address information has no missing address value, and the target address information is obtained.
[0011] In a third aspect, the present disclosure provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor so that the at least one processor can execute the above-mentioned text processing method.
[0012] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned text processing method when executed by a processor.
[0013] In a fifth aspect, the present disclosure provides a computer program product, which includes a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned text processing method.
[0014] The text processing method provided by the embodiment of the present disclosure can extract the first address information in the dialogue text to be processed, and judge whether the first address information has a missing address value, so as to obtain the supplementary address text of the first address information by determining the first address item with a missing address value in the first address information when the first address information has a missing address value, thereby further extracting the address information of the dialogue text to be processed after being updated based on the supplementary address text, until the extracted address information has no missing address value, and obtains the target address information. It can be achieved that even if the extracted first address information has a missing address value, the supplementary address text can be obtained to supplement the missing address value, thereby improving the accuracy and completeness of address extraction.
[0015] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings, in which:
[0017] Figure 1 is an application scenario diagram of a text processing method and device provided by an embodiment of the present disclosure;
[0018] Figure 2is a flowchart of a text processing method provided by an embodiment of the present disclosure;
[0019] Figure 3 is a processing flow chart of a text processing method provided by an embodiment of the present disclosure;
[0020] Figure 4 is a block diagram of a text processing device provided by an embodiment of the present disclosure;
[0021] Figure 5 It is a block diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0023] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.
[0024] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0025] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0026] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0027] In the technical solution disclosed in this disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals. The use of user data in this technical solution complies with relevant national laws and regulations (for example, the "Information Security Technology Personal Information Security Specification", etc.). For example: corresponding prescribed measures are taken for personal information access control; prescribed restrictions are imposed on the display of personal information; the purpose of using personal information does not exceed the scope of direct or reasonable association; when using personal information, clear identity orientation is eliminated to avoid precise positioning of specific individuals.
[0028] In current practical applications, the identification and acquisition of address information is mostly achieved through artificial intelligence. For example, in outbound marketing business, outbound robots are required to confirm or inquire about the address with customers. However, if the customer's answer to the outbound robot's question is not consistent or vague, the outbound robot will obtain incorrect address information or omit address information; obtaining incorrect address information or omitting address information will make it difficult to fully utilize the context of the conversation, causing the customer and the outbound robot to ask questions in a loop. Therefore, how to accurately and efficiently extract and confirm address information has become a technical problem that needs to be solved in current applications.
[0029] Based on this, the embodiments of the present disclosure provide a text processing method, a text processing device, an electronic device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0030] Figure 1 The application scenario diagram of the text processing method and device provided by the embodiments of the present disclosure is schematically shown.
[0031] like Figure 1 As shown, the application scenario of the embodiment of the present disclosure may include a terminal device 101, a network 103 and a server 102. The network 103 is used to provide a medium for a communication link between the terminal device 101 and the server 102. The network 103 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0032] The user can use the terminal device 101 to interact with the server 102 through the network 103 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0033] The terminal device 101 may be any electronic device having a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, and the like.
[0034] The server 102 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the terminal device 101. The background management server may analyze and process received data such as user requests, and feed back processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0035] It should be noted that the text processing method and apparatus provided in the embodiments of the present disclosure may be executed by the server 102. Accordingly, the text processing method and apparatus provided in the embodiments of the present disclosure may be arranged in the server 102. The text processing method and apparatus provided in the embodiments of the present disclosure may also be executed by a server or server cluster that is different from the server 102 and that can communicate with the terminal device 101 and / or the server 102. Accordingly, the text processing method and apparatus provided in the embodiments of the present disclosure may also be arranged in a server or server cluster that is different from the server 102 and that can communicate with the terminal device 101 and / or the server 102.
[0036] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0037] See also Figure 2 , Figure 2 A flowchart of a text processing method provided according to an embodiment of the present disclosure is shown, which specifically includes the following steps:
[0038] Step 202: Acquire the conversation text to be processed, wherein the conversation text to be processed includes address information.
[0039] The dialogue text to be processed refers to the dialogue text between the user and the robot, and the dialogue text to be processed includes address information. The robot can be an outbound call robot or an intelligent robot with interactive functions. For example, the robot can communicate with the user by voice or text.
[0040] In actual applications, when users communicate with robots, multiple rounds of communication content are often generated, but not all of the multiple rounds of communication content include address information. Therefore, in order to improve the accuracy and efficiency of obtaining address information, communication content including address information can be screened out from the multiple rounds of communication content.
[0041] Based on this, in a specific implementation manner provided by the present disclosure, obtaining the dialogue text to be processed includes:
[0042] According to the preset address keywords, determine whether the user conversation text includes address information;
[0043] In the case where the user dialogue text includes address information, the user dialogue text is used as dialogue text to be processed.
[0044] The preset address keywords are used to filter the dialogue texts to be processed that include address information. In practical applications, the preset address keywords include but are not limited to provinces, cities, districts, counties, townships, towns, etc. The user dialogue text refers to the original dialogue text between the user and the robot without filtering the address information. The user dialogue text may include address information or not.
[0045] Specifically, in the conversation communication between the user and the robot, the user conversation text between the user and the robot can be obtained. After obtaining the user conversation text, it is determined whether the user conversation text includes address information based on the preset address keywords. If the address information is included, it can be determined that the user conversation text is the conversation text to be processed. If the address information is not included, it can be determined that the user conversation text is not the conversation text to be processed.
[0046] For example, the user dialogue text 1 is obtained as:
[0047] “q: Hello.
[0048] a: Hello. ".
[0049] The user dialogue text 2 obtained is:
[0050] “Q: Where are you?
[0051] a: I am in ChaoY District, Beijing J City. ", where q represents a robot and a represents a user.
[0052] Since user dialogue text 1 does not include the preset address keywords, it can be determined that user dialogue text 1 is not the dialogue text to be processed. User dialogue text 2 includes the preset address keywords "city" and "district", so user dialogue text 2 can be determined as the dialogue text to be processed.
[0053] In actual applications, users can communicate with robots through text communication, in which case the user dialogue text between the user and the robot can be directly obtained; users can also communicate with robots through voice communication, in which case the dialogue voice between the user and the robot can be directly obtained. When the dialogue voice between the user and the robot is obtained, the user dialogue text can be obtained by converting the dialogue voice.
[0054] Based on this, in a specific implementation provided by the present disclosure, the method further includes:
[0055] Get the user's conversation voice;
[0056] The user conversation speech is converted into user conversation text.
[0057] Among them, the user dialogue voice is the dialogue voice generated after the user has a voice dialogue with the robot.
[0058] Specifically, after the user conversation voice is acquired, the user conversation voice may be converted into a user conversation text by performing speech recognition on the user conversation voice, for example, translating through an automatic speech recognition (Automatic Speech Recognition, ASR) method.
[0059] The embodiments provided by the present disclosure can obtain user conversation voice or user conversation text between the user and the robot during the process of communication between the user and the robot. When the user conversation voice is obtained, the user conversation voice is converted into user conversation text, so that it can be determined in the subsequent process whether the user conversation text is the conversation text to be processed.
[0060] Step 204: extracting first address information from the conversation text to be processed, wherein the first address information includes multiple levels of address items, and the address items include address values.
[0061] After obtaining the conversation text to be processed, the address information included in the conversation text to be processed can be extracted. The first address information refers to the structured address information extracted from the conversation text to be processed, including multi-level address items, and the address items include address values. The address items are specifically the hierarchical address information in the first address information, and the address values are specifically the assigned values in the hierarchical address information. Using the above example user conversation text 2, the representation of the first address information is explained as follows:
[0062] First address information = {"Province":"North J",
[0063] "City":"Beijing J City",
[0064] "District":"ChaoY District",
[0065] "Detailed address":""}.
[0066] Among them, "province": "Bei J" is an address item, "Bei J" is an address value, similarly, "city": "Bei J City" is an address item, "Bei J City" is an address value; "district": "Chao Y District" is an address item, "Chao Y District" is an address value; "detailed address": "" is an address item, "" is an address value, that is, the address value of "detailed address":"" is empty. The following specifically describes the implementation method of extracting the first address information in the dialogue text to be processed:
[0067] In a specific implementation provided by the present disclosure, extracting the first address information in the conversation text to be processed includes:
[0068] Adding the dialogue text to be processed to a preset prompt word template to generate an extraction prompt word, wherein the extraction prompt word is used to assist in extracting address information from the dialogue text to be processed;
[0069] Inputting the extraction prompt word into an address extraction model to obtain second address information output by the address extraction model;
[0070] The second address information is corrected according to the standard address information in the preset address library to obtain the first address information of the dialogue text to be processed.
[0071] In practical applications, the address extraction model can be used to extract the address information in the conversation text to be processed. However, since different users may use different address expressions, after obtaining the address information in the conversation text to be processed based on the address extraction model, the obtained address information can also be corrected to make the address information more standardized.
[0072] The preset prompt word template refers to a pre-configured template for generating and extracting prompt words. For example, the preset prompt word template can be:
[0073] “
Task Description
[0074]
Content of the conversation
[0075] {text}
[0076] [Requirements]: Output in JSON format, with the primary keys being province, city, district, county and detailed address.
[0077]
Output
[0078] The extraction prompt word refers to a prompt word used to assist in extracting the address information in the conversation text to be processed, and is specifically the input of the address extraction model. The address extraction model is used to extract the address information in the conversation text to be processed. The address extraction model can be any type of large language model (LLM), such as Qwen, GPT, etc. The present disclosure does not limit the specific model type of the address extraction model.
[0079] The second address information refers to the address information output by the address extraction model. The preset address database refers to a pre-established address database, which stores standard address information, and the standard address information is used to correct the second address information output by the address extraction model. The standard address information specifically includes the hierarchical relationship between address information, the mapping relationship between the standard name, abbreviation, alias, etc. of the same place name, etc.
[0080] Specifically, after obtaining the dialogue text to be processed, the dialogue text to be processed is added to a preset prompt word template to generate an extraction prompt word, and the extraction prompt word is input into the address extraction model, and the address extraction model extracts the address information in the dialogue text to be processed according to the extraction prompt word to obtain the second address information output by the address extraction model. For the second address information output by the address extraction model, the second address information is corrected according to the standard address information in the preset address library, so as to obtain the first address information in the dialogue text to be processed.
[0081] Continuing with the user dialogue text 2 in the above example, since the user dialogue text 2 includes the preset address keyword, the user dialogue text 2 is determined as the dialogue text to be processed, and the dialogue text to be processed, that is, the user dialogue text 2, is added to the preset prompt word template, and the following extracted prompt words can be obtained:
[0082] “
Task Description
[0083]
Content of the conversation
[0084] “Q: Where are you?
[0085] a: I am in ChaoY District, Beijing J City. "
[0086] [Requirements]: Output in JSON format, with the primary keys being province, city, district, county and detailed address.
[0087]
Output
[0088] The above extraction prompt word is input into the address extraction model, and the address extraction model can extract the second address information in the dialogue text to be processed according to the input extraction prompt word, as follows:
[0089] Second address information = {"province":"",
[0090] "City":"Beijing J City",
[0091] "District":"ChaoY District",
[0092] "Detailed address":""}.
[0093] According to the standard address information in the preset address library, the extracted second address information is corrected. The address value corresponding to the "province" is missing in the above second address information. Based on the standard address information in the preset address library, it can be determined that the "province" corresponding to "Beijing J City" is "Beijing J". Therefore, the corrected first address information can be obtained, as follows:
[0094] First address information = {"Province":"North J",
[0095] "City":"Beijing J City",
[0096] "District":"ChaoY District",
[0097] "Detailed address":""}.
[0098] For another example, the second address information extracted by the address extraction model is:
[0099] Second address information = {"province":"",
[0100] "City":"North P",
[0101] "District":"ChaoY",
[0102] "Detailed address":""}.
[0103] According to the standard address information in the preset address library, the second address information is corrected. In the second address information, the address value corresponding to "city" is "North P", and the address value corresponding to "district and county" is "Chao Y". It is necessary to correct "North P" to "North J City" and "Chao Y" to "Chao Y District". According to the corrected "city" address value "North J City", the address value corresponding to "province" can be matched to "North J". Therefore, the corrected first address information can be obtained, as follows:
[0104] First address information = {"Province":"North J",
[0105] "City":"Beijing J City",
[0106] "District":"ChaoY District",
[0107] "Detailed address":""}.
[0108] The embodiment provided by the present disclosure can extract the second address information in the conversation text to be processed based on the address extraction model, and then correct the second address information according to the preset address library to obtain the first address information with higher accuracy.
[0109] However, in actual applications, the complete address information usually requires multiple rounds of dialogue between the robot and the user to extract. For example, in the two examples above, the address value corresponding to the "detailed address" in the first address information extracted is empty. In this case, it is necessary to further obtain the address value corresponding to the "detailed address".
[0110] Therefore, in the embodiment provided in the present disclosure, after obtaining the first address information, a processing method for the first address information can be further determined, and whether an address value is missing in the first address information can be determined according to the corresponding processing method to improve the integrity of the address information.
[0111] In a specific implementation provided by the present disclosure, the first address information further includes an address fusion flag field, and the address fusion flag field is used to indicate a processing method of the first address information;
[0112] The method further comprises:
[0113] Determining a target processing method for the first address information according to the address fusion flag field;
[0114] In the case where the target processing method is address information fusion, the first address information is fused with the recorded first address information to obtain fused first address information, and it is determined whether the fused first address information has any missing address value;
[0115] When the target processing method is address information determination, it is determined whether the first address information has any missing address value.
[0116] After the second address information is corrected to obtain the first address information, the first address information includes an address fusion flag field, which is used to indicate the processing method of the first address information. The target processing method refers to the actual processing method of the first address information determined according to the address fusion flag field.
[0117] Specifically, after correcting the second address information to obtain the first address information, the target processing method of the first address information is determined according to the address fusion mark field in the first address information. If it is determined that the target processing method of the first address information is address information fusion, the first address information is fused with the already recorded first address information to obtain the fused first address information, and it is further determined whether the fused first address information has an address value missing. If it is determined that the target processing method of the first address information is address information judgment, it is directly determined whether the first address information has an address value missing.
[0118] In practical applications, the address fusion mark field can be represented by "if-add". If the "if-add" field is 1, the target processing method of the first address information is determined to be address information fusion. If the "if-add" field is 0, the target processing method of the first address information is determined to be address information judgment.
[0119] Step 206: When there is a missing address value in the first address information, determine a first address item in the first address information that has a missing address value.
[0120] If the first address information does not have any missing address value, it means that the first address information is complete and can be stored for subsequent business use. If the first address information has any missing address value, it means that there are address items with missing address values in the first address information and the address items with missing address values need to be supplemented to obtain relatively complete address information.
[0121] The first address item refers to an address item in the first address information that is missing an address value. For example, if the address value corresponding to "Detailed Address" is empty, then "Detailed Address":"" is the first address item.
[0122] Specifically, when it is determined that the first address information has a missing address value, the first address item with a missing address value can be determined in the multi-level address items according to the hierarchical order of the address items. Take the first address information as follows as an example:
[0123] First address information = {"Province":"North J",
[0124] "City":"Beijing J City",
[0125] "District":"ChaoY District",
[0126] "Detailed address":""}.
[0127] In the above-mentioned first address information, the address value corresponding to "Province" is "Bei J", the address value corresponding to "City" is "Bei J City", the address value corresponding to "District and County" is "Chao Y District", and the address value corresponding to "Detailed Address" is empty, that is, the address value of "Detailed Address" is missing. Therefore, "Detailed Address":"" is determined to be the first address item.
[0128] Step 208: According to the first address item, obtain a supplementary address text of the first address information.
[0129] The supplementary address text refers to the conversation text between the user and the robot that supplements the first address information, and the supplementary address text includes the address information.
[0130] When the first address information has a missing address value and the first address item with the missing address value is determined, the supplementary address text can be obtained according to the first address item, and the specific implementation method is as follows:
[0131] In a specific implementation provided by the present disclosure, obtaining, according to the first address item, a supplementary address text of the first address information includes:
[0132] generating an address rhetorical question of the first address item according to the first address item;
[0133] Obtaining the address answer text of the address rhetorical question;
[0134] The address rhetorical question and the address answer text are determined as supplementary address text of the first address information.
[0135] The address rhetorical question refers to a question used to determine the address value of the first address item; the address answer text refers to the answer text of the user's feedback to the address rhetorical question.
[0136] Specifically, after determining the first address item, an address rhetorical question of the first address item is generated, the robot asks questions to the user based on the address rhetorical question, and obtains the address answer text of the user's feedback to the address rhetorical question, thereby obtaining a supplementary address text consisting of the address rhetorical question and the address answer text.
[0137] Take the first address item as "city" as an example. After determining that the first address item is "city", the address question "Which city are you in?" of "city" is generated. The robot asks the user "Which city are you in?" and obtains the address answer text "North J" provided by the user. Based on this, the supplementary address text that can be obtained is:
[0138] “Q: Which city are you in?
[0139] a: North J. ".
[0140] The embodiments provided by the present disclosure can determine the first address item with a missing address value from the multi-level address items in the first address information in hierarchical order, and generate an address rhetorical question for the first address item to ask the user a rhetorical question to obtain an address answer text fed back by the user, so that the first address information can be supplemented in a subsequent process based on the supplementary address text composed of the address rhetorical question and the address answer text.
[0141] Step 210: Based on the supplementary address text, the to-be-processed conversation text is updated, and the step of extracting the first address information in the to-be-processed conversation text is performed on the updated to-be-processed conversation text until the extracted first address information has no missing address value, thereby obtaining the target address information.
[0142] After obtaining the supplementary address text of the first address information, the conversation text to be processed is updated based on the supplementary address text, and the first address information in the updated conversation text to be processed is continuously extracted until the extracted first address information has no missing address values, and the extracted first address information has no missing address values, and is determined as the target address information.
[0143] For example, the recorded dialogue text to be processed is:
[0144] “Q: Where are you?
[0145] a: I am in ChaoY District, Beijing. ".
[0146] The supplementary address text obtained is:
[0147] "q: Please provide the detailed address of your location.
[0148] a: XXX Building, XXX Street, Chaoyang District, Beijing City. ".
[0149] The updated pending dialogue text is:
[0150] “Q: Where are you?
[0151] a: I am in ChaoY District, Beijing.
[0152] q: Please provide the detailed address of your location.
[0153] a: XXX Building, XXX Street, Chaoyang District, Beijing City. ".
[0154] After obtaining the updated dialogue text to be processed, the above operations are continued to be performed on the updated dialogue text to be processed until the target address information is obtained.
[0155] It should be noted that since the address rhetorical question is generated based on the first address item, the address answer text obtained is also the answer text to the address rhetorical question. Therefore, the obtained supplementary address text includes the address information for the first address item. After obtaining the supplementary address text, there is no need to determine whether the supplementary address text includes address information based on the preset address keywords.
[0156] The text processing method provided by the present disclosure includes: obtaining a conversation text to be processed, wherein the conversation text to be processed includes address information; extracting first address information from the conversation text to be processed, wherein the first address information includes multiple levels of address items, and the address items include address values; in the case where the first address information has a missing address value, determining the first address item in the first address information that is missing the address value; according to the first address item, obtaining supplementary address text for the first address information; based on the supplementary address text, updating the conversation text to be processed, and executing the step of extracting the first address information from the conversation text to be processed on the updated conversation text to be processed, until the extracted first address information has no missing address value, and the target address information is obtained.
[0157] The disclosed embodiment realizes that by extracting the first address information in the dialogue text to be processed and judging whether the first address information has missing address values, in the case where the first address information has missing address values, the first address item with missing address values in the first address information is determined to obtain the supplementary address text of the first address information, thereby further extracting address information from the dialogue text to be processed after being updated based on the supplementary address text, until the extracted address information has no missing address values, and the target address information is obtained. It can be achieved that even in the case where the extracted first address information has missing address values, the supplementary address text can be obtained to supplement the missing address values, thereby improving the accuracy and completeness of address extraction.
[0158] The following combination Figure 3 , the text processing method provided by the embodiment of the present disclosure is further explained. Figure 3 A processing flow chart of a text processing method provided according to an embodiment of the present disclosure is shown, such as Figure 3 As shown, after obtaining the user dialogue text, it is determined whether the user dialogue text includes address information according to the preset address keyword. If the address information is included, the user dialogue text is determined as the dialogue text to be processed. The dialogue text to be processed is added to the preset prompt word template to generate the extraction prompt word ( Figure 3 The extraction prompt word is input into the address extraction model. The address extraction model extracts the second address information in the dialogue text to be processed according to the extraction prompt word.
[0159] After obtaining the second address information, the second address information is corrected according to the standard address information in the preset address library to obtain the corrected first address information. According to the address fusion mark field in the first address information, the target processing method of the first address information is determined. If the target processing method of the first address information is address information fusion, the first address information is merged with the recorded first address information to obtain the merged first address information, and the address value of the merged first address information is determined to be missing. If the target processing method of the first address information is address information judgment, the address value of the first address information can be directly determined to be missing.
[0160] If the first address information does not have any missing address value, the first address information is determined as the target address information. If the first address information has any missing address value, the first address item with the missing address value in the first address information is determined, and an address rhetorical question of the first address item is generated. The robot asks the user a rhetorical question based on the address rhetorical question. After obtaining the address answer text of the address rhetorical question fed back by the user, the address rhetorical question and the address answer text are determined as the supplementary address text of the first address information, and the dialogue text to be processed is updated based on the supplementary address text. The address information of the updated dialogue text to be processed is continuously extracted until the extracted first address information does not have any missing address value, and the target address information can be obtained.
[0161] The disclosed embodiment realizes that the second address information in the conversation text to be processed is extracted based on the address extraction model, the extraction efficiency of the second address information is improved, the second address information is corrected by a preset address library, and the corrected first address information is obtained, thereby improving the accuracy of the first address information. It is judged whether the first address information has a missing address value. When the first address information has a missing address value, the supplementary address text of the first address information can be obtained by determining the first address item with a missing address value in the first address information, thereby further extracting the address information of the conversation text to be processed after being updated based on the supplementary address text, until the extracted address information has no missing address value and the target address information is obtained. It can be achieved that even when the extracted first address information has a missing address value, the supplementary address text can be obtained to supplement the missing address value, thereby improving the integrity of the address extraction.
[0162] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.
[0163] In addition, the present disclosure also provides a text processing device, an electronic device, a computer-readable storage medium and a computer program product, all of which can be used to implement any text processing method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to the corresponding records in the method part and will not be repeated here.
[0164] Figure 4 A block diagram of a text processing device provided according to an embodiment of the present disclosure is shown. Figure 4 , an embodiment of the present disclosure provides a text processing device, the text processing device comprising:
[0165] A first acquisition module 402 is configured to acquire a conversation text to be processed, wherein the conversation text to be processed includes address information;
[0166] The extraction module 404 is configured to extract first address information from the conversation text to be processed, wherein the first address information includes multiple levels of address items, and the address items include address values;
[0167] A determination module 406 is configured to determine a first address item with a missing address value in the first address information when an address value is missing in the first address information;
[0168] A second acquisition module 408 is configured to acquire a supplementary address text of the first address information according to the first address item;
[0169] The updating module 410 is configured to update the conversation text to be processed based on the supplementary address text, and to perform the step of extracting the first address information in the conversation text to be processed on the updated conversation text to be processed until the extracted first address information has no missing address value, thereby obtaining the target address information.
[0170] Optionally, the extraction module 404 is further configured to:
[0171] Adding the dialogue text to be processed to a preset prompt word template to generate an extraction prompt word, wherein the extraction prompt word is used to assist in extracting address information from the dialogue text to be processed;
[0172] Inputting the extraction prompt word into an address extraction model to obtain second address information output by the address extraction model;
[0173] The second address information is corrected according to the standard address information in the preset address library to obtain the first address information of the dialogue text to be processed.
[0174] Optionally, the first address information further includes an address fusion flag field, and the address fusion flag field is used to indicate a processing method of the first address information;
[0175] The device also includes a judgment module, which is configured to:
[0176] Determining a target processing method for the first address information according to the address fusion flag field;
[0177] In the case where the target processing method is address information fusion, the first address information is fused with the recorded first address information to obtain fused first address information, and it is determined whether the fused first address information has any missing address value;
[0178] When the target processing method is address information determination, it is determined whether the first address information has any missing address value.
[0179] Optionally, the second acquisition module 408 is further configured to:
[0180] generating an address rhetorical question of the first address item according to the first address item;
[0181] Obtaining the address answer text of the address rhetorical question;
[0182] The address rhetorical question and the address answer text are determined as supplementary address text of the first address information.
[0183] Optionally, the first acquisition module 402 is further configured to:
[0184] According to the preset address keywords, determine whether the user conversation text includes address information;
[0185] In the case where the user dialogue text includes address information, the user dialogue text is used as dialogue text to be processed.
[0186] Optionally, the device further comprises a conversion module configured to:
[0187] Get the user's conversation voice;
[0188] The user conversation speech is converted into user conversation text.
[0189] The text processing device provided by the present disclosure includes: a first acquisition module, configured to acquire a conversation text to be processed, wherein the conversation text to be processed includes address information; an extraction module, configured to extract first address information from the conversation text to be processed, wherein the first address information includes multiple levels of address items, and the address items include address values; a determination module, configured to determine the first address item with a missing address value in the first address information when an address value is missing in the first address information; a second acquisition module, configured to acquire supplementary address text for the first address information based on the first address item; an update module, configured to update the conversation text to be processed based on the supplementary address text, and execute the step of extracting the first address information from the conversation text to be processed on the updated conversation text to be processed, until the extracted first address information has no missing address value, and the target address information is obtained.
[0190] The disclosed embodiment realizes that by extracting the first address information in the dialogue text to be processed and judging whether the first address information has missing address values, in the case where the first address information has missing address values, the first address item with missing address values in the first address information is determined to obtain the supplementary address text of the first address information, thereby further extracting address information from the dialogue text to be processed after being updated based on the supplementary address text, until the extracted address information has no missing address values, and the target address information is obtained. It can be achieved that even in the case where the extracted first address information has missing address values, the supplementary address text can be obtained to supplement the missing address values, thereby improving the accuracy and completeness of address extraction.
[0191] Each module in the above-mentioned text processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0192] Figure 5 A block diagram of an electronic device provided in an embodiment of the present disclosure.
[0193] Reference Figure 5 The embodiment of the present disclosure provides an electronic device 500, which includes: at least one processor 501; at least one memory 502, and one or more I / O interfaces 503, connected between the processor 501 and the memory 502; wherein the memory 502 stores one or more computer programs that can be executed by the at least one processor 501, and the one or more computer programs are executed by the at least one processor 501 so that the at least one processor 501 can execute the above-mentioned text processing method.
[0194] Each module in the above electronic device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0195] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the above-mentioned text processing method when executed by a processor / processing core. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.
[0196] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned text processing method.
[0197] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).
[0198] As is known to those of ordinary skill in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable program instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0199] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0200] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0201] The computer program product described herein may be implemented in hardware, software, or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0202] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0203] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0204] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0205] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0206] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. A text processing method, characterized in that: include: Acquire a conversation text to be processed, wherein the conversation text to be processed includes address information; Extracting first address information from the conversation text to be processed, wherein the first address information includes multi-level address items, and the address items include address values; In the case where an address value is missing in the first address information, determining a first address item in the first address information where the address value is missing; According to the first address item, obtaining a supplementary address text of the first address information; Based on the supplementary address text, the to-be-processed dialogue text is updated, and the step of extracting the first address information in the to-be-processed dialogue text is performed on the updated to-be-processed dialogue text until the extracted first address information has no missing address value, thereby obtaining the target address information.
2. The method according to claim 1, characterized in that Extracting the first address information from the conversation text to be processed includes: Adding the dialogue text to be processed to a preset prompt word template to generate an extraction prompt word, wherein the extraction prompt word is used to assist in extracting address information from the dialogue text to be processed; Inputting the extraction prompt word into an address extraction model to obtain second address information output by the address extraction model; The second address information is corrected according to the standard address information in the preset address library to obtain the first address information of the dialogue text to be processed.
3. The method according to claim 1 or 2, characterized in that The first address information also includes an address fusion flag field, and the address fusion flag field is used to indicate a processing method of the first address information; The method further comprises: Determining a target processing method for the first address information according to the address fusion flag field; In the case where the target processing method is address information fusion, the first address information is fused with the recorded first address information to obtain fused first address information, and it is determined whether the fused first address information has any missing address value; When the target processing method is address information determination, it is determined whether the first address information has any missing address value.
4. The method according to claim 1, characterized in that Acquiring, according to the first address item, a supplementary address text of the first address information, including: generating an address rhetorical question of the first address item according to the first address item; Obtaining the address answer text of the address rhetorical question; The address rhetorical question and the address answer text are determined as supplementary address text of the first address information.
5. The method according to claim 1, characterized in that Get the conversation text to be processed, including: According to the preset address keywords, determine whether the user conversation text includes address information; In the case where the user dialogue text includes address information, the user dialogue text is used as dialogue text to be processed.
6. The method according to claim 5, characterized in that The method further comprises: Get the user's conversation voice; The user conversation speech is converted into user conversation text.
7. A text processing device, characterized in that: include: A first acquisition module is configured to acquire a conversation text to be processed, wherein the conversation text to be processed includes address information; An extraction module is configured to extract first address information from the conversation text to be processed, wherein the first address information includes multiple levels of address items, and the address items include address values; a determining module, configured to determine a first address item in the first address information where an address value is missing, when the first address information has an address value missing; A second acquisition module is configured to acquire a supplementary address text of the first address information according to the first address item; The update module is configured to update the to-be-processed conversation text based on the supplementary address text, and to perform the step of extracting the first address information in the to-be-processed conversation text on the updated to-be-processed conversation text until the extracted first address information has no missing address value, thereby obtaining the target address information.
8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises a computer-readable code or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the method according to any one of claims 1 to 6.