WO2022142106A1 - 文本分析方法、装置、电子设备及可读存储介质 - Google Patents

文本分析方法、装置、电子设备及可读存储介质 Download PDF

Info

Publication number
WO2022142106A1
WO2022142106A1 PCT/CN2021/096526 CN2021096526W WO2022142106A1 WO 2022142106 A1 WO2022142106 A1 WO 2022142106A1 CN 2021096526 W CN2021096526 W CN 2021096526W WO 2022142106 A1 WO2022142106 A1 WO 2022142106A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
network
processed
feature extraction
matrix
Prior art date
Application number
PCT/CN2021/096526
Other languages
English (en)
French (fr)
Inventor
张楠
王健宗
瞿晓阳
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022142106A1 publication Critical patent/WO2022142106A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present application relates to the field of semantic parsing, and in particular, to a text analysis method, apparatus, electronic device, and readable storage medium.
  • the inventor realizes that the current text analysis can only perform intention recognition or slot filling alone, and at the same time, the feature extraction network of text analysis cannot use the best feature extraction network, resulting in low efficiency of text analysis.
  • a text analysis method comprising:
  • a text analysis model is constructed according to the text feature extraction network, and the text matrix to be processed is analyzed by using the text analysis model to obtain an analysis result.
  • a text analysis device includes:
  • a text processing module configured to obtain the text to be processed, perform word segmentation on the text to be processed, and obtain a word sequence; perform vector transformation and vector splicing processing on the word sequence to obtain a text matrix to be processed;
  • the feature network building module is used to construct a text feature extraction network based on the neural structure search mechanism
  • a text analysis module configured to construct a text analysis model according to the text feature extraction network, and use the text analysis model to analyze the to-be-processed text matrix to obtain an analysis result.
  • An electronic device comprising:
  • the processor executes the computer program stored in the memory to realize the following steps:
  • a text analysis model is constructed according to the text feature extraction network, and the text matrix to be processed is analyzed by using the text analysis model to obtain an analysis result.
  • a computer-readable storage medium having at least one computer program stored in the computer-readable storage medium, the at least one computer program being executed by a processor in an electronic device to implement the following steps:
  • a text analysis model is constructed according to the text feature extraction network, and the text matrix to be processed is analyzed by using the text analysis model to obtain an analysis result.
  • the present application improves the efficiency of text analysis.
  • FIG. 1 is a schematic flowchart of a text analysis method provided by an embodiment of the present application.
  • FIG. 2 is a schematic block diagram of a text analysis apparatus provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of the internal structure of an electronic device implementing a text analysis method provided by an embodiment of the present application
  • the embodiment of the present application provides a text analysis method.
  • the execution body of the text analysis method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server and a terminal.
  • the text analysis method can be executed by software or hardware installed in a terminal device or a server device, and the software can 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, and the like.
  • the text analysis method includes:
  • the text to be processed is language text that needs to be processed for intention recognition and slot filling. Further, in order to better perform text analysis on the text to be processed, word segmentation is performed on the text to be processed. , to get the word sequence.
  • the word segmentation is performed on the to-be-processed text to obtain a word sequence
  • a preset word segmentation dictionary is used to segment the to-be-processed text to obtain a word set. All words are sequentially combined according to the position of each word in the text to be processed to obtain the word sequence. For example: the text to be processed is "today is a good weather”, and the word set obtained after word segmentation of the text to be processed includes five words including "yes", "a”, "good”, “weather” and "today” words, these five words are combined in order according to the position of each word in the text to be processed, to obtain a word sequence [today, yes, one, good, weather].
  • the word sequence in order to facilitate the subsequent model to better process the word sequence and reduce data occupation, is subjected to vector transformation and vector splicing processing to obtain a text matrix to be processed.
  • performing vector transformation and vector splicing processing on the word sequence to obtain a text matrix to be processed including: using a preset coding algorithm to convert each word in the word sequence into a column vector to obtain Corresponding word vectors, all the word vectors are combined horizontally according to the corresponding word order in the word sequence to obtain the text matrix to be processed, preferably, the encoding algorithm is a onehot encoding algorithm, such as: the There are two words in the word sequence, the first word A and the second word B.
  • the word A is converted into a column vector by the onehot encoding algorithm to obtain the word vector a
  • the word B is converted into a column vector by the onehot encoding algorithm to obtain the word vector b
  • the word vector a and the word vector b are horizontally spliced, that is, the word vector a is used as the first column of the matrix
  • the word vector b is used as the second column of the matrix to obtain the to-be-processed text matrix.
  • the neural structure search (Neural Architecture Search, NAS) mechanism is a method to find the best performing architecture from all possible architectures in the search space by following a specific search strategy, which mainly includes search space, search strategy and performance evaluation strategy.
  • a text feature extraction network can be automatically constructed by using the neural structure search mechanism.
  • the construction of a text feature extraction network based on the neural structure search mechanism includes:
  • the neural network units are arranged and combined using a preset connection method to obtain a search space;
  • the neural network unit in the embodiment of the present application includes 3x3 convolution, 5x5 convolution, 7x7 convolution, max pooling, and average pooling.
  • the connection modes include enabling incoming connections and disabling incoming connections.
  • the search space is a collection of multiple network architectures, constructed by permuting and combining neural network units and connection methods.
  • performing a search in the search space using an evolutionary algorithm to obtain a text feature extraction network including:
  • a plurality of network architectures are randomly selected in the search space and added to a preset network architecture set in turn to obtain a population set, wherein the network architecture set is a blank set that can be added to a preset number of network architectures, and the population set is added to All network architectures are added to the history set; for example, the network architecture set is a blank set of seven network architectures that can be added, and seven network architectures are randomly selected in the search space and added to the preset network architecture set in turn to obtain a population set. Random sampling is performed on the population set to obtain a candidate set, and the peak signal-to-noise ratio of each network architecture in the candidate set is calculated;
  • selecting the network architecture corresponding to the highest peak signal-to-noise ratio for structural modification includes: enabling or disabling the connection mode in the network architecture, such as controlling to enable or disable incoming connections; or replacing or adding or deleting the network architecture. the neural network unit.
  • the embodiment of the present application further includes:
  • a text training set is constructed, and the large super-network is trained by using the training set; wherein the text training set is a set including a plurality of matrices of the same type as the text matrix to be processed but with different contents.
  • the parameters of the network structure in the search space are updated according to the large super-network that has been trained.
  • the large super network can simulate any specific network architecture in the search space. Therefore, each network architecture can directly inherit the weight parameters of the large super-network after training, instead of training thousands of independent architectures.
  • the text feature extraction network described in the embodiments of the present application is the architecture with the highest accuracy that is automatically searched in the search space using an optimization algorithm, which does not require manual network design, reduces errors caused by human factors, and saves time in designing the network structure. time.
  • the text feature extraction network can only perform text feature extraction, in order to further perform intention recognition and slot filling processing on the text, it is also necessary to use the text feature extraction network to construct a text analysis model.
  • the use of the text feature extraction network to construct a text analysis model includes: adding a serialization labeling algorithm network and a pooling classification network to the text feature extraction network to obtain the text analysis model , wherein the serialized labeling algorithm network is used to perform slot filling and marking on the features extracted by the text feature extraction network, the pooling classification network includes a maximum pooling layer and a softmax layer, and the maximum pooling layer is a pair of The features extracted by the text feature extraction network are subjected to feature fusion to obtain a fusion matrix, and the softmax layer classifies the fusion matrix to obtain the text intent of the text to be processed.
  • the serialized labeling algorithm network and the pooling classification The network shares the features extracted by the text feature extraction network, which improves the efficiency of text analysis.
  • using the text analysis model to analyze the text matrix to be processed includes: acquiring a historical text matrix set, where the historical text matrix set is a set of multiple historical text matrices, The historical text matrix is a text feature matrix corresponding to texts with different contents of the text to be processed, and the text feature matrix is of the same type as the text matrix to be processed.
  • Perform slot filling marking and text intent marking on each historical text matrix in the historical text matrix set to obtain a text matrix training set and use the text matrix training set to iteratively train the text analysis model until the text analysis The model converges, and a trained text analysis model is obtained, and the to-be-processed text matrix is analyzed by using the trained text analysis model to obtain an analysis result.
  • the word sequence [today, yes, one, good, weather] contains five words
  • the to-be-processed text matrix is 5 columns
  • the to-be-processed text matrix is input to the text analysis completed by the training Model
  • the serialized labeling algorithm network in the trained text analysis model outputs the slot filling results
  • the pooled classification network in the trained text analysis model outputs the text intent recognition results, and summarizes the slot filling results and all the results.
  • the text intent recognition result is described, and the analysis result is obtained.
  • the analysis result may be stored in a blockchain node.
  • FIG. 2 it is a functional block diagram of the text analysis device of the present application.
  • the text analysis apparatus 100 described in this application may be installed in an electronic device.
  • the text analysis device may include a text processing module 101, a feature network construction module 102, and a text analysis module 103.
  • the modules described in the present invention may also be referred to as units, which refer to a type of device that can be used by an electronic device processor. A series of computer program segments that are executed and capable of performing a fixed function and are stored in the memory of an electronic device.
  • each module/unit is as follows:
  • the text processing module 101 is used to obtain the text to be processed, perform word segmentation on the text to be processed to obtain a word sequence; perform vector transformation and vector splicing processing on the word sequence to obtain a text matrix to be processed.
  • the text to be processed is language text that needs to be processed for intention recognition and slot filling. Further, in order to better perform text analysis on the text to be processed, the text processing module 101 The text to be processed is word-segmented to obtain a word sequence.
  • the text processing module 101 performs word segmentation on the text to be processed to obtain a word sequence, and uses a preset word segmentation dictionary to segment the text to be processed to obtain a word set, All words in the described word set are sequentially combined according to the position of each word in the to-be-processed text to obtain the word sequence.
  • the text to be processed is "today is a good weather”
  • the word set obtained after word segmentation of the text to be processed includes five words including "yes”, “one”, “good”, “weather” and "today” words, these five words are combined in order according to the position of each word in the text to be processed, to obtain a word sequence [today, yes, one, good, weather].
  • the text processing module 101 performs vector transformation and vector splicing processing on the word sequence to obtain a text matrix to be processed.
  • the text processing module 101 uses the following means to perform vector transformation and vector splicing processing to obtain a text matrix to be processed, including: using a preset coding algorithm to convert each word in the word sequence Converting column vectors to obtain corresponding word vectors, and horizontally combining all the word vectors according to the corresponding word order in the word sequence to obtain the text matrix to be processed, preferably, the encoding algorithm is a onehot encoding algorithm , such as: there are two words in the word sequence, which are the first word A and the second word B, use the onehot coding algorithm to convert the word A into a column vector to obtain the word vector a, and use the onehot coding algorithm to convert the word B
  • the word vector b is obtained for the column vector, and the word vector a and the word vector b are horizontally spliced, that is, the word vector a is taken as the first column of the matrix, and the word vector b is taken as the second column of the matrix, Obtain the to perform vector transformation and vector splic
  • the feature network building module 102 is used to build a text feature extraction network based on a neural structure search mechanism.
  • the neural structure search (Neural Architecture Search, NAS) mechanism is a method to find the best performing architecture from all possible architectures in the search space by following a specific search strategy, which mainly includes search space, search strategy and performance evaluation strategy.
  • a text feature extraction network can be automatically constructed by using the neural structure search mechanism.
  • the feature network building module 102 uses the following means to build a text feature extraction network, including:
  • the neural network units are arranged and combined using a preset connection method to obtain a search space;
  • the neural network unit in the embodiment of the present application includes 3x3 convolution, 5x5 convolution, 7x7 convolution, max pooling, and average pooling.
  • the connection method is an incoming connection.
  • the search space is a collection of multiple network architectures, constructed by permuting and combining neural network units and connection methods.
  • the feature network building module 102 uses the following means to search in the search space to obtain a text feature extraction network, including:
  • a plurality of network architectures are randomly selected in the search space and added to a preset network architecture set in turn to obtain a population set, wherein the network architecture set is a blank set that can be added to a preset number of network architectures, and the population set is added to All network architectures are added to the history set; for example, the network architecture set is a blank set of seven network architectures that can be added, and seven network architectures are randomly selected in the search space and added to the preset network architecture set in turn to obtain a population set.
  • Random sampling is performed on the population set to obtain a candidate set, and the peak signal-to-noise ratio of each network architecture in the candidate set is calculated;
  • the selecting the network architecture corresponding to the highest peak signal-to-noise ratio for structural modification includes: enabling or disabling a connection method in the network architecture, enabling or disabling a connection method in the network architecture, such as enabling or disabling incoming connect; or replace or add or delete neural network units in the network architecture.
  • the method further includes:
  • a text training set is constructed, and the large super-network is trained by using the training set; wherein the text training set is a set including a plurality of matrices of the same type as the text matrix to be processed but with different contents.
  • the parameters of the network structure in the search space are updated according to the large super-network that has been trained.
  • the large super network can simulate any specific network architecture in the search space. Therefore, each network architecture can directly inherit the weight parameters of the large super-network after training, instead of training thousands of independent architectures.
  • the text feature extraction network described in the embodiments of the present application is the architecture with the highest accuracy that is automatically searched in the search space using an optimization algorithm, which does not require manual network design, reduces errors caused by human factors, and saves time in designing the network structure. time.
  • the text analysis module 103 is configured to construct a text analysis model according to the text feature extraction network, and use the text analysis model to analyze the to-be-processed text matrix to obtain an analysis result.
  • the text analysis module 103 Since the text feature extraction network can only perform text feature extraction, in order to further perform intention recognition and slot filling processing on the text, the text analysis module 103 also needs to use the text feature extraction network to construct a text analysis model.
  • the text analysis module 103 uses the following means to construct a text analysis model, including: adding a serialization labeling algorithm network and a pooling classification network to the text feature extraction network to obtain the text analysis model model, wherein the serialized labeling algorithm network is used to perform slot filling and marking on the features extracted by the text feature extraction network, the pooling classification network includes a maximum pooling layer and a softmax layer, and the maximum pooling layer Perform feature fusion on the features extracted by the text feature extraction network to obtain a fusion matrix, the softmax layer classifies the fusion matrix, and obtains the text intent of the text to be processed, the serialization annotation algorithm network and the pooling
  • the classification network shares the features extracted by the text feature extraction network, which improves the efficiency of text analysis.
  • the text analysis module 103 uses the following means to analyze the text matrix to be processed, including: acquiring a historical text matrix set, wherein the historical text matrix set is a plurality of historical texts A set of matrices, where the historical text matrix is a text feature matrix corresponding to texts with different contents of the text to be processed, and the text feature matrix is of the same type as the text matrix to be processed.
  • the word sequence [today, yes, one, good, weather] contains five words
  • the to-be-processed text matrix has 5 columns
  • the to-be-processed text matrix is input to the text analysis completed by the training Model
  • the serialized labeling algorithm network in the trained text analysis model outputs the slot filling results
  • the pooled classification network in the trained text analysis model outputs the text intent recognition results, and summarizes the slot filling results and all the results.
  • the text intent recognition result is described, and the analysis result is obtained.
  • the analysis result may be stored in a blockchain node.
  • FIG. 3 it is a schematic structural diagram of an electronic device implementing the text analysis method 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, such as a text analysis program 12, stored in the memory 11 and executable on the processor 10.
  • a computer program such as a text analysis program 12 stored in the memory 11 and executable on the processor 10.
  • 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 , such as 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 pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital) device equipped on the electronic device 1. , SD) card, flash memory 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 not only be used to store application software installed in the electronic device 1 and various types of data, such as code of a text analysis program, etc., but also can be used to temporarily store data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits.
  • Central Processing Unit CPU
  • microprocessor digital processing chip
  • graphics processor and combination of various control chips, etc.
  • the processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and by running or executing the program or module (such as text) stored in the memory 11. Analysis programs, etc.), and call data stored in the memory 11 to perform various functions of the electronic device 1 and process data.
  • the bus may be a peripheral component interconnect standard (perIPheral component interconnect, referred to as PCI) bus or extended industry standard structure (extended industry standard architecture, referred to as 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 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 those shown in the figure. components, or a combination of certain components, or a different arrangement of components.
  • the electronic device 1 may also include a power source (such as a battery) for powering the various components, preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power source can be managed by the power source.
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components.
  • the electronic device 1 may further include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface, optionally, 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.
  • a network interface optionally, 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 further include a user interface, and the user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), optionally, 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, and the like.
  • the display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
  • the text analysis program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple computer programs. When running in the processor 10, it can realize:
  • a text analysis model is constructed according to the text feature extraction network, and the text matrix to be processed is analyzed by using the text analysis model to obtain an analysis result.
  • modules/units integrated in the electronic device 1 may be stored in a computer-readable storage medium.
  • the computer-readable medium may be non-volatile or volatile.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
  • Embodiments of the present application may further provide a computer-readable storage medium, where the computer-readable storage medium may be volatile or non-volatile, and the readable storage medium stores a computer program, and the The computer program, when executed by the processor of the electronic device, can realize:
  • a text analysis model is constructed according to the text feature extraction network, and the text matrix to be processed is analyzed by using the text analysis model to obtain an analysis result.
  • the computer usable storage medium may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function, and the like; using the created data, etc.
  • modules described as separate components may or may not be physically separated, and components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
  • the blockchain referred to in this application is a new application mode of computer technologies 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 to verify its Validity of information (anti-counterfeiting) and 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.

Abstract

一种文本分析方法、及对应装置、电子设备以及可读存储介质,所述方法包括:获取待处理文本,对所述待处理文本进行单词分割,得到单词序列(S1);将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵(S2);基于神经结构搜索机制构建文本特征提取网络(S3);根据所述文本特征提取网络构建文本分析模型,利用所述文本分析模型对所述待处理文本矩阵进行分析,得到分析结果(S4)。另外,所述分析结果可以存储在区块链节点中。通过以上方式可以提高文本分析的效率。

Description

文本分析方法、装置、电子设备及可读存储介质
本申请要求于2020年12月31日提交中国专利局、申请号为CN202011640963.X,发明名称为“文本分析方法、装置、电子设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及语义解析领域,尤其涉及一种文本分析方法、装置、电子设备及可读存储介质。
背景技术
随着人工智能的发展,为了更好地让机器理解人的语言,需要对人的语言文本进行文本分析,通过文本分析实现意图识别和槽填充,意图识别可以帮助机器理解用户意图,槽填充可以为满足用户意图所需的关键信息进行抽取和提炼,因此,文本分析实现意图识别和槽填充是影响机器理解人文本的关键技术。
技术问题
发明人意识到目前的文本分析只能单独进行意图识别或槽填充,同时,文本分析的特征提取网络不能使用最佳的特征提取网络,导致文本分析的效率低。
技术解决方案
一种文本分析方法,包括:
获取待处理文本,对所述待处理文本进行单词分割,得到单词序列;
将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵;
基于神经结构搜索机制构建文本特征提取网络;
根据所述文本特征提取网络构建文本分析模型,利用所述文本分析模型对所述待处理文本矩阵进行分析,得到分析结果。
一种文本分析装置,所述装置包括:
文本处理模块,用于获取待处理文本,对所述待处理文本进行单词分割,得到单词序列;将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵;
特征网络构建模块,用于基于神经结构搜索机制构建文本特征提取网络;
文本分析模块,用于根据所述文本特征提取网络构建文本分析模型,利用所述文本分析模型对所述待处理文本矩阵进行分析,得到分析结果。
一种电子设备,所述电子设备包括:
存储器,存储至少一个计算机程序;及
处理器,执行所述存储器中存储的计算机程序以实现如下步骤:
获取待处理文本,对所述待处理文本进行单词分割,得到单词序列;
将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵;
基于神经结构搜索机制构建文本特征提取网络;
根据所述文本特征提取网络构建文本分析模型,利用所述文本分析模型对所述待处理文本矩阵进行分析,得到分析结果。
一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个计算机程序,所述至少一个计算机程序被电子设备中的处理器执行以实现如下步骤:
获取待处理文本,对所述待处理文本进行单词分割,得到单词序列;
将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵;
基于神经结构搜索机制构建文本特征提取网络;
根据所述文本特征提取网络构建文本分析模型,利用所述文本分析模型对所述待处理文本矩阵进行分析,得到分析结果。
本申请提高了文本分析的效率。
附图说明
图1为本申请一实施例提供的文本分析方法的流程示意图;
图2为本申请一实施例提供的文本分析装置的模块示意图;
图3为本申请一实施例提供的实现文本分析方法的电子设备的内部结构示意图;
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
本发明的实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例提供一种文本分析方法。所述文本分析方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述文本分析方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。
参照图1所示的本申请一实施例提供的文本分析方法的流程示意图,在本申请实施例中,所述文本分析方法包括:
S1、获取待处理文本,对所述待处理文本进行单词分割,得到单词序列;
本申请实施例中,所述待处理文本是需要进行意图识别及槽填充处理的语言文本,进一步地,为了更好地对所述待处理文本进行文本分析,对所述待处理文本进行单词分割,得到单词序列。
详细地,本申请实施例中,所述对所述待处理文本进行单词分割,得到单词序列,利用预设的分词词典对所述待处理文本进行分词,得到单词集,将所述单词集中的所有单词按照每个单词在所述待处理文本中的位置进行顺序组合,得到所述单词序列。例如:所述待处理文本为“今天是个好天气”,对所述待处理文本进行分词后得到单词集包含“是”、“个”、“好”、“天气”、“今天”共五个单词,将这五个单词按照每个单词在所述待处理文本中的位置进行顺序组合,得到单词序列[今天,是,个,好,天气]。
S2、将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵;
本申请实施例中,为了便于后续模型更好地对所述单词序列进行处理,降低数据占用,将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵。
详细地,本申请实施例中,将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵,包括:利用预设编码算法将所述单词序列中的每个单词转化列向量,得到对应的单词向量,将所有所述单词向量按照所述单词序列中对应的单词顺序进行横向组合,得到所述待处理文本矩阵,较佳地,所述编码算法为onehot编码算法,如:所述单词序列中共有两个单词分别为第一个单词A和第二个单词B,利用onehot编码算法将单词A转化为列向量得到单词向量a,利用onehot编码算法将单词B转化为列向量得到单词向量b,将所述单词向量a与所述单词向量b进行横向拼接,即将所述单词向量a作为矩阵的第一列,将所述单词向量b作为矩阵的第二列,得到所述待处理文本矩阵。
S3、基于神经结构搜索机制构建文本特征提取网络;
本申请实施例中所述神经结构搜索(Neural Architecture Search, NAS)机制是一种通过遵循特定的搜索策略从搜索空间中所有可能的架构中找出性能最佳的架构的方法,主要包括搜索空间、搜索策略和性能评估策略。本申请实施例中为了对所述待处理文本进行特征提取,使用所述神经结构搜索机制,可以自动构建文本特征提取网络。
详细地,所述基于神经结构搜索机制构建文本特征提取网络,包括:
获取预设的神经网络单元;
利用预设的连接方式对所述神经网络单元进行排列组合处理,得到搜索空间;
利用进化算法在所述搜索空间内进行搜索,得到所述文本特征提取网络。
其中,本申请实施例中所述神经网络单元包括3x3卷积,5x5卷积,7x7卷积,最大池化,平均池化。所述连接方式包括启用传入连接和禁用传入连接。所述搜索空间是包括多种网络架构的集合,由神经网络单元和连接方式进行排列组合构建。
进一步地,所述使用进化算法在所述搜索空间内进行搜索,得到文本特征提取网络,包括:
在所述搜索空间中随机选择多个网络架构依次加入预设网络架构集合,得到种群集合,其中,所述网络架构集合为可以加入预设数目网络架构的空白集合,并将所述种群集合中的所有网络架构都加入历史集中;例如:所述网络架构集合为可以加入的七个网络架构空白集合,在所述搜索空间中随机选择七个网络架构依次加入预设网络架构集合得到种群集合。对所述种群集合进行随机采样得到候选集合,计算所述候选集合中每个网络架构的峰值信噪比;
选择最高峰值信噪比对应的网络架构进行结构修改,得到子代网络架构;
将所述子代网络架构添加至所述种群集合和所述历史集合中,并将所述种群集合中的第一个网络架构进行删除;
返回上述对所述种群集合进行随机采样得到候选集合步骤,直到所述历史集合中网络架构的数量大于预设阈时值,选择最高峰值信噪比对应的网络架构,得到所述文本特征提取网络。
其中,所述选择最高峰值信噪比对应的网络架构进行结构修改,包括:启用或禁用所述网络架构中的连接方式,如控制启用或禁用传入连接;或替换或增删所述网络架构中的神经网络单元。
可选地,本申请实施例在使用进化算法在所述搜索空间内进行搜索得到文本特征提取网络之前,还包括:
将所述搜索空间中的所有网络结构进行组合,得到大型超网络;
构建文本训练集,并利用所述训练集对所述大型超网络进行训练;其中所述文本训练集为包含多个与所述待处理文本矩阵类型相同但内容不同的矩阵的集合。
根据训练完成的所述大型超网络更新所述搜索空间中的网络结构的参数。
其中,所述大型超网络可以模拟搜索空间中的任何特定网络架构。因此,每个网络架构可以直接继承训练后所述大型超网络的权值参数,而不需要训练数千个独立的架构。
本申请实施例中所述文本特征提取网络是使用优化算法在搜索空间中自动搜索出来的精度最高的架构,不需要人工进行设计网络,减少了人为因素导致的误差,并节省了设计网络结构的时间。
S4、根据所述文本特征提取网络构建文本分析模型,利用所述文本分析模型对所述待处理文本矩阵进行分析,得到分析结果;
由于所述文本特征提取网络只能进行文本特征提取的,为了进一步地对文本进行意图识别及槽填充处理,还需要利用所述文本特征提取网络构建文本分析模型。
详细地,本申请实施例中,所述利用所述文本特征提取网络构建文本分析模型,包括:将所述文本特征提取网络增加序列化标注算法网络及池化分类网络,得到所述文本分析模型,其中,所述序列化标注算法网络用来对所述文本特征提取网络提取得到的特征进行槽填充标记,所述池化分类网络包含最大池化层及softmax层,所述最大池化层对所述文本特征提取网络提取得到的特征进行特征融合得到融合矩阵,所述softmax层对所述融合矩阵进行分类,得到待处理文本的文本意图,所述序列化标注算法网络与所述池化分类网络共用所述文本特征提取网络提取得到的特征,提升了文本分析的效率。
进一步地,本申请实施例中,利用所述文本分析模型对所述待处理文本矩阵进行分析,包括:获取历史文本矩阵集,其中,所述历史文本矩阵集为多个历史文本矩阵的集合,所述历史文本矩阵为与所述待处理文本内容不同的文本对应的文本特征矩阵,所述文本特征矩阵与所述待处理文本矩阵类型相同。对所述历史文本矩阵集中的每个历史文本矩阵进行槽填充标记及文本意图标记,得到文本矩阵训练集,利用所述文本矩阵训练集对所述文本分析模型进行迭代训练,直至所述文本分析模型收敛,得到训练完成的文本分析模型,利用所述训练完成的文本分析模型对所述待处理文本矩阵进行分析,得到分析结果。例如:所述单词序列[今天,是,个,好,天气],包含五个单词,那么所述待处理文本矩阵为5列,将所述待处理文本矩阵输入至所述训练完成的文本分析模型,所述训练完成的文本分析模型中的序列化标注算法网络输出槽填充结果,所述训练完成的文本分析模型中池化分类网络,输出文本意图识别结果,汇总所述槽填充结果及所述文本意图识别结果,得到所述分析结果。
本申请另一实施例中,为了保证数据的隐私性,所述分析结果可以存储在区块链节点中。
如图2所示,是本申请文本分析装置的功能模块图。
本申请所述文本分析装置100可以安装于电子设备中。根据实现的功能,所述文本分析装置可以包括文本处理模块101、特征网络构建模块102、文本分析模块103,本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。
在本实施例中,关于各模块/单元的功能如下:
所述文本处理模块101用于获取待处理文本,对所述待处理文本进行单词分割,得到单词序列;将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵。
本申请实施例中,所述待处理文本是需要进行意图识别及槽填充处理的语言文本,进一步地,为了更好地对所述待处理文本进行文本分析,所述文本处理模块101对所述待处理文本进行单词分割,得到单词序列。
详细地,本申请实施例中,所述文本处理模块101对所述待处理文本进行单词分割,得到单词序列,利用预设的分词词典对所述待处理文本进行分词,得到单词集,将所述单词集中的所有单词按照每个单词在所述待处理文本中的位置进行顺序组合,得到所述单词序列。例如:所述待处理文本为“今天是个好天气”,对所述待处理文本进行分词后得到单词集包含“是”、“个”、“好”、“天气”、“今天”共五个单词,将这五个单词按照每个单词在所述待处理文本中的位置进行顺序组合,得到单词序列[今天,是,个,好,天气]。
本申请实施例中,为了便于后续模型更好地对所述单词序列进行处理,降低数据占用,所述文本处理模块101将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵。
详细地,本申请实施例中,所述文本处理模块101利用下述手段进行向量转化及向量拼接处理,得到待处理文本矩阵,包括:利用预设编码算法将所述单词序列中的每个单词转化列向量,得到对应的单词向量,将所有所述单词向量按照所述单词序列中对应的单词顺序进行横向组合,得到所述待处理文本矩阵,较佳地,所述编码算法为onehot编码算法,如:所述单词序列中共有两个单词分别为第一个单词A和第二个单词B,利用onehot编码算法将单词A转化为列向量得到单词向量a,利用onehot编码算法将单词B转化为列向量得到单词向量b,将所述单词向量a与所述单词向量b进行横向拼接,即将所述单词向量a作为矩阵的第一列,将所述单词向量b作为矩阵的第二列,得到所述待处理文本矩阵。
所述特征网络构建模块102用于基于神经结构搜索机制构建文本特征提取网络。
本申请实施例中所述神经结构搜索(Neural Architecture Search, NAS)机制是一种通过遵循特定的搜索策略从搜索空间中所有可能的架构中找出性能最佳的架构的方法,主要包括搜索空间、搜索策略和性能评估策略。本申请实施例中为了对所述待处理文本进行特征提取,使用所述神经结构搜索机制,可以自动构建文本特征提取网络。
详细地,所述特征网络构建模块102利用下述手段构建文本特征提取网络,包括:
获取预设的神经网络单元;
利用预设的连接方式对所述神经网络单元进行排列组合处理,得到搜索空间;
利用进化算法在所述搜索空间内进行搜索,得到所述文本特征提取网络。
其中,本申请实施例中所述神经网络单元包括3x3卷积,5x5卷积,7x7卷积,最大池化,平均池化。所述连接方式为传入连接。所述搜索空间是包括多种网络架构的集合,由神经网络单元和连接方式进行排列组合构建。
进一步地,所述特征网络构建模块102利用下述手段在所述搜索空间内进行搜索,得到文本特征提取网络,包括:
在所述搜索空间中随机选择多个网络架构依次加入预设网络架构集合,得到种群集合,其中,所述网络架构集合为可以加入预设数目网络架构的空白集合,并将所述种群集合中的所有网络架构都加入历史集中;例如:所述网络架构集合为可以加入的七个网络架构空白集合,在所述搜索空间中随机选择七个网络架构依次加入预设网络架构集合得到种群集合。
对所述种群集合进行随机采样得到候选集合,计算所述候选集合中每个网络架构的峰值信噪比;
选择最高峰值信噪比对应的网络架构进行结构修改,得到子代网络架构;
将所述子代网络架构添加至所述种群集合和所述历史集合中,并将所述种群集合中的最早加入的网络架构进行删除;
返回上述对所述种群集合进行随机采样得到候选集合步骤,直到所述历史集合中网络架构的数量大于预设阈时值,选择最高峰值信噪比对应的网络架构,得到所述文本特征提取网络。
其中,所述选择最高峰值信噪比对应的网络架构进行结构修改,包括:启用或禁用所述网络架构中的连接方式启用或禁用所述网络架构中的连接方式,如控制启用或禁用传入连接;或替换或增删所述网络架构中的神经网络单元。
可选地,本申请实施例所述特征网络构建模块102在利用进化算法在所述搜索空间内进行搜索得到文本特征提取网络之前,还包括:
将所述搜索空间中的所有网络结构进行组合,得到大型超网络;
构建文本训练集,并利用所述训练集对所述大型超网络进行训练;其中所述文本训练集为包含多个与所述待处理文本矩阵类型相同但内容不同的矩阵的集合。
根据训练完成的所述大型超网络更新所述搜索空间中的网络结构的参数。
其中,所述大型超网络可以模拟搜索空间中的任何特定网络架构。因此,每个网络架构可以直接继承训练后所述大型超网络的权值参数,而不需要训练数千个独立的架构。
本申请实施例中所述文本特征提取网络是使用优化算法在搜索空间中自动搜索出来的精度最高的架构,不需要人工进行设计网络,减少了人为因素导致的误差,并节省了设计网络结构的时间。
所述文本分析模块103用于根据所述文本特征提取网络构建文本分析模型,利用所述文本分析模型对所述待处理文本矩阵进行分析,得到分析结果。
由于所述文本特征提取网络只能进行文本特征提取的,为了进一步地对文本进行意图识别及槽填充处理,所述文本分析模块103还需要利用所述文本特征提取网络构建文本分析模型。
详细地,本申请实施例中,所述文本分析模块103利用下述手段构建文本分析模型,包括:将所述文本特征提取网络增加序列化标注算法网络及池化分类网络,得到所述文本分析模型,其中,所述序列化标注算法网络用来对所述文本特征提取网络提取得到的特征进行槽填充标记,所述池化分类网络包含最大池化层及softmax层,所述最大池化层对所述文本特征提取网络提取得到的特征进行特征融合得到融合矩阵,所述softmax层对所述融合矩阵进行分类,得到待处理文本的文本意图,所述序列化标注算法网络与所述池化分类网络共用所述文本特征提取网络提取得到的特征,提升了文本分析的效率。
进一步地,本申请实施例中,所述文本分析模块103利用下述手段对所述待处理文本矩阵进行分析,包括:获取历史文本矩阵集,其中,所述历史文本矩阵集为多个历史文本矩阵的集合,所述历史文本矩阵为与所述待处理文本内容不同的文本对应的文本特征矩阵,所述文本特征矩阵与所述待处理文本矩阵类型相同。对所述历史文本矩阵集中的每个历史文本矩阵进行槽填充标记及文本意图标记,得到文本矩阵训练集,利用所述文本矩阵训练集对所述文本分析模型进行迭代训练,直至所述文本分析模型收敛,得到训练完成的文本分析模型,利用所述训练完成的文本分析模型对所述待处理文本矩阵进行分析,得到分析结果。例如:所述单词序列[今天,是,个,好,天气],包含五个单词,那么所述待处理文本矩阵为5列,将所述待处理文本矩阵输入至所述训练完成的文本分析模型,所述训练完成的文本分析模型中的序列化标注算法网络输出槽填充结果,所述训练完成的文本分析模型中池化分类网络,输出文本意图识别结果,汇总所述槽填充结果及所述文本意图识别结果,得到所述分析结果。
本申请另一实施例中,为了保证数据的隐私性,所述分析结果可以存储在区块链节点中。
如图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的应用软件及各类数据,例如文本分析程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
所述处理器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. 如权利要求1所述的文本分析方法,其中,所述基于神经结构搜索机制构建文本特征提取网络,包括:
    获取预设的神经网络单元;
    利用预设的连接方式对所述神经网络单元进行排列组合处理,得到搜索空间;
    利用进化算法在所述搜索空间内进行搜索,得到所述文本特征提取网络。
  4. 如权利要求3所述的文本分析方法,其中,所述利用进化算法在所述搜索空间内进行搜索,得到所述文本特征提取网络,包括:
    在所述搜索空间中随机选择多个网络架构依次加入预设网络架构集合,得到种群集合,并将所述种群集合中的网络架构加入历史集中;
    对所述种群集合进行随机采样得到候选集合,计算所述候选集合中每个网络架构的峰值信噪比;
    选择最高峰值信噪比对应的网络架构进行结构修改,得到子代网络架构;
    将所述子代网络架构添加至所述种群集合和所述历史集合中,并将所述种群集合中的最早加入的网络架构进行删除;
    返回上述对所述种群集合进行随机采样得到候选集合步骤,直到所述历史集合中网络架构的数量大于预设阈值时,选择最高峰值信噪比对应的网络架构,得到所述文本特征提取网络。
  5. 如权利要求4所述的文本分析方法,其中,所述选择最高峰值信噪比对应的网络架构进行结构修改,包括:
    启用或禁用所述网络架构中的连接方式;或
    替换或增删所述网络架构中的神经网络单元。
  6. 如权利要求1所述的文本分析方法,其中,所述根据所述文本特征提取网络构建文本分析模型,包括:
    在所述文本特征提取网络后增加序列化标注算法网络及池化分类网络,得到所述文本分析模型。
  7. 如权利要求1所述的文本分析方法,其中,所述利用所述文本分析模型对所述待处理文本矩阵进行分析,得到分析结果,包括:
    获取历史文本矩阵集,对所述历史文本矩阵集中包含的每个历史文本矩阵进行槽填充标记及文本意图标记,得到文本矩阵训练集;
    利用所述文本矩阵训练集对所述文本分析模型进行迭代训练,直至所述文本分析模型收敛,得到训练完成的文本分析模型;
    利用所述训练完成的文本分析模型对所述待处理文本矩阵进行分析,得到所述分析结果。
  8. 一种文本分析装置,其中,包括:
    文本处理模块,用于获取待处理文本,对所述待处理文本进行单词分割,得到单词序列;将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵;
    特征网络构建模块,用于基于神经结构搜索机制构建文本特征提取网络;
    文本分析模块,用于根据所述文本特征提取网络构建文本分析模型,利用所述文本分析模型对所述待处理文本矩阵进行分析,得到分析结果。
  9. 一种电子设备,其中,所述电子设备包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的计算机程序指令,所述计算机程序指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:
    获取待处理文本,对所述待处理文本进行单词分割,得到单词序列;
    将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵;
    基于神经结构搜索机制构建文本特征提取网络;
    根据所述文本特征提取网络构建文本分析模型,利用所述文本分析模型对所述待处理文本矩阵进行分析,得到分析结果。
  10. 如权利要求9所述的电子设备,其中,所述将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵,包括:
    利用预设编码算法将所述单词序列中的每个单词转化为列向量,得到对应的单词向量;
    将所有所述单词向量按照所述单词序列中对应的单词顺序进行横向组合,得到所述待处理文本矩阵。
  11. 如权利要求9所述的电子设备,其中,所述基于神经结构搜索机制构建文本特征提取网络,包括:
    获取预设的神经网络单元;
    利用预设的连接方式对所述神经网络单元进行排列组合处理,得到搜索空间;
    利用进化算法在所述搜索空间内进行搜索,得到所述文本特征提取网络。
  12. 如权利要求11所述的电子设备,其中,所述利用进化算法在所述搜索空间内进行搜索,得到所述文本特征提取网络,包括:
    在所述搜索空间中随机选择多个网络架构依次加入预设网络架构集合,得到种群集合,并将所述种群集合中的网络架构加入历史集中;
    对所述种群集合进行随机采样得到候选集合,计算所述候选集合中每个网络架构的峰值信噪比;
    选择最高峰值信噪比对应的网络架构进行结构修改,得到子代网络架构;
    将所述子代网络架构添加至所述种群集合和所述历史集合中,并将所述种群集合中的最早加入的网络架构进行删除;
    返回上述对所述种群集合进行随机采样得到候选集合步骤,直到所述历史集合中网络架构的数量大于预设阈值时,选择最高峰值信噪比对应的网络架构,得到所述文本特征提取网络。
  13. 如权利要求12所述的电子设备,其中,所述选择最高峰值信噪比对应的网络架构进行结构修改,包括:
    启用或禁用所述网络架构中的连接方式;或
    替换或增删所述网络架构中的神经网络单元。
  14. 如权利要求9所述的电子设备,其中,所述根据所述文本特征提取网络构建文本分析模型,包括:
    在所述文本特征提取网络后增加序列化标注算法网络及池化分类网络,得到所述文本分析模型。
  15. 如权利要求9所述的电子设备,其中,所述利用所述文本分析模型对所述待处理文本矩阵进行分析,得到分析结果,包括:
    获取历史文本矩阵集,对所述历史文本矩阵集中包含的每个历史文本矩阵进行槽填充标记及文本意图标记,得到文本矩阵训练集;
    利用所述文本矩阵训练集对所述文本分析模型进行迭代训练,直至所述文本分析模型收敛,得到训练完成的文本分析模型;
    利用所述训练完成的文本分析模型对所述待处理文本矩阵进行分析,得到所述分析结果。
  16. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下步骤:
    获取待处理文本,对所述待处理文本进行单词分割,得到单词序列;
    将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵;
    基于神经结构搜索机制构建文本特征提取网络;
    根据所述文本特征提取网络构建文本分析模型,利用所述文本分析模型对所述待处理文本矩阵进行分析,得到分析结果。
  17. 如权利要求16所述的计算机可读存储介质,其中,所述将所述单词序列进行向量转化及向量拼接处理,得到待处理文本矩阵,包括:
    利用预设编码算法将所述单词序列中的每个单词转化为列向量,得到对应的单词向量;
    将所有所述单词向量按照所述单词序列中对应的单词顺序进行横向组合,得到所述待处理文本矩阵。
  18. 如权利要求16所述的计算机可读存储介质,其中,所述基于神经结构搜索机制构建文本特征提取网络,包括:
    获取预设的神经网络单元;
    利用预设的连接方式对所述神经网络单元进行排列组合处理,得到搜索空间;
    利用进化算法在所述搜索空间内进行搜索,得到所述文本特征提取网络。
  19. 如权利要求18所述的计算机可读存储介质,其中,所述利用进化算法在所述搜索空间内进行搜索,得到所述文本特征提取网络,包括:
    在所述搜索空间中随机选择多个网络架构依次加入预设网络架构集合,得到种群集合,并将所述种群集合中的网络架构加入历史集中;
    对所述种群集合进行随机采样得到候选集合,计算所述候选集合中每个网络架构的峰值信噪比;
    选择最高峰值信噪比对应的网络架构进行结构修改,得到子代网络架构;
    将所述子代网络架构添加至所述种群集合和所述历史集合中,并将所述种群集合中的最早加入的网络架构进行删除;
    返回上述对所述种群集合进行随机采样得到候选集合步骤,直到所述历史集合中网络架构的数量大于预设阈值时,选择最高峰值信噪比对应的网络架构,得到所述文本特征提取网络。
  20. 如权利要求19所述的计算机可读存储介质,其中,所述选择最高峰值信噪比对应的网络架构进行结构修改,包括:
    启用或禁用所述网络架构中的连接方式;或
    替换或增删所述网络架构中的神经网络单元。
PCT/CN2021/096526 2020-12-31 2021-05-27 文本分析方法、装置、电子设备及可读存储介质 WO2022142106A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011640963.X 2020-12-31
CN202011640963.XA CN112733551A (zh) 2020-12-31 2020-12-31 文本分析方法、装置、电子设备及可读存储介质

Publications (1)

Publication Number Publication Date
WO2022142106A1 true WO2022142106A1 (zh) 2022-07-07

Family

ID=75609083

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/096526 WO2022142106A1 (zh) 2020-12-31 2021-05-27 文本分析方法、装置、电子设备及可读存储介质

Country Status (2)

Country Link
CN (1) CN112733551A (zh)
WO (1) WO2022142106A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116384410A (zh) * 2023-04-14 2023-07-04 天津睿锋智联科技有限公司 一种数字工厂的可视化处理方法及系统
CN117273015A (zh) * 2023-11-22 2023-12-22 湖南省水运建设投资集团有限公司 一种语义分析的电子文件归档分类方法

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112733551A (zh) * 2020-12-31 2021-04-30 平安科技(深圳)有限公司 文本分析方法、装置、电子设备及可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160321243A1 (en) * 2014-01-10 2016-11-03 Cluep Inc. Systems, devices, and methods for automatic detection of feelings in text
CN109299142A (zh) * 2018-11-14 2019-02-01 中山大学 一种基于进化算法的卷积神经网络结构搜索方法及系统
CN109766540A (zh) * 2018-12-10 2019-05-17 平安科技(深圳)有限公司 通用文本信息提取方法、装置、计算机设备和存储介质
CN112052675A (zh) * 2020-08-21 2020-12-08 北京邮电大学 一种非结构化文本的敏感信息检测方法及检测装置
CN112733551A (zh) * 2020-12-31 2021-04-30 平安科技(深圳)有限公司 文本分析方法、装置、电子设备及可读存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160321243A1 (en) * 2014-01-10 2016-11-03 Cluep Inc. Systems, devices, and methods for automatic detection of feelings in text
CN109299142A (zh) * 2018-11-14 2019-02-01 中山大学 一种基于进化算法的卷积神经网络结构搜索方法及系统
CN109766540A (zh) * 2018-12-10 2019-05-17 平安科技(深圳)有限公司 通用文本信息提取方法、装置、计算机设备和存储介质
CN112052675A (zh) * 2020-08-21 2020-12-08 北京邮电大学 一种非结构化文本的敏感信息检测方法及检测装置
CN112733551A (zh) * 2020-12-31 2021-04-30 平安科技(深圳)有限公司 文本分析方法、装置、电子设备及可读存储介质

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116384410A (zh) * 2023-04-14 2023-07-04 天津睿锋智联科技有限公司 一种数字工厂的可视化处理方法及系统
CN117273015A (zh) * 2023-11-22 2023-12-22 湖南省水运建设投资集团有限公司 一种语义分析的电子文件归档分类方法
CN117273015B (zh) * 2023-11-22 2024-02-13 湖南省水运建设投资集团有限公司 一种语义分析的电子文件归档分类方法

Also Published As

Publication number Publication date
CN112733551A (zh) 2021-04-30

Similar Documents

Publication Publication Date Title
WO2022134759A1 (zh) 关键词生成方法、装置、电子设备及计算机存储介质
US11836081B2 (en) Methods and systems for handling data received by a state machine engine
WO2022142106A1 (zh) 文本分析方法、装置、电子设备及可读存储介质
WO2022160449A1 (zh) 文本分类方法、装置、电子设备及存储介质
CN112541338A (zh) 相似文本匹配方法、装置、电子设备及计算机存储介质
TW201246081A (en) Method and apparatus for compiling regular expressions
WO2021212683A1 (zh) 基于法律知识图谱的查询方法、装置、电子设备及介质
CN104603742A (zh) 用于状态机引擎的结果产生
WO2022105179A1 (zh) 生物特征图像识别方法、装置、电子设备及可读存储介质
WO2022141858A1 (zh) 行人检测方法、装置、电子设备及存储介质
CN112380343A (zh) 问题解析方法、装置、电子设备及存储介质
WO2022222300A1 (zh) 开放关系抽取方法、装置、电子设备及存储介质
CN104487956A (zh) 用于使用状态机引擎中的状态向量数据的方法及系统
CN113157927A (zh) 文本分类方法、装置、电子设备及可读存储介质
CN112528013A (zh) 文本摘要提取方法、装置、电子设备及存储介质
CN114491047A (zh) 多标签文本分类方法、装置、电子设备及存储介质
US20180113951A1 (en) Graph traversal using automata processor
CN113434542B (zh) 数据关系识别方法、装置、电子设备及存储介质
CN113360654B (zh) 文本分类方法、装置、电子设备及可读存储介质
WO2022141840A1 (zh) 网络架构搜索方法、装置、电子设备及介质
CN105229602A (zh) 高效dvcs存储系统
CN113204698A (zh) 新闻主题词生成方法、装置、设备及介质
CN113157739A (zh) 跨模态检索方法、装置、电子设备及存储介质
CN113626605B (zh) 信息分类方法、装置、电子设备及可读存储介质
WO2022141867A1 (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: 21912867

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: 21912867

Country of ref document: EP

Kind code of ref document: A1