WO2022022049A1 - 文本长难句的压缩方法、装置、计算机设备及存储介质 - Google Patents

文本长难句的压缩方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2022022049A1
WO2022022049A1 PCT/CN2021/097418 CN2021097418W WO2022022049A1 WO 2022022049 A1 WO2022022049 A1 WO 2022022049A1 CN 2021097418 W CN2021097418 W CN 2021097418W WO 2022022049 A1 WO2022022049 A1 WO 2022022049A1
Authority
WO
WIPO (PCT)
Prior art keywords
text information
type
neural network
text
network model
Prior art date
Application number
PCT/CN2021/097418
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 WO2022022049A1 publication Critical patent/WO2022022049A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the technical field of artificial intelligence, and in particular, to a compression method, device, computer equipment and computer-readable storage medium for long and difficult text sentences.
  • the frequency of task-based voice intelligent dialogue systems in practical applications is getting higher and higher.
  • the user's input speech is converted into text through a speech recognizer (ASR), and then semantically understood by a natural language understanding component (NLU), a dialogue manager (DM) ) maintains the conversation history and state, manages the flow of conversation nodes, and the natural language generator (NLG) generates the text of the conversation according to the dialogue strategy of the dialogue manager, and finally synthesizes the speech through the speech synthesizer (TTS) and outputs it to the user.
  • ASR speech recognizer
  • NLU natural language understanding component
  • DM dialogue manager
  • NSG natural language generator
  • the inventor realizes that due to the problem of jerky and inaccurate words generated by NLG, the conventional method is to manually organize a batch of corpora, namely the question and answer corpus.
  • the question and answer corpus When the input of , matches a question in the corpus, the answer corresponding to the question is returned, and the question of intent recognition is converted into a question of text matching.
  • the user's answer in the actual process, it was found that in the dialogue with the customer, when asking some overdue questions, the user's answer usually has serious colloquialism, confusing logic, repeated sentences, and the core sentence in the user's sentence cannot be accurately extracted.
  • the main purpose of the present application is to provide a compression method, device, computer equipment and computer-readable storage medium for long and difficult text sentences, aiming at that when asking some overdue questions in a dialogue with a customer, the user's answer will usually be There are technical problems such as serious colloquialization, confusion of logic, repetition of sentences, and inability to accurately extract the core sentences in user sentences.
  • the present application provides a method for compressing long and difficult text sentences, and the method for compressing long and difficult text sentences includes the following steps:
  • the text information is compressed according to the second preset neural network model to obtain the core sentence of the text information.
  • the application also provides a compression device for a long and difficult text sentence, and the compression device for the long and difficult text sentence includes:
  • the acquisition module is used to acquire the text information to be processed
  • a determining module configured to determine the type of the text information according to the first preset neural network model
  • the compression and acquisition module is configured to compress the text information according to the second preset neural network model if the type of the text information is the core type, and acquire the core sentence of the text information.
  • the present application also provides a computer device, the computer device comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program is executed by the When executed by the processor, the above steps of the compression method for long and difficult text sentences are implemented.
  • the present application also provides a computer-readable storage medium on which a computer program is stored, wherein when the computer program is executed by a processor, the above-mentioned compression of long and difficult text sentences is realized. steps of the method.
  • the present application provides a method, device, computer equipment and computer-readable storage medium for compressing long and difficult text sentences, by acquiring text information to be processed; determining the type of the text information according to a first preset neural network model; If the type of the text information is the core type, then the text information is compressed according to the second preset neural network model, and the core sentences of the text information are obtained, so as to reduce the semantic matching of long and short sentences due to excessively long sentences during intention recognition. low rate problem.
  • FIG. 1 is a schematic flowchart of a method for compressing long and difficult text sentences according to an embodiment of the present application
  • Fig. 2 is the sub-step flow schematic diagram of the compression method of the text long difficult sentence in Fig. 1;
  • Fig. 3 is the sub-step flow schematic diagram of the compression method of the text long difficult sentence in Fig. 1;
  • FIG. 5 is a schematic block diagram of a device for compressing long and difficult text sentences according to an embodiment of the present application
  • FIG. 6 is a schematic structural block diagram of a computer device according to an embodiment of the present application.
  • Embodiments of the present application provide a method, apparatus, computer device, and computer-readable storage medium for compressing long and difficult text sentences.
  • the method for compressing long and difficult text sentences can be applied to a terminal device, and the terminal device can be an electronic device such as a mobile phone, a tablet computer, a notebook computer, and a desktop computer.
  • FIG. 1 is a schematic flowchart of a method for compressing long and difficult text sentences according to an embodiment of the present application.
  • the method for compressing long and difficult text sentences includes steps S101 to S103.
  • Step S101 acquiring text information to be processed
  • the acquisition method includes, when receiving the voice information of the user, converting the voice information into text information.
  • Step S102 determining the type of the text information according to the first preset neural network model
  • Types of text information are determined according to the first preset neural network model, and the types include irrelevant types and core types.
  • An exemplary example is that text information is input into a first preset neural network model, the first preset neural network model recognizes a keyword in the text information, and determines that a sentence containing the keyword is an irrelevant type. For example, when it is recognized that a sentence in the text information contains that and what, it is determined that the sentence is an irrelevant type.
  • the first preset model is a neural network model trained in advance by identifying sentences.
  • step S102 includes: sub-step S1021 to sub-step S1025.
  • Sub-step S1021 inputting the text information into the first preset neural network model
  • the text information is input into the preset first neural network model.
  • the text information includes sentences and the like. For example, say whatever you want, hey, I told you that this phone number was given to you by the previous unit, and I really don't know who the last owner was. Get the input layer of the first preset neural network model, you will get it, whatever you say, hey, I will tell you that this phone number was given to you by the previous unit. I really don’t know who is the last owner The input layer of the first preset neural network model.
  • Sub-step S1022 converting the text information into a feature matrix through the word vector layer of the first preset neural network model
  • the convolution operation is performed through the convolution kernels of different sizes of the first preset neural network model to extract different text context feature information, which is similar to the N-gram language model.
  • Different n such as the sentence "I didn't hear clearly", the context corresponding to different n includes:
  • obtaining the target feature vector information of the text information includes: multiplying the convolution kernel and elements at the corresponding positions of the feature matrix and summing them up to obtain the corresponding first target feature; The convolution kernel is multiplied and summed by the element in the next position of the feature matrix to obtain the corresponding second target feature; the obtained first target feature and the second target feature are spliced to generate Target feature vector information.
  • feature maps feature maps
  • a convolution result corresponds to a feature map.
  • one of the convolution kernels with a size of 3*5 performs a convolution operation on the feature matrix, that is, the convolution kernel and the elements at the corresponding positions of the feature matrix are multiplied and summed, and the convolution is performed after one calculation.
  • the product kernel moves down one step and continues the same operation until it reaches the bottom, where the resulting sums are spliced together to form a feature map.
  • Sub-step S1024 according to the target feature vector information, determine the type probability value of the text information output by the first preset neural network model
  • determining the type probability value of the text information output by the first preset neural network model includes: extracting the maximum value in the target feature vector information through maximum pooling of the first neural network model. value to obtain the feature expression vector of the text information; classify the feature expression vector to obtain the probability value of the irrelevant type and the probability value of the core type respectively.
  • the final feature expression vector is obtained.
  • y i (1, 2)
  • h is the measure
  • x is the type of input. Two types of probability values are obtained, the irrelevant category and the core category.
  • Sub-step S1025 Determine the type of the text information based on the type probability value.
  • the type of the textual information is determined by the probability value.
  • the types of this text include extraneous types and core types. For example, when the probability value is greater than the preset probability value, it is determined that the text type is an irrelevant type; when the probability value is less than or equal to the preset probability value, it is determined that the text type is a core type. Or, when the probability value is greater than the preset probability value, it is determined that the text type is a core type; when the probability value is less than or equal to the preset probability value, it is determined that the text type is an irrelevant type.
  • determining the type of the text information includes: comparing the probability value of the irrelevant type with the probability value of the core type; if the probability value of the irrelevant type is greater than the probability value of the core type value, the type of the text information is determined to be an irrelevant type; if the probability value of the irrelevant type is less than or equal to the probability value of the core type, the type of the text information is determined to be a core type.
  • the obtained probability value of the irrelevant type is compared with the probability value of the core type. For example, the obtained probability value of the irrelevant type is 0.6, and the probability of the core type If the value is 0.4, the type of the text information is determined to be an irrelevant type; if the obtained probability value of the irrelevant type is 0.3, and the probability value of the core type is 0.7, the type of the text information is determined to be the core type.
  • Step S103 If the type of the text information is the core type, compress the text information according to the second preset neural network model to obtain the core sentence of the text information.
  • the text information type is the core type
  • the text information is identified and segmented by the second preset model.
  • the attributes in the participle are obtained as subject, predicate, object and other target participles, and the target participles are combined to obtain the core sentence of the text information.
  • the text information is "Hey, I told you that this phone number was given by the previous unit, I really don't know who the last owner was", and the second preset model will be "Hey, I told you that this phone number was from the previous time.”
  • I really don’t know who the last owner given by the unit” is participle, and the text after the participle is “hey, me, follow, you, say, me, this, phone, yes, before, unit, given , who is the last owner, I really don't know”, determine the subject, predicate and object in this sentence, and the core sentence after the combination is "My phone number was given by the previous unit, I don't know who the last owner is”.
  • step S103 includes: sub-step S1031 to sub-step S1033 .
  • Sub-step S1031 inputting the text information into a second preset neural network model, and segmenting the text information through the second preset neural network;
  • the text information is input into the second preset neural network model, and the second preset neural network model is obtained by training a large amount of text information to be labeled, wherein, among the large amount of text information
  • the words are labeled, and the words in the text information are labeled by the position and attribute relationship between each word in the dependent syntax.
  • Dependency syntax interprets the syntactic structure by analyzing the dependencies before the components within a language unit, asserting that the core verb in a sentence is the central component that dominates other components. And it itself is not dominated by any other elements, and all dominated elements are subordinate to the dominant in some way.
  • the text information is word-segmented based on the word-segmentation table or word-segmentation library in the second preset neural network.
  • Sub-step S1032 obtain the weight matrix of each described word segmentation, to determine the attribute relationship between each described word segmentation;
  • the weight matrix of each word segmentation is obtained. For example, after obtaining the weight matrix of each word segment, the attribute vector feature information of each word segment is obtained based on the mapping of the weight matrix. Based on the attribute vector feature information of each participle, the attribute relationship between each participle is determined. For example, subject-predicate relationship, fixed-center relationship, left-additive relationship, right-additional relationship, and verb-object relationship.
  • Only one component in a sentence is independent; all other components of the sentence are subordinate to a component; no component can depend on two or more components; if component A is directly dependent on component B, and component C is in the sentence is located between A and B, then component C is either subordinate to A, or subordinate to B, or subordinate to a component between A and B; the other components on the left and right sides of the central component are not related to each other.
  • Sub-step S1033 Based on the attribute relationship between each of the word segmentations, obtain the core sentence of the text information output by the second preset neural network model.
  • each participle subject-predicate relationship, fixed-center relationship, left-additive relationship, right-additional relationship, and verb-object relationship determine whether there is a subject-predicate relationship, fixed-center relationship, left-additional relationship, right-side relationship between each of the participles Additive relationship, verb-object relationship; combine the participles with the subject-predicate relationship, fixed-center relationship, left-additive relationship, right-additional relationship, and verb-object relationship to determine the core sentence to be output.
  • the core sentence to be output is output through the second preset neural network model, and the core sentence to be output is used as the core sentence of the text information.
  • the text information to be processed is acquired, and the type of the text information is determined according to the first preset neural network model. If it is determined that the type of the text information is the core type, the text information is compressed according to the second preset neural network model to obtain the core sentence of the text information. Realization can reduce the problem of low semantic matching accuracy of long and short sentences due to too long sentences during intention recognition; at the same time, by extracting key information, redundant information of sentences can be removed, and key information can be retained to improve the accuracy of intention recognition.
  • FIG. 4 is a schematic flowchart of another data acquisition method provided by an embodiment of the present application.
  • the data acquisition method includes steps S201 to S205.
  • Step S201 acquiring text information to be processed
  • the acquisition method includes, when receiving the voice information of the user, converting the voice information into text information.
  • Step S202 determining the type of the text information according to the first preset neural network model
  • Types of text information are determined according to the first preset neural network model, and the types include irrelevant types and core types.
  • An exemplary example is that text information is input into a first preset neural network model, the first preset neural network model recognizes a keyword in the text information, and determines that a sentence containing the keyword is an irrelevant type. For example, when it is recognized that a sentence in the text information contains that and what, it is determined that the sentence is an irrelevant type.
  • the first preset model is a neural network model trained in advance by identifying sentences.
  • Step S203 If the type of the text information is the core type, compress the text information according to the second preset neural network model to obtain the core sentence of the text information.
  • the text information type is the core type
  • the text information is identified and segmented by the second preset model.
  • the attributes in the participle are obtained as subject, predicate, object and other target participles, and the target participles are combined to obtain the core sentence of the text information.
  • the text information is "Hey, I told you that this phone number was given by the previous unit, I really don't know who the last owner was", and the second preset model will be "Hey, I told you that this phone number was from the previous time.”
  • I really don’t know who the last owner given by the unit” is participle, and the text after the participle is “hey, me, follow, you, say, me, this, phone, yes, before, unit, given , who is the last owner, I really don't know”, determine the subject, predicate and object in this sentence, and the core sentence after the combination is "My phone number was given by the previous unit, I don't know who the last owner is”.
  • Step S204 matching the core sentence with a preset question and answer library, and obtaining a question and answer text that matches the core sentence;
  • the core sentence of the text information is obtained, the core sentence is matched with the preset question answering library.
  • the preset question-and-answer library includes texts of answers, wherein the texts of question-and-answers include questions and corresponding lexical information.
  • the question and answer text matching the core sentence is obtained. If multiple question and answer texts are obtained, the frequency of matching each question and answer text with the core sentence is obtained, and the frequency of matching each question and answer text with the core sentence is compared, and the question and answer text corresponding to the highest frequency is obtained.
  • Step S205 based on the question and answer text, send the vocabulary information in the question and answer text to the user.
  • the sending method includes sending the phonetic information to the user in the form of text or pictures, and the phonetic information can be converted into voice information and sent to the user in the form of voice information.
  • the text information to be processed is obtained, and the type of the text information is determined according to the first preset neural network model. If it is determined that the type of the text information is the core type, the second preset neural network model The text information is compressed to obtain the core sentence of the text information. Realization can reduce the problem that the semantic matching accuracy of long and short sentences is not high due to too long sentences during intention recognition; at the same time, by extracting key information, redundant information of sentences can be removed, and key information can be retained to improve the accuracy of intention recognition, and quickly send corresponding information to users. voice information.
  • FIG. 5 is a schematic block diagram of an apparatus for compressing long and difficult text sentences according to an embodiment of the present application.
  • the apparatus 400 for compressing long and difficult text sentences includes: an acquisition module 401 , a first determination module 402 , and a compression acquisition module 403 .
  • an acquisition module 401 used to acquire text information to be processed
  • a determination module 402 configured to determine the type of the text information according to the first preset neural network model
  • the compression obtaining module 403 is configured to compress the text information according to the second preset neural network model if the type of the text information is the core type, and obtain the core sentence of the text information.
  • the determining module 402 is further configured to: input the text information into a first preset neural network model; convert the text information into a feature matrix through the word vector layer of the first preset neural network model;
  • the convolution kernel of the first preset neural network model performs a convolution operation on the feature matrix, extracts context feature information in the text information, and obtains target feature vector information of the text information; according to the target feature vector information , determining the type probability value of the text information output by the first preset neural network model; and determining the type of the text information based on the type probability value.
  • the determining module 402 is further configured to: multiply and sum the elements of the corresponding positions of the convolution kernel and the feature matrix to obtain the corresponding first target feature; The elements in the next position of the matrix are multiplied and summed to obtain the corresponding second target feature; the obtained first target feature and the second target feature are spliced to generate target feature vector information.
  • the determining module 402 is further configured to: extract the maximum value in the target feature vector information through the maximum pooling of the first neural network model to obtain the feature expression vector of the text information; express the feature The vector is classified, and the probability value of the irrelevant type and the probability value of the core type are obtained respectively.
  • the determining module 402 is further configured to: compare the probability value of the irrelevant type with the probability value of the core type; if the probability value of the irrelevant type is greater than the probability value of the core type, determine the probability value of the core type.
  • the type of the text information is an irrelevant type; if the probability value of the irrelevant type is less than or equal to the probability value of the core type, the type of the text information is determined to be the core type.
  • the compression and acquisition module 403 is further configured to: input the text information into a second preset neural network model, and perform word segmentation on the text information through the second preset neural network; obtain a weight matrix of each of the word segmentations to determine the attribute relationship between each of the segmented words; and based on the attribute relationship between each of the segmented words, obtain the core sentence of the text information output by the second preset neural network model.
  • the device for compressing long and difficult texts is further configured to: match the core sentences with a preset question and answer library to obtain question and answer texts matching the core sentences; send the question and answer texts to the user based on the question and answer texts Discourse information in the question and answer text.
  • the apparatus provided by the above-mentioned embodiments can be implemented in the form of a computer program, and the computer program can be executed on the computer device as shown in FIG. 6 .
  • FIG. 6 is a schematic structural block diagram of a computer device according to an embodiment of the present application.
  • the computer device may be a terminal.
  • the computer device includes a processor, a memory, and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
  • Non-volatile storage media can store operating systems and computer programs.
  • the computer program includes program instructions, which, when executed, can cause the processor to execute any compression method for long and difficult text.
  • the processor is used to provide computing and control capabilities to support the operation of the entire computer equipment.
  • the internal memory provides an environment for running a computer program in a non-volatile storage medium.
  • the computer program can cause the processor to execute any compression method for long and difficult text.
  • the network interface is used for network communication, such as sending assigned tasks.
  • the network interface is used for network communication, such as sending assigned tasks.
  • FIG. 6 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
  • the processor may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated circuits) Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor can be a microprocessor or the processor can also be any conventional processor or the like.
  • the processor is configured to run a computer program stored in the memory to implement the following steps:
  • the processor when the processor determines the type implementation of the text information according to the first preset model, the processor is configured to implement:
  • the product kernel performs a convolution operation on the feature matrix, extracts the context feature information in the text information, and obtains the target feature vector information of the text information; and determines the first preset neural network according to the target feature vector information.
  • the model outputs the type probability value of the text information; based on the type probability value, the type of the text information is determined.
  • the processor when the processor obtains the target feature vector information of the text information for realization, the processor is configured to realize:
  • the processor when the processor determines, according to the target feature vector information, that the first preset neural network model outputs the type probability value of the text, the processor is configured to:
  • the maximum value in the target feature vector information is extracted to obtain the feature expression vector of the text information; the feature expression vector is classified to obtain the probability of irrelevant types respectively. value and the probability value of the core type.
  • the processor when determining the type of the text information is implemented, the processor is configured to implement:
  • the processor when the processor compresses the text information according to the second preset neural network model and obtains the core sentence of the text information for implementation, the processor is configured to implement:
  • the processor when the processor compresses the text information according to the second preset neural network model and implements after acquiring the core sentence of the text information, the processor is configured to implement:
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the following steps are implemented:
  • the text information is compressed according to the second preset neural network model to obtain the core sentence of the text information.
  • the computer-readable storage medium may be non-volatile or volatile, and the computer-readable storage medium may be the internal storage unit of the computer device described in the foregoing embodiments, for example, the hard disk or memory.
  • the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) ) card, Flash Card, etc.
  • the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function, and the like; The data created by the use of the node, etc.
  • the blockchain referred to in this application is a new application mode of computer technologies such as storage of preset texts, 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Human Computer Interaction (AREA)
  • Databases & Information Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Machine Translation (AREA)
  • Document Processing Apparatus (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种文本长难句的压缩方法、装置、计算机设备及计算机可读存储介质,涉及人工智能技术领域。该方法包括:获取待处理的文本信息(S101);根据第一预置神经网络模型确定所述文本信息的类型(S102);若所述文本信息的类型为核心类型,则根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句(S103),所述方法实现了降低意图识别时由于语句过长,长短句语义匹配准确率不高的问题。

Description

文本长难句的压缩方法、装置、计算机设备及存储介质
本申请要求于2020年07月27日提交中国专利局、申请号为CN202010733600.4、发明名称为“文本长难句的压缩方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,尤其涉及一种文本长难句的压缩方法、装置、计算机设备及计算机可读存储介质。
背景技术
任务型语音智能对话系统在实际应用中的频率越来越高,用户的输入语音通过语音识别器(ASR)转为文本,然后由自然语言理解组件(NLU)进行语义理解,对话管理器(DM)保持会话历史及状态,管理会话节点的流转,自然语言生成器(NLG)则根据对话管理器的对话策略生成对话的文本,最后通过语音合成器(TTS)合成语音输出给用户。
目前,发明人意识到由于NLG生成的话术存在生涩且不准确的问题,常规的做法是人工整理一批语料库,即问答语料库,系统将客户可能问到的问题整理精简为一个问答库,当用户的输入匹配到语料库中的某条问题时,即返回该问题对应的答案,则将意图识别的问题转化为文本匹配的问题。但在实际过程中发现,在与客户的对话中,当询问一些逾期性的问题时,用户的回答通常会存在口语化严重、逻辑混乱、语句重复,不能准确提取用户语句中的核心句。
发明内容
本申请的主要目的在于提供一种文本长难句的压缩方法、装置、计算机设备及计算机可读存储介质,旨在与客户的对话中,当询问一些逾期性的问题时,用户的回答通常会存在口语化严重、逻辑混乱、语句重复,不能准确提取用户语句中的核心句的技术问题。
第一方面,本申请提供一种文本长难句的压缩方法,所述文本长难句的压缩方法包括以下步骤:
获取待处理的文本信息;
根据第一预置神经网络模型确定所述文本信息的类型;
若所述文本信息的类型为核心类型,则根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句。
第二方面,本申请还提供一种文本长难句的压缩装置,所述文本长难句的压缩装置包 括:
获取模块,用于获取待处理的文本信息;
确定模块,用于根据第一预置神经网络模型确定所述文本信息的类型;
压缩获取模块,用于若所述文本信息的类型为核心类型,则根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句。
第三方面,本申请还提供一种计算机设备,所述计算机设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机程序,其中所述计算机程序被所述处理器执行时,实现如上述的文本长难句的压缩方法的步骤。
第四方面,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,其中所述计算机程序被处理器执行时,实现如上述的文本长难句的压缩方法的步骤。
本申请提供一种文本长难句的压缩方法、装置、计算机设备及计算机可读存储介质,通过获取待处理的文本信息;根据第一预置神经网络模型确定所述文本信息的类型;若所述文本信息的类型为核心类型,则根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句,实现了降低意图识别时由于语句过长,长短句语义匹配准确率不高的问题。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种文本长难句的压缩方法的流程示意图;
图2为图1中的文本长难句的压缩方法的子步骤流程示意图;
图3为图1中的文本长难句的压缩方法的子步骤流程示意图;
图4为本申请实施例提供的另一种文本长难句的压缩方法的流程示意图;
图5为本申请实施例提供的一种文本长难句的压缩装置的示意性框图;
图6为本申请一实施例涉及的计算机设备的结构示意框图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必 须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。
本申请实施例提供一种文本长难句的压缩方法、装置、计算机设备及计算机可读存储介质。其中,该文本长难句的压缩方法可应用于终端设备中,该终端设备可以手机、平板电脑、笔记本电脑、台式电脑等电子设备。
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。
请参照图1,图1为本申请的实施例提供的一种文本长难句的压缩方法的流程示意图。
如图1所示,该文本长难句的压缩方法包括步骤S101至步骤S103。
步骤S101、获取待处理的文本信息;
获取文本信息,将获取到的文本信息作为待处理的文本信息,其中,文本信息包括多段语句,例如,“随你怎么说。你不要,你不要说一个小时,因为,我,因为我不是说我不想给你哈,不想张嘴,就那个如果到账的话,马上就给那个啥了,好不好?给你打电话给你说”。获取方式包括,在接收到用户的语音信息时,将该语音信息转换为文本信息。
步骤S102、根据第一预置神经网络模型确定所述文本信息的类型;
根据第一预置神经网络模型确定文本信息的类型,该类型包括无关类型和核心类型。示范例为,将文本信息输入到第一预置神经网络模型,第一预置神经网络模型识别到文本信息中的关键字词,确定包含该关键字词的语句为无关类型。例如,当识别到文本信息中的语句包含那个、啥了,确定该语句为无关类型。第一预置模型为预先通过标识语句训练得到的神经网络模型。
在一实施例中,具体地,参照图2,步骤S102包括:子步骤S1021至子步骤S1025。
子步骤S1021、将所述文本信息输入第一预置神经网络模型;
在获取到文本信息,将该文本信息输入到预置第一神经网络模型。该文本信息包括语句等。例如,随你怎么说、哎我跟你们说我这个电话是以前单位给的上一位主人是谁我还真不知道等语句。获取第一预置神经网络模型的输入层,将获取到的,随你怎么说、哎我跟你们说我这个电话是以前单位给的上一位主人是谁我还真不知道等语句输入到第一预置神经网络模型的输入层。
子步骤S1022、通过所述第一预置神经网络模型的词向量层将所述文本信息转化为特征矩阵;
在获取到的文本信息为随你怎么说时,通过第一预置神经网络模型中的维度为b的外部预训练的词向量层将输入的我没听清楚转化为特征矩阵表示中的文本,先以字进行分隔,得到“我、没、听、清、楚”,通过外部预训练的中文字向量,将该句话映射到该向量的b维空间,得到该段文本的特征矩阵。
子步骤S1023、基于所述第一预置神经网络模型的卷积核对所述特征矩阵进行卷积操 作,提取所述文本信息中的上下文特征信息,得到所述文本信息的目标特征向量信息;
在得到该文该文本信息的特征矩阵上,通过第一预置神经网络模型不同大小的卷积核来进行卷积操作,以提取不同的文本上下文特征信息,类似于N-gram语言模型中的不同的n,例如句子“我没听清楚”,不同的n对应的上下文包括:
n=2,我没,没听,听清,清楚
n=3,我没听,没听清,听清楚
n=4,我没听清,没听清楚
将特征矩阵分别与不同大小的卷积核进行卷积操作,得到每个卷积核卷积操作对应的特征向量,根据每个卷积核卷积操作对应的特征向量,得到该文本信息对应的目标特征向量。
在一实施例中,得到所述文本信息的目标特征向量信息包括:将所述卷积核与所述特征矩阵对应位置的元素进行相乘并求和,得到对应的第一目标特征;通过所述卷积核与所述特征矩阵的下一位置的元素进行相乘并求和,得到对应的第二目标特征;将得到的所述第一目标特征和所述第二目标特征进行拼接,生成目标特征向量信息。
将特征矩阵分别与不同大小的卷积核进行卷积操作,得到每个卷积核卷积操作对应的特征向量(feature maps),一个卷积的结果对应一个feature map。例如,其中一个大小为3*5的卷积核,将该卷积核在特征矩阵是进行卷积操作,即将卷积核与特征矩阵对应位置的元素进行相乘并求和,一次计算以后卷积核向下移动一步,继续相同的操作,直到到达底端,将得到的和拼接起来,形成一个feature map。
例如,1×0+1×0+(-1)×0+0×0+(-1)×1+1×0+0×2+1×0+(-1)×0+(-1)×0+1×0+1×1+1×1+(-1)×0=1,得到第一目标特征,获取下一位置处的元素进行计算,分别得到第二目标特征1和第三目标特征-4从而进行拼接,得到目标特征向量信息。
子步骤S1024、根据所述目标特征向量信息,确定所述第一预置神经网络模型输出所述文本信息的类型概率值;
通过第一预置神经网络模型中一维最大池化(1-max pooling)操作提取每个目标特征向量信息(feature map)中的最大值,然后通过拼接(concat)操作,得到最终的特征表达向量。再对特征表达向量进行分类,得到该文本信息的类型概率值。从而确定第一预置神经网络模型输出该文本信息的概率值。
在一实施例中,确定所述第一预置神经网络模型输出所述文本信息的类型概率值包括:通过所述第一神经网络模型的最大池化,提取所述目标特征向量信息中的最大值,得到所述文本信息的特征表达向量;将所述特征表达向量进行分类,分别得到无关类型的概率值和核心类型的概率值。
通过每个目标特征向量信息(feature map)中的最大值,然后通过拼接(concat)操作,得到最终的特征表达向量。获取第一预置神经网络模型中的概率公式
Figure PCTCN2021097418-appb-000001
通过该公式对该文本信息的特征向量进行分类,其中,y i为(1,2)、h为度量、x为输入的类型。得到两种类型,即无关类别和核心类别的概率值。
子步骤S1025、基于所述类型概率值,确定所述文本信息的类型。
在获取到该文文本信息的概率值时,通过该概率值来确定该文本信息的类型。该文本的类型包括无关类型和核心类型。例如,当概率值大于预置概率值时,确定该文本类型为无关类型;当概率值小于或等于预置概率值时,确定该文本类型为核心类型。或者,当概率值大于预置概率值时,确定该文本类型为核心类型;当概率值小于或等于预置概率值时,确定该文本类型为无关类型。
在一实施例中,确定所述文本信息的类型包括:将所述无关类型的概率值和所述核心类型的概率值进行比对;若所述无关类型的概率值大于所述核心类型的概率值,则确定所述文本信息的类型为无关类型;若所述无关类型的概率值小于或等于所述核心类型的概率值,则确定所述文本信息的类型为核心类型。
在分别获取到无关类型和核心类型的概率值时,将获取到的无关类型的概率值和核心类型的概率值进行比对,例如,获取到的无关类型的概率值为0.6、核心类型的概率值为0.4,则确定该文本信息的类型为无关类型;若获取到的无关类型的概率值为0.3,核心类型的概率值为0.7,则确定该文本信息的类型为核心类型。
步骤S103、若所述文本信息的类型为核心类型,则根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句。
若确定该文本信息类型为核心类型,通过第二预置模型识别将文本信息进行分词。获取该分词中属性为主语、谓语、宾语等目标分词,将该目标分词进行组合,从而获取该文本信息的核心句。例如,文本信息为“哎我跟你们说我这个电话是以前单位给的上一位主人是谁我还真不知道”,通过第二预置模型将“哎我跟你们说我这个电话是以前单位给的上一位主人是谁我还真不知道”进行分词,分到分词后的文本为“哎、我、跟、你们、说、我、这个、电话、是、以前、单位、给的、上一位主人、是谁、我还真不知”,确定这个句子中的主谓宾,得到组合后的核心句为“我这个电话是以前单位给的,上一位主人是谁不知”。
在一实施例中,具体地,参照图3,步骤S103包括:子步骤S1031至子步骤S1033。
子步骤S1031、将所述文本信息输入第二预置神经网络模型,通过所述第二预置神经网络对所述文本信息进行分词;
在确定该文本信息为核心类型时,将该文本信息输入第二预置神经网络模型,第二预置神将网络模型通过大量待标签的文本信息训练得到的,其中,多大量文本信息中的词进行标注,通过依存句法中各个词之间为位置以及属性关系对文本信息中的词进行标注。依存句法通过分析语言单位内成分之前的依存关系解释其句法结构,主张句子中核心动词是支配其他成分的中心成分。而它本身却不受其他任何成分的支配,所有受支配成分都以某 种关系从属于支配者。基于第二预置神经网络中的分词表或分词库来对该文本信息进行分词。
子步骤S1032、获取各个所述分词的权重矩阵,以确定各个所述分词之间的属性关系;
通过第二预置神经网络模型中的隐藏层,获取各个分词的权重矩阵。例如,在获取到每一个分词的权重矩阵,基于权重矩阵的映射,获取每一个分词的属性向量特征信息。基于每一个分词的属性向量特征信息,确定各个分词之间属性关系。例如,主谓关系、定中关系、左附加关系、右附加关系、动宾关系。一个句子中只有一个成分是独立的;句子的其他成分都从属于某一成分;任何一个成分都不能依存于两个或两个以上的成分;如果成分A直接从属成分B,而成分C在句子中位于A和B之间,那么,成分C或者从属于A,或者从属于B,或者从属于A和B之间的某一成分;中心成分左右两边的其他成分相互不发生关系。
子步骤S1033、基于各个所述分词之间的属性关系,获取所述第二预置神经网络模型输出所述文本信息的核心句。
在获取到每一个分词主谓关系、定中关系、左附加关系、右附加关系、动宾关系,通过确定各个所述分词之间是否存在的主谓关系、定中关系、左附加关系、右附加关系、动宾关系;将存在所述主谓关系、定中关系、左附加关系、右附加关系、动宾关系的分词进行组合,确定待输出的核心句。通过第二预置神经网络模型输出该待输出的核心句,将待输出的核心句作为该文本信息的核心句。
在本申请实施例中,获取待处理的文本信息,根据第一预置神经网络模型确定该文本信息的类型。若确定该文本信息的类型为核心类型,则根据第二预置神经网络模型对文本信息进行压缩,获取该文本信息的核心句。实现可以降低意图识别时由于语句过长,长短句语义匹配准确率不高的问题;同时通过抽取关键信息,可以去除句子的冗余信息,保留关键信息从而提升意图识别准确率。
请参照图4,图4为本申请实施例提供的另一种数据获取方法的流程示意图。
如图4所示,该数据获取方法包括步骤S201至步骤S205。
步骤S201、获取待处理的文本信息;
获取文本信息,将获取到的文本信息作为待处理的文本信息,其中,文本信息包括多段语句,例如,“随你怎么说。你不要,你不要说一个小时,因为,我,因为我不是说我不想给你哈,不想张嘴,就那个如果到账的话,马上就给那个啥了,好不好?给你打电话给你说”。获取方式包括,在接收到用户的语音信息时,将该语音信息转换为文本信息。
步骤S202、根据第一预置神经网络模型确定所述文本信息的类型;
根据第一预置神经网络模型确定文本信息的类型,该类型包括无关类型和核心类型。示范例为,将文本信息输入到第一预置神经网络模型,第一预置神经网络模型识别到文本信息中的关键字词,确定包含该关键字词的语句为无关类型。例如,当识别到文本信息中的语句包含那个、啥了,确定该语句为无关类型。第一预置模型为预先通过标识语句训练 得到的神经网络模型。
步骤S203、若所述文本信息的类型为核心类型,则根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句。
若确定该文本信息类型为核心类型,通过第二预置模型识别将文本信息进行分词。获取该分词中属性为主语、谓语、宾语等目标分词,将该目标分词进行组合,从而获取该文本信息的核心句。例如,文本信息为“哎我跟你们说我这个电话是以前单位给的上一位主人是谁我还真不知道”,通过第二预置模型将“哎我跟你们说我这个电话是以前单位给的上一位主人是谁我还真不知道”进行分词,分到分词后的文本为“哎、我、跟、你们、说、我、这个、电话、是、以前、单位、给的、上一位主人、是谁、我还真不知”,确定这个句子中的主谓宾,得到组合后的核心句为“我这个电话是以前单位给的,上一位主人是谁不知”。
步骤S204、将所述核心句与预置问答库进行匹配,获取与所述核心句相匹配的问答文本;
在获取到文本信息的核心句时,将该核心句与预置问答库进行匹配。预置问答库包括文答文本,其中,问答文本包括提问和对应的话术信息。通过将该核心句与预置问答库中进行匹配,获取与该核心句相匹配的问答文本。若获取到多个问答文本时,获取各个问答文本与该核心句相匹配的频率,将各个问答文本与该核心句相匹配的频率进行对比,获取频率最大对应的问答文本。
步骤S205、基于所述问答文本,向用户发送所述问答文本中的话术信息。
在获取到待核心句相匹配的问答文本时,向用户发送问答文本中的话术信息。发送的方式包括将该话术信息以文字或图片的形式发送给用户,还了可以将该话术信息转换为语音信息,以语音信息的方式发送给用户。
在本申请实施例中,获取待处理的文本信息,根据第一预置神经网络模型确定该文本信息的类型,若确定该文本信息的类型为核心类型,则根据第二预置神经网络模型对文本信息进行压缩,获取该文本信息的核心句。实现可以降低意图识别时由于语句过长,长短句语义匹配准确率不高的问题;同时通过抽取关键信息,可以去除句子的冗余信息,保留关键信息从而提升意图识别准确率,快速向用户发送对应的语音信息。
请参照图5,图5为本申请实施例提供的一种文本长难句的压缩装置的示意性框图。
如图5所示,该文本长难句的压缩装置400,包括:获取模块401、第一确定模块402、压缩获取模块403。
获取模块401,用于获取待处理的文本信息;
确定模块402,用于根据第一预置神经网络模型确定所述文本信息的类型;
压缩获取模块403,用于若所述文本信息的类型为核心类型,则根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句。
其中,确定模块402具体还用于:将所述文本信息输入第一预置神经网络模型;通过所述第一预置神经网络模型的词向量层将所述文本信息转化为特征矩阵;基于所述第一预 置神经网络模型的卷积核对所述特征矩阵进行卷积操作,提取所述文本信息中的上下文特征信息,得到所述文本信息的目标特征向量信息;根据所述目标特征向量信息,确定所述第一预置神经网络模型输出所述文本信息的类型概率值;基于所述类型概率值,确定所述文本信息的类型。
其中,确定模块402具体还用于:将所述卷积核与所述特征矩阵对应位置的元素进行相乘并求和,得到对应的第一目标特征;通过所述卷积核与所述特征矩阵的下一位置的元素进行相乘并求和,得到对应的第二目标特征;将得到的所述第一目标特征和所述第二目标特征进行拼接,生成目标特征向量信息。
其中,确定模块402具体还用于:通过所述第一神经网络模型的最大池化,提取所述目标特征向量信息中的最大值,得到所述文本信息的特征表达向量;将所述特征表达向量进行分类,分别得到无关类型的概率值和核心类型的概率值。
其中,确定模块402具体还用于:将所述无关类型的概率值和所述核心类型的概率值进行比对;若所述无关类型的概率值大于所述核心类型的概率值,则确定所述文本信息的类型为无关类型;若所述无关类型的概率值小于或等于所述核心类型的概率值,则确定所述文本信息的类型为核心类型。
其中,压缩获取模块403具体还用于:将所述文本信息输入第二预置神经网络模型,通过所述第二预置神经网络对所述文本信息进行分词;获取各个所述分词的权重矩阵,以确定各个所述分词之间的属性关系;基于各个所述分词之间的属性关系,获取所述第二预置神经网络模型输出所述文本信息的核心句。
其中,文本长难句的压缩装置具体还用于:将所述核心句与预置问答库进行匹配,获取与所述核心句相匹配的问答文本;基于所述问答文本,向用户发送所述问答文本中的话术信息。
需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置和各模块及单元的具体工作过程,可以参考前述文本长难句的压缩方法实施例中的对应过程,在此不再赘述。
上述实施例提供的装置可以实现为一种计算机程序的形式,该计算机程序可以在如图6所示的计算机设备上运行。
请参阅图6,图6为本申请实施例提供的一种计算机设备的结构示意性框图。该计算机设备可以为终端。
如图6所示,该计算机设备包括通过系统总线连接的处理器、存储器和网络接口,其中,存储器可以包括非易失性存储介质和内存储器。
非易失性存储介质可存储操作系统和计算机程序。该计算机程序包括程序指令,该程序指令被执行时,可使得处理器执行任意一种文本长难句的压缩方法。
处理器用于提供计算和控制能力,支撑整个计算机设备的运行。
内存储器为非易失性存储介质中的计算机程序的运行提供环境,该计算机程序被处理 器执行时,可使得处理器执行任意一种文本长难句的压缩方法。
该网络接口用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
应当理解的是,处理器可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
其中,在一个实施例中,所述处理器用于运行存储在存储器中的计算机程序,以实现如下步骤:
获取待处理的文本信息;根据第一预置神经网络模型确定所述文本信息的类型;若所述文本信息的类型为核心类型,则根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句。
在一个实施例中,所述处理器在所述根据第一预置模型确定所述文本信息的类型实现时,用于实现:
将所述文本信息输入第一预置神经网络模型;通过所述第一预置神经网络模型的词向量层将所述文本信息转化为特征矩阵;基于所述第一预置神经网络模型的卷积核对所述特征矩阵进行卷积操作,提取所述文本信息中的上下文特征信息,得到所述文本信息的目标特征向量信息;根据所述目标特征向量信息,确定所述第一预置神经网络模型输出所述文本信息的类型概率值;基于所述类型概率值,确定所述文本信息的类型。
在一个实施例中,所述处理器在得到所述文本信息的目标特征向量信息实现时,用于实现:
将所述卷积核与所述特征矩阵对应位置的元素进行相乘并求和,得到对应的第一目标特征;通过所述卷积核与所述特征矩阵的下一位置的元素进行相乘并求和,得到对应的第二目标特征;将得到的所述第一目标特征和所述第二目标特征进行拼接,生成目标特征向量信息。
在一个实施例中,所述处理器在根据所述目标特征向量信息,确定所述第一预置神经网络模型输出所述文本的类型概率值实现时,用于实现:
通过所述第一神经网络模型的最大池化,提取所述目标特征向量信息中的最大值,得到所述文本信息的特征表达向量;将所述特征表达向量进行分类,分别得到无关类型的概率值和核心类型的概率值。
在一个实施例中,所述处理器在确定所述文本信息的类型实现时时,用于实现:
将所述无关类型的概率值和所述核心类型的概率值进行比对;若所述无关类型的概率值大于所述核心类型的概率值,则确定所述文本信息的类型为无关类型;若所述无关类型的概率值小于或等于所述核心类型的概率值,则确定所述文本信息的类型为核心类型。
在一个实施例中,所述处理器在所述根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句实现时,用于实现:
将所述文本信息输入第二预置神经网络模型,通过所述第二预置神经网络对所述文本信息进行分词;获取各个所述分词的权重矩阵,以确定各个所述分词之间的属性关系;基于各个所述分词之间的属性关系,获取所述第二预置神经网络模型输出所述文本信息的核心句。
在一个实施例中,所述处理器在根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句之后实现时,用于实现:
将所述核心句与预置问答库进行匹配,获取与所述核心句相匹配的问答文本;基于所述问答文本,向用户发送所述问答文本中的话术信息。
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时,实现以下步骤:
获取待处理的文本信息;
根据第一预置神经网络模型确定所述文本信息的类型;
若所述文本信息的类型为核心类型,则根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句。
需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的计算机可读存储介质的具体工作过程可参照本申请文本长难句的压缩方法的各个实施例。
其中,所述计算机可读存储介质可以是非易失性,也可以是易失性,所述计算机可读存储介质可以是前述实施例所述的计算机设备的内部存储单元,例如所述计算机设备的硬盘或内存。所述计算机可读存储介质也可以是所述计算机设备的外部存储设备,例如所述计算机设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。
进一步地,所述计算机可读存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。
本申请所指区块链是预置文答文本的存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种文本长难句的压缩方法,其中,包括:
    获取待处理的文本信息;
    根据第一预置神经网络模型确定所述文本信息的类型;
    若所述文本信息的类型为核心类型,则根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句。
  2. 如权利要求1所述的文本长难句的压缩方法,其中,所述根据第一预置模型确定所述文本信息的类型,包括:
    将所述文本信息输入第一预置神经网络模型;
    通过所述第一预置神经网络模型的词向量层将所述文本信息转化为特征矩阵;
    基于所述第一预置神经网络模型的卷积核对所述特征矩阵进行卷积操作,提取所述文本信息中的上下文特征信息,得到所述文本信息的目标特征向量信息;
    根据所述目标特征向量信息,确定所述第一预置神经网络模型输出所述文本信息的类型概率值;
    基于所述类型概率值,确定所述文本信息的类型。
  3. 如权利要求2所述的文本长难句的压缩方法,其中,所述得到所述文本信息的目标特征向量信息,包括:
    将所述卷积核与所述特征矩阵对应位置的元素进行相乘并求和,得到对应的第一目标特征;
    通过所述卷积核与所述特征矩阵的下一位置的元素进行相乘并求和,得到对应的第二目标特征;
    将得到的所述第一目标特征和所述第二目标特征进行拼接,生成目标特征向量信息。
  4. 如权利要求2所述的文本长难句的压缩方法,其中,所述根据所述目标特征向量信息,确定所述第一预置神经网络模型输出所述文本的类型概率值,包括:
    通过所述第一神经网络模型的最大池化,提取所述目标特征向量信息中的最大值,得到所述文本信息的特征表达向量;
    将所述特征表达向量进行分类,分别得到无关类型的概率值和核心类型的概率值。
  5. 如权利要求4所述的文本长难句的压缩方法,其中,所述确定所述文本信息的类型,包括:
    将所述无关类型的概率值和所述核心类型的概率值进行比对;
    若所述无关类型的概率值大于所述核心类型的概率值,则确定所述文本信息的类型为无关类型;
    若所述无关类型的概率值小于或等于所述核心类型的概率值,则确定所述文本信息的类型为核心类型。
  6. 如权利要求1所述的文本长难句的压缩方法,其中,所述根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句,包括:
    将所述文本信息输入第二预置神经网络模型,通过所述第二预置神经网络对所述文本信息进行分词;
    获取各个所述分词的权重矩阵,以确定各个所述分词之间的属性关系;
    基于各个所述分词之间的属性关系,获取所述第二预置神经网络模型输出所述文本信息的核心句。
  7. 如权利要求1所述的文本长难句的压缩方法,其中,所述根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句之后,还包括:
    将所述核心句与预置问答库进行匹配,获取与所述核心句相匹配的问答文本;
    基于所述问答文本,向用户发送所述问答文本中的话术信息。
  8. 一种文本长难句的压缩装置,其中,包括:
    获取模块,用于获取待处理的文本信息;
    确定模块,用于根据第一预置神经网络模型确定所述文本信息的类型;
    压缩获取模块,用于若所述文本信息的类型为核心类型,则根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句。
  9. 一种计算机设备,其中,所述计算机设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机程序,其中所述计算机程序被所述处理器执行时,实现以下步骤:
    获取待处理的文本信息;
    根据第一预置神经网络模型确定所述文本信息的类型;
    若所述文本信息的类型为核心类型,则根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句。
  10. 如权利要求9所述计算机设备,其中,所述处理器在实现所述根据第一预置模型确定所述文本信息的类型时,用于实现:
    将所述文本信息输入第一预置神经网络模型;
    通过所述第一预置神经网络模型的词向量层将所述文本信息转化为特征矩阵;
    基于所述第一预置神经网络模型的卷积核对所述特征矩阵进行卷积操作,提取所述文本信息中的上下文特征信息,得到所述文本信息的目标特征向量信息;
    根据所述目标特征向量信息,确定所述第一预置神经网络模型输出所述文本信息的类型概率值;
    基于所述类型概率值,确定所述文本信息的类型。
  11. 如权利要求10所述计算机设备,其中,所述处理器在实现所述得到所述文本信息的目标特征向量信息时,用于实现:
    将所述卷积核与所述特征矩阵对应位置的元素进行相乘并求和,得到对应的第一目标 特征;
    通过所述卷积核与所述特征矩阵的下一位置的元素进行相乘并求和,得到对应的第二目标特征;
    将得到的所述第一目标特征和所述第二目标特征进行拼接,生成目标特征向量信息。
  12. 如权利要求10所述计算机设备,其中,所述处理器在实现所述根据所述目标特征向量信息,确定所述第一预置神经网络模型输出所述文本的类型概率值时,用于实现:
    通过所述第一神经网络模型的最大池化,提取所述目标特征向量信息中的最大值,得到所述文本信息的特征表达向量;
    将所述特征表达向量进行分类,分别得到无关类型的概率值和核心类型的概率值。
  13. 如权利要求12所述计算机设备,其中,所述处理器在实现确定所述文本信息的类型时,用于实现:
    将所述无关类型的概率值和所述核心类型的概率值进行比对;
    若所述无关类型的概率值大于所述核心类型的概率值,则确定所述文本信息的类型为无关类型;
    若所述无关类型的概率值小于或等于所述核心类型的概率值,则确定所述文本信息的类型为核心类型。
  14. 如权利要求9所述计算机设备,其中,所述处理器在实现所述根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句时,用于实现:
    将所述文本信息输入第二预置神经网络模型,通过所述第二预置神经网络对所述文本信息进行分词;
    获取各个所述分词的权重矩阵,以确定各个所述分词之间的属性关系;
    基于各个所述分词之间的属性关系,获取所述第二预置神经网络模型输出所述文本信息的核心句。
  15. 如权利要求9所述计算机设备,其中,所述处理器在实现所述根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句之后,还用于实现:
    将所述核心句与预置问答库进行匹配,获取与所述核心句相匹配的问答文本;
    基于所述问答文本,向用户发送所述问答文本中的话术信息。
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有计算机程序,其中所述计算机程序被处理器执行时,实现以下步骤:
    获取待处理的文本信息;
    根据第一预置神经网络模型确定所述文本信息的类型;
    若所述文本信息的类型为核心类型,则根据第二预置神经网络模型对所述文本信息进行压缩,获取所述文本信息的核心句。
  17. 如权利要求16所述的计算机可读存储介质,其中,所述处理器在实现所述根据第一预置模型确定所述文本信息的类型时,用于实现:
    将所述文本信息输入第一预置神经网络模型;
    通过所述第一预置神经网络模型的词向量层将所述文本信息转化为特征矩阵;
    基于所述第一预置神经网络模型的卷积核对所述特征矩阵进行卷积操作,提取所述文本信息中的上下文特征信息,得到所述文本信息的目标特征向量信息;
    根据所述目标特征向量信息,确定所述第一预置神经网络模型输出所述文本信息的类型概率值;
    基于所述类型概率值,确定所述文本信息的类型。
  18. 如权利要求17所述的计算机可读存储介质,其中,所述处理器在实现所述得到所述文本信息的目标特征向量信息时,用于实现:
    将所述卷积核与所述特征矩阵对应位置的元素进行相乘并求和,得到对应的第一目标特征;
    通过所述卷积核与所述特征矩阵的下一位置的元素进行相乘并求和,得到对应的第二目标特征;
    将得到的所述第一目标特征和所述第二目标特征进行拼接,生成目标特征向量信息。
  19. 如权利要求17所述的计算机可读存储介质,其中,所述处理器在实现所述根据所述目标特征向量信息,确定所述第一预置神经网络模型输出所述文本的类型概率值时,用于实现:
    通过所述第一神经网络模型的最大池化,提取所述目标特征向量信息中的最大值,得到所述文本信息的特征表达向量;
    将所述特征表达向量进行分类,分别得到无关类型的概率值和核心类型的概率值。
  20. 如权利要求19所述的计算机可读存储介质,其中,所述处理器在实现所述确定所述文本信息的类型时,用于实现:
    将所述无关类型的概率值和所述核心类型的概率值进行比对;
    若所述无关类型的概率值大于所述核心类型的概率值,则确定所述文本信息的类型为无关类型;
    若所述无关类型的概率值小于或等于所述核心类型的概率值,则确定所述文本信息的类型为核心类型。
PCT/CN2021/097418 2020-07-27 2021-05-31 文本长难句的压缩方法、装置、计算机设备及存储介质 WO2022022049A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010733600.4A CN111898363B (zh) 2020-07-27 2020-07-27 文本长难句的压缩方法、装置、计算机设备及存储介质
CN202010733600.4 2020-07-27

Publications (1)

Publication Number Publication Date
WO2022022049A1 true WO2022022049A1 (zh) 2022-02-03

Family

ID=73190182

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/097418 WO2022022049A1 (zh) 2020-07-27 2021-05-31 文本长难句的压缩方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN111898363B (zh)
WO (1) WO2022022049A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111898363B (zh) * 2020-07-27 2023-07-28 平安科技(深圳)有限公司 文本长难句的压缩方法、装置、计算机设备及存储介质
CN117033393B (zh) * 2023-10-08 2023-12-12 四川酷赛科技有限公司 一种基于人工智能的信息存储管理系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105096942A (zh) * 2014-05-21 2015-11-25 清华大学 语义分析方法和装置
CN106528694A (zh) * 2016-10-31 2017-03-22 百度在线网络技术(北京)有限公司 基于人工智能的语义判定处理方法和装置
US20200097820A1 (en) * 2017-05-16 2020-03-26 Samsung Electronics Co., Ltd. Method and apparatus for classifying class, to which sentence belongs, using deep neural network
CN111414471A (zh) * 2020-03-20 2020-07-14 北京百度网讯科技有限公司 用于输出信息的方法和装置
CN111898363A (zh) * 2020-07-27 2020-11-06 平安科技(深圳)有限公司 文本长难句的压缩方法、装置、计算机设备及存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7702680B2 (en) * 2006-11-02 2010-04-20 Microsoft Corporation Document summarization by maximizing informative content words
US10229111B1 (en) * 2016-02-03 2019-03-12 Google Llc Sentence compression using recurrent neural networks
CN110019758B (zh) * 2019-04-11 2021-07-06 北京百度网讯科技有限公司 一种核心要素提取方法、装置及电子设备
CN110110332B (zh) * 2019-05-06 2023-04-25 中国联合网络通信集团有限公司 文本摘要生成方法及设备
CN111444703A (zh) * 2020-03-04 2020-07-24 中国平安人寿保险股份有限公司 语句压缩方法、装置、设备及计算机可读存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105096942A (zh) * 2014-05-21 2015-11-25 清华大学 语义分析方法和装置
CN106528694A (zh) * 2016-10-31 2017-03-22 百度在线网络技术(北京)有限公司 基于人工智能的语义判定处理方法和装置
US20200097820A1 (en) * 2017-05-16 2020-03-26 Samsung Electronics Co., Ltd. Method and apparatus for classifying class, to which sentence belongs, using deep neural network
CN111414471A (zh) * 2020-03-20 2020-07-14 北京百度网讯科技有限公司 用于输出信息的方法和装置
CN111898363A (zh) * 2020-07-27 2020-11-06 平安科技(深圳)有限公司 文本长难句的压缩方法、装置、计算机设备及存储介质

Also Published As

Publication number Publication date
CN111898363A (zh) 2020-11-06
CN111898363B (zh) 2023-07-28

Similar Documents

Publication Publication Date Title
US10176804B2 (en) Analyzing textual data
US11227118B2 (en) Methods, devices, and systems for constructing intelligent knowledge base
US10262062B2 (en) Natural language system question classifier, semantic representations, and logical form templates
CN112417102B (zh) 一种语音查询方法、装置、服务器和可读存储介质
WO2018157789A1 (zh) 一种语音识别的方法、计算机、存储介质以及电子装置
WO2022252636A1 (zh) 基于人工智能的回答生成方法、装置、设备及存储介质
WO2021189951A1 (zh) 文本搜索方法、装置、计算机设备和存储介质
US20220261545A1 (en) Systems and methods for producing a semantic representation of a document
US20140350934A1 (en) Systems and Methods for Voice Identification
WO2021204017A1 (zh) 文本意图识别方法、装置以及相关设备
WO2022022049A1 (zh) 文本长难句的压缩方法、装置、计算机设备及存储介质
US20170116250A1 (en) System and Method for Identifying Answer Key Problems in a Natural Language Question and Answering System
CN113407677B (zh) 评估咨询对话质量的方法、装置、设备和存储介质
CN110335608B (zh) 声纹验证方法、装置、设备及存储介质
WO2021063089A1 (zh) 规则匹配方法、规则匹配装置、存储介质及电子设备
CN111368037A (zh) 基于Bert模型的文本相似度计算方法和装置
TWI640877B (zh) 語意分析裝置、方法及其電腦程式產品
WO2023045186A1 (zh) 意图识别方法、装置、电子设备和存储介质
CN111126084A (zh) 数据处理方法、装置、电子设备和存储介质
CN113743090A (zh) 一种关键词提取方法及装置
CN110309278B (zh) 关键词检索方法、装置、介质及电子设备
CN114118049B (zh) 信息获取方法、装置、电子设备及存储介质
CN110750967A (zh) 一种发音的标注方法、装置、计算机设备和存储介质
CN111401069A (zh) 会话文本的意图识别方法、意图识别装置及终端
CN113362809B (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: 21849688

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

Country of ref document: EP

Kind code of ref document: A1