WO2021208696A1 - 用户意图分析方法、装置、电子设备及计算机存储介质 - Google Patents

用户意图分析方法、装置、电子设备及计算机存储介质 Download PDF

Info

Publication number
WO2021208696A1
WO2021208696A1 PCT/CN2021/082893 CN2021082893W WO2021208696A1 WO 2021208696 A1 WO2021208696 A1 WO 2021208696A1 CN 2021082893 W CN2021082893 W CN 2021082893W WO 2021208696 A1 WO2021208696 A1 WO 2021208696A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
feature extraction
vector
intention
semantic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2021/082893
Other languages
English (en)
French (fr)
Inventor
李志韬
王健宗
程宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2021208696A1 publication Critical patent/WO2021208696A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Definitions

  • This application relates to the field of data analysis technology, and in particular to a user intention analysis method, device, electronic equipment, and computer-readable storage medium.
  • a user intention analysis method provided by this application includes:
  • a preset number of target intents are selected from the plurality of target intents as user intents according to the priority.
  • the present application also provides a user intention analysis device, which includes:
  • the vector conversion module is used to obtain the input text of the user and convert the input text into a semantic vector
  • the intention prediction module is used to perform intention prediction on the semantic vector to obtain the predicted intention label of the input text
  • the feature extraction module is used to perform feature extraction on the predicted intent tag by using a feature extraction network, and generate multiple target intents based on the extracted features;
  • a priority calculation module for calculating the priority of each target intent among the multiple target intents
  • the intention screening module is used to select a preset number of target intentions as user intentions according to the priority.
  • This application also provides an electronic device, which includes:
  • Memory storing at least one instruction
  • the processor executes the instructions stored in the memory to implement the following steps:
  • a preset number of target intents are selected from the plurality of target intents as user intents according to the priority.
  • the present application also provides a computer-readable storage medium in which at least one instruction is stored, and the at least one instruction is executed by a processor in an electronic device to implement the following steps:
  • a preset number of target intents are selected from the plurality of target intents as user intents according to the priority.
  • FIG. 1 is a schematic flowchart of a user intention analysis method provided by an embodiment of this application
  • FIG. 2 is a functional module diagram of a user intention analysis device provided by an embodiment of the application
  • FIG. 3 is a schematic structural diagram of an electronic device that implements the user intention analysis method provided by an embodiment of the application.
  • the embodiment of the present application provides a user intention analysis method.
  • the execution subject of the user intention analysis method includes, but is not limited to, a server, a terminal, etc., which can be configured to execute at least one of the electronic devices of the method provided in the embodiments of the present application.
  • the user intention analysis method may be executed by software or hardware installed on a terminal device or a server device, and the software may be a blockchain platform.
  • the server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
  • the user intention analysis method includes:
  • the user's input text may be any text provided by the user that contains the user's intention, for example, the text for the user to inquire about certain business information, the text for the user to inquire about a certain product, and so on.
  • a python sentence with a data capture function can be used to obtain input text stored in advance by a user from a blockchain node, and the high throughput of the blockchain node for data can be used to improve the efficiency of obtaining input text.
  • the converting the input text into a semantic vector includes:
  • the input text is transformed using the trained text vectorization model to obtain the semantic vector of the input text.
  • the deep learning network model is used to construct the initial vectorization model; in detail, the Bert base network model is used as the initial vectorization model, and the initial vectorization model is followed by a layer of serialized annotation algorithm network to obtain the The text vectorization model, wherein the serialized annotation algorithm network is used to constrain the sequence of characters input to the initial vectorization model to obtain the entity text vectorization model.
  • the performing preset entity marking on the historical text to obtain the training text includes:
  • the preset entities construct a label set including non-preset entity character tags, preset entity beginning character tags, and preset entity middle character tags;
  • the tag set includes a plurality of preset tags, such as a non-preset entity character tag, a preset entity start character tag, and a preset entity intermediate character tag, wherein the non-preset entity character tag is used for Mark the characters that are not preset entities in the historical text, the preset entity start character tag is used to mark the beginning characters of the preset entity in the historical text, and the preset entity middle character tag is used to mark the preset entities in the historical text except Characters other than the start character.
  • the non-preset entity character tag is used for Mark the characters that are not preset entities in the historical text
  • the preset entity start character tag is used to mark the beginning characters of the preset entity in the historical text
  • the preset entity middle character tag is used to mark the preset entities in the historical text except Characters other than the start character.
  • the historical text contains the text information "a financial company provides a zero interest loan", the default entity is a financial entity, and the label entity set includes: non-financial entity character label, financial entity start character label, financial entity middle character label, then Use the label entity set to mark the text message "a financial company provides a zero interest loan", the character "a financial” is marked with the financial entity start character label as the financial entity start character, and the "company” character is marked with the financial entity middle character label as financial Intermediate characters of the entity, "provided” characters are marked as non-financial entity characters using non-financial entity character tags, "zero interest rate” characters are marked as non-financial entity characters using non-financial entity character tags, and "loan” characters are marked as non-financial entity character tags Mark as a non-financial entity character.
  • the iterative training of the text vectorization model by using the training text until the text vectorization model converges includes:
  • a loss value between the predicted text vector and the standard text vector is calculated, and when the loss value is less than a preset loss threshold, it is determined that the text vectorization model converges.
  • a python sentence with a data capture function may be used to obtain a pre-stored standard text vector from the database.
  • the embodiment of the present application may use a preset loss function to calculate the loss value between the predicted text vector and the standard text vector.
  • the loss function includes, but is not limited to, a cross-entropy loss function, a square error loss function, and Regular loss function.
  • the embodiment of the present application converts the input text into a semantic vector, which can realize the digitization of the text information, which is beneficial to improve the efficiency of subsequent analysis of the input text.
  • the intent prediction performed on the semantic vector to obtain the predicted intent label of the input text includes:
  • the fused semantic feature is used as the predicted intent label of the input text.
  • the embodiment of the application adopts an LSTM network (Long Short-Term Memory Net, long short-term memory network) to construct an intent prediction network including multiple down-sampling layers, and uses the multi-layer down-sampling layer structure in the LSTM network to perform semantic analysis.
  • the vector is down-sampled multiple times, which is beneficial to extract more accurate semantic features and improve the accuracy of the generated predicted intent label.
  • the front down-sampling layer and the back down-sampling layer are relative terms.
  • the intention prediction network includes 4 down-sampling layers, and the first down-sampling layer that down-samples the semantic vector is relatively
  • the second down-sampling layer that down-samples the semantic vector, the third down-sampling layer that down-samples the semantic vector, and the fourth down-sampling layer that down-samples the semantic vector are the pre-down-sampling layer ;
  • the second down-sampling layer that down-samples the standard semantic vector is a post-down-sampling layer relative to the first down-sampling layer that down-samples the semantic vector, and so on.
  • the later down-sampling layer down-samples the result (forward semantic feature) obtained by the previous down-sampling layer to obtain the backward semantic feature.
  • the later down-sampling layer down-samples the result (forward semantic feature) obtained by the previous down-sampling layer to obtain the backward semantic feature.
  • the thoracic cavity image is down-sampled in the first down-sampling layer to obtain the first semantic feature
  • Feature fusion is performed on the first semantic feature, the second semantic feature, the third semantic feature, and the fourth semantic feature to obtain a fused semantic feature, and the fused semantic feature is used as a predicted intention label of the input text.
  • the embodiment of the present application performs intention prediction on the semantic vector to obtain the predicted intention label of the input text, which can reduce the amount of data in the semantic vector containing a large amount of semantics, and is beneficial to improve the efficiency of subsequent analysis of user intent.
  • the feature extraction network includes multiple visual layers and multiple hidden layers, wherein the visual layer includes multiple visual units, the hidden layer includes multiple hidden units, and The number of visible layers corresponds to the number of multiple hidden layers, and the number of multiple visible units corresponds to the number of multiple hidden units.
  • said using a feature extraction network to perform feature extraction on said predicted intent label includes:
  • the hidden layer of the feature extraction network uses a machine learning algorithm to perform feature extraction on the data representation of the visible layer label.
  • each visible unit in the visible layer of the feature extraction network is used to mark a data representation in the intent tag, and each hidden unit in the hidden layer of the feature extraction network is extracted.
  • each hidden unit in the hidden layer extracts a data characterization marked by a visible unit matching the hidden unit based on a machine learning algorithm.
  • the states of the visible unit and the hidden unit are represented by Boolean values, such as 0 and 1, where 0 represents an inactive state and 1 represents an activated state. Only after the visible unit and/or the hidden unit are activated by the activation function can the data contained in the visible unit be transmitted to the hidden unit matching the visible unit.
  • the activation function of the visible unit and/or the hidden unit is as follows:
  • E(v, h, ⁇ ) is the activation value
  • I is the number of visible units in the visible layer
  • J is the number of hidden units in the hidden layer
  • a is the bias of the visible layer Vector
  • b is the bias vector of the hidden layer
  • w is the direct weight matrix between the visible layer and the hidden layer
  • v is any visible unit in the visible layer
  • h is the hidden layer
  • is the preset error parameter.
  • the visible unit and/or the hidden unit are activated by the activation function.
  • the data contained in the visible unit and/or the hidden unit is transmitted to the hidden unit matching the visible unit .
  • the visible unit in the visible layer is matched with the hidden unit in the hidden layer through the following matching algorithm:
  • P(v, h, ⁇ ) is a matching value
  • v is any visible unit in the visible layer
  • h is any hidden unit in the hidden layer
  • is a preset error parameter
  • Z is The normalization factor of the feature extraction network, exp(-E(v, h, ⁇ )) is the expectation that the visible unit v matches the hidden unit h.
  • the activated visible layer can transmit data to and match the visible layer.
  • the hidden layer that has been activated is not limited to
  • v j is the jth hidden unit in the hidden layer
  • h is any hidden unit in the hidden layer
  • is a preset error parameter
  • J is the number of hidden units in the hidden layer
  • w is the direct weight matrix between the visible layer and the hidden layer
  • b is the bias vector of the hidden layer
  • is the preset probability coefficient
  • h i is the i-th visible unit in the visible layer
  • v is any visible unit in the visible layer
  • is a preset error parameter
  • I is the visible unit in the visible layer.
  • w is the direct weight matrix between the visible layer and the hidden layer
  • a is the bias vector of the visible layer
  • is the preset probability coefficient.
  • multiple visible layers and hidden layers in multiple feature extraction networks are used to superimpose, so as to achieve more accurate feature extraction of the predicted intent tag.
  • using the hidden layer of the feature extraction network to use a machine learning algorithm to perform feature extraction on the data representation marked by the visible layer includes:
  • h is the data feature obtained by feature extraction of the data representation of the visible layer mark
  • Y is the data representation
  • w is the weight matrix between the visible layer and the hidden layer
  • b is The bias vector of the hidden layer.
  • the generating multiple target intents based on the extracted features includes: calculating the similarity between the extracted features and multiple preset standard intents, and determining that the multiple standard intents with the similarity greater than the similarity threshold are the target intents.
  • the target intention is described, wherein the embodiment of the present application may use the cosine similarity algorithm to calculate the similarity between the extracted feature and a plurality of preset standard intentions.
  • the feature extraction network is used to perform feature extraction on the predicted intention label, and multiple target intentions are generated based on the extracted features, and the user intention is predicted by using the extracted features, which improves the accuracy of predicting user intentions.
  • the calculation of the priority of each target intention among the multiple target intentions includes:
  • Pir is the priority
  • is a preset weight coefficient
  • M k is the kth target intention among the multiple target intentions.
  • the selection of a preset number of target intentions as user intentions according to the priority includes:
  • a preset number of target intents are selected as user intents from the multiple target intents that have been sorted in a front-to-back order.
  • the multiple target intentions include: intention A, intention B, intention C, and intention D, where the priority of intention A is 50, the priority of intention B is 40, the priority of intention C is 60, and the priority of intention D is 60.
  • the priority of is 30. Therefore, the multiple target intentions are sorted as follows: Intention C, Intention A, Intent B, and Intent D in the order of priority; Select the intention C and the intention A as the user's intentions from the sorted multiple target intentions in the order of.
  • the embodiment of the application obtains the input text of the user, converts the input text into a semantic vector, and converts the input text into a semantic vector, which can realize the digitization of the text information, which is beneficial to improve the efficiency of subsequent analysis of the input text;
  • the vector is used to predict the intent to obtain the predicted intent label of the input text, which can reduce the amount of data in the semantic vector containing a large amount of semantics, which is beneficial to improve the efficiency and accuracy of subsequent analysis of user intent;
  • the feature extraction network is used to perform the prediction of the intent label.
  • Feature extraction and generating multiple target intents based on the extracted features realizes the use of extracted features to predict the user's intent, and improves the accuracy of predicting user intent; by calculating the priority, and according to the priority Sorting and screening of individual target intentions helps to improve the accuracy of the selected target intentions. Therefore, the user intention analysis method proposed in this application can solve the problem of low accuracy in identifying user intentions.
  • FIG. 2 it is a functional module diagram of a user intention analysis device provided by an embodiment of the present application.
  • the user intention analysis apparatus 100 described in this application may be installed in an electronic device.
  • the user intention analysis device 100 may include an electronic seal generation module 101, a two-dimensional code generation module 102, a two-dimensional code analysis module 103, a seal record search module 104, and an electronic seal verification module 105.
  • the module described in this application can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the vector conversion module 101 is configured to obtain user input text, and convert the input text into a semantic vector
  • the intention prediction module 102 is configured to perform intention prediction on the semantic vector to obtain the predicted intention label of the input text
  • the feature extraction module 103 is configured to perform feature extraction on the predicted intent tag by using a feature extraction network, and generate multiple target intents based on the extracted features;
  • the priority calculation module 104 is configured to calculate the priority of each target intention among the multiple target intentions
  • the intention screening module 105 is configured to select a preset number of target intentions as user intentions according to the priority.
  • each module of the user intention analysis device is as follows:
  • the vector conversion module 101 is used to obtain user input text, and convert the input text into a semantic vector.
  • the user's input text may be any text provided by the user that contains the user's intention, for example, the text for the user to inquire about certain business information, the text for the user to inquire about a certain product, and so on.
  • a python sentence with a data capture function can be used to obtain input text stored in advance by a user from a blockchain node, and the high data throughput of the blockchain node can be used to improve the efficiency of obtaining input text.
  • vector conversion module 101 is specifically used for:
  • the input text is transformed using the trained text vectorization model to obtain the semantic vector of the input text.
  • the deep learning network model is used to construct the initial vectorization model; in detail, the Bert base network model is used as the initial vectorization model, and the initial vectorization model is followed by a layer of serialized annotation algorithm network to obtain the The text vectorization model, wherein the serialized annotation algorithm network is used to constrain the sequence of characters input to the initial vectorization model to obtain the entity text vectorization model.
  • the performing preset entity marking on the historical text to obtain the training text includes:
  • the preset entities construct a label set including non-preset entity character tags, preset entity beginning character tags, and preset entity middle character tags;
  • the tag set includes a plurality of preset tags, such as a non-preset entity character tag, a preset entity start character tag, and a preset entity intermediate character tag, wherein the non-preset entity character tag is used for Mark the characters that are not preset entities in the historical text, the preset entity start character tag is used to mark the beginning characters of the preset entity in the historical text, and the preset entity middle character tag is used to mark the preset entities in the historical text except Characters other than the start character.
  • the non-preset entity character tag is used for Mark the characters that are not preset entities in the historical text
  • the preset entity start character tag is used to mark the beginning characters of the preset entity in the historical text
  • the preset entity middle character tag is used to mark the preset entities in the historical text except Characters other than the start character.
  • the historical text contains the text information "a financial company provides a zero interest loan", the default entity is a financial entity, and the label entity set includes: non-financial entity character label, financial entity start character label, financial entity middle character label, then Use the label entity set to mark the text message "a financial company provides a zero interest loan", the character "a financial” is marked with the financial entity start character label as the financial entity start character, and the "company” character is marked with the financial entity middle character label as financial Intermediate characters of the entity, "provided” characters are marked as non-financial entity characters using non-financial entity character tags, "zero interest rate” characters are marked as non-financial entity characters using non-financial entity character tags, and "loan” characters are marked as non-financial entity character tags Mark as a non-financial entity character.
  • the iterative training of the text vectorization model by using the training text until the text vectorization model converges includes:
  • a loss value between the predicted text vector and the standard text vector is calculated, and when the loss value is less than a preset loss threshold, it is determined that the text vectorization model converges.
  • a python sentence with a data capture function may be used to obtain a pre-stored standard text vector from the database.
  • the embodiment of the present application may use a preset loss function to calculate the loss value between the predicted text vector and the standard text vector.
  • the loss function includes, but is not limited to, a cross-entropy loss function, a square error loss function, and Regular loss function.
  • the embodiment of the present application converts the input text into a semantic vector, which can realize the digitization of the text information, which is beneficial to improve the efficiency of subsequent analysis of the input text.
  • the intention prediction module 102 is configured to perform intention prediction on the semantic vector to obtain the predicted intention label of the input text.
  • the intention prediction module 102 is specifically configured to:
  • the fused semantic feature is used as the predicted intent label of the input text.
  • the embodiment of the application adopts an LSTM network (Long Short-Term Memory Net, long short-term memory network) to construct an intent prediction network including multiple down-sampling layers, and uses the multi-layer down-sampling layer structure in the LSTM network to perform semantic analysis.
  • the vector is down-sampled multiple times, which is beneficial to extract more accurate semantic features and improve the accuracy of the generated predicted intent label.
  • the pre-down-sampling layer and the post-down-sampling layer are relative terms.
  • the intention prediction network includes 4 down-sampling layers.
  • the second down-sampling layer that down-samples the semantic vector, the third down-sampling layer that down-samples the semantic vector, and the fourth down-sampling layer that down-samples the semantic vector are the pre-down-sampling layer ;
  • the second down-sampling layer that down-samples the standard semantic vector is a post-down-sampling layer relative to the first down-sampling layer that down-samples the semantic vector, and so on.
  • the later down-sampling layer down-samples the result (forward semantic feature) obtained by the previous down-sampling layer to obtain the backward semantic feature.
  • the later down-sampling layer down-samples the result (forward semantic feature) obtained by the previous down-sampling layer to obtain the backward semantic feature.
  • the thoracic cavity image is down-sampled in the first down-sampling layer to obtain the first semantic feature
  • Feature fusion is performed on the first semantic feature, the second semantic feature, the third semantic feature, and the fourth semantic feature to obtain a fused semantic feature, and the fused semantic feature is used as a predicted intention label of the input text.
  • the embodiment of the present application performs intention prediction on the semantic vector to obtain the predicted intention label of the input text, which can reduce the amount of data in the semantic vector containing a large amount of semantics, and is beneficial to improve the efficiency of subsequent analysis of user intent.
  • the feature extraction module 103 is configured to perform feature extraction on the predicted intent tag by using a feature extraction network, and generate multiple target intents based on the extracted features.
  • the feature extraction network includes multiple visual layers and multiple hidden layers, wherein the visual layer includes multiple visual units, the hidden layer includes multiple hidden units, and The number of visible layers corresponds to the number of multiple hidden layers, and the number of multiple visible units corresponds to the number of multiple hidden units.
  • the feature extraction module 103 is specifically configured to:
  • each visible unit in the visible layer of the feature extraction network is used to mark a data representation in the intent tag, and each hidden unit in the hidden layer of the feature extraction network is extracted.
  • each hidden unit in the hidden layer extracts a data characterization marked by a visible unit matching the hidden unit based on a machine learning algorithm.
  • the states of the visible unit and the hidden unit are represented by Boolean values, such as 0 and 1, where 0 represents an inactive state and 1 represents an activated state. Only after the visible unit and/or the hidden unit are activated by the activation function can the data contained in the visible unit be transmitted to the hidden unit matching the visible unit.
  • the activation function of the visible unit and/or the hidden unit is as follows:
  • E(v, h, ⁇ ) is the activation value
  • I is the number of visible units in the visible layer
  • J is the number of hidden units in the hidden layer
  • a is the bias of the visible layer Vector
  • b is the bias vector of the hidden layer
  • w is the direct weight matrix between the visible layer and the hidden layer
  • v is any visible unit in the visible layer
  • h is the hidden layer
  • is the preset error parameter.
  • the visible unit and/or the hidden unit are activated by the activation function.
  • the data contained in the visible unit and/or the hidden unit is transmitted to the hidden unit matching the visible unit .
  • the visible unit in the visible layer is matched with the hidden unit in the hidden layer through the following matching algorithm:
  • P(v, h, ⁇ ) is a matching value
  • v is any visible unit in the visible layer
  • h is any hidden unit in the hidden layer
  • is a preset error parameter
  • Z is The normalization factor of the feature extraction network, exp(-E(v, h, ⁇ )) is the expectation that the visible unit v matches the hidden unit h.
  • the activated visible layer can transmit data to and match the visible layer.
  • the hidden layer that has been activated is not limited to
  • v j is the jth hidden unit in the hidden layer
  • h is any hidden unit in the hidden layer
  • is a preset error parameter
  • J is the number of hidden units in the hidden layer
  • w is the direct weight matrix between the visible layer and the hidden layer
  • b is the bias vector of the hidden layer
  • is the preset probability coefficient
  • h i is the i-th visible unit in the visible layer
  • v is any visible unit in the visible layer
  • is a preset error parameter
  • I is the visible unit in the visible layer.
  • w is the direct weight matrix between the visible layer and the hidden layer
  • a is the bias vector of the visible layer
  • is the preset probability coefficient.
  • multiple visible layers and hidden layers in multiple feature extraction networks are used to superimpose, so as to achieve more accurate feature extraction of the predicted intent tag.
  • using the hidden layer of the feature extraction network to use a machine learning algorithm to perform feature extraction on the data representation marked by the visible layer includes:
  • h is the data feature obtained by feature extraction of the data representation of the visible layer mark
  • Y is the data representation
  • w is the weight matrix between the visible layer and the hidden layer
  • b is The bias vector of the hidden layer.
  • the generating multiple target intents based on the extracted features includes: calculating the similarity between the extracted features and multiple preset standard intents, and determining that the multiple standard intents with the similarity greater than the similarity threshold are the target intents.
  • the target intention is described, wherein the embodiment of the present application may use the cosine similarity algorithm to calculate the similarity between the extracted feature and a plurality of preset standard intentions.
  • the feature extraction network is used to perform feature extraction on the predicted intention label, and multiple target intentions are generated based on the extracted features, and the user intention is predicted by using the extracted features, which improves the accuracy of predicting user intentions.
  • the priority calculation module 104 is configured to calculate the priority of each target intention among the multiple target intentions.
  • the priority calculation module 104 is specifically configured to:
  • Pir is the priority
  • is a preset weight coefficient
  • M k is the kth target intention among the multiple target intentions.
  • the intention screening module 105 is configured to select a preset number of target intentions as user intentions according to the priority.
  • the intention screening module 105 is specifically configured to:
  • a preset number of target intents are selected as user intents from the multiple target intents that have been sorted in a front-to-back order.
  • the multiple target intentions include: intention A, intention B, intention C, and intention D, where the priority of intention A is 50, the priority of intention B is 40, the priority of intention C is 60, and the priority of intention D is 60.
  • the priority of is 30. Therefore, the multiple target intentions are sorted as follows: Intention C, Intention A, Intent B, and Intent D in the order of priority; Select the intention C and the intention A as the user's intentions from the sorted multiple target intentions in the order of.
  • the embodiment of the application obtains the input text of the user, converts the input text into a semantic vector, and converts the input text into a semantic vector, which can realize the digitization of the text information, which is beneficial to improve the efficiency of subsequent analysis of the input text;
  • the vector is used to predict the intent to obtain the predicted intent label of the input text, which can reduce the amount of data in the semantic vector containing a large amount of semantics, which is beneficial to improve the efficiency and accuracy of subsequent analysis of user intent;
  • the feature extraction network is used to perform the prediction of the intent label.
  • the user intention analysis device proposed in the present application can solve the problem of low accuracy in recognizing user intentions.
  • FIG. 3 it is a schematic structural diagram of an electronic device that implements a user intention analysis method provided by an embodiment of the present application.
  • the electronic device 1 may include a processor 10, a memory 11, and a bus, and may also include a computer program stored in the memory 11 and running on the processor 10, such as a user intention analysis program 12.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, for example, a mobile hard disk of the electronic device 1.
  • the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart media card (SMC), and a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash card (Flash Card), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can be used not only to store application software and various data installed in the electronic device 1, such as the code of the user intent analysis program 12, etc., but also to temporarily store data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Combinations of central processing unit (CPU), microprocessor, digital processing chip, graphics processor, and various control chips, etc.
  • the processor 10 is the control unit of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules (such as user Intention analysis program, etc.), and call data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • the bus may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection and communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure. Components, or a combination of certain components, or different component arrangements.
  • the electronic device 1 may also include a power source (such as a battery) for supplying power to various components.
  • the power source may be logically connected to the at least one processor 10 through a power management device, thereby controlling power
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators.
  • the electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface.
  • the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may also include a user interface.
  • the user interface may be a display (Display) and an input unit (such as a keyboard (Keyboard)).
  • the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc.
  • the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
  • the user intention analysis program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can realize:
  • a preset number of target intents are selected from the plurality of target intents as user intents according to the priority.
  • the integrated module/unit of the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the computer-readable storage medium may be volatile or non-volatile.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).
  • the present application also provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor of an electronic device, it can realize:
  • a preset number of target intents are selected from the plurality of target intents as user intents according to the priority.
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional modules.
  • the blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Machine Translation (AREA)

Abstract

一种用户意图分析方法、装置、电子设备以及计算机可读存储介质,所述方法包括:获取用户的输入文本,将所述输入文本转化为语义向量(S1);对所述语义向量进行意图预测,得到所述输入文本的预测意图标签(S2);利用特征提取网络对所述预测意图标签进行特征提取,根据提取到的特征生成多个目标意图(S3);计算所述多个目标意图中各目标意图的优先度(S4);根据所述优先度从所述多个目标意图中选取预设数量的目标意图为用户意图(S5)。还涉及区块链技术,所述用户的输入文本可存储于区块链的节点。该方法可以提高识别用户意图的准确性。

Description

用户意图分析方法、装置、电子设备及计算机存储介质
本申请要求于2020年11月19日提交中国专利局、申请号为CN202011302192.3、名称为“用户意图分析方法、装置、电子设备及计算机存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据分析技术领域,尤其涉及一种用户意图分析方法、装置、电子设备及计算机可读存储介质。
背景技术
随着智能客服的广泛应用,越来越多的公司或企业使用智能机器人对用户的提问进行自动答复。自动答复过程中,如何根据用户的提问准确地识别出用户的意图是越来越被人们所关注的重点。
现有的自动答复过程中对用户意图进行识别的方法多为基于相似度算法计算用户的提问与预先设定的标准提问的相似度,以根据相似度识别出用户提问的意图。发明人意识到由于不同用户的语言表达习惯不一致,因此对于同一意图,不同的用户在表达上差异较大,导致了现有方法在利用相似度识别用户意图时的识别精确度不高。
发明内容
本申请提供的一种用户意图分析方法,包括:
获取用户的输入文本,将所述输入文本转化为语义向量;
对所述语义向量进行意图预测,得到所述输入文本的预测意图标签;
利用特征提取网络对所述预测意图标签进行特征提取,根据提取到的特征生成多个目标意图;
计算所述多个目标意图中各目标意图的优先度;
根据所述优先度从所述多个目标意图中选取预设数量的目标意图为用户意图。
本申请还提供一种用户意图分析装置,所述装置包括:
向量转化模块,用于获取用户的输入文本,将所述输入文本转化为语义向量;
意图预测模块,用于对所述语义向量进行意图预测,得到所述输入文本的预测意图标签;
特征提取模块,用于利用特征提取网络对所述预测意图标签进行特征提取,根据提取到的特征生成多个目标意图;
优先度计算模块,用于计算所述多个目标意图中各目标意图的优先度;
意图筛选模块,用于根据所述优先度选取预设数量的目标意图为用户意图。
本申请还提供一种电子设备,所述电子设备包括:
存储器,存储至少一个指令;及
处理器,执行所述存储器中存储的指令以实现如下步骤:
获取用户的输入文本,将所述输入文本转化为语义向量;
对所述语义向量进行意图预测,得到所述输入文本的预测意图标签;
利用特征提取网络对所述预测意图标签进行特征提取,根据提取到的特征生成多个目标意图;
计算所述多个目标意图中各目标意图的优先度;
根据所述优先度从所述多个目标意图中选取预设数量的目标意图为用户意图。
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现如下步骤:
获取用户的输入文本,将所述输入文本转化为语义向量;
对所述语义向量进行意图预测,得到所述输入文本的预测意图标签;
利用特征提取网络对所述预测意图标签进行特征提取,根据提取到的特征生成多个目标意图;
计算所述多个目标意图中各目标意图的优先度;
根据所述优先度从所述多个目标意图中选取预设数量的目标意图为用户意图。
附图说明
图1为本申请一实施例提供的用户意图分析方法的流程示意图;
图2为本申请一实施例提供的用户意图分析装置的功能模块图;
图3为本申请一实施例提供的实现所述用户意图分析方法的电子设备的结构示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例提供一种用户意图分析方法。所述用户意图分析方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述用户意图分析方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。
参照图1所示,为本申请一实施例提供的用户意图分析方法的流程示意图。在本实施例中,所述用户意图分析方法包括:
S1、获取用户的输入文本,将所述输入文本转化为语义向量。
本申请实施例中,所述用户的输入文本可以是用户提供的任何包含用户意图的文本,例如,用户对某业务信息进行询问的文本,用户对某产品进行咨询的文本等。
本申请实施例可利用具有数据抓取功能的python语句从区块链节点中获取用户预先存储的输入文本,利用区块链节点对数据的高吞吐性,可提高获取输入文本的效率。
详细地,所述将所述输入文本转化为语义向量,包括:
构建文本向量化模型;
获取历史文本,对所述历史文本进行预设实体标记,得到训练文本;
利用所述训练文本对所述文本向量化模型进行迭代训练,直至所述文本向量化模型收敛,得到训练完成的文本向量化模型;
利用训练完成的文本向量化模型对所述输入文本进行转化,得到所述输入文本的语义向量。
本申请实施例中,利用深度学习网络模型构建初始向量化模型;详细地,使用Bert base网络模型作为初始向量化模型,在所述初始向量化模型后面接一层序列化标注算法网络,得到所述文本向量化模型,其中,所述序列化标注算法网络用于对输入至所述初始向量化模型的字符的顺序进行约束,得到所述实体文本向量化模型。
详细地,所述对所述历史文本进行预设实体标记,得到训练文本,包括:
根据预设实体构建包含非预设实体字符标签、预设实体开始字符标签、预设实体中间字符标签的标签集合;
利用所述标签集合中的标签对所述历史文本中的每个字符进行标记,得到训练文本。
具体地,所述标签集合中包含多个预设标签,如,非预设实体字符标签、预设实体开始字符标签、预设实体中间字符标签,其中,所述非预设实体字符标签用于标记历史文本中非预设实体的字符,所述预设实体开始字符标签用于标记历史文本中预设实体的开始字符,所述预设实体中间字符标签用于标记历史文本中预设实体除开始字符之外的字符。
例如:历史文本包含的文本信息为“某金融公司提供零利率贷款”,预设实体为金融实体,标签实体集合包括:非金融实体字符标签、金融实体开始字符标签、金融实体中间字符标签,那么利用标签实体集合对文本信息“某金融公司提供零利率贷款”进行标记,“某金融”字符利用金融实体开始字符标签标记为金融实体开始字符,“公司”字符利用金融实体中间字符标签标记为金融实体中间字符,“提供”字符利用非金融实体字符标签标记为非金融实体字符,“零利率”字符利用非金融实体字符标签标签标记为非金融实体字符,“贷款”字符利用非金融实体字符标签标记为非金融实体字符。
进一步地,所述利用所述训练文本对所述文本向量化模型进行迭代训练,直至所述文本向量化模型收敛,包括:
将所述训练文本输入至所述文本向量化模型进行向量转化,得到预测文本向量;
获取所述训练文本对应的标准文本向量;
计算所述预测文本向量与所述标准文本向量之间的损失值,当所述损失值小于预设损失阈值时,确定所述文本向量化模型收敛。
本申请实施例中,可利用具有数据抓取功能的python语句从数据库中获取预先存储的标准文本向量。
详细地,本申请实施例可利用预设的损失函数计算所述预测文本向量与所述标准文本向量之间的损失值,所述损失函数包括但不限于交叉熵损失函数、平方误差损失函数和正则损失函数。当所述损失值小于预设的损失阈值时,则说明文本向量化模型已收敛,得到训练完成的文本向量化模型。
本申请实施例将输入文本转化为语义向量,可实现将文本信息进行数值化,有利于提高后续对输入文本进行分析的效率。
S2、对所述语义向量进行意图预测,得到所述输入文本的预测意图标签。
本申请实施例中,所述对所述语义向量进行意图预测,得到所述输入文本的预测意图标签,包括:
构建包含多层下采样层的意图预测网络;
利用所述意图预测网络中的前向下采样层对所述语义向量进行下采样,得到前向语义特征;
利用所述特征筛选模型中的后向下采样层对所述前向语义特征进行下采样,得到后向语义特征;
对获得的前向语义特征和后向语义特征进行特征融合,得到融合语义特征;
将所述融合语义特征作为所述输入文本的预测意图标签。
详细地,本申请实施例采用LSTM网络(Long Short-Term Memory Net,长短期记忆网络)构建包含多层下采样层的意图预测网络,利用所述LSTM网络中的多层下采样层结构对语义向量进行多次下采样,有利于提取出更精确的语义特征,提高生成的预测意图标签精确度。
具体地,所述前向下采样层与所述后向下采样层是相对而言的,例如,意图预测网络包括4个下采样层,第一个对语义向量进行下采样的下采样层相对于第二个对语义向量进行下采样的下采样层、第三个对语义向量进行下采样的下采样层和第四个对语义向量进行下采样的下采样层来说是前向下采样层;第二个对标准语义向量进行下采样的下采样层相对于第一个对语义向量进行下采样的下采样层来说是后向下采样层,依此类推。
详细地,当前向下采样层为初始下采样层时,后向下采样层对前向下采样层得到的结果(前向语义特征)进行下采样,得到后向语义特征。
当前向下采样层不为初始下采样层时,后向下采样层对前向下采样层得到的结果(前向语义特征)进行下采样,得到后向语义特征。
具体地,例如,在第一下采样层中对所述胸腔图像进行下采样,得到第一语义特征;
在第二下采样层中对所述第一语义特征进行下采样,得到第二语义特征;
在第三下采样层中对所述第二语义特征进行下采样,得到第三语义特征;
在第四下采样层中对所述第三语义特征进行下采样,得到第四语义特征;
对所述第一语义特征、所述第二语义特征、所述第三语义特征和所述第四语义特征进行特征融合得到融合语义特征,并将融合语义特征作为输入文本的预测意图标签。
本申请实施例对语义向量进行意图预测,得到输入文本的预测意图标签,可减少包含大量语义的语义向量中的数据量,有利于提高后续对用户意图进行分析的效率。
S3、利用特征提取网络对所述预测意图标签进行特征提取,根据提取到的特征生成多个目标意图。
本申请实施例中,所述特征提取网络包括多个可视层和多个隐藏层,其中,所述可视层包含多个可视单元,所述隐藏层包含多个隐藏单元,且多个可视层和多个隐藏层的数目对应,多个可视单元与多个隐藏单元的数目对应。
详细地,所述利用特征提取网络对所述预测意图标签进行特征提取,包括:
通过特征提取网络的可视层标记所述预测意图标签的数据表征;
通过特征提取网络的隐藏层利用机器学习算法对所述可视层标记的数据表征进行特征提取。
具体地,在进行特征提取的过程中,通过特征提取网络的可视层中的每个可视单元标记所述意图标签中一个数据表征,通过特征提取网络的隐藏层中的每个隐藏单元提取所述数据表征,所述隐藏层中的每个隐藏单元基于机器学习算法提取与所述隐藏单元相匹配的可视单元标记的数据表征。
本申请实施例中,所述可视单元和所述隐藏单元的状态由布尔值进行表示,如,0和1,其中,0表示未激活状态,1表示激活状态。当所述可视单元和/或所述隐藏单元被激活函数激活后,才可将可视单元包含的数据传输至与所述可视单元相匹配的隐藏单元中。
具体地,所述可视单元和/或所述隐藏单元的激活函数如下:
Figure PCTCN2021082893-appb-000001
其中,E(v,h,θ)为激活值,I为所述可视层中可视单元的数目,J为所述隐藏层中隐藏单元的数目,a为所述可视层的偏置向量,b为所述隐藏层的偏置向量,w为所述可视层与所述隐藏层直接的权值矩阵,v为所述可视层中任一可视单元,h为所述隐藏层中任一隐藏单元,θ为预设的误差参数。
当所述激活函数的激活值大于激活阈值时,所述可视单元和/或所述隐藏单元被激活函数激活。在所述可视单元和/或所述隐藏单元被激活函数激活后,将所述可视单元和/或所述隐藏单元中包含的数据传输至与所述可视单元相匹配的隐藏单元中。
优选的,本申请实施例通过如下匹配算法将所述可视层中的可视单元与所述隐藏层中的隐藏单元进行匹配:
Figure PCTCN2021082893-appb-000002
其中,P(v,h,θ)为匹配值,v为所述可视层中任一可视单元,h为所述隐藏层中任一隐藏单元,θ为预设的误差参数,Z为所述特征提取网络的归一化因子,exp(-E(v,h,θ))为可视单元v与隐藏单元h匹配的期望。
较佳地,只有在所述可视层中的可视单元与所述隐藏层中的隐藏单元匹配完成后,被激活的可视层才可将数据传输给与所述可视层相匹配且已被激活的隐藏层。
进一步地,当给定所述可视层中的可视单元被激活后,对应的所述隐藏层中的隐藏单元也被激活的概率为P(v j=1|h;θ):
Figure PCTCN2021082893-appb-000003
其中,v j为所述隐藏层中的第j个隐藏单元,h为所述隐藏层中任一隐藏单元,θ为预设的误差参数,J为所述隐藏层中隐藏单元的数目,w为所述可视层与所述隐藏层直接的权值矩阵,b为所述隐藏层的偏置向量,δ为预设的概率系数。
当给定所述隐藏层中的隐藏单元被激活后,对应的所述可视层中的可视单元也被激活的概率为P(h i=1|v;θ):
Figure PCTCN2021082893-appb-000004
其中,h i为所述可视层中的第i个可视单元,v为所述可视层中任一可视单元,θ为预设的误差参数,I为所述可视层中可视单元的数目,w为所述可视层与所述隐藏层直接的权值矩阵,a为所述可视层的偏置向量,δ为预设的概率系数。
本申请实施例中,当给定所述可视层/隐藏层中的可视单元/隐藏单元被激活后,只有当与所述可视单元/隐藏单元相匹配的隐藏单元/可视单元被激活的概率为1时,表明所述隐藏单元/可视单元被激活。
本申请实施例中,利用多个所述特征提取网络中的多个可视层和隐藏层进行叠加,以实现更加精准地对所述预测意图标签进行特征提取。
具体地,所述通过特征提取网络的隐藏层利用机器学习算法对所述可视层标记的数据表征进行特征提取,包括:
利用如下所述机器学习算法对所述可视层标记的数据表征进行特征提取:
Figure PCTCN2021082893-appb-000005
其中,h为对所述可视层标记的数据表征进行特征提取得到的数据特征,Y为所述数据表征,w为所述可视层与所述隐藏层之间的权值矩阵,b为所述隐藏层的偏置向量。
进一步地,所述根据提取到的特征生成多个目标意图,包括:计算提取到的特征与预设的多个标准意图的相似度,确定所述相似度大于相似阈值的多个标准意图为所述目标意图,其中,本申请实施例可利用余弦相似度算法计算提取到的特征与预设的多个标准意图的相似度。
本申请实施例利用特征提取网络对预测意图标签进行特征提取并根据提取到的特征生成多个目标意图,利用提取的特征对用户进行意图预测,提高了对用户意图进行预测的精确度。
S4、计算所述多个目标意图中各目标意图的优先度。
本申请实施例中,所述计算所述多个目标意图中各目标意图的优先度,包括:
利用如下优先度算法计算所述多个目标意图中各目标意图的优先度:
Pir=δ*M k
其中,Pir为所述优先度,δ为预设权重系数,M k为所述多个目标意图中第k个目标意图。
S5、根据所述优先度从所述多个目标意图中选取预设数量的目标意图为用户意图。
本申请实施例中,所述根据所述优先度选取预设数量的目标意图为用户意图,包括:
按照所述优先度从大到小的顺序将所述多个目标意图进行排序;
按照从前向后的顺序从排序完成的所述多个目标意图中选取预设数量的目标意图为用户意图。
例如,所述多个目标意图包括:意图A、意图B、意图C和意图D,其中,意图A的优先度为50,意图B的优先度为40,意图C的优先度为60,意图D的优先度为30,因 此,按照优先度从大到小的顺序将多个目标意图排序为:意图C、意图A、意图B、意图D;当预设数量为2时,则按照从前向后的顺序从排序完成的多个目标意图中选取意图C和意图A为用户意图。
详细地,通过计算优先度,并按照优先度的大小将多个目标意图进行排序、筛选,有利于提高筛选出的目标意图的精确性。
本申请实施例通过获取用户的输入文本,将输入文本转化为语义向量,将输入文本转化为语义向量,可实现将文本信息进行数值化,有利于提高后续对输入文本进行分析的效率;对语义向量进行意图预测,得到输入文本的预测意图标签,可减少包含大量语义的语义向量中的数据量,有利于提高后续对用户意图进行分析的效率和精确性;利用特征提取网络对预测意图标签进行特征提取并根据提取到的特征生成多个目标意图,实现了利用提取的特征对用户进行意图预测,提高了对用户意图进行预测的精确性;通过计算优先度,并按照优先度的大小将多个目标意图进行排序、筛选,有利于提高筛选出的目标意图的精确性。因此本申请提出的用户意图分析方法,可以解决对用户意图进行识别的精确性不高的问题。
如图2所示,是本申请一实施例提供的用户意图分析装置的功能模块图。
本申请所述用户意图分析装置100可以安装于电子设备中。根据实现的功能,所述用户意图分析装置100可以包括电子印章生成模块101、二维码生成模块102、二维码解析模块103、印章记录查找模块104及电子印章验证模块105。本申请所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。
在本实施例中,关于各模块/单元的功能如下:
所述向量转化模块101,用于获取用户的输入文本,将所述输入文本转化为语义向量;
所述意图预测模块102,用于对所述语义向量进行意图预测,得到所述输入文本的预测意图标签;
所述特征提取模块103,用于利用特征提取网络对所述预测意图标签进行特征提取,根据提取到的特征生成多个目标意图;
所述优先度计算模块104,用于计算所述多个目标意图中各目标意图的优先度;
所述意图筛选模块105,用于根据所述优先度选取预设数量的目标意图为用户意图。
详细地,所述用户意图分析装置的各模块的具体实施方式如下:
所述向量转化模块101,用于获取用户的输入文本,将所述输入文本转化为语义向量。
本申请实施例中,所述用户的输入文本可以是用户提供的任何包含用户意图的文本,例如,用户对某业务信息进行询问的文本,用户对某产品进行咨询的文本等。
本申请实施例可利用具有数据抓取功能的python语句从区块链节点中获取用户预先存储的输入文本,利用区块链节点对数据的高吞吐性,可提高获取输入文本的效率。
详细地,所述向量转化模块101具体用于:
获取用户的输入文本;
构建文本向量化模型;
获取历史文本,对所述历史文本进行预设实体标记,得到训练文本;
利用所述训练文本对所述文本向量化模型进行迭代训练,直至所述文本向量化模型收敛,得到训练完成的文本向量化模型;
利用训练完成的文本向量化模型对所述输入文本进行转化,得到所述输入文本的语义向量。
本申请实施例中,利用深度学习网络模型构建初始向量化模型;详细地,使用Bert base网络模型作为初始向量化模型,在所述初始向量化模型后面接一层序列化标注算法网络,得到所述文本向量化模型,其中,所述序列化标注算法网络用于对输入至所述初始向量化 模型的字符的顺序进行约束,得到所述实体文本向量化模型。
详细地,所述对所述历史文本进行预设实体标记,得到训练文本,包括:
根据预设实体构建包含非预设实体字符标签、预设实体开始字符标签、预设实体中间字符标签的标签集合;
利用所述标签集合中的标签对所述历史文本中的每个字符进行标记,得到训练文本。
具体地,所述标签集合中包含多个预设标签,如,非预设实体字符标签、预设实体开始字符标签、预设实体中间字符标签,其中,所述非预设实体字符标签用于标记历史文本中非预设实体的字符,所述预设实体开始字符标签用于标记历史文本中预设实体的开始字符,所述预设实体中间字符标签用于标记历史文本中预设实体除开始字符之外的字符。
例如:历史文本包含的文本信息为“某金融公司提供零利率贷款”,预设实体为金融实体,标签实体集合包括:非金融实体字符标签、金融实体开始字符标签、金融实体中间字符标签,那么利用标签实体集合对文本信息“某金融公司提供零利率贷款”进行标记,“某金融”字符利用金融实体开始字符标签标记为金融实体开始字符,“公司”字符利用金融实体中间字符标签标记为金融实体中间字符,“提供”字符利用非金融实体字符标签标记为非金融实体字符,“零利率”字符利用非金融实体字符标签标签标记为非金融实体字符,“贷款”字符利用非金融实体字符标签标记为非金融实体字符。
进一步地,所述利用所述训练文本对所述文本向量化模型进行迭代训练,直至所述文本向量化模型收敛,包括:
将所述训练文本输入至所述文本向量化模型进行向量转化,得到预测文本向量;
获取所述训练文本对应的标准文本向量;
计算所述预测文本向量与所述标准文本向量之间的损失值,当所述损失值小于预设损失阈值时,确定所述文本向量化模型收敛。
本申请实施例中,可利用具有数据抓取功能的python语句从数据库中获取预先存储的标准文本向量。
详细地,本申请实施例可利用预设的损失函数计算所述预测文本向量与所述标准文本向量之间的损失值,所述损失函数包括但不限于交叉熵损失函数、平方误差损失函数和正则损失函数。当所述损失值小于预设的损失阈值时,则说明文本向量化模型已收敛,得到训练完成的文本向量化模型。
本申请实施例将输入文本转化为语义向量,可实现将文本信息进行数值化,有利于提高后续对输入文本进行分析的效率。
所述意图预测模块102,用于对所述语义向量进行意图预测,得到所述输入文本的预测意图标签。
本申请实施例中,所述意图预测模块102具体用于:
构建包含多层下采样层的意图预测网络;
利用所述意图预测网络中的前向下采样层对所述语义向量进行下采样,得到前向语义特征;
利用所述特征筛选模型中的后向下采样层对所述前向语义特征进行下采样,得到后向语义特征;
对获得的前向语义特征和后向语义特征进行特征融合,得到融合语义特征;
将所述融合语义特征作为所述输入文本的预测意图标签。
详细地,本申请实施例采用LSTM网络(Long Short-Term Memory Net,长短期记忆网络)构建包含多层下采样层的意图预测网络,利用所述LSTM网络中的多层下采样层结构对语义向量进行多次下采样,有利于提取出更精确的语义特征,提高生成的预测意图标签精确度。
具体地,所述前向下采样层与所述后向下采样层是相对而言的,例如,意图预测网络 包括4个下采样层,第一个对语义向量进行下采样的下采样层相对于第二个对语义向量进行下采样的下采样层、第三个对语义向量进行下采样的下采样层和第四个对语义向量进行下采样的下采样层来说是前向下采样层;第二个对标准语义向量进行下采样的下采样层相对于第一个对语义向量进行下采样的下采样层来说是后向下采样层,依此类推。
详细地,当前向下采样层为初始下采样层时,后向下采样层对前向下采样层得到的结果(前向语义特征)进行下采样,得到后向语义特征。
当前向下采样层不为初始下采样层时,后向下采样层对前向下采样层得到的结果(前向语义特征)进行下采样,得到后向语义特征。
具体地,例如,在第一下采样层中对所述胸腔图像进行下采样,得到第一语义特征;
在第二下采样层中对所述第一语义特征进行下采样,得到第二语义特征;
在第三下采样层中对所述第二语义特征进行下采样,得到第三语义特征;
在第四下采样层中对所述第三语义特征进行下采样,得到第四语义特征;
对所述第一语义特征、所述第二语义特征、所述第三语义特征和所述第四语义特征进行特征融合得到融合语义特征,并将融合语义特征作为输入文本的预测意图标签。
本申请实施例对语义向量进行意图预测,得到输入文本的预测意图标签,可减少包含大量语义的语义向量中的数据量,有利于提高后续对用户意图进行分析的效率。
所述特征提取模块103,用于利用特征提取网络对所述预测意图标签进行特征提取,根据提取到的特征生成多个目标意图。
本申请实施例中,所述特征提取网络包括多个可视层和多个隐藏层,其中,所述可视层包含多个可视单元,所述隐藏层包含多个隐藏单元,且多个可视层和多个隐藏层的数目对应,多个可视单元与多个隐藏单元的数目对应。
详细地,所述特征提取模块103具体用于:
通过特征提取网络的可视层标记所述预测意图标签的数据表征;
通过特征提取网络的隐藏层利用机器学习算法对所述可视层标记的数据表征进行特征提取;
根据提取到的特征生成多个目标意图。
具体地,在进行特征提取的过程中,通过特征提取网络的可视层中的每个可视单元标记所述意图标签中一个数据表征,通过特征提取网络的隐藏层中的每个隐藏单元提取所述数据表征,所述隐藏层中的每个隐藏单元基于机器学习算法提取与所述隐藏单元相匹配的可视单元标记的数据表征。
本申请实施例中,所述可视单元和所述隐藏单元的状态由布尔值进行表示,如,0和1,其中,0表示未激活状态,1表示激活状态。当所述可视单元和/或所述隐藏单元被激活函数激活后,才可将可视单元包含的数据传输至与所述可视单元相匹配的隐藏单元中。
具体地,所述可视单元和/或所述隐藏单元的激活函数如下:
Figure PCTCN2021082893-appb-000006
其中,E(v,h,θ)为激活值,I为所述可视层中可视单元的数目,J为所述隐藏层中隐藏单元的数目,a为所述可视层的偏置向量,b为所述隐藏层的偏置向量,w为所述可视层与所述隐藏层直接的权值矩阵,v为所述可视层中任一可视单元,h为所述隐藏层中任一隐藏单元,θ为预设的误差参数。
当所述激活函数的激活值大于激活阈值时,所述可视单元和/或所述隐藏单元被激活函数激活。在所述可视单元和/或所述隐藏单元被激活函数激活后,将所述可视单元和/或所述隐藏单元中包含的数据传输至与所述可视单元相匹配的隐藏单元中。
优选的,本申请实施例通过如下匹配算法将所述可视层中的可视单元与所述隐藏层中的隐藏单元进行匹配:
Figure PCTCN2021082893-appb-000007
其中,P(v,h,θ)为匹配值,v为所述可视层中任一可视单元,h为所述隐藏层中任一隐藏单元,θ为预设的误差参数,Z为所述特征提取网络的归一化因子,exp(-E(v,h,θ))为可视单元v与隐藏单元h匹配的期望。
较佳地,只有在所述可视层中的可视单元与所述隐藏层中的隐藏单元匹配完成后,被激活的可视层才可将数据传输给与所述可视层相匹配且已被激活的隐藏层。
进一步地,当给定所述可视层中的可视单元被激活后,对应的所述隐藏层中的隐藏单元也被激活的概率为P(v j=1|h;θ):
Figure PCTCN2021082893-appb-000008
其中,v j为所述隐藏层中的第j个隐藏单元,h为所述隐藏层中任一隐藏单元,θ为预设的误差参数,J为所述隐藏层中隐藏单元的数目,w为所述可视层与所述隐藏层直接的权值矩阵,b为所述隐藏层的偏置向量,δ为预设的概率系数。
当给定所述隐藏层中的隐藏单元被激活后,对应的所述可视层中的可视单元也被激活的概率为P(h i=1|v;θ):
Figure PCTCN2021082893-appb-000009
其中,h i为所述可视层中的第i个可视单元,v为所述可视层中任一可视单元,θ为预设的误差参数,I为所述可视层中可视单元的数目,w为所述可视层与所述隐藏层直接的权值矩阵,a为所述可视层的偏置向量,δ为预设的概率系数。
本申请实施例中,当给定所述可视层/隐藏层中的可视单元/隐藏单元被激活后,只有当与所述可视单元/隐藏单元相匹配的隐藏单元/可视单元被激活的概率为1时,表明所述隐藏单元/可视单元被激活。
本申请实施例中,利用多个所述特征提取网络中的多个可视层和隐藏层进行叠加,以实现更加精准地对所述预测意图标签进行特征提取。
具体地,所述通过特征提取网络的隐藏层利用机器学习算法对所述可视层标记的数据表征进行特征提取,包括:
利用如下所述机器学习算法对所述可视层标记的数据表征进行特征提取:
Figure PCTCN2021082893-appb-000010
其中,h为对所述可视层标记的数据表征进行特征提取得到的数据特征,Y为所述数据表征,w为所述可视层与所述隐藏层之间的权值矩阵,b为所述隐藏层的偏置向量。
进一步地,所述根据提取到的特征生成多个目标意图,包括:计算提取到的特征与预设的多个标准意图的相似度,确定所述相似度大于相似阈值的多个标准意图为所述目标意图,其中,本申请实施例可利用余弦相似度算法计算提取到的特征与预设的多个标准意图的相似度。
本申请实施例利用特征提取网络对预测意图标签进行特征提取并根据提取到的特征生成多个目标意图,利用提取的特征对用户进行意图预测,提高了对用户意图进行预测的精确度。
所述优先度计算模块104,用于计算所述多个目标意图中各目标意图的优先度。
本申请实施例中,所述优先度计算模块104具体用于:
利用如下优先度算法计算所述多个目标意图中各目标意图的优先度:
Pir=δ*M k
其中,Pir为所述优先度,δ为预设权重系数,M k为所述多个目标意图中第k个目标意图。
所述意图筛选模块105,用于根据所述优先度选取预设数量的目标意图为用户意图。
本申请实施例中,所述意图筛选模块105具体用于:
按照所述优先度从大到小的顺序将所述多个目标意图进行排序;
按照从前向后的顺序从排序完成的所述多个目标意图中选取预设数量的目标意图为用户意图。
例如,所述多个目标意图包括:意图A、意图B、意图C和意图D,其中,意图A的优先度为50,意图B的优先度为40,意图C的优先度为60,意图D的优先度为30,因此,按照优先度从大到小的顺序将多个目标意图排序为:意图C、意图A、意图B、意图D;当预设数量为2时,则按照从前向后的顺序从排序完成的多个目标意图中选取意图C和意图A为用户意图。
详细地,通过计算优先度,并按照优先度的大小将多个目标意图进行排序、筛选,有利于提高筛选出的目标意图的精确性。
本申请实施例通过获取用户的输入文本,将输入文本转化为语义向量,将输入文本转化为语义向量,可实现将文本信息进行数值化,有利于提高后续对输入文本进行分析的效率;对语义向量进行意图预测,得到输入文本的预测意图标签,可减少包含大量语义的语义向量中的数据量,有利于提高后续对用户意图进行分析的效率和精确性;利用特征提取网络对预测意图标签进行特征提取并根据提取到的特征生成多个目标意图,实现了利用提取的特征对用户进行意图预测,提高了对用户意图进行预测的精确性;通过计算优先度,并按照优先度的大小将多个目标意图进行排序、筛选,有利于提高筛选出的目标意图的精确性。因此本申请提出的用户意图分析装置,可以解决对用户意图进行识别的精确性不高的问题。
如图3所示,是本申请一实施例提供的实现用户意图分析方法的电子设备的结构示意图。
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如用户意图分析程序12。
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如用户意图分析程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如用户意图分析程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。
图3仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图3示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。
所述电子设备1中的所述存储器11存储的用户意图分析程序12是多个指令的组合,在所述处理器10中运行时,可以实现:
获取用户的输入文本,将所述输入文本转化为语义向量;
对所述语义向量进行意图预测,得到所述输入文本的预测意图标签;
利用特征提取网络对所述预测意图标签进行特征提取,根据提取到的特征生成多个目标意图;
计算所述多个目标意图中各目标意图的优先度;
根据所述优先度从所述多个目标意图中选取预设数量的目标意图为用户意图。
具体地,所述处理器10对上述指令的具体实现方法可参考图1对应实施例中相关步骤的标记,在此不赘述。
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。所述计算机可读存储介质可以是易失性的,也可以是非易失性的。例如,所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。
本申请还提供一种计算机可读存储介质,所述可读存储介质存储有计算机程序,所述计算机程序在被电子设备的处理器所执行时,可以实现:
获取用户的输入文本,将所述输入文本转化为语义向量;
对所述语义向量进行意图预测,得到所述输入文本的预测意图标签;
利用特征提取网络对所述预测意图标签进行特征提取,根据提取到的特征生成多个目标意图;
计算所述多个目标意图中各目标意图的优先度;
根据所述优先度从所述多个目标意图中选取预设数量的目标意图为用户意图。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所标记的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。

Claims (20)

  1. 一种用户意图分析方法,其中,所述方法包括:
    获取用户的输入文本,将所述输入文本转化为语义向量;
    对所述语义向量进行意图预测,得到所述输入文本的预测意图标签;
    利用特征提取网络对所述预测意图标签进行特征提取,根据提取到的特征生成多个目标意图;
    计算所述多个目标意图中各目标意图的优先度;
    根据所述优先度从所述多个目标意图中选取预设数量的目标意图为用户意图。
  2. 如权利要求1所述的用户意图分析方法,其中,所述将所述输入文本转化为语义向量,包括:
    构建文本向量化模型;
    获取历史文本,对所述历史文本进行预设实体标记,得到训练文本;
    利用所述训练文本对所述文本向量化模型进行迭代训练,直至所述文本向量化模型收敛,得到训练完成的文本向量化模型;
    利用训练完成的文本向量化模型对所述输入文本进行转化,得到所述输入文本的语义向量。
  3. 如权利要求2所述的用户意图分析方法,其中,所述对所述历史文本进行预设实体标记,得到训练文本,包括:
    根据预设实体构建包含非预设实体字符标签、预设实体开始字符标签、预设实体中间字符标签的标签集合;
    利用所述标签集合中的标签对所述历史文本中的每个字符进行标记,得到训练文本。
  4. 如权利要求2所述的用户意图分析方法,其中,所述利用所述训练文本对所述文本向量化模型进行迭代训练,直至所述文本向量化模型收敛,包括:
    将所述训练文本输入至所述文本向量化模型进行向量转化,得到预测文本向量;
    获取所述训练文本对应的标准文本向量;
    计算所述预测文本向量与所述标准文本向量之间的损失值,当所述损失值小于预设损失阈值时,确定所述文本向量化模型收敛。
  5. 如权利要求1所述的用户意图分析方法,其中,所述利用特征提取网络对所述预测意图标签进行特征提取,包括:
    通过特征提取网络的可视层标记所述预测意图标签的数据表征;
    通过特征提取网络的隐藏层利用机器学习算法对所述可视层标记的数据表征进行特征提取。
  6. 如权利要求5所述的用户意图分析方法,其中,所述通过特征提取网络的隐藏层利用机器学习算法对所述可视层标记的数据表征进行特征提取,包括:
    利用如下所述机器学习算法对所述可视层标记的数据表征进行特征提取:
    Figure PCTCN2021082893-appb-100001
    其中,h为对所述可视层描述的数据表征进行特征提取得到的数据特征,Y为所述数据表征,w为所述可视层与所述隐藏层之间的权值矩阵,b为所述隐藏层的偏置向量。
  7. 如权利要求1至6中任一项所述的用户意图分析方法,其中,所述对所述语义向量进行意图预测,得到所述输入文本的预测意图标签,包括:
    构建包含多层下采样层的意图预测网络;
    利用所述意图预测网络中的前向下采样层对所述语义向量进行下采样,得到前向语义特征;
    利用所述特征筛选模型中的后向下采样层对所述前向语义特征进行下采样,得到后向语义特征;
    对获得的前向语义特征和后向语义特征进行特征融合,得到融合语义特征;
    将所述融合语义特征作为所述输入文本的预测意图标签。
  8. 一种用户意图分析装置,其中,所述装置包括:
    向量转化模块,用于获取用户的输入文本,将所述输入文本转化为语义向量;
    意图预测模块,用于对所述语义向量进行意图预测,得到所述输入文本的预测意图标签;
    特征提取模块,用于利用特征提取网络对所述预测意图标签进行特征提取,根据提取到的特征生成多个目标意图;
    优先度计算模块,用于计算所述多个目标意图中各目标意图的优先度;
    意图筛选模块,用于根据所述优先度选取预设数量的目标意图为用户意图。
  9. 一种电子设备,其中,所述电子设备包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:
    获取用户的输入文本,将所述输入文本转化为语义向量;
    对所述语义向量进行意图预测,得到所述输入文本的预测意图标签;
    利用特征提取网络对所述预测意图标签进行特征提取,根据提取到的特征生成多个目标意图;
    计算所述多个目标意图中各目标意图的优先度;
    根据所述优先度从所述多个目标意图中选取预设数量的目标意图为用户意图。
  10. 如权利要求9所述的电子设备,其中,所述将所述输入文本转化为语义向量,包括:
    构建文本向量化模型;
    获取历史文本,对所述历史文本进行预设实体标记,得到训练文本;
    利用所述训练文本对所述文本向量化模型进行迭代训练,直至所述文本向量化模型收敛,得到训练完成的文本向量化模型;
    利用训练完成的文本向量化模型对所述输入文本进行转化,得到所述输入文本的语义向量。
  11. 如权利要求10所述的电子设备,其中,所述对所述历史文本进行预设实体标记,得到训练文本,包括:
    根据预设实体构建包含非预设实体字符标签、预设实体开始字符标签、预设实体中间字符标签的标签集合;
    利用所述标签集合中的标签对所述历史文本中的每个字符进行标记,得到训练文本。
  12. 如权利要求10所述的电子设备,其中,所述利用所述训练文本对所述文本向量化模型进行迭代训练,直至所述文本向量化模型收敛,包括:
    将所述训练文本输入至所述文本向量化模型进行向量转化,得到预测文本向量;
    获取所述训练文本对应的标准文本向量;
    计算所述预测文本向量与所述标准文本向量之间的损失值,当所述损失值小于预设损失阈值时,确定所述文本向量化模型收敛。
  13. 如权利要求9所述的电子设备,其中,所述利用特征提取网络对所述预测意图标签进行特征提取,包括:
    通过特征提取网络的可视层标记所述预测意图标签的数据表征;
    通过特征提取网络的隐藏层利用机器学习算法对所述可视层标记的数据表征进行特征提取。
  14. 如权利要求13所述的电子设备,其中,所述通过特征提取网络的隐藏层利用机器学习算法对所述可视层标记的数据表征进行特征提取,包括:
    利用如下所述机器学习算法对所述可视层标记的数据表征进行特征提取:
    Figure PCTCN2021082893-appb-100002
    其中,h为对所述可视层描述的数据表征进行特征提取得到的数据特征,Y为所述数据表征,w为所述可视层与所述隐藏层之间的权值矩阵,b为所述隐藏层的偏置向量。
  15. 如权利要求9至14中任一项所述的电子设备,其中,所述对所述语义向量进行意图预测,得到所述输入文本的预测意图标签,包括:
    构建包含多层下采样层的意图预测网络;
    利用所述意图预测网络中的前向下采样层对所述语义向量进行下采样,得到前向语义特征;
    利用所述特征筛选模型中的后向下采样层对所述前向语义特征进行下采样,得到后向语义特征;
    对获得的前向语义特征和后向语义特征进行特征融合,得到融合语义特征;
    将所述融合语义特征作为所述输入文本的预测意图标签。
  16. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下步骤:
    获取用户的输入文本,将所述输入文本转化为语义向量;
    对所述语义向量进行意图预测,得到所述输入文本的预测意图标签;
    利用特征提取网络对所述预测意图标签进行特征提取,根据提取到的特征生成多个目标意图;
    计算所述多个目标意图中各目标意图的优先度;
    根据所述优先度从所述多个目标意图中选取预设数量的目标意图为用户意图。
  17. 如权利要求16所述的计算机可读存储介质,其中,所述将所述输入文本转化为语义向量,包括:
    构建文本向量化模型;
    获取历史文本,对所述历史文本进行预设实体标记,得到训练文本;
    利用所述训练文本对所述文本向量化模型进行迭代训练,直至所述文本向量化模型收敛,得到训练完成的文本向量化模型;
    利用训练完成的文本向量化模型对所述输入文本进行转化,得到所述输入文本的语义向量。
  18. 如权利要求17所述的计算机可读存储介质,其中,所述对所述历史文本进行预设实体标记,得到训练文本,包括:
    根据预设实体构建包含非预设实体字符标签、预设实体开始字符标签、预设实体中间字符标签的标签集合;
    利用所述标签集合中的标签对所述历史文本中的每个字符进行标记,得到训练文本。
  19. 如权利要求17所述的计算机可读存储介质,其中,所述利用所述训练文本对所述文本向量化模型进行迭代训练,直至所述文本向量化模型收敛,包括:
    将所述训练文本输入至所述文本向量化模型进行向量转化,得到预测文本向量;
    获取所述训练文本对应的标准文本向量;
    计算所述预测文本向量与所述标准文本向量之间的损失值,当所述损失值小于预设损失阈值时,确定所述文本向量化模型收敛。
  20. 如权利要求16所述的计算机可读存储介质,其中,所述利用特征提取网络对所述预测意图标签进行特征提取,包括:
    通过特征提取网络的可视层标记所述预测意图标签的数据表征;
    通过特征提取网络的隐藏层利用机器学习算法对所述可视层标记的数据表征进行特征提取。
PCT/CN2021/082893 2020-11-19 2021-03-25 用户意图分析方法、装置、电子设备及计算机存储介质 Ceased WO2021208696A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011302192.3 2020-11-19
CN202011302192.3A CN112380870A (zh) 2020-11-19 2020-11-19 用户意图分析方法、装置、电子设备及计算机存储介质

Publications (1)

Publication Number Publication Date
WO2021208696A1 true WO2021208696A1 (zh) 2021-10-21

Family

ID=74584375

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/082893 Ceased WO2021208696A1 (zh) 2020-11-19 2021-03-25 用户意图分析方法、装置、电子设备及计算机存储介质

Country Status (2)

Country Link
CN (1) CN112380870A (zh)
WO (1) WO2021208696A1 (zh)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114548925A (zh) * 2022-02-21 2022-05-27 中国平安人寿保险股份有限公司 线上活动邀请方法、装置、设备及存储介质
CN114722281A (zh) * 2022-04-07 2022-07-08 平安科技(深圳)有限公司 基于用户画像及用户选课行为的培训课程配置方法、装置
CN114741511A (zh) * 2022-04-19 2022-07-12 国网冀北电力有限公司电力科学研究院 电力调度操作票实体信息抽取方法及装置
CN115081425A (zh) * 2022-06-13 2022-09-20 北京师范大学 一种辅导意图的识别方法和基于辅导意图的个性化辅导方法
CN115757900A (zh) * 2022-12-20 2023-03-07 邢台达喆网络科技有限公司 应用人工智能模型的用户需求分析方法及系统
CN116189193A (zh) * 2023-04-25 2023-05-30 杭州镭湖科技有限公司 一种基于样本信息的数据存储可视化方法和装置
CN118551368A (zh) * 2024-07-24 2024-08-27 广东电力通信科技有限公司 一种字符指令意图识别方法及系统

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112380870A (zh) * 2020-11-19 2021-02-19 平安科技(深圳)有限公司 用户意图分析方法、装置、电子设备及计算机存储介质
CN114281959B (zh) * 2021-10-27 2024-03-19 腾讯科技(深圳)有限公司 语句处理的方法、装置、设备、介质及计算机程序产品
CN114254622B (zh) * 2021-12-10 2024-06-14 马上消费金融股份有限公司 一种意图识别方法和装置
CN114398903B (zh) * 2022-01-21 2023-06-20 平安科技(深圳)有限公司 意图识别方法、装置、电子设备及存储介质
CN115309983B (zh) * 2022-07-21 2023-05-12 国家康复辅具研究中心 一种辅具适配方法、系统及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109858030A (zh) * 2019-02-11 2019-06-07 北京邮电大学 双向的意图槽值交叉相关的任务型对话理解系统及方法
CN109992671A (zh) * 2019-04-10 2019-07-09 出门问问信息科技有限公司 意图识别方法、装置、设备及存储介质
CN110928997A (zh) * 2019-12-04 2020-03-27 北京文思海辉金信软件有限公司 意图识别方法、装置、电子设备及可读存储介质
US20200160851A1 (en) * 2018-11-20 2020-05-21 Institute For Information Industry Semantic analysis method, semantic analysis system and non-transitory computer-readable medium
CN111860661A (zh) * 2020-07-24 2020-10-30 中国平安财产保险股份有限公司 基于用户行为的数据分析方法、装置、电子设备及介质
CN112380870A (zh) * 2020-11-19 2021-02-19 平安科技(深圳)有限公司 用户意图分析方法、装置、电子设备及计算机存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111563208B (zh) * 2019-01-29 2023-06-30 株式会社理光 一种意图识别的方法、装置及计算机可读存储介质
CN110287283B (zh) * 2019-05-22 2023-08-01 中国平安财产保险股份有限公司 意图模型训练方法、意图识别方法、装置、设备及介质
CN111931513B (zh) * 2020-07-08 2023-11-14 泰康保险集团股份有限公司 一种文本的意图识别方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200160851A1 (en) * 2018-11-20 2020-05-21 Institute For Information Industry Semantic analysis method, semantic analysis system and non-transitory computer-readable medium
CN109858030A (zh) * 2019-02-11 2019-06-07 北京邮电大学 双向的意图槽值交叉相关的任务型对话理解系统及方法
CN109992671A (zh) * 2019-04-10 2019-07-09 出门问问信息科技有限公司 意图识别方法、装置、设备及存储介质
CN110928997A (zh) * 2019-12-04 2020-03-27 北京文思海辉金信软件有限公司 意图识别方法、装置、电子设备及可读存储介质
CN111860661A (zh) * 2020-07-24 2020-10-30 中国平安财产保险股份有限公司 基于用户行为的数据分析方法、装置、电子设备及介质
CN112380870A (zh) * 2020-11-19 2021-02-19 平安科技(深圳)有限公司 用户意图分析方法、装置、电子设备及计算机存储介质

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114548925A (zh) * 2022-02-21 2022-05-27 中国平安人寿保险股份有限公司 线上活动邀请方法、装置、设备及存储介质
CN114548925B (zh) * 2022-02-21 2024-04-30 中国平安人寿保险股份有限公司 线上活动邀请方法、装置、设备及存储介质
CN114722281A (zh) * 2022-04-07 2022-07-08 平安科技(深圳)有限公司 基于用户画像及用户选课行为的培训课程配置方法、装置
CN114722281B (zh) * 2022-04-07 2024-04-12 平安科技(深圳)有限公司 基于用户画像及用户选课行为的培训课程配置方法、装置
CN114741511A (zh) * 2022-04-19 2022-07-12 国网冀北电力有限公司电力科学研究院 电力调度操作票实体信息抽取方法及装置
CN115081425A (zh) * 2022-06-13 2022-09-20 北京师范大学 一种辅导意图的识别方法和基于辅导意图的个性化辅导方法
CN115081425B (zh) * 2022-06-13 2024-12-31 北京师范大学 一种辅导意图的识别方法和基于辅导意图的个性化辅导方法
CN115757900A (zh) * 2022-12-20 2023-03-07 邢台达喆网络科技有限公司 应用人工智能模型的用户需求分析方法及系统
CN115757900B (zh) * 2022-12-20 2023-08-01 创贸科技(深圳)集团有限公司 应用人工智能模型的用户需求分析方法及系统
CN116189193A (zh) * 2023-04-25 2023-05-30 杭州镭湖科技有限公司 一种基于样本信息的数据存储可视化方法和装置
CN116189193B (zh) * 2023-04-25 2023-11-10 杭州镭湖科技有限公司 一种基于样本信息的数据存储可视化方法和装置
CN118551368A (zh) * 2024-07-24 2024-08-27 广东电力通信科技有限公司 一种字符指令意图识别方法及系统

Also Published As

Publication number Publication date
CN112380870A (zh) 2021-02-19

Similar Documents

Publication Publication Date Title
WO2021208696A1 (zh) 用户意图分析方法、装置、电子设备及计算机存储介质
CN113312461A (zh) 基于自然语言处理的智能问答方法、装置、设备及介质
WO2021212682A1 (zh) 知识抽取方法、装置、电子设备及存储介质
WO2022222300A1 (zh) 开放关系抽取方法、装置、电子设备及存储介质
CN112597312A (zh) 文本分类方法、装置、电子设备及可读存储介质
CN108305050B (zh) 报案信息及服务需求信息的提取方法、装置、设备及介质
CN113157739B (zh) 跨模态检索方法、装置、电子设备及存储介质
CN109992763A (zh) 语言标注处理方法、系统、电子设备及计算机可读介质
CN112559687B (zh) 问题识别及查询方法、装置、电子设备及存储介质
CN115309864B (zh) 评论文本的情感智能分类方法、装置、电子设备及介质
CN113553431B (zh) 用户标签提取方法、装置、设备及介质
CN113360654B (zh) 文本分类方法、装置、电子设备及可读存储介质
CN117390213B (zh) 基于oscar的图文检索模型的训练方法和实现图文检索的方法
US20230133690A1 (en) Processing forms using artificial intelligence models
CN113627187B (zh) 命名实体识别方法、装置、电子设备及可读存储介质
WO2023173554A1 (zh) 坐席违规话术识别方法、装置、电子设备、存储介质
CN116450829A (zh) 医疗文本分类方法、装置、设备及介质
CN115510219A (zh) 话术推荐方法、装置、电子设备及存储介质
CN115146052A (zh) 基于知识图谱的信息检索方法、装置、设备及存储介质
CN114840684A (zh) 基于医疗实体的图谱构建方法、装置、设备及存储介质
WO2021151303A1 (zh) 命名实体对齐方法、装置、电子设备及可读存储介质
CN113723114A (zh) 基于多意图识别的语义分析方法、装置、设备及存储介质
CN113254814A (zh) 网络课程视频打标签方法、装置、电子设备及介质
US20210295036A1 (en) Systematic language to enable natural language processing on technical diagrams
CN114398482B (zh) 一种词典构造方法、装置、电子设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21788569

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21788569

Country of ref document: EP

Kind code of ref document: A1