Address information updating method and device, electronic equipment and storage medium
By processing user voice data and recognizing it using neural network models, the address information in the banking business system is automatically updated, solving the problems of low accuracy and efficiency in address information updates in existing technologies, and achieving timely and accurate address information updates.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PING AN TECH (SHENZHEN) CO LTD
- Filing Date
- 2023-05-31
- Publication Date
- 2026-04-21
AI Technical Summary
In existing technologies, updating user address information suffers from low accuracy and low efficiency. In particular, manual modification methods are prone to errors and cannot be updated in real time.
By acquiring users' voice data, converting and processing it, then segmenting and vectorizing it, and using a neural network model for address recognition, the system automatically updates the address information in the banking system.
This improved the accuracy and efficiency of address information updates, enabling timely and accurate address information updates.
Smart Images

Figure CN116595023B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of financial technology, and in particular to a method and apparatus for updating address information, an electronic device, and a storage medium. Background Technology
[0002] With the development of internet technology, traditional banking has gradually begun its transformation towards fintech. In the internet context, banks are establishing automated payment service systems through their business systems to provide users with reliable and efficient payment services. Before making online payments, users need to go to a bank branch to activate online banking and provide personal information such as their mobile phone number, address, and ID number for identity verification. Address information is one of the important means for banks to contact users, as banks can use this address to send bills or other important documents.
[0003] In related technologies, if a user's address information changes, bank staff need to log into the business system and manually update the user's registered address information. However, manual updates can lead to errors in address information such as neighborhood and house number, reducing the accuracy of address information updates. Furthermore, manual updates are susceptible to subjective factors that prevent real-time updates of registered address information, resulting in untimely updates. Therefore, improving the accuracy and efficiency of address information updates has become an urgent problem to be solved. Summary of the Invention
[0004] The main objective of this application is to provide a method, apparatus, electronic device, and storage medium for updating address information, aiming to improve the accuracy and efficiency of address information updating, so as to accurately and timely update the address information reserved in the banking business system.
[0005] To achieve the above objectives, a first aspect of this application proposes a method for updating address information, the method comprising:
[0006] Acquire the voice data of the target object and the original address information of the target object stored in a preset system;
[0007] The speech data is converted to obtain the text data of the speech data;
[0008] The text data is segmented to obtain a word sequence;
[0009] The words in the word sequence are vectorized to obtain the initial word vectors of the words;
[0010] The relative positions of the words in the word sequence are encoded to obtain the position encoding vectors of the words.
[0011] The initial word vector and the positional encoding vector are fused to obtain the target word vector of the word;
[0012] The target word vector is input into a preset neural network model for address recognition to obtain the target address information of the text data; wherein, the target address information includes positive address information;
[0013] The original address information is updated based on the positive address information.
[0014] In some embodiments, the text data includes text words, and the step of segmenting the text data to obtain a word sequence includes:
[0015] The text words are compared with preset sample words;
[0016] If the text words are the same as the sample words, then the text words are segmented to obtain initial words;
[0017] Calculate the word frequency of the initial word in the text data;
[0018] Multiple initial words are filtered based on the word frequency to obtain multiple target words;
[0019] The word sequence is obtained by constructing a sequence based on multiple target words.
[0020] In some embodiments, the step of encoding the relative positions of words in the word sequence to obtain the position encoding vector of the words includes:
[0021] Obtain the location identifier of the word;
[0022] The words are relatively positioned according to a preset sine function and the position identifier to obtain a first relative position code;
[0023] The words are relatively positioned and encoded according to a preset cosine function and the position identifier to obtain a second relative position code;
[0024] The first relative position code and the second relative position code are concatenated to obtain the position code vector.
[0025] In some embodiments, the neural network model includes an encoding layer, a decoding layer, and a conditional random field layer. The step of inputting the target word vector into a preset neural network model for address recognition to obtain the target address information of the text data includes:
[0026] The target word vector is subjected to feature extraction through the encoding layer to obtain the first address semantic feature of the target word vector;
[0027] The first address semantic features are decoded by the decoding layer to obtain the second address semantic features of the target word vector;
[0028] The target address information is obtained by performing feature discrimination on the semantic features of the second address through the conditional random field layer.
[0029] In some embodiments, the encoding layer includes a self-attention layer and a feedforward neural network layer. The step of extracting features from the target word vector through the encoding layer to obtain the first address semantic features of the target word vector includes:
[0030] The attention matrix is obtained by performing self-attention calculation on the target word vector through the self-attention layer.
[0031] The first address semantic features are obtained by performing feature transformation on the attention matrix through the feedforward neural network layer.
[0032] In some embodiments, the step of performing self-attention calculation on the target word vector through the self-attention layer to obtain an attention matrix includes:
[0033] The self-attention layer linearly maps the target word vector to obtain the query vector, key vector, and value vector.
[0034] The attention matrix is obtained by performing self-attention calculation on the query vector, the key vector, and the value vector.
[0035] In some embodiments, the step of performing feature transformation on the attention matrix through the feedforward neural network layer to obtain the first address semantic features includes:
[0036] The attention matrix is transformed by the feedforward neural network layer to obtain the initial address semantic features;
[0037] The attention matrix and the initial address semantic features are used to perform residual connection calculations to obtain intermediate address semantic features;
[0038] The semantic features of the intermediate address are normalized to obtain the first address semantic features.
[0039] To achieve the above objectives, a second aspect of this application provides an address information updating apparatus, the apparatus comprising:
[0040] The acquisition module is used to acquire the voice data of the target object and the original address information of the target object stored in a preset system; wherein, the original address information is used to represent the initial location address information of the target object;
[0041] A conversion module is used to convert the voice data to obtain the text data of the voice data;
[0042] The word segmentation module is used to segment the text data into words to obtain a word sequence;
[0043] The vectorization module is used to vectorize the words in the word sequence to obtain the initial word vectors of the words;
[0044] The position encoding module is used to encode the relative positions of words in the word sequence to obtain the position encoding vector of the words.
[0045] The vector fusion module is used to fuse the initial word vector and the positional encoding vector to obtain the target word vector of the word;
[0046] The address recognition module is used to input the target word vector into a preset neural network model for address recognition to obtain the target address information of the text data; wherein, the target address information includes positive address information;
[0047] An update module is used to update the original address information based on the positive address information.
[0048] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.
[0049] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.
[0050] The address information updating method, address information updating device, electronic device, and computer-readable storage medium proposed in this application acquire the voice data of the target object and the original address information of the target object stored in a preset system, enabling the user to update the original address information through voice dialogue. The voice data is converted to obtain the text data of the voice data, the text data is segmented to obtain a word sequence, the words in the word sequence are vectorized to obtain the initial word vectors of the words, and the words in the word sequence are relatively position encoded to obtain the position encoding vectors of the words. This allows the neural network model to learn the relative position information between the words in the word sequence. Compared with absolute position encoding, relative position encoding does not limit the text length that the neural network model can process, allowing the model to process input text sequences of arbitrary length. Furthermore, the initial word vectors and positional encoding vectors are fused to obtain the target word vectors. The target word vectors are then input into a pre-defined neural network model for address recognition, enabling the model to fully understand the semantic information in the user's speech and obtain the target address information of the text data. The target address information includes the positive address information. The original address information is updated based on the positive address information. This allows for the automatic updating of the user's reserved address information in the business system based on the user's speech, improving the accuracy and efficiency of address information updates, and ensuring accurate and timely updates of the address information reserved in the banking business system. Attached Figure Description
[0051] Figure 1 This is a flowchart of the address information updating method provided in the embodiments of this application;
[0052] Figure 2 yes Figure 1 The flowchart of step S130 in the process;
[0053] Figure 3 yes Figure 1 The flowchart of step S150 in the middle;
[0054] Figure 4 yes Figure 1 The flowchart of step S170 in the process;
[0055] Figure 5 yes Figure 4 The flowchart of step S410 in the middle;
[0056] Figure 6 yes Figure 5 The flowchart of step S510 in the text;
[0057] Figure 7 yes Figure 5 The flowchart of step S520 in the text;
[0058] Figure 8This is a schematic diagram of the structure of the address information updating device provided in the embodiments of this application;
[0059] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0061] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0063] First, let's analyze some of the terms used in this application:
[0064] Artificial intelligence (AI) is a new branch of computer science that studies, develops, and applies theories, methods, technologies, and systems to simulate, extend, and expand human intelligence. It aims to understand the essence of intelligence and produce intelligent machines that can react in a way similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thought. Furthermore, AI utilizes digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceiving the environment, acquiring knowledge, and using that knowledge to achieve optimal results.
[0065] Natural Language Processing (NLP): NLP uses computers to process, understand, and utilize human language (such as Chinese and English). It is a branch of artificial intelligence and an interdisciplinary field of computer science and linguistics, often referred to as computational linguistics. NLP includes syntactic analysis, semantic analysis, and discourse understanding. It is commonly used in machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information retrieval, information extraction and filtering, text classification and clustering, sentiment analysis, and opinion mining. It involves data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computation.
[0066] Named Entity Recognition (NER) refers to the identification of entities with specific meanings in text, mainly including names of people, places, organizations, and proper nouns.
[0067] An entity refers to a distinctive and independently existing thing, such as a person, a city, a plant, or a commodity. All things in the world are composed of concrete things; this refers to entities.
[0068] Encoder: Transforms an input sequence into a fixed-length vector.
[0069] Decoding: Transforms the previously generated fixed vector into an output sequence; where the input sequence can be text, speech, image, or video; and the output sequence can be text or image.
[0070] With the development of internet technology, traditional banking has gradually begun its transformation towards fintech. In the internet context, banks are establishing automated payment service systems through their business systems to provide users with reliable and efficient payment services. Before making online payments, users need to go to a bank branch to activate online banking and provide personal information such as their mobile phone number, address, and ID number for identity verification. Address information is one of the important means for banks to contact users, as banks can use this address to send bills or other important documents.
[0071] In related technologies, if a user's address information changes, relevant personnel need to log into the business system and manually update the user's reserved address information in the system. However, manual modification can lead to errors in address information such as the neighborhood and house number, reducing the accuracy of address information updates. Furthermore, manual modification is susceptible to subjective factors that prevent real-time updates of reserved address information, resulting in untimely address information updates. Therefore, how to accurately and promptly update address information has become an urgent problem to be solved.
[0072] Based on this, embodiments of this application provide a method, apparatus, electronic device, and storage medium for updating address information, aiming to update the reserved address information of users in the business system in real time and improve the accuracy of address information updates.
[0073] The address information updating method, address information updating device, electronic device, and computer-readable storage medium provided in this application are specifically described through the following embodiments. First, the address information updating method in the embodiments of this application is described.
[0074] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0075] Foundational technologies in artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0076] The address information updating method provided in this application relates to the field of financial technology. This address information updating method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the address information updating method, but is not limited to the above forms.
[0077] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0078] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.
[0079] Figure 1 This is an optional flowchart of the address information update method provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S110 to S180.
[0080] Step S110: Obtain the voice data of the target object and the original address information of the target object stored in the preset system;
[0081] Step S120: Convert the speech data to obtain the text data of the speech data;
[0082] Step S130: Perform word segmentation on the text data to obtain a word sequence;
[0083] Step S140: Vectorize the words in the word sequence to obtain the initial word vectors;
[0084] Step S150: Encode the relative positions of the words in the word sequence to obtain the position encoding vector of the words;
[0085] Step S160: The initial word vector and the positional encoding vector are fused to obtain the target word vector of the word;
[0086] Step S170: Input the target word vector into a preset neural network model for address recognition to obtain the target address information of the text data; wherein, the target address information includes positive address information;
[0087] Step S180: Update the original address information based on the positive address information.
[0088] Steps S110 to S180 as shown in this embodiment of the application involve acquiring the voice data of the target object and the original address information of the target object stored in a preset system, enabling the user to update the original address information through voice dialogue, converting the voice data to obtain text data of the voice data, performing word segmentation on the text data to obtain a word sequence, vectorizing the words in the word sequence to obtain the initial word vectors of the words, and performing relative position encoding on the words in the word sequence to obtain the position encoding vectors of the words. This allows the neural network model to learn the relative position information between the words in the word sequence. Compared with absolute position encoding, relative position encoding does not limit the text length that the neural network model can process, allowing the model to process input text sequences of any length. Furthermore, the initial word vector and the positional encoding vector are fused to obtain the target word vector. The target word vector is then input into a pre-defined neural network model for address recognition, enabling the model to fully understand the semantic information in the user's speech and obtain the target address information of the text data. Based on the positive address information, the original address information is updated. This allows for the automatic updating of the user's reserved address information in the business system based on the user's speech, improving the accuracy and efficiency of address information updates, and ensuring accurate and timely updates of the address information reserved in the banking business system.
[0089] In step S110 of some embodiments, the original address information is the initial location address information of the target object reserved in the business system. The chatbot asks the user about their current location, and the user answers the question to provide the chatbot with their current location address information, thus obtaining voice data, which includes the user's current location address information. The user's initial location address information stored in the business system is obtained to update the initial location address information in real time using the current location address information.
[0090] In step S120 of some embodiments, the speech data is converted and processed by a speech-to-text tool to recognize the speech as text in real time, and the text data of the speech data is obtained, wherein the text data is the textual expression of the speech data.
[0091] Please see Figure 2 In some embodiments, the text data includes text words, and step S130 may include, but is not limited to, steps S210 to S250:
[0092] Step S210: Compare the text words with preset sample words;
[0093] Step S220: If the text words are the same as the sample words, then the text words are segmented to obtain the initial words;
[0094] Step S230: Calculate the word frequency of the initial words in the text data;
[0095] Step S240: Filter multiple initial words based on word frequency to obtain multiple target words;
[0096] Step S250: Construct a sequence based on multiple target words to obtain a word sequence.
[0097] In steps S210 to S220 of some embodiments, to improve the word segmentation speed, this application embodiment employs a string comparison-based word segmentation method to segment text data. This string comparison-based method includes forward maximum comparison, reverse maximum comparison, and bidirectional comparison word segmentation. Specifically, the text data is traversed according to a preset text scanning order, and the text words in the text data are compared with sample words in the word segmentation dictionary according to preset comparison principles to obtain comparison results. The text scanning order includes forward scanning, reverse scanning, and bidirectional scanning, and the comparison principles include maximum comparison principle, minimum comparison principle, word-by-word comparison principle, and optimal comparison principle. For example, the text data is traversed according to the forward scanning order, and the text data is compared with the word segmentation dictionary according to the maximum comparison principle, i.e., the forward maximum comparison method is used for word comparison to obtain comparison results. If the comparison result indicates that the text words in the text data are the same as the sample words in the word segmentation dictionary, then the text words are segmented from the text data to obtain initial words, where the initial words are keywords in the text data. If the comparison results indicate that the text words in the text data are different from the sample words in the word segmentation dictionary, then the text words are discarded.
[0098] In step S230 of some embodiments, the word frequency of the initial word in the text data is calculated, where the word frequency is the frequency of the initial word appearing in the text data.
[0099] In step S240 of some embodiments, multiple initial words are sorted from highest to lowest frequency to obtain a sorting result. The top K initial words are then selected as target words based on the sorting result, where K is greater than or equal to 1. By filtering the initial words and removing unnecessary initial words, the amount of data input to the neural network model can be reduced, thereby simplifying the model and reducing the memory space occupied by the neural network model.
[0100] In step S250 of some embodiments, a sequence is constructed based on multiple target words to treat the multiple target words as a whole and obtain a word sequence.
[0101] Steps S210 to S250 above perform word segmentation on the text data based on a dictionary, which can obtain keywords in the text data. Compared with other word segmentation methods, the dictionary-based word segmentation method can improve the word segmentation speed of text data. By filtering the initial words, the amount of data input to the neural network model can be reduced, thereby reducing the number of parameters occupied by the neural network model's embedding layer and thus reducing the memory space occupied by the neural network model.
[0102] In step S140 of some embodiments, one-hot encoding is performed on the words in the word sequence to obtain the word code. The word code is then multiplied by the weight matrix of the fully connected layer to obtain the initial word vector of the word. The fully connected layer can be a word2vec model. Specifically, the ID number of the sample word matching the target word in the word segmentation dictionary is used as the key value, the target word is used as the value value, and the key-value pair formed by the key value and the value value is used as the token of the target word. The target word is a word in the word sequence. One-hot encoding is performed on the target word according to the token to obtain the word code of the target word. The fully connected matrix is then calculated to obtain the initial word vector of the target word. For example, if the target word in the word sequence is "A", the ID number is 2, and the token is {"A": 2}, and if the word segmentation dictionary includes 4 sample words, one-hot encoding of the target word according to the token yields a word code of [0, 1, 0, 0]. If the weight matrix of the fully connected layer is [w1, w2, w3, w4]... T Multiplying the word encoding with the weight matrix yields a one-dimensional initial word vector [w2], where T represents the transpose of the matrix.
[0103] Please see Figure 3 In some embodiments, step S150 may include, but is not limited to, steps S310 to S340:
[0104] Step S310: Obtain the location identifier of the word;
[0105] Step S320: The words are relatively coded according to the preset sine function and position identifier to obtain the first relative position code;
[0106] Step S330: The words are encoded in relative position according to the preset cosine function and position identifier to obtain the second relative position code;
[0107] Step S340: The first relative position code and the second relative position code are concatenated to obtain the position code vector.
[0108] In step S310 of some embodiments, the position identifier of a word is obtained, wherein the position identifier is the absolute position code of the word in the word sequence.
[0109] In step S320 of some embodiments, the sine function, i.e. the sin function, is used to encode the word relative position based on the sin function and the absolute position code to obtain the first relative position code. The calculation method of the first relative position code is shown in formula (1).
[0110]
[0111] Where i and j are the absolute position codes of words, i represents the i-th word in the word sequence, and j represents the j-th word in the word sequence; bij represents the relative position code vector of the i-th word and the j-th word; t represents the t-th dimension of the relative position code vector, and the value of t is 0≤t≤(d-2) / 2; d is the dimension of the position code vector. If d is 8, then the value of t is [0,3].
[0112] In step S330 of some embodiments, the cosine function, i.e. the cosine function, is used to encode the relative position of the word according to the cosine function and the absolute position code to obtain the second relative position code. The calculation method of the second relative position code is shown in formula (2).
[0113]
[0114] In step S340 of some embodiments, the words in the word sequence are relatively encoded (sine position encoding), that is, the absolute position encoding of the words is processed according to the sin function and the cos function to obtain the position encoding vector of the words. The position encoding vector is a relative position encoding vector, and the dimension of the position encoding vector is the same as the dimension of the initial word vector. The dimension can be 512. If the total number of the first relative position encoding and the second relative position encoding is equal to the dimension of the position encoding vector, then all the first relative position encoding and the second relative position encoding are concatenated to obtain the position encoding vector. For example, if i is 1, j is 2, and the dimension of the position encoding vector is 8, then the relative position encoding vector is: b12 = [b12[0], b12[1], ..., b12[7]].
[0115] The BERT model, Generative Pre-Training (GPT) model, and T5 model all use absolute positional encoding, such as 1, 2, ..., 10000, which limits the text length that the model can handle. In dialogue tasks, to make the text length that the model can handle approach infinite, this embodiment of the application uses relative positional encoding, which clearly distinguishes the word relationships between different positions. For example, it clearly distinguishes the word relationship with a distance of 1 from the word relationship with a distance of 10000, allowing the neural network model to generalize to longer text data and enhancing the model's scalability.
[0116] In step S160 of some embodiments, the initial word vector and the position encoding vector of the target word are added together to obtain the target word vector of the target word, wherein the target word vector is the final vector representation of the target word.
[0117] Please see Figure 4 In some embodiments, the neural network model includes an encoding layer, a decoding layer, and a conditional random field layer, and step S170 may include, but is not limited to, steps S410 to S430:
[0118] Step S410: Extract features from the target word vector through the encoding layer to obtain the first address semantic features of the target word vector;
[0119] Step S420: The first address semantic features are decoded by the decoding layer to obtain the second address semantic features of the target word vector;
[0120] Step S430: The semantic features of the second address are discriminated through a conditional random field layer to obtain the target address information.
[0121] In step S410 of some embodiments, feature extraction is performed on the target word vector through a preset number of coding layers (e.g., 12 coding layers), the output of each coding layer is used as the input of the next coding layer, and the output of the last coding layer is used as the first address semantic feature.
[0122] In step S420 of some embodiments, the first address semantic features are decoded by a preset number of decoding layers (e.g., 12 decoding layers), the output of each decoding layer is used as the input of the next decoding layer, and the output of the last decoding layer is multiplied by the initial word vector to obtain the second address semantic features.
[0123] In step S430 of some embodiments, in order to correct the erroneous information in the second address semantic features, a conditional random field layer, i.e., a CRF layer, is used to add conditional constraints to the second address semantic features, and the second address semantic features that satisfy the conditional constraints are used as target address information, wherein the target address information includes the address information of the user's current location.
[0124] Because of the large amount of noise in the user's speech, namely the vague colloquial expressions and ambiguous address descriptions, it is impossible to accurately understand the user's speech, resulting in the inability to accurately extract the address from the user's speech.
[0125] To improve the accuracy of address extraction, this application trains a neural network model to perform address recognition, thereby increasing the accuracy of address recognition. The training method for the neural network model is as follows:
[0126] The user text dataset is augmented based on the data augmentation concept to enhance its quality. This is achieved by simulating user expressions using various colloquial styles. Specifically, Chinese text is input into a translation model to convert it into English text, and then the English text is input into the same model to convert it back into Chinese text. Explanatory addresses are inserted into the dataset, such as "I live in District B of City A, where A is the capital letter A." Repeated address expressions are added, such as "I'm in City AAAA." Colloquial phrases like "XX's XX," "um," and "uh" are added, along with non-physical business expressions like "Let's talk about it later, I'm busy right now." Multi-level sentiment polarity labeling is then applied to the augmented dataset. Addresses in the user text are labeled with four levels: "Province," "City," "District / County," and "Detailed Address." Sentiment is then assigned to each level of label based on the semantics of the text, resulting in the target user text dataset. The target user text dataset is input into a neural network model constructed using a transformer and a conditional random field (CRF). The weight parameters of the neural network model are adjusted by minimizing the loss function to obtain a trained neural network model.
[0127] In steps S410 to S430 above, feature extraction is performed on the target word vector through the encoder and decoder, enabling the neural network model to learn the contextual semantic information of the text data, obtain the key address information in the text data, and correct the key address information through the CRF layer, thereby improving the accuracy of address recognition of the neural network model.
[0128] Please see Figure 5 In some embodiments, the coding layer includes a self-attention layer and a feedforward neural network layer, and step S410 may include, but is not limited to, steps S510 to S520:
[0129] Step S510: Perform self-attention calculation on the target word vector through a self-attention layer to obtain the attention matrix;
[0130] Step S520: The attention matrix is transformed through a feedforward neural network layer to obtain the first address semantic features.
[0131] In step S510 of some embodiments, the target word vector is linearly mapped through a self-attention layer to obtain a query vector, a key vector, and a value vector. Self-attention calculation is then performed on the query vector, the key vector, and the value vector to obtain an attention matrix.
[0132] In step S520 of some embodiments, the attention matrix is transformed according to the feedforward neural network layer to obtain the initial address semantic features. The attention matrix and the initial address semantic features are then connected by residual connection to obtain the intermediate address semantic features. The gradient vanishing problem of deep neural networks can be solved by residual connection. The intermediate address semantic features are then normalized by layer to obtain the first address semantic features. Layer normalization can improve the convergence speed of the neural network model, thereby improving the speed of address recognition.
[0133] Steps S510 to S520 above use a self-attention mechanism to quickly extract key address semantic features from the target word vectors, obtaining an attention matrix. The attention matrix and the initial address semantic features output by the fully connected layer after feature transformation of the attention matrix are then residually connected. This solves the gradient vanishing problem in deep neural networks. Furthermore, the calculation results of the residual connections are processed by layer normalization to accelerate model convergence and improve the speed of address recognition.
[0134] Please see Figure 6 In some embodiments, step S510 may include, but is not limited to, steps S610 to S620:
[0135] Step S610: Linearly map the target word vector through a self-attention layer to obtain the query vector, key vector, and value vector;
[0136] Step S620: Perform self-attention calculation on the query vector, key vector, and value vector to obtain the attention matrix.
[0137] In step S610 of some embodiments, the target word vector is multiplied by the first weight matrix to obtain the query vector, the target word vector is multiplied by the second weight matrix to obtain the key vector, and the target word vector is multiplied by the third weight matrix to obtain the value vector. Specifically, if the target word vector is represented as x, the first weight matrix is represented as WQ, the second weight matrix is represented as WK, and the third weight matrix is represented as WV, the target word vector x is multiplied by the first weight matrix WQ to obtain the query vector Q of the target word, the target word vector x is multiplied by the second weight matrix WK to obtain the key vector K of the target word, and the target word vector x is multiplied by the third weight matrix WV to obtain the value vector V of the target word.
[0138] In step S620 of some embodiments, in order to obtain the correlation between the query vector Q and the key vector K, the query vector Q is multiplied by each key vector K to obtain the weight coefficient of the value vector V corresponding to the key vector K. The weight coefficient is normalized according to the softmax function. The normalized weight coefficient and the value vector corresponding to the weight coefficient are weighted and summed to obtain the attention score of one head. The calculation method of the attention score is shown in formula (3). The attention scores of other heads are calculated, and the attention scores of other heads are shown in formula (4). The attention scores of multiple heads are concatenated to obtain the initial attention matrix. The initial attention matrix is multiplied by the fourth weight matrix WO to obtain the target attention matrix. The calculation method of the target attention matrix is shown in formula (5).
[0139]
[0140] headi=attention(Qi,Ki,Vi)=attention(xWQi,xWKi,xWVi) (4)
[0141] multiatt(WO)=[head1;...;headi]WO (5)
[0142] Among them, K T It involves transposing the key vector K. As a scaling factor, avoid QK T The result of the dot product is too large. headi represents the attention score of the i-th head. Self-attention is calculated on the query vector Qi, key vector Ki, and value vector Vi of the i-th head to obtain the attention score headi of the i-th head. The attention scores headi of multiple heads are concatenated and multiplied with the fourth weight matrix WQ to obtain the target attention matrix.
[0143] It should be noted that the encoding layer uses bidirectional attention computation. For example, if the target word vectors of each word in the word sequence are represented as x1, x2, x3, and x4, bidirectional attention computation means that the target word vector of each word is relevance calculated with the target word vectors of all other words. That is, x1 is relevance calculated with x1 to x4, and x2 is also relevance calculated with x1 to x4. The difference between the decoding layer and the encoding layer is that the decoding layer uses unidirectional attention computation. That is, x1 is relevance calculated with x1 to x4, x2 is relevance calculated with x2 to x4, and x4 is relevance calculated with x4.
[0144] Steps S610 to S620 above perform attention calculation on the target word vector through a self-attention mechanism, which can fully understand the contextual semantic information of the text data, so as to quickly extract key address information in the text data and improve the accuracy of address recognition.
[0145] Please see Figure 7 In some embodiments, step S520 may include, but is not limited to, steps S710 to S730:
[0146] Step S710: The attention matrix is transformed through a feedforward neural network layer to obtain the initial address semantic features;
[0147] Step S720: Perform residual connection calculation on the attention matrix and the initial address semantic features to obtain the intermediate address semantic features;
[0148] Step S730: Normalize the semantic features of the intermediate address to obtain the semantic features of the first address.
[0149] In step S710 of some embodiments, the feedforward neural network layer consists of two fully connected layers, including a first fully connected layer and a second fully connected layer. The first fully connected layer extracts features from the attention matrix to obtain a first feature vector. The ReLU activation function is used to perform feature mapping on the first feature vector to obtain a second feature vector. The second fully connected layer extracts features from the second feature vector to obtain the initial address semantic features.
[0150] In step S720 of some embodiments, the attention matrix and the initial address semantic features are added bit by bit to obtain the intermediate address semantic features.
[0151] In step S730 of some embodiments, the intermediate address semantic features are subjected to layer normalization processing, i.e., LN standardization processing, to obtain the first address semantic features. LN standardization can accelerate the convergence of the neural network model, reduce the training time of the neural network model, and improve the speed of address recognition by the neural network model.
[0152] Through the above steps S710 to S730, the convergence of the neural network model can be accelerated, and the speed of address recognition by the model can be improved.
[0153] In step S180 of some embodiments, address recognition is performed using a neural network model to determine the address sentiment polarity in the text data and obtain target address information. The target address information includes both the address and its sentiment polarity. The target address information includes positive address information, which is the address of the user's current location. For example, if the user's voice data is "I live in City A," then City A is the positive address information. The original address information is updated based on the positive address information. Specifically, the positive address information and the original address information are compared. If they are the same, the original address information remains unchanged and is not updated. If they are different, the positive address information overwrites the original address information. If the positive address information is missing, the chatbot continues to inquire about the address of the user's current location to obtain voice data, and then performs address recognition on the voice data to obtain the positive address information.
[0154] The target address information also includes negative address information, which refers to addresses other than the user's current location. For example, if the user's voice data is "I moved from City A to City B," the neural network model performs address recognition on the user's voice data, obtaining a first probability that City A is a positive address, a second probability that City A is a negative address, a third probability that City B is a positive address, and a fourth probability that City B is a negative address. The second probability is greater than the first probability, and the third probability is greater than the fourth probability, thus concluding that City B is a positive address and City A is a negative address. If the user's voice data is "I am not in City A," the neural network model performs address recognition on the user's voice data, obtaining a first probability that City A is a positive address, a second probability that City A is a negative address, and positive address information is missing.
[0155] If the target address information includes both positive and negative address information, the positive and negative address information are compared to determine if the positive address information is correct. If the positive and negative address information are the same, it means the user believes the positive address information is incorrect, and the positive address information is retrieved again. If the positive and negative address information are different, it means the user believes the positive address information is correct, and the original address information is updated based on the positive address information. For example, in the statement "I am in City A, no, no, no, I am not in City A," both the positive and negative address information are City A. Since the positive and negative address information are the same, it means the user believes the positive address information is incorrect, and the positive address information needs to be retrieved again.
[0156] When a user believes the positive address information is correct and updates the original address information based on it, the negative address information is compared with the original address information. If the negative address information and the original address information are the same, it means the user believes the original address information is incorrect, i.e., the user is not currently at the location represented by the original address information. In this case, an invalidation flag is added to the original address information to indicate that the original address information is invalid and needs to be updated based on the positive address information. If the negative address information and the original address information are different, it means the user provided invalid address information, and the original address information is directly updated based on the positive address information. For example, "I am in City A, not City B," the positive address information is City A, the negative address information is City B, and the original address information is City C. The negative address information is different from both the original and positive address information, indicating that the negative address information is invalid, and the original address information is directly updated to City A based on the positive address information.
[0157] In some embodiments, positive and negative address information are at the same level, meaning their lowest-level addresses are the same. If higher-level address information for the positive address is missing, the positive address information is retrieved again. If higher-level address information for the negative address is missing, the higher-level address information for the positive address and the negative address are concatenated to obtain new negative address information. For example, "I am on Road 1, Street B, City A, not on Road 2," the positive address information is Road 1, Street B, City A, and the negative address information is Road 2. Both the positive and negative address information have a road as their lowest-level address, meaning they are at the same level. If higher-level address information such as city or street is missing for the negative address, the higher-level address information "Street B, City A" for the positive address and "Road 2" for the negative address are concatenated to obtain new negative address information "Road 2, Street B, City A." Similarly, "I am on Road 1, not on Road 2, Street B, City A," the positive address information is Road 1, and the negative address is Road 2, Street B, City A. If higher-level address information such as city or street is missing for the positive address, the higher-level address information is retrieved again to obtain the positive address information.
[0158] If the positive and negative address information are at different levels, their levels are compared. The address information with the lower level is retrieved, and this process continues until the positive and negative address information are at the same level. For example, if the positive address information is "City A, Street B, Road 2" and the negative address information is "City A", then the positive and negative address information are at different levels, and the negative address information is at a lower level. Therefore, the lower-level address information such as "street" or "road" for the negative address information is retrieved.
[0159] In step S730 of some embodiments, if the positive address information and the original address information for which the failure mark was added are different, the original address information for which the failure mark was added is overwritten according to the positive address information. If the positive address information and the original address information for which the failure mark was added are the same, the failure mark of the original address information is removed.
[0160] Through steps S710 to S730 above, when the user's reserved address information in the business system changes, the reserved address information can be updated in real time based on the user's voice, which improves the accuracy of address information updates compared with manual address information updates.
[0161] Please see Figure 8 This application also provides an address information updating apparatus, which can implement the above-described address information updating method. The apparatus includes:
[0162] The acquisition module 810 is used to acquire the voice data of the target object and the original address information of the target object stored in the preset system;
[0163] The conversion module 820 is used to convert and process the speech data to obtain the text data of the speech data;
[0164] The word segmentation module 830 is used to segment text data into words to obtain word sequences;
[0165] The vectorization module 840 is used to vectorize the words in the word sequence to obtain the initial word vectors;
[0166] The position encoding module 850 is used to encode the relative positions of words in a word sequence to obtain the position encoding vector of the words.
[0167] The vector fusion module 860 is used to fuse the initial word vector and the positional encoding vector to obtain the target word vector of the word;
[0168] The address recognition module 870 is used to input the target word vector into a preset neural network model for address recognition, and obtain the target address information of the text data;
[0169] Update module 880 is used to update the original address information based on the target address information.
[0170] The specific implementation of the address information updating device is basically the same as the specific embodiment of the address information updating method described above, and will not be repeated here.
[0171] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method for updating the aforementioned address information. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0172] Please see Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:
[0173] The processor 910 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0174] The memory 920 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 920 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 920 and is called by the processor 910 to execute the address information update method of the embodiments of this application.
[0175] The input / output interface 930 is used to implement information input and output;
[0176] The communication interface 940 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0177] Bus 950 transmits information between various components of the device (e.g., processor 910, memory 920, input / output interface 930, and communication interface 940);
[0178] The processor 910, memory 920, input / output interface 930 and communication interface 940 are connected to each other within the device via bus 950.
[0179] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for updating address information.
[0180] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0181] The address information updating method, address information updating device, electronic device, and computer-readable storage medium provided in this application embodiment acquire the voice data of the target object and the original address information of the target object stored in a preset system, enabling the user to update the original address information through voice dialogue. The voice data is converted to obtain the text data of the voice data, the text data is segmented to obtain a word sequence, the words in the word sequence are vectorized to obtain the initial word vectors of the words, and the words in the word sequence are relatively position encoded to obtain the position encoding vectors of the words. This allows the neural network model to learn the relative position information between the words in the word sequence. Compared with absolute position encoding, relative position encoding does not limit the text length that the neural network model can process, allowing the model to process input text sequences of any length. Furthermore, the initial word vectors and positional encoding vectors are fused to obtain the target word vectors. The target word vectors are then input into a pre-defined neural network model for address recognition, enabling the model to fully understand the semantic information in the user's speech and obtain the target address information of the text data. The target address information includes the positive address information. The original address information is updated based on the positive address information, which can automatically update the user's reserved address information in the business system based on the user's speech, thereby improving the accuracy of address information updates.
[0182] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0183] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0184] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0185] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0186] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0187] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0188] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above 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.
[0189] The units described above 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.
[0190] Furthermore, 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. The integrated unit can be implemented in hardware or as a software functional unit.
[0191] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it 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 all or part 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 multiple 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 of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0192] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for updating address information, characterized in that, The method includes: Acquire the voice data of the target object and the original address information of the target object stored in a preset system; The speech data is converted to obtain the text data of the speech data; The text data is segmented to obtain a word sequence; The words in the word sequence are vectorized to obtain the initial word vectors of the words; The relative positions of the words in the word sequence are encoded to obtain the position encoding vectors of the words. The initial word vector and the positional encoding vector are fused to obtain the target word vector of the word; The target word vector is input into a preset neural network model for address recognition to obtain the target address information of the text data; wherein, the target address information includes positive address information, which is the address information of the current location of the target object; Update the original address information according to the positive address information; The step of encoding the relative positions of words in the word sequence to obtain the position encoding vector of the words includes: Obtain the position identifier of the word, which is the absolute position code of the word in the word sequence; perform relative position encoding on the word according to a preset sine function and the position identifier to obtain a first relative position code; perform relative position encoding on the word according to a preset cosine function and the position identifier to obtain a second relative position code; concatenate the first relative position code and the second relative position code to obtain the position code vector.
2. The address information updating method according to claim 1, characterized in that, The text data includes text words, and the step of segmenting the text data to obtain a word sequence includes: The text words are compared with preset sample words; If the text words are the same as the sample words, then the text words are segmented to obtain initial words; Calculate the word frequency of the initial word in the text data; Multiple initial words are filtered based on the word frequency to obtain multiple target words; The word sequence is obtained by constructing a sequence based on multiple target words.
3. The method for updating address information according to any one of claims 1 to 2, characterized in that, The neural network model includes an encoding layer, a decoding layer, and a conditional random field layer. The step of inputting the target word vector into the preset neural network model for address recognition to obtain the target address information of the text data includes: The target word vector is subjected to feature extraction through the encoding layer to obtain the first address semantic feature of the target word vector; The first address semantic features are decoded by the decoding layer to obtain the second address semantic features of the target word vector; The target address information is obtained by performing feature discrimination on the semantic features of the second address through the conditional random field layer.
4. The address information updating method according to claim 3, characterized in that, The encoding layer includes a self-attention layer and a feedforward neural network layer. The step of extracting features from the target word vector through the encoding layer to obtain the first address semantic features of the target word vector includes: The attention matrix is obtained by performing self-attention calculation on the target word vector through the self-attention layer. The first address semantic features are obtained by performing feature transformation on the attention matrix through the feedforward neural network layer.
5. The address information updating method according to claim 4, characterized in that, The step of performing self-attention calculation on the target word vector through the self-attention layer to obtain the attention matrix includes: The self-attention layer linearly maps the target word vector to obtain the query vector, key vector, and value vector. The attention matrix is obtained by performing self-attention calculation on the query vector, the key vector, and the value vector.
6. The address information updating method according to claim 4, characterized in that, The step of performing feature transformation on the attention matrix through the feedforward neural network layer to obtain the first address semantic features includes: The attention matrix is transformed by the feedforward neural network layer to obtain the initial address semantic features; The attention matrix and the initial address semantic features are used to perform residual connection calculations to obtain intermediate address semantic features; The semantic features of the intermediate address are normalized to obtain the first address semantic features.
7. An address information updating device, characterized in that, The device includes: The acquisition module is used to acquire the voice data of the target object and the original address information of the target object stored in a preset system; A conversion module is used to convert the voice data to obtain the text data of the voice data; The word segmentation module is used to segment the text data into words to obtain a word sequence; The vectorization module is used to vectorize the words in the word sequence to obtain the initial word vectors of the words; The position encoding module is used to encode the relative positions of words in the word sequence to obtain the position encoding vector of the words. The vector fusion module is used to fuse the initial word vector and the positional encoding vector to obtain the target word vector of the word; The address recognition module is used to input the target word vector into a preset neural network model for address recognition to obtain the target address information of the text data; wherein, the target address information includes positive address information, which is the address information of the current location of the target object; The update module is used to update the original address information based on the positive address information; The device is also used for: Obtain the position identifier of the word, which is the absolute position code of the word in the word sequence; perform relative position encoding on the word according to a preset sine function and the position identifier to obtain a first relative position code; perform relative position encoding on the word according to a preset cosine function and the position identifier to obtain a second relative position code; concatenate the first relative position code and the second relative position code to obtain the position code vector.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement: The address information updating method as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to achieve the following: The address information updating method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for processing address information in text
CN111522901A
Address search method and device, electronic equipment and storage medium
CN113192534A