WO2020140635A1 - Text matching method and apparatus, storage medium and computer device - Google Patents

Text matching method and apparatus, storage medium and computer device Download PDF

Info

Publication number
WO2020140635A1
WO2020140635A1 PCT/CN2019/118532 CN2019118532W WO2020140635A1 WO 2020140635 A1 WO2020140635 A1 WO 2020140635A1 CN 2019118532 W CN2019118532 W CN 2019118532W WO 2020140635 A1 WO2020140635 A1 WO 2020140635A1
Authority
WO
WIPO (PCT)
Prior art keywords
vector
sentence
neural network
training sentence
target
Prior art date
Application number
PCT/CN2019/118532
Other languages
French (fr)
Chinese (zh)
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 WO2020140635A1 publication Critical patent/WO2020140635A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • 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
    • 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 field of text processing technology. Specifically, the present application relates to a text matching method, device, storage medium, and computer equipment.
  • Text matching is to measure the relevance or matching degree of the search term and the text on the text.
  • the text matching method is an indispensable technology in the search system.
  • a very important step is to sort the retrieved answers to get the best answer.
  • the traditional text matching method usually performs matching operation on the text according to the word frequency.
  • the TF-IDF term frequency-inverse document frequency
  • the text matching using word segmentation and word frequency has certain limitations in the accuracy of the matching results, and it is not possible to determine other texts with a high matching rate.
  • the present application proposes a text matching method, device, storage medium, and computer equipment, so as to achieve the sentence with the most matching semantics among text matching candidate sentences without manually defining a feature template.
  • the present application discloses a text matching method, comprising: receiving input target text; obtaining a plurality of candidate sentences obtained by preliminary matching according to the target text; and inputting the target text with each of the candidate sentences A text matching model composed of a convolutional neural network CNN and a GRU neural network to obtain the semantic similarity between each candidate sentence and the target text; wherein the text matching model is used to characterize the target text and the candidate The semantic similarity of the sentences; according to the semantic similarity corresponding to each of the candidate sentences, recommend the candidate sentences to the user.
  • the present application discloses a text matching device, including: a receiving module for acquiring target text input; a first acquiring module for acquiring a plurality of candidate sentences obtained by preliminary matching according to the target text; A second obtaining module, configured to input the target text and each candidate sentence into a text matching model formed by a convolutional neural network CNN and a GRU neural network, and obtain that each candidate sentence is semantically similar to the target text
  • the text matching model is used to characterize the semantic similarity between the target text and the candidate sentence
  • the recommendation module is used to recommend the candidate to the user based on the semantic similarity corresponding to each candidate sentence Statement.
  • the present application discloses a computer device, including: one or more processors; a memory; one or more computer programs, wherein the one or more computer programs are stored in the memory and configured as Executed by the one or more processors, the one or more computer programs are configured to perform a text matching method, the text matching method includes the following steps: receiving input target text; acquiring according to the target text Multiple candidate sentences obtained by preliminary matching; input the target text and each candidate sentence into a text matching model composed of a convolutional neural network CNN and a GRU neural network to obtain each candidate sentence and the target text Semantic similarity; wherein the text matching model is used to characterize the semantic similarity between the target text and the candidate sentence; according to the semantic similarity corresponding to each candidate sentence, recommend the candidate sentence to the user.
  • the text matching method includes the following steps: receiving input target text; acquiring according to the target text Multiple candidate sentences obtained by preliminary matching; input the target text and each candidate sentence into a text matching model composed of a convolutional neural network CNN and a GRU neural network to
  • the present application discloses a storage medium on which a computer program is stored; the computer program is adapted to be loaded by a processor and execute a text matching method, the text matching method includes the following steps: receiving an input target Text; obtain multiple candidate sentences obtained by preliminary matching according to the target text; input the target text and each candidate sentence into a text matching model composed of a convolutional neural network CNN and a GRU neural network to obtain each The semantic similarity between the candidate sentence and the target text; wherein the text matching model is used to characterize the semantic similarity between the target text and the candidate sentence; according to the semantic similarity corresponding to each candidate sentence, Recommend the candidate sentence to the user.
  • FIG. 1 is a flowchart of a method in an embodiment of a text matching method provided by this application;
  • FIG. 2 is a flowchart of the method in an embodiment of step S300 provided by the present application.
  • FIG. 3 is a flowchart of a training method in an embodiment of a text matching model provided by this application;
  • FIG. 4 is a structural block diagram of an embodiment of a text matching device provided by this application.
  • FIG. 5 is a schematic structural diagram of an embodiment of a computer device provided by this application.
  • terminal and “terminal device” used here include not only devices with wireless signal receivers, but only devices with wireless signal receivers that do not have transmitting capabilities, but also devices that receive and transmit hardware.
  • Such devices may include: cellular or other communication devices with single-line displays or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Services), which can combine voice and data Processing, fax and/or data communication capabilities; PDA (Personal Digital Assistant), which can include radio frequency receivers, pagers, Internet/Intranet access, web browsers, notepads, calendars and/or GPS (Global Positioning System (Global Positioning System) receiver; conventional laptop and/or palmtop computer or other device that has and/or includes a conventional radio frequency receiver and/or palmtop computer or other device.
  • PCS Personal Communications Services
  • PDA Personal Digital Assistant
  • terminal and “terminal equipment” may be portable, transportable, installed in a vehicle (aeronautical, maritime, and/or terrestrial), or suitable and/or configured to operate locally, and/or In a distributed form, it operates on any other location on the earth and/or in space.
  • the "terminal” and “terminal device” used herein may also be a communication terminal, an Internet terminal, a music/video playback terminal, for example, may be a PDA, MID (Mobi Internet) Device, and/or have music/video
  • the mobile phone with playback function can also be a smart TV, set-top box and other devices.
  • the text matching method includes the following steps:
  • the system receives the target text input by the user.
  • the target text may be a paragraph of characters. Specifically, it may be a searchable question and answer system in which the user inputs a target text.
  • the system may initially filter to obtain a plurality of matching candidate sentences according to the target text.
  • the initial screening method here may be a general text matching method. For example, by cutting the target text, and analyzing the semantics of each word segmentation after the word cutting, the overall semantics of the target text are determined to obtain multiple candidate sentences that match the target text semantically from the database. Or, according to a conventional technical method in the technical field, multiple candidate sentences that semantically match the target text are obtained from the system database.
  • the text matching model is used to characterize the semantic similarity between the target text and the candidate sentence.
  • the system matches each candidate sentence in the multiple candidate sentences with the target text input text matching model to obtain the semantic similarity between each candidate sentence and the target text.
  • the text matching model is a model composed of CNN and GRU neural network.
  • convolutional neural network CNN is more suitable for the learning of sentence vectors, but recurrent neural network is more suitable for the learning of temporal relationships. Therefore, in the text matching model used in this embodiment, the convolutional neural network is used to convolution the sentence, and then the results of the CNN are input into the GRU neural network, and the recurrent neural network is used to condense the words.
  • the product representation learns its sequence relationship, so that the resulting sentence vector representation can characterize more sentence information and sentence features. The following explains the CNN and GRU neural network:
  • Convolutional neural network (Convolutional Neural Network, CNN) is one of the most common network structures in the deep learning network model, and its recognition effect in the image field has been greatly improved, which makes the convolutional neural network famous. Vibrate.
  • the two most important layers of the convolutional neural network are the convolutional layer and the pooling layer, which are also the core steps of the convolutional neural network.
  • the following figure shows a typical CNN structure, called LeNet-5 network, which includes multiple convolutional layers and pooling layers.
  • the convolutional layer (Convolutional Layer) uses a convolution kernel (parameter matrix) to slide the windows one by one in the entire picture matrix to perform inner product to obtain another intermediate matrix. The size of the intermediate matrix depends on the dimension of the convolution kernel.
  • Pooling layer also called subsampling layer (Subsampling Layer)
  • Subsampling Layer After the convolution layer is convolved, the corresponding features can be obtained, and the obtained features can be used for classifier training.
  • this method still has a huge amount of calculation, which is prone to overfitting problems.
  • the convolutional layer needs to be pooled.
  • Recurrent Neural Network is widely used to process variable-length text sequence input, which can learn the word order features of sentences.
  • the key structure is a memory unit (Memory Unit).
  • the memory unit can memorize the information of a certain period of time, and can selectively memorize the information of the words of the previous moment for a sentence.
  • LSTM and GRU can solve the problem of long-term distance dependence and gradient disappearance in traditional RNN.
  • the hidden unit inside the GRU has one less control gate, fewer parameters, and faster convergence. While ensuring the model effect, the model structure has been effectively simplified.
  • the CNN and the GRU neural network are combined to obtain the text matching model.
  • the text matching model is used to characterize the semantic similarity of two input texts. Through the text matching model, the similarity value of the two input texts can be obtained to judge the matching degree of the two input texts.
  • step S300 includes:
  • S320 Input the first convolution vector into the GRU neural network, and then enter the first convolution vector into the GRU neural network to obtain a second neural network vector.
  • S330 Obtain a semantic similarity between the candidate sentence and the target text according to the cosine similarity between the first neural network vector and the second neural network vector.
  • the system first uses a convolutional neural network to convolve the target text and candidate sentences, and then enters the results of the convolutional neural network CNN into the GRU neural network, and uses the recurrent neural network to target the text and candidate sentences. To learn the time sequence of the words in the two to get more sentence information and sentence characteristics, and then determine the similarity between the target text and the candidate sentence according to the sentence information and sentence characteristics of the target text and the candidate sentence .
  • the text matching model composed of the CNN and GRU neural network is trained according to the following manner:
  • S20 Use the convolutional neural network CNN to perform convolution processing on the target training sentence, the first training sentence, and the second training sentence, respectively, to obtain a first vector corresponding to the target training sentence, and A second vector corresponding to the first training sentence, and a third vector corresponding to the second training sentence.
  • step S20 includes: setting a convolution window of the convolutional neural network CNN to preset N words; using the set convolutional neural network CNN to respectively target the target The training sentence, the first training sentence and the second training sentence are subjected to convolution processing.
  • S30 Input the first vector, the second vector, and the third vector into the GRU neural network, respectively, to obtain a fourth vector corresponding to the first vector, and a third vector corresponding to the second vector Five vectors and a sixth vector corresponding to the third vector.
  • step S30 the method further includes: respectively passing the fourth vector, the fifth vector, and the sixth vector through a pooling layer to analyze the fourth vector, the The fifth vector and the sixth vector undergo dimension change processing.
  • step S30 includes: according to the cosine similarity between the fourth vector and the fifth vector after the dimensional change processing, and the cosine similarity between the fourth vector and the sixth vector after the dimensional change processing, to obtain A first score for the target training sentence and the first training sentence, and a second score for the target training sentence and the second training sentence.
  • the system acquires the target training sentence, the first training sentence semantically similar to the target training sentence, and the second training sentence not semantically similar to the target training sentence as the training corpus.
  • the text matching model formed by the network is used for model training.
  • the target training sentence, the first training sentence, and the second training sentence are respectively input into the convolutional neural network CNN for preliminary convolution training, and the first vector corresponding to the target training sentence and the first training sentence are respectively obtained The second vector of, and the third vector corresponding to the second training sentence.
  • the first vector, the second vector, and the third vector are respectively input into the GRU neural network to obtain a fourth vector corresponding to the first vector, a fifth vector corresponding to the second vector, and a sixth vector corresponding to the third vector vector.
  • step S50 includes: determining the associated parameters of the cost function corresponding to the text matching model according to the first score and the second score; the cost function includes a hinge The loss function Hinge loss.
  • the text matching model inputs three sentences, the current input sentence (target training sentence, Sentence), a sentence similar to the current input sentence (Similar, semantic, sentence), and the current input sentence Different semantic sentences (Different semantic).
  • CNN and GRU two deep learning network structures
  • CNN's convolution window is two words
  • the recurrent neural network uses the basic model GRU.
  • This embodiment does not use a bidirectional GRU, and does not require more complicated improvements to optimize, so as to avoid the problem of overfitting and slow training due to too many parameters.
  • this model uses an additional layer of recurrent neural network to learn sentences compared to the CNN model, and can learn more information and features.
  • S400 Recommend the candidate sentence to the user according to the semantic similarity corresponding to each candidate sentence.
  • step S400 includes: filtering out candidate sentences with the highest semantic similarity from the plurality of candidate sentences according to the semantic similarity corresponding to each of the candidate sentences, and recommending the semantic similarity to the user The candidate with the highest degree.
  • the text matching method can be used in a retrieval question answering system.
  • the retrieval question answering system the user inputs a target text
  • the system reads a plurality of candidate sentences for the semantic matching of the target text from the corresponding database by analyzing the target text.
  • the system obtains multiple candidate sentences through preliminary matching, but the semantic similarity between each candidate sentence and the target sentence is not determined. Therefore, it is difficult to filter out the candidate sentences that best match the semantics of the target text input by the user.
  • a text matching model composed of CNN and GRU neural network is provided.
  • Each candidate sentence and target text are input into the text matching model to obtain the semantic meaning of each candidate sentence and target text. Similarity, so that the candidate sentences with the highest similarity can be selected and recommended to the user. Therefore, there is no need to manually define the feature template, and finally obtain the sentence with the best semantic match among the candidate sentences.
  • the present application also provides a text matching device.
  • the text matching device includes a receiving module 100, a first acquiring module 200, a second acquiring module 300, and a recommendation module 400.
  • the receiving module 100 is used to obtain the input target text.
  • the system receives the target text input by the user.
  • the target text may be a paragraph of characters. Specifically, it may be a searchable question and answer system in which the user inputs a target text.
  • the first obtaining module 200 is used to obtain a plurality of candidate sentences obtained by preliminary matching according to the target text.
  • the system may initially filter to obtain a plurality of matching candidate sentences according to the target text.
  • the initial screening method here may be a general text matching method. For example, by cutting the target text, and analyzing the semantics of each word segmentation after the word cutting, the overall semantics of the target text are determined to obtain multiple candidate sentences that match the target text semantically from the database. Or, according to a conventional technical method in the technical field, multiple candidate sentences that semantically match the target text are obtained from the system database.
  • the second obtaining module 300 is used to input the target text and each of the candidate sentences into a text matching model composed of a convolutional neural network CNN and a GRU neural network, and obtain that each candidate sentence is semantically similar to the target text Degree; wherein, the text matching model is used to characterize the semantic similarity of the target text and the candidate sentence.
  • the text matching model is used to characterize the semantic similarity between the target text and the candidate sentence.
  • the system matches each candidate sentence in the multiple candidate sentences with the target text input text matching model to obtain the semantic similarity between each candidate sentence and the target text.
  • the text matching model is a model composed of CNN and GRU neural network.
  • the recommendation module 400 is used to recommend the candidate sentence to the user according to the semantic similarity corresponding to each of the candidate sentences.
  • each candidate sentence in the plurality of candidate sentences and the target text are input into the above text matching model, respectively, to obtain the semantic similarity between each candidate sentence and the target text, thereby according to each candidate sentence
  • the corresponding semantic similarity recommends to the user candidate sentences that are semantically similar to the target text.
  • each module in the text matching device provided by this application is also used to perform the operations performed in accordance with each step in the text matching method described in this application, and no detailed description will be given here.
  • the application also provides a storage medium.
  • a computer program is stored on the storage medium; when the computer program is executed by the processor, the text matching method described in any of the above embodiments is implemented.
  • the storage medium may be a memory.
  • the storage medium in this embodiment is a volatile storage medium or a non-volatile storage medium.
  • internal memory or external memory or include both internal memory and external memory.
  • the internal memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, or random access memory.
  • the external memory may include hard disks, floppy disks, ZIP disks, U disks, magnetic tapes, etc.
  • the storage media disclosed in this application include but are not limited to these types of memories.
  • the memory disclosed in this application is only an example and not a limitation.
  • a computer device includes: one or more processors; memory; one or more application programs. Wherein the one or more application programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more application programs are configured to perform the operations described in any of the foregoing embodiments Text matching method.
  • the computer device in this embodiment may be a server, a personal computer, and a network device.
  • the device includes a processor 703, a memory 705, an input unit 707, a display unit 709, and other devices.
  • the memory 705 may be used to store application programs 701 and various functional modules.
  • the processor 703 runs the application programs 701 stored in the memory 705 to execute various functional applications and data processing of the device.
  • the memory may be internal memory or external memory, or include both internal memory and external memory.
  • the internal memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, or random access memory.
  • ROM read-only memory
  • PROM programmable ROM
  • EPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • flash memory or random access memory.
  • the external memory may include hard disks, floppy disks, ZIP disks, U disks, magnetic tapes, etc.
  • the memories disclosed in this application include but are not limited to these types of memories.
  • the memory disclosed in this application is only an example and not a limitation.
  • the input unit 707 is used to receive an input of a signal and a keyword input by a user.
  • the input unit 707 may include a touch panel and other input devices.
  • the touch panel can collect the user's touch operations on or near it (such as the user's operation with any suitable objects or accessories such as fingers, stylus, etc. on or near the touch panel), and according to the preset
  • the program drives the corresponding connection device; other input devices may include but are not limited to one or more of a physical keyboard, function keys (such as playback control keys, switch keys, etc.), trackball, mouse, joystick, etc.
  • the display unit 709 can be used to display information input by the user or information provided to the user and various menus of the computer device.
  • the display unit 709 may take the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the processor 703 is the control center of the computer equipment. It uses various interfaces and lines to connect the various parts of the entire computer. By running or executing the software programs and/or modules stored in the memory 705, and calling the data stored in the memory, the Various functions and processing data.
  • the device includes one or more processors 703, and one or more memories 705, and one or more applications 701.
  • the one or more application programs 701 are stored in the memory 705 and are configured to be executed by the one or more processors 703, and the one or more application programs 701 are configured to perform the operations described in the above embodiments Text matching method.
  • each functional unit in each embodiment of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or software function modules. If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
  • a person of ordinary skill in the art may understand that all or part of the steps for implementing the above-mentioned embodiments may be completed by hardware, or by a program instructing related hardware.
  • the program may be stored in a computer-readable storage medium, and the storage medium may include Memory, magnetic disk or optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Computational Mathematics (AREA)
  • Molecular Biology (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Algebra (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

A text matching method and apparatus, a storage medium and a computer device. The method comprises: receiving an input target text (S100); obtaining a plurality of candidate sentences obtained by preliminary matching according to the target text (S200); inputting the target text and each candidate sentence into a text matching model formed by a convolutional neural network (CNN) and a GRU neural network, to obtain the semantic similarity between each candidate sentence and the target text, wherein the text matching model is used for representing the semantic similarities between the target text and the candidate sentences (S300); and recommending the candidate sentences to a user according to the semantic similarity corresponding to each candidate sentence (S400). According to the method above, the most semantically matched sentence in the candidate sentences for text matching can be obtained without manually defining a feature template, and the screening efficiency is improved.

Description

文本匹配方法、装置及存储介质、计算机设备Text matching method, device, storage medium, and computer equipment
本申请要求于2019年01月04日提交中国专利局、申请号为201910008683.8,发明名称为“文本匹配方法、装置及存储介质、计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of the Chinese patent application submitted to the China Patent Office on January 4, 2019, with the application number 201910008683.8 and the invention titled "text matching method, device and storage medium, computer equipment", the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及文本处理技术领域,具体而言,本申请涉及一种文本匹配方法、装置及存储介质、计算机设备。The present application relates to the field of text processing technology. Specifically, the present application relates to a text matching method, device, storage medium, and computer equipment.
背景技术Background technique
文本匹配,即衡量搜索词与文本在文本上的相关性或者匹配度。文本匹配方法是搜索系统中一项必不可少的技术。在检索式的问答系统中,很重要的一步是将检索到的答案进行排序得到最佳的答案。换句话说,就是给定一个句子和众多自然语言形式的候选句,根据该句子,在众多的候选句中找到最匹配的句子。Text matching is to measure the relevance or matching degree of the search term and the text on the text. The text matching method is an indispensable technology in the search system. In the retrieval question answering system, a very important step is to sort the retrieved answers to get the best answer. In other words, given a sentence and many candidate sentences in natural language form, according to the sentence, find the best matching sentence among the many candidate sentences.
发明人意识到,传统的文本匹配方法通常根据词频的方式对文本进行匹配运算。例如,TF-IDF(term frequency-inverse document frequency,词频-逆向文件频率)算法。然而,采用分词词频的方式进行文本匹配,其匹配结果的准确性存在一定局限,不能很好地确定出与文本匹配对较高的其他文本。The inventor realized that the traditional text matching method usually performs matching operation on the text according to the word frequency. For example, the TF-IDF (term frequency-inverse document frequency) algorithm. However, the text matching using word segmentation and word frequency has certain limitations in the accuracy of the matching results, and it is not possible to determine other texts with a high matching rate.
发明内容Summary of the invention
本申请提出一种文本匹配方法、装置及存储介质、计算机设备,以实现无需人工去定义特征模板即可获得文本匹配的候选句中语义最匹配的句子。The present application proposes a text matching method, device, storage medium, and computer equipment, so as to achieve the sentence with the most matching semantics among text matching candidate sentences without manually defining a feature template.
第一方面,本申请公开一种文本匹配方法,包括:接收输入的目标文本;获取根据所述目标文本进行初步匹配得到的多个候选语句;将所述目 标文本与每个所述候选语句输入卷积神经网络CNN与GRU神经网络构成的文本匹配模型,得到每个所述候选语句与所述目标文本的语义相似度;其中,所述文本匹配模型用于表征所述目标文本与所述候选语句的语义相似度;根据每个所述候选语句对应的语义相似度,向用户推荐所述候选语句。In the first aspect, the present application discloses a text matching method, comprising: receiving input target text; obtaining a plurality of candidate sentences obtained by preliminary matching according to the target text; and inputting the target text with each of the candidate sentences A text matching model composed of a convolutional neural network CNN and a GRU neural network to obtain the semantic similarity between each candidate sentence and the target text; wherein the text matching model is used to characterize the target text and the candidate The semantic similarity of the sentences; according to the semantic similarity corresponding to each of the candidate sentences, recommend the candidate sentences to the user.
第二方面,本申请公开一种文本匹配装置,包括:接收模块,用于获接收输入的目标文本;第一获取模块,用于获取根据所述目标文本进行初步匹配得到的多个候选语句;第二获取模块,用于将所述目标文本与每个所述候选语句输入卷积神经网络CNN与GRU神经网络构成的文本匹配模型,得到每个所述候选语句与所述目标文本的语义相似度;其中,所述文本匹配模型用于表征所述目标文本与所述候选语句的语义相似度;推荐模块,用于根据每个所述候选语句对应的语义相似度,向用户推荐所述候选语句。In a second aspect, the present application discloses a text matching device, including: a receiving module for acquiring target text input; a first acquiring module for acquiring a plurality of candidate sentences obtained by preliminary matching according to the target text; A second obtaining module, configured to input the target text and each candidate sentence into a text matching model formed by a convolutional neural network CNN and a GRU neural network, and obtain that each candidate sentence is semantically similar to the target text Wherein the text matching model is used to characterize the semantic similarity between the target text and the candidate sentence; the recommendation module is used to recommend the candidate to the user based on the semantic similarity corresponding to each candidate sentence Statement.
第三方面,本申请公开一种计算机设备,包括:一个或多个处理器;存储器;一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个计算机程序配置用于执行一种文本匹配方法,所述文本匹配方法包括以下步骤:接收输入的目标文本;获取根据所述目标文本进行初步匹配得到的多个候选语句;将所述目标文本与每个所述候选语句输入卷积神经网络CNN与GRU神经网络构成的文本匹配模型,得到每个所述候选语句与所述目标文本的语义相似度;其中,所述文本匹配模型用于表征所述目标文本与所述候选语句的语义相似度;根据每个所述候选语句对应的语义相似度,向用户推荐所述候选语句。In a third aspect, the present application discloses a computer device, including: one or more processors; a memory; one or more computer programs, wherein the one or more computer programs are stored in the memory and configured as Executed by the one or more processors, the one or more computer programs are configured to perform a text matching method, the text matching method includes the following steps: receiving input target text; acquiring according to the target text Multiple candidate sentences obtained by preliminary matching; input the target text and each candidate sentence into a text matching model composed of a convolutional neural network CNN and a GRU neural network to obtain each candidate sentence and the target text Semantic similarity; wherein the text matching model is used to characterize the semantic similarity between the target text and the candidate sentence; according to the semantic similarity corresponding to each candidate sentence, recommend the candidate sentence to the user.
第四方面,本申请公开一种存储介质,其上存储有计算机程序;所述计算机程序适于由处理器加载并执行一种文本匹配方法,所述文本匹配方法包括以下步骤:接收输入的目标文本;获取根据所述目标文本进行初步匹配得到的多个候选语句;将所述目标文本与每个所述候选语句输入卷积神经网络CNN与GRU神经网络构成的文本匹配模型,得到每个所述候选语句与所述目标文本的语义相似度;其中,所述文本匹配模型用于表征所述目标文本与所述候选语句的语义相似度;根据每个所述候选语句对应的语义相似度,向用户推荐所述候选语句。In a fourth aspect, the present application discloses a storage medium on which a computer program is stored; the computer program is adapted to be loaded by a processor and execute a text matching method, the text matching method includes the following steps: receiving an input target Text; obtain multiple candidate sentences obtained by preliminary matching according to the target text; input the target text and each candidate sentence into a text matching model composed of a convolutional neural network CNN and a GRU neural network to obtain each The semantic similarity between the candidate sentence and the target text; wherein the text matching model is used to characterize the semantic similarity between the target text and the candidate sentence; according to the semantic similarity corresponding to each candidate sentence, Recommend the candidate sentence to the user.
本申请附加的方面和优点将在下面的描述中部分给出,这些将从下面的描述中变得明显,或通过本申请的实践了解到。Additional aspects and advantages of the present application will be partially given in the following description, which will become apparent from the following description, or be learned through the practice of the present application.
附图说明BRIEF DESCRIPTION
本申请上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above-mentioned and/or additional aspects and advantages of this application will become apparent and easy to understand from the following description of the embodiments in conjunction with the accompanying drawings, in which:
图1为本申请提供的一种文本匹配方法的一实施例中的方法流程图;1 is a flowchart of a method in an embodiment of a text matching method provided by this application;
图2为本申请提供的步骤S300的一实施例中的方法流程图;FIG. 2 is a flowchart of the method in an embodiment of step S300 provided by the present application;
图3为本申请提供的文本匹配模型的一实施例中的训练方式的方法流程图;3 is a flowchart of a training method in an embodiment of a text matching model provided by this application;
图4为本申请提供的一种文本匹配装置的一实施例中的结构框图;4 is a structural block diagram of an embodiment of a text matching device provided by this application;
图5为本申请提供的一种计算机设备的一实施例中的结构示意图。FIG. 5 is a schematic structural diagram of an embodiment of a computer device provided by this application.
具体实施方式detailed description
本技术领域技术人员可以理解,这里所使用的“终端”、“终端设备”既包括无线信号接收器的设备,其仅具备无发射能力的无线信号接收器的设备,又包括接收和发射硬件的设备,其具有能够在双向通信链路上,执行双向通信的接收和发射硬件的设备。这种设备可以包括:蜂窝或其他通信设备,其具有单线路显示器或多线路显示器或没有多线路显示器的蜂窝或其他通信设备;PCS(Personal Communications Service,个人通信系统),其可以组合语音、数据处理、传真和/或数据通信能力;PDA(Personal Digital Assistant,个人数字助理),其可以包括射频接收器、寻呼机、互联网/内联网访问、网络浏览器、记事本、日历和/或GPS(Global Positioning System,全球定位系统)接收器;常规膝上型和/或掌上型计算机或其他设备,其具有和/或包括射频接收器的常规膝上型和/或掌上型计算机或其他设备。这里所使用的“终端”、“终端设备”可以是便携式、可运输、安装在交通工具(航空、海运和/或陆地)中的,或者适合于和/或配置为在本地运行,和/或以分布形式,运行在地球和/或空间的任何其他位置运行。这里所使用的“终端”、“终端设备”还可以是通信 终端、上网终端、音乐/视频播放终端,例如可以是PDA、MID(Mobi le Internet Device,移动互联网设备)和/或具有音乐/视频播放功能的移动电话,也可以是智能电视、机顶盒等设备。Those skilled in the art can understand that the term “terminal” and “terminal device” used here include not only devices with wireless signal receivers, but only devices with wireless signal receivers that do not have transmitting capabilities, but also devices that receive and transmit hardware. A device having a device capable of performing receiving and transmitting hardware for bidirectional communication on a bidirectional communication link. Such devices may include: cellular or other communication devices with single-line displays or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Services), which can combine voice and data Processing, fax and/or data communication capabilities; PDA (Personal Digital Assistant), which can include radio frequency receivers, pagers, Internet/Intranet access, web browsers, notepads, calendars and/or GPS (Global Positioning System (Global Positioning System) receiver; conventional laptop and/or palmtop computer or other device that has and/or includes a conventional radio frequency receiver and/or palmtop computer or other device. As used herein, "terminal" and "terminal equipment" may be portable, transportable, installed in a vehicle (aeronautical, maritime, and/or terrestrial), or suitable and/or configured to operate locally, and/or In a distributed form, it operates on any other location on the earth and/or in space. The "terminal" and "terminal device" used herein may also be a communication terminal, an Internet terminal, a music/video playback terminal, for example, may be a PDA, MID (Mobi Internet) Device, and/or have music/video The mobile phone with playback function can also be a smart TV, set-top box and other devices.
本申请提供一种文本匹配方法。在一实施例中,如图1所示,该文本匹配方法,包括以下步骤:This application provides a text matching method. In an embodiment, as shown in FIG. 1, the text matching method includes the following steps:
S100,接收输入的目标文本。S100. Receive the input target text.
在本实施例中,系统接收到用户输入的目标文本。该目标文本可以是一段字符。具体地,可以是检索式的问答系统中,用户输入一目标文本。In this embodiment, the system receives the target text input by the user. The target text may be a paragraph of characters. Specifically, it may be a searchable question and answer system in which the user inputs a target text.
S200,获取根据所述目标文本进行初步匹配得到的多个候选语句。S200. Acquire a plurality of candidate sentences obtained by preliminary matching according to the target text.
在本实施例中,系统接收到用户输入的目标文本后,根据目标文本可初步筛选获得匹配的多个候选语句。此处的初步筛选的方式可以为通用的文本匹配方式。例如,通过对目标文本进行切词,并分析切词后每个分词的语义,以确定出目标文本的整体语义,从而从数据库中获取与所述目标文本语义匹配的多个候选语句。或者,根据本技术领域内惯用的技术方式,从系统数据库中获取与目标文本语义匹配的多个候选语句。In this embodiment, after receiving the target text input by the user, the system may initially filter to obtain a plurality of matching candidate sentences according to the target text. The initial screening method here may be a general text matching method. For example, by cutting the target text, and analyzing the semantics of each word segmentation after the word cutting, the overall semantics of the target text are determined to obtain multiple candidate sentences that match the target text semantically from the database. Or, according to a conventional technical method in the technical field, multiple candidate sentences that semantically match the target text are obtained from the system database.
S300,将所述目标文本与每个所述候选语句输入卷积神经网络CNN与GRU神经网络构成的文本匹配模型,得到每个所述候选语句与所述目标文本的语义相似度。S300. Input the target text and each candidate sentence into a text matching model composed of a convolutional neural network CNN and a GRU neural network to obtain a semantic similarity between each candidate sentence and the target text.
在本实施例中,需要说明的是,所述文本匹配模型用于表征所述目标文本与所述候选语句的语义相似度。系统分别将多个候选语句中的每个候选语句与目标文本输入文本匹配模型,得到每个候选语句与目标文本的语义相似度。其中,文本匹配模型为卷积神经网络CNN与GRU神经网络构成的模型。In this embodiment, it should be noted that the text matching model is used to characterize the semantic similarity between the target text and the candidate sentence. The system matches each candidate sentence in the multiple candidate sentences with the target text input text matching model to obtain the semantic similarity between each candidate sentence and the target text. Among them, the text matching model is a model composed of CNN and GRU neural network.
在本方案中,卷积神经网络CNN更适合句子向量的学习,但是循环神经网络更适合时序关系的学习。因此,本实施例采用的所述文本匹配模型,先用卷积神经网络对句子进行卷积,之后再将卷积神经网络CNN的结果输入到GRU神经网络中,利用循环神经网络对词语的卷积表示学习其顺序关系,使得最终得到的句子向量表示能够表征更多的句子信息和句子特征。以下对卷积神经网络CNN以及GRU神经网络进行解释说明:In this scheme, convolutional neural network CNN is more suitable for the learning of sentence vectors, but recurrent neural network is more suitable for the learning of temporal relationships. Therefore, in the text matching model used in this embodiment, the convolutional neural network is used to convolution the sentence, and then the results of the CNN are input into the GRU neural network, and the recurrent neural network is used to condense the words. The product representation learns its sequence relationship, so that the resulting sentence vector representation can characterize more sentence information and sentence features. The following explains the CNN and GRU neural network:
卷积神经网络(Convolutional Neural Network,CNN),是深度学习网络模型中最常见的网络结构之一,其在图像领域的识别效果上取得了很大的提升,也因此使得卷积神经网络声名大振。卷积神经网络最重要的两层就是卷积层和池化层,这也是卷积神经网络的核心步骤。如下图所示为典型的CNN结构,称之为LeNet-5网络,其中就包括了多个卷积层和池化层。卷积层(Convolutional Layer)利用一个卷积核(参数矩阵),在整个图片矩阵中逐一滑动窗口,进行内积,得到另一个中间矩阵,中间矩阵的大小取决于卷积核的维度。池化层(Pooling Layer),也叫下采样层(Subsampling Layer),在卷积层进行了卷积处理之后,可得到相应的特征,可以使用得到的特征进行分类器的训练。然而,该方式依然存在巨大的计算量,容易产生过拟合的问题。想要进一步降低模型的拟合程度,需要对卷积层进行池化。Convolutional neural network (Convolutional Neural Network, CNN) is one of the most common network structures in the deep learning network model, and its recognition effect in the image field has been greatly improved, which makes the convolutional neural network famous. Vibrate. The two most important layers of the convolutional neural network are the convolutional layer and the pooling layer, which are also the core steps of the convolutional neural network. The following figure shows a typical CNN structure, called LeNet-5 network, which includes multiple convolutional layers and pooling layers. The convolutional layer (Convolutional Layer) uses a convolution kernel (parameter matrix) to slide the windows one by one in the entire picture matrix to perform inner product to obtain another intermediate matrix. The size of the intermediate matrix depends on the dimension of the convolution kernel. Pooling layer (Pooling Layer), also called subsampling layer (Subsampling Layer), after the convolution layer is convolved, the corresponding features can be obtained, and the obtained features can be used for classifier training. However, this method still has a huge amount of calculation, which is prone to overfitting problems. To further reduce the fitting degree of the model, the convolutional layer needs to be pooled.
循环神经网络(Recurrent Neural Network,RNN)被广泛应用于处理可变长的文本序列输入,其可以学习到句子的词序特征。其关键的结构是一个记忆单元(Memory Unit)。记忆单元可以记忆某时间段的信息,对于一个句子则可以选择性的记住前一时刻词语的信息。当前循环神经网络主要有两种不同的变体LSTM和GRU,他们都能解决传统RNN存在的长期距离依赖与梯度消失问题。相对于LSTM的网络结构,GRU内部的隐藏单元少了一个控制门,参数少,收敛较快,在保证模型效果的同时,模型的结构也得到了有效简化。Recurrent Neural Network (RNN) is widely used to process variable-length text sequence input, which can learn the word order features of sentences. The key structure is a memory unit (Memory Unit). The memory unit can memorize the information of a certain period of time, and can selectively memorize the information of the words of the previous moment for a sentence. At present, there are mainly two different variants of LSTM and GRU in recurrent neural networks. They can solve the problem of long-term distance dependence and gradient disappearance in traditional RNN. Compared with the LSTM network structure, the hidden unit inside the GRU has one less control gate, fewer parameters, and faster convergence. While ensuring the model effect, the model structure has been effectively simplified.
本实施例结合卷积神经网络CNN与GRU神经网络,可得到所述文本匹配模型。其中,文本匹配模型用于表征两个输入文本的语义相似度。通过该文本匹配模型可获取两个输入文本的相似度值,以判断两个输入文本的匹配度。In this embodiment, the CNN and the GRU neural network are combined to obtain the text matching model. Among them, the text matching model is used to characterize the semantic similarity of two input texts. Through the text matching model, the similarity value of the two input texts can be obtained to judge the matching degree of the two input texts.
在一实施例中,如图2所示,步骤S300,包括:In an embodiment, as shown in FIG. 2, step S300 includes:
S310,将所述目标文本输入所述卷积神经网络CNN进行卷积处理,得到第一卷积向量,将所述候选语句输入所述卷积神经网络CNN进行卷积处理,得到第二卷积向量。S310, input the target text into the convolutional neural network CNN for convolution processing to obtain a first convolution vector, and input the candidate sentence into the convolutional neural network CNN for convolution processing to obtain a second convolution vector.
S320,将所述第一卷积向量输入所述GRU神经网络,到第一神经网络 向量,将所述第二卷积向量输入所述GRU神经网络,得到第二神经网络向量。S320: Input the first convolution vector into the GRU neural network, and then enter the first convolution vector into the GRU neural network to obtain a second neural network vector.
S330,根据所述第一神经网络向量和所述第二神经网络向量的余弦相似度,得到所述候选语句与所述目标文本的语义相似度。S330: Obtain a semantic similarity between the candidate sentence and the target text according to the cosine similarity between the first neural network vector and the second neural network vector.
在该实施例中,系统先分别采用卷积神经网络对目标文本以及候选语句进行卷积,之后再将卷积神经网络CNN的结果分别输入GRU神经网络,利用循环神经网络对目标文本以及候选语句的词语进行时序学习,得到两者中词语的时序关系,从而得到学习到更多的句子信息和句子特征,进而根据目标文本与候选语句的句子信息以及句子特征确定目标文本与候选语句的相似度。In this embodiment, the system first uses a convolutional neural network to convolve the target text and candidate sentences, and then enters the results of the convolutional neural network CNN into the GRU neural network, and uses the recurrent neural network to target the text and candidate sentences. To learn the time sequence of the words in the two to get more sentence information and sentence characteristics, and then determine the similarity between the target text and the candidate sentence according to the sentence information and sentence characteristics of the target text and the candidate sentence .
在一实施例中,如图3所示,所述卷积神经网络CNN与GRU神经网络构成的文本匹配模型根据以下方式进行训练:In an embodiment, as shown in FIG. 3, the text matching model composed of the CNN and GRU neural network is trained according to the following manner:
S10,获取目标训练语句,与所述目标训练语句语义相似的第一训练语句,以及与所述目标训练语句语义不相似的第二训练语句。S10. Acquire a target training sentence, a first training sentence semantically similar to the target training sentence, and a second training sentence not semantically similar to the target training sentence.
S20,利用所述卷积神经网络CNN分别对所述目标训练语句、所述第一训练语句及所述第二训练语句进行卷积处理,得到与所述目标训练语句对应的第一向量、与所述第一训练语句对应的第二向量,及与所述第二训练语句对应的第三向量。S20. Use the convolutional neural network CNN to perform convolution processing on the target training sentence, the first training sentence, and the second training sentence, respectively, to obtain a first vector corresponding to the target training sentence, and A second vector corresponding to the first training sentence, and a third vector corresponding to the second training sentence.
在该实施例的一个实施方式中,步骤S20包括:将所述卷积神经网络CNN的卷积窗口设置为预设N个词;利用设置后的所述卷积神经网络CNN分别对所述目标训练语句、所述第一训练语句及所述第二训练语句进行卷积处理。In an implementation manner of this embodiment, step S20 includes: setting a convolution window of the convolutional neural network CNN to preset N words; using the set convolutional neural network CNN to respectively target the target The training sentence, the first training sentence and the second training sentence are subjected to convolution processing.
S30,分别将所述第一向量、所述第二向量及所述第三向量输入所述GRU神经网络,得到与所述第一向量对应的第四向量、与所述第二向量对应的第五向量及与所述第三向量对应的第六向量。S30: Input the first vector, the second vector, and the third vector into the GRU neural network, respectively, to obtain a fourth vector corresponding to the first vector, and a third vector corresponding to the second vector Five vectors and a sixth vector corresponding to the third vector.
在该实施例的一个实施方式中,步骤S30之后,还包括:分别将所述第四向量、所述第五向量及所述第六向量通过池化层,以对所述第四向量、所述第五向量及所述第六向量进行维度变化处理。此时,步骤S30包括:分别根据维度变化处理后的所述第四向量与第五向量的余弦相似度,以及 维度变化处理后的所述第四向量与第六向量的余弦相似度,得到所述目标训练语句与所述第一训练语句的第一分值,以及所述目标训练语句与所述第二训练语句的第二分值。In an implementation manner of this embodiment, after step S30, the method further includes: respectively passing the fourth vector, the fifth vector, and the sixth vector through a pooling layer to analyze the fourth vector, the The fifth vector and the sixth vector undergo dimension change processing. At this time, step S30 includes: according to the cosine similarity between the fourth vector and the fifth vector after the dimensional change processing, and the cosine similarity between the fourth vector and the sixth vector after the dimensional change processing, to obtain A first score for the target training sentence and the first training sentence, and a second score for the target training sentence and the second training sentence.
S40,分别根据所述第四向量与第五向量的余弦相似度,以及所述第四向量与第六向量的余弦相似度,得到所述目标训练语句与所述第一训练语句的第一分值,以及所述目标训练语句与所述第二训练语句的第二分值。S40. According to the cosine similarity between the fourth vector and the fifth vector, and the cosine similarity between the fourth vector and the sixth vector, obtain the first score of the target training sentence and the first training sentence Value, and the second score of the target training sentence and the second training sentence.
S50,根据所述第一分值和所述第二分值确定所述文本匹配模型中相关联的参数。S50. Determine related parameters in the text matching model according to the first score and the second score.
在该实施例中,系统获取目标训练语句,与目标训练语句语义相似的第一训练语句,以及与目标训练语句语义不相似的第二训练语句作为训练语料,对卷积神经网络CNN与GRU神经网络构成的文本匹配模型进行模型训练。具体地,将目标训练语句、第一训练语句和第二训练语句分别输入卷积神经网络CNN中进行初步的卷积训练,分别得到与目标训练语句对应的第一向量、与第一训练语句对应的第二向量,及与第二训练语句对应的第三向量。进一步地,分别将第一向量、第二向量及第三向量输入GRU神经网络,得到与第一向量对应的第四向量、与第二向量对应的第五向量及与第三向量对应的第六向量。最后,获取第四向量与第五向量的余弦相似度,以及第四向量与第六向量的余弦相似度,以得到相应的余弦相似度分值,根据相应的余弦相似度分值确定文本匹配模型中相关联的参数。In this embodiment, the system acquires the target training sentence, the first training sentence semantically similar to the target training sentence, and the second training sentence not semantically similar to the target training sentence as the training corpus. The text matching model formed by the network is used for model training. Specifically, the target training sentence, the first training sentence, and the second training sentence are respectively input into the convolutional neural network CNN for preliminary convolution training, and the first vector corresponding to the target training sentence and the first training sentence are respectively obtained The second vector of, and the third vector corresponding to the second training sentence. Further, the first vector, the second vector, and the third vector are respectively input into the GRU neural network to obtain a fourth vector corresponding to the first vector, a fifth vector corresponding to the second vector, and a sixth vector corresponding to the third vector vector. Finally, the cosine similarity between the fourth vector and the fifth vector and the cosine similarity between the fourth vector and the sixth vector are obtained to obtain the corresponding cosine similarity score, and the text matching model is determined according to the corresponding cosine similarity score The parameters associated in.
在该实施例的一个实施方式中,步骤S50包括:根据所述第一分值和所述第二分值确定所述文本匹配模型对应的代价函数的相关联的参数;所述代价函数包括铰链损失函数Hinge loss。In one implementation of this embodiment, step S50 includes: determining the associated parameters of the cost function corresponding to the text matching model according to the first score and the second score; the cost function includes a hinge The loss function Hinge loss.
针对上述实施例所述卷积神经网络CNN与GRU神经网络构成的文本匹配模型的训练方式,以下提供一个具体实施例,以进行详细说明:For the training method of the text matching model composed of the CNN and the GRU neural network described in the above embodiment, a specific embodiment is provided below for detailed description:
具体地,文本匹配模型在文本匹配模型的训练过程中,输入三个句子,当前输入句子(目标训练语句、Sentence)、与该当前输入句子语义相似的句子(Similar semantic sentence)和该当前输入句子语义不相似的句子(Different semantic sentence)。首先利用CNN的卷积层分别对三个句子进行卷积,卷积窗口设置为两个词,学习得到相应的句子向量; 接着使用循环神经网络进一步获得句子的时序信息;然后分别经过一层池化层(mean/max pooling,均值池化或最大值池化),做一次向量的维度变化,防止模型过拟合;再使用该向量进行相似度(cosine)的计算,相似度使用的是余弦相似度,得到当前输入的句子与语义相似和不相似句子的分数。其中,代价函数使用的是hinge loss,目的是为了使语义相似句子的得分能够高于语义不相似句子的得分,而不仅仅是接近1。Specifically, in the text matching model training process, the text matching model inputs three sentences, the current input sentence (target training sentence, Sentence), a sentence similar to the current input sentence (Similar, semantic, sentence), and the current input sentence Different semantic sentences (Different semantic). First, use CNN's convolutional layer to convolve three sentences, and set the convolution window to two words, and learn the corresponding sentence vector; then use the recurrent neural network to further obtain the timing information of the sentence; and then pass through a layer of pools The mean/max pooling (mean/max pooling, mean value pooling or maximum pooling), do a dimensional change of the vector to prevent the model from overfitting; then use this vector to calculate the similarity (cosine), the similarity uses cosine Similarity, get the score of the currently input sentence and the semantic similarity and dissimilarity. Among them, the cost function uses hinge loss, the purpose is to make the score of semantically similar sentences higher than the score of semantically dissimilar sentences, not just close to 1.
因此,在池化层之前,使用了两种深度学习网络结构,CNN和GRU,以学习句子的信息。在具体实施过程,可使用CNN的卷积窗口是两个词,循环神经网络使用了基本的模型GRU。本实施例没有使用双向的GRU,不需要更复杂的改进来优化,以避免参数过多会导致过拟合和训练过慢的问题。结合该模型图的构造可知,该模型相比于CNN模型来说,多使用了一层循环神经网络去学习句子,能够学习得到更多的信息和特征。Therefore, before the pooling layer, two deep learning network structures, CNN and GRU, are used to learn sentence information. In the specific implementation process, CNN's convolution window is two words, and the recurrent neural network uses the basic model GRU. This embodiment does not use a bidirectional GRU, and does not require more complicated improvements to optimize, so as to avoid the problem of overfitting and slow training due to too many parameters. Combined with the construction of the model graph, it can be seen that this model uses an additional layer of recurrent neural network to learn sentences compared to the CNN model, and can learn more information and features.
S400,根据每个所述候选语句对应的语义相似度,向用户推荐所述候选语句。S400: Recommend the candidate sentence to the user according to the semantic similarity corresponding to each candidate sentence.
在本实施例中,分别将多个候选语句中的每个候选语句与所述目标文本输入上述文本匹配模型,得到每个候选语句与所述目标文本的语义相似度,从而根据每个候选语句对应的语义相似度向用户推荐与目标文本语义相似的候选语句。在一实施例中,步骤S400,包括:根据每个所述候选语句对应的语义相似度,从所述多个候选语句中筛选出所述语义相似度最高的候选语句,向用户推荐该语义相似度最高的候选语句。In this embodiment, each candidate sentence in the plurality of candidate sentences and the target text are input into the above text matching model, respectively, to obtain the semantic similarity between each candidate sentence and the target text, thereby according to each candidate sentence The corresponding semantic similarity recommends to the user candidate sentences that are semantically similar to the target text. In one embodiment, step S400 includes: filtering out candidate sentences with the highest semantic similarity from the plurality of candidate sentences according to the semantic similarity corresponding to each of the candidate sentences, and recommending the semantic similarity to the user The candidate with the highest degree.
以下提供一具体的实施场景,以进一步说明上述文本匹配方法:The following provides a specific implementation scenario to further illustrate the above text matching method:
在该具体实施场景中,所述文本匹配方法可用于检索式的问答系统。在检索式的问答系统中,用户输入一目标文本,系统通过分析目标文本从对应数据库中读取出于该目标文本语义匹配的多个候选语句。一般地,此步骤中系统通过初步匹配得到多个所述候选语句,但对于每个候选语句与目标语句在语义中的相似度,并没有确定。因此,很难筛选出与用户输入的目标文本语义上最匹配的候选语句。本实施场景中,提供了卷积神经网络CNN与GRU神经网络构成的文本匹配模型,将每个候选语句与目标文本输入到该文本匹配模型中,得到每个候选语句与目标文本在语义上的相似 度,从而可以筛选出相似度最高的候选语句推荐给用户。因此,不需要人工去定义特征模板,最终获得候选句中语义最匹配的句子。In this specific implementation scenario, the text matching method can be used in a retrieval question answering system. In the retrieval question answering system, the user inputs a target text, and the system reads a plurality of candidate sentences for the semantic matching of the target text from the corresponding database by analyzing the target text. Generally, in this step, the system obtains multiple candidate sentences through preliminary matching, but the semantic similarity between each candidate sentence and the target sentence is not determined. Therefore, it is difficult to filter out the candidate sentences that best match the semantics of the target text input by the user. In this implementation scenario, a text matching model composed of CNN and GRU neural network is provided. Each candidate sentence and target text are input into the text matching model to obtain the semantic meaning of each candidate sentence and target text. Similarity, so that the candidate sentences with the highest similarity can be selected and recommended to the user. Therefore, there is no need to manually define the feature template, and finally obtain the sentence with the best semantic match among the candidate sentences.
本申请还提供一种文本匹配装置。如图4所示,在一实施例中,该文本匹配装置包括接收模块100、第一获取模块200、第二获取模块300以及推荐模块400。The present application also provides a text matching device. As shown in FIG. 4, in an embodiment, the text matching device includes a receiving module 100, a first acquiring module 200, a second acquiring module 300, and a recommendation module 400.
接收模块100用于获接收输入的目标文本。在本实施例中,系统接收到用户输入的目标文本。该目标文本可以是一段字符。具体地,可以是检索式的问答系统中,用户输入一目标文本。The receiving module 100 is used to obtain the input target text. In this embodiment, the system receives the target text input by the user. The target text may be a paragraph of characters. Specifically, it may be a searchable question and answer system in which the user inputs a target text.
第一获取模块200用于获取根据所述目标文本进行初步匹配得到的多个候选语句。在本实施例中,系统接收到用户输入的目标文本后,根据目标文本可初步筛选获得匹配的多个候选语句。此处的初步筛选的方式可以为通用的文本匹配方式。例如,通过对目标文本进行切词,并分析切词后每个分词的语义,以确定出目标文本的整体语义,从而从数据库中获取与所述目标文本语义匹配的多个候选语句。或者,根据本技术领域内惯用的技术方式,从系统数据库中获取与目标文本语义匹配的多个候选语句。The first obtaining module 200 is used to obtain a plurality of candidate sentences obtained by preliminary matching according to the target text. In this embodiment, after receiving the target text input by the user, the system may initially filter to obtain a plurality of matching candidate sentences according to the target text. The initial screening method here may be a general text matching method. For example, by cutting the target text, and analyzing the semantics of each word segmentation after the word cutting, the overall semantics of the target text are determined to obtain multiple candidate sentences that match the target text semantically from the database. Or, according to a conventional technical method in the technical field, multiple candidate sentences that semantically match the target text are obtained from the system database.
第二获取模块300用于将所述目标文本与每个所述候选语句输入卷积神经网络CNN与GRU神经网络构成的文本匹配模型,得到每个所述候选语句与所述目标文本的语义相似度;其中,所述文本匹配模型用于表征所述目标文本与所述候选语句的语义相似度。在本实施例中,需要说明的是,所述文本匹配模型用于表征所述目标文本与所述候选语句的语义相似度。系统分别将多个候选语句中的每个候选语句与目标文本输入文本匹配模型,得到每个候选语句与目标文本的语义相似度。其中,文本匹配模型为卷积神经网络CNN与GRU神经网络构成的模型。The second obtaining module 300 is used to input the target text and each of the candidate sentences into a text matching model composed of a convolutional neural network CNN and a GRU neural network, and obtain that each candidate sentence is semantically similar to the target text Degree; wherein, the text matching model is used to characterize the semantic similarity of the target text and the candidate sentence. In this embodiment, it should be noted that the text matching model is used to characterize the semantic similarity between the target text and the candidate sentence. The system matches each candidate sentence in the multiple candidate sentences with the target text input text matching model to obtain the semantic similarity between each candidate sentence and the target text. Among them, the text matching model is a model composed of CNN and GRU neural network.
推荐模块400用于根据每个所述候选语句对应的语义相似度,向用户推荐所述候选语句。在本实施例中,分别将多个候选语句中的每个候选语句与所述目标文本输入上述文本匹配模型,得到每个候选语句与所述目标文本的语义相似度,从而根据每个候选语句对应的语义相似度向用户推荐与目标文本语义相似的候选语句。The recommendation module 400 is used to recommend the candidate sentence to the user according to the semantic similarity corresponding to each of the candidate sentences. In this embodiment, each candidate sentence in the plurality of candidate sentences and the target text are input into the above text matching model, respectively, to obtain the semantic similarity between each candidate sentence and the target text, thereby according to each candidate sentence The corresponding semantic similarity recommends to the user candidate sentences that are semantically similar to the target text.
在其他实施例中,本申请提供的文本匹配装置中的各个模块还用于执 行本申请所述的文本匹配方法中,对应各个步骤执行的操作,在此不再做详细的说明。In other embodiments, each module in the text matching device provided by this application is also used to perform the operations performed in accordance with each step in the text matching method described in this application, and no detailed description will be given here.
本申请还提供一种存储介质。该存储介质上存储有计算机程序;所述计算机程序被处理器执行时,实现上述任一实施例所述的文本匹配方法。该存储介质可以是存储器。本实施方式中的存储介质是易失性存储介质,也可以是非易失性的存储介质。例如,内存储器或外存储器,或者包括内存储器和外存储器两者。内存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦写可编程ROM(EEPROM)、快闪存储器、或者随机存储器。外存储器可以包括硬盘、软盘、ZIP盘、U盘、磁带等。本申请所公开的存储介质包括但不限于这些类型的存储器。本申请所公开的存储器只作为例子而非作为限定。The application also provides a storage medium. A computer program is stored on the storage medium; when the computer program is executed by the processor, the text matching method described in any of the above embodiments is implemented. The storage medium may be a memory. The storage medium in this embodiment is a volatile storage medium or a non-volatile storage medium. For example, internal memory or external memory, or include both internal memory and external memory. The internal memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, or random access memory. The external memory may include hard disks, floppy disks, ZIP disks, U disks, magnetic tapes, etc. The storage media disclosed in this application include but are not limited to these types of memories. The memory disclosed in this application is only an example and not a limitation.
本申请还提供一种计算机设备。一种计算机设备包括:一个或多个处理器;存储器;一个或多个应用程序。其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个应用程序配置用于执行上述任一实施例所述的文本匹配方法。This application also provides a computer device. A computer device includes: one or more processors; memory; one or more application programs. Wherein the one or more application programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more application programs are configured to perform the operations described in any of the foregoing embodiments Text matching method.
图5为本申请一实施例中的计算机设备的结构示意图。本实施例所述计算机设备可以是服务器、个人计算机以及网络设备。如图5所示,设备包括处理器703、存储器705、输入单元707以及显示单元709等器件。本领域技术人员可以理解,图5示出的设备结构器件并不构成对所有设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件。存储器705可用于存储应用程序701以及各功能模块,处理器703运行存储在存储器705的应用程序701,从而执行设备的各种功能应用以及数据处理。存储器可以是内存储器或外存储器,或者包括内存储器和外存储器两者。内存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦写可编程ROM(EEPROM)、快闪存储器、或者随机存储器。外存储器可以包括硬盘、软盘、ZIP盘、U盘、磁带等。本申请所公开的存储器包括但不限于这些类型的存储器。本申请所公开的存储器只作为例子而非作为限定。5 is a schematic structural diagram of a computer device in an embodiment of the present application. The computer device in this embodiment may be a server, a personal computer, and a network device. As shown in FIG. 5, the device includes a processor 703, a memory 705, an input unit 707, a display unit 709, and other devices. Those skilled in the art may understand that the device structure device shown in FIG. 5 does not constitute a limitation on all devices, and may include more or less components than those illustrated, or combine certain components. The memory 705 may be used to store application programs 701 and various functional modules. The processor 703 runs the application programs 701 stored in the memory 705 to execute various functional applications and data processing of the device. The memory may be internal memory or external memory, or include both internal memory and external memory. The internal memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, or random access memory. The external memory may include hard disks, floppy disks, ZIP disks, U disks, magnetic tapes, etc. The memories disclosed in this application include but are not limited to these types of memories. The memory disclosed in this application is only an example and not a limitation.
输入单元707用于接收信号的输入,以及接收用户输入的关键字。输 入单元707可包括触控面板以及其它输入设备。触控面板可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板上或在触控面板附近的操作),并根据预先设定的程序驱动相应的连接装置;其它输入设备可以包括但不限于物理键盘、功能键(比如播放控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。显示单元709可用于显示用户输入的信息或提供给用户的信息以及计算机设备的各种菜单。显示单元709可采用液晶显示器、有机发光二极管等形式。处理器703是计算机设备的控制中心,利用各种接口和线路连接整个电脑的各个部分,通过运行或执行存储在存储器705内的软件程序和/或模块,以及调用存储在存储器内的数据,执行各种功能和处理数据。The input unit 707 is used to receive an input of a signal and a keyword input by a user. The input unit 707 may include a touch panel and other input devices. The touch panel can collect the user's touch operations on or near it (such as the user's operation with any suitable objects or accessories such as fingers, stylus, etc. on or near the touch panel), and according to the preset The program drives the corresponding connection device; other input devices may include but are not limited to one or more of a physical keyboard, function keys (such as playback control keys, switch keys, etc.), trackball, mouse, joystick, etc. The display unit 709 can be used to display information input by the user or information provided to the user and various menus of the computer device. The display unit 709 may take the form of a liquid crystal display, an organic light emitting diode, or the like. The processor 703 is the control center of the computer equipment. It uses various interfaces and lines to connect the various parts of the entire computer. By running or executing the software programs and/or modules stored in the memory 705, and calling the data stored in the memory, the Various functions and processing data.
在一实施方式中,设备包括一个或多个处理器703,以及一个或多个存储器705,一个或多个应用程序701。其中所述一个或多个应用程序701被存储在存储器705中并被配置为由所述一个或多个处理器703执行,所述一个或多个应用程序701配置用于执行以上实施例所述的文本匹配方法。In one embodiment, the device includes one or more processors 703, and one or more memories 705, and one or more applications 701. The one or more application programs 701 are stored in the memory 705 and are configured to be executed by the one or more processors 703, and the one or more application programs 701 are configured to perform the operations described in the above embodiments Text matching method.
此外,在本申请各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The above integrated modules can be implemented in the form of hardware or software function modules. If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括存储器、磁盘或光盘等。A person of ordinary skill in the art may understand that all or part of the steps for implementing the above-mentioned embodiments may be completed by hardware, or by a program instructing related hardware. The program may be stored in a computer-readable storage medium, and the storage medium may include Memory, magnetic disk or optical disk, etc.
以上所述仅是本申请的部分实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above is only part of the implementation of this application. It should be pointed out that for those of ordinary skill in the art, without departing from the principles of this application, a number of improvements and retouches can be made. These improvements and retouches also It should be regarded as the scope of protection of this application.
应该理解的是,在本申请各实施例中的各功能单元可集成在一个处理 模块中,也可以各个单元单独物理存在,也可以两个或两个以上单元集成于一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。It should be understood that the functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units may be integrated into one module. The above integrated modules can be implemented in the form of hardware or software function modules.
以上所述仅是本申请的部分实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above is only part of the implementation of this application. It should be pointed out that for those of ordinary skill in the art, without departing from the principles of this application, a number of improvements and retouches can be made. These improvements and retouches also It should be regarded as the scope of protection of this application.

Claims (20)

  1. 一种文本匹配方法,包括:A text matching method, including:
    接收输入的目标文本;Receive the input target text;
    获取根据所述目标文本进行初步匹配得到的多个候选语句;Acquiring multiple candidate sentences obtained by preliminary matching according to the target text;
    将所述目标文本与每个所述候选语句输入卷积神经网络CNN与GRU神经网络构成的文本匹配模型,得到每个所述候选语句与所述目标文本的语义相似度;其中,所述文本匹配模型用于表征所述目标文本与所述候选语句的语义相似度;Input the target text and each candidate sentence into a text matching model composed of a convolutional neural network CNN and a GRU neural network to obtain a semantic similarity between each candidate sentence and the target text; wherein, the text The matching model is used to characterize the semantic similarity between the target text and the candidate sentence;
    根据每个所述候选语句对应的语义相似度,向用户推荐所述候选语句。According to the semantic similarity corresponding to each candidate sentence, the candidate sentence is recommended to the user.
  2. 根据权利要求1所述的方法,所述将所述目标文本与每个所述候选语句输入卷积神经网络CNN与GRU神经网络构成的文本匹配模型,得到每个所述候选语句与所述目标文本的语义相似度,包括:The method according to claim 1, the inputting the target text and each candidate sentence into a text matching model formed by a convolutional neural network CNN and a GRU neural network to obtain each candidate sentence and the target The semantic similarity of text, including:
    将所述目标文本输入所述卷积神经网络CNN进行卷积处理,得到第一卷积向量,将所述候选语句输入所述卷积神经网络CNN进行卷积处理,得到第二卷积向量;Input the target text into the convolutional neural network CNN to perform convolution processing to obtain a first convolution vector, and input the candidate sentence into the convolutional neural network CNN to perform convolution processing to obtain a second convolution vector;
    将所述第一卷积向量输入所述GRU神经网络,到第一神经网络向量,将所述第二卷积向量输入所述GRU神经网络,得到第二神经网络向量;Input the first convolution vector into the GRU neural network to the first neural network vector, and input the second convolution vector into the GRU neural network to obtain a second neural network vector;
    根据所述第一神经网络向量和所述第二神经网络向量的余弦相似度,得到所述候选语句与所述目标文本的语义相似度。According to the cosine similarity between the first neural network vector and the second neural network vector, a semantic similarity between the candidate sentence and the target text is obtained.
  3. 根据权利要求1所述的方法,所述卷积神经网络CNN与GRU神经网络构成的文本匹配模型根据以下方式进行训练:The method according to claim 1, the text matching model composed of the CNN and the GRU neural network is trained according to the following manner:
    获取目标训练语句,与所述目标训练语句语义相似的第一训练语句,以及与所述目标训练语句语义不相似的第二训练语句;Acquiring a target training sentence, a first training sentence semantically similar to the target training sentence, and a second training sentence not semantically similar to the target training sentence;
    利用所述卷积神经网络CNN分别对所述目标训练语句、所述第一训练语句及所述第二训练语句进行卷积处理,得到与所述目标训练语句对应的第一向量、与所述第一训练语句对应的第二向量,及与所述第二训练语句对应的第三向量;Use the convolutional neural network CNN to perform convolution processing on the target training sentence, the first training sentence, and the second training sentence, respectively, to obtain a first vector corresponding to the target training sentence, and the A second vector corresponding to the first training sentence, and a third vector corresponding to the second training sentence;
    分别将所述第一向量、所述第二向量及所述第三向量输入所述GRU神经网络,得到与所述第一向量对应的第四向量、与所述第二向量对应的第 五向量及与所述第三向量对应的第六向量;Input the first vector, the second vector and the third vector into the GRU neural network respectively to obtain a fourth vector corresponding to the first vector and a fifth vector corresponding to the second vector And a sixth vector corresponding to the third vector;
    分别根据所述第四向量与第五向量的余弦相似度,以及所述第四向量与第六向量的余弦相似度,得到所述目标训练语句与所述第一训练语句的第一分值,以及所述目标训练语句与所述第二训练语句的第二分值;Obtain the first score of the target training sentence and the first training sentence based on the cosine similarity between the fourth vector and the fifth vector, and the cosine similarity between the fourth vector and the sixth vector, And the second score of the target training sentence and the second training sentence;
    根据所述第一分值和所述第二分值确定所述文本匹配模型中相关联的参数。The associated parameters in the text matching model are determined according to the first score and the second score.
  4. 根据权利要求3所述的方法,所述卷积神经网络CNN分别对所述目标训练语句、所述第一训练语句及所述第二训练语句进行卷积处理,包括:According to the method of claim 3, the convolutional neural network CNN respectively performs convolution processing on the target training sentence, the first training sentence, and the second training sentence, including:
    将所述卷积神经网络CNN的卷积窗口设置为预设N个词;Setting the convolution window of the convolutional neural network CNN to preset N words;
    利用设置后的所述卷积神经网络CNN分别对所述目标训练语句、所述第一训练语句及所述第二训练语句进行卷积处理。The convolutional neural network CNN is used to perform convolution processing on the target training sentence, the first training sentence, and the second training sentence, respectively.
  5. 根据权利要求3所述的方法,所述分别将所述第一向量、所述第二向量及所述第三向量输入所述GRU神经网络,得到与所述第一向量对应的第四向量、与所述第二向量对应的第五向量及与所述第三向量对应的第六向量之后,还包括:分别将所述第四向量、所述第五向量及所述第六向量通过池化层,以对所述第四向量、所述第五向量及所述第六向量进行维度变化处理;The method according to claim 3, the inputting the first vector, the second vector and the third vector to the GRU neural network respectively to obtain a fourth vector corresponding to the first vector, After the fifth vector corresponding to the second vector and the sixth vector corresponding to the third vector, the method further includes: pooling the fourth vector, the fifth vector, and the sixth vector, respectively Layer to perform dimension change processing on the fourth vector, the fifth vector, and the sixth vector;
    所述分别根据所述第四向量与第五向量的余弦相似度,以及所述第四向量与第六向量的余弦相似度,得到所述目标训练语句与所述第一训练语句的第一分值,以及所述目标训练语句与所述第二训练语句的第二分值,包括:分别根据维度变化处理后的所述第四向量与第五向量的余弦相似度,以及维度变化处理后的所述第四向量与第六向量的余弦相似度,得到所述目标训练语句与所述第一训练语句的第一分值,以及所述目标训练语句与所述第二训练语句的第二分值。Obtaining the first score of the target training sentence and the first training sentence according to the cosine similarity of the fourth vector and the fifth vector, and the cosine similarity of the fourth vector and the sixth vector, respectively Value, and the second score of the target training sentence and the second training sentence, including: the cosine similarity between the fourth vector and the fifth vector after the dimensional change processing and the dimensional change processing The cosine similarity of the fourth vector and the sixth vector to obtain the first score of the target training sentence and the first training sentence, and the second score of the target training sentence and the second training sentence value.
  6. 根据权利要求3所述的方法,所述根据所述第一分值和所述第二分值确定所述文本匹配模型中相关联的参数,包括:The method according to claim 3, the determining the associated parameters in the text matching model according to the first score and the second score includes:
    根据所述第一分值和所述第二分值确定所述文本匹配模型对应的代价函数的相关联的参数;所述代价函数包括铰链损失函数Hinge loss。The related parameters of the cost function corresponding to the text matching model are determined according to the first score and the second score; the cost function includes a hinge loss function Hinge loss.
  7. 根据权利要求1所述的方法,所述根据每个所述候选语句对应的语义相似度,向用户推荐所述候选语句,包括:According to the method of claim 1, the recommending the candidate sentence to the user according to the semantic similarity corresponding to each of the candidate sentences includes:
    根据每个所述候选语句对应的语义相似度,从所述多个候选语句中筛选出所述语义相似度最高的候选语句,向用户推荐该语义相似度最高的候选语句。According to the semantic similarity corresponding to each candidate sentence, the candidate sentence with the highest semantic similarity is selected from the plurality of candidate sentences, and the candidate sentence with the highest semantic similarity is recommended to the user.
  8. 一种文本匹配装置,包括:A text matching device, including:
    接收模块,用于获接收输入的目标文本;The receiving module is used to obtain the target text of the received input;
    第一获取模块,用于获取根据所述目标文本进行初步匹配得到的多个候选语句;A first obtaining module, configured to obtain a plurality of candidate sentences obtained by preliminary matching according to the target text;
    第二获取模块,用于将所述目标文本与每个所述候选语句输入卷积神经网络CNN与GRU神经网络构成的文本匹配模型,得到每个所述候选语句与所述目标文本的语义相似度;其中,所述文本匹配模型用于表征所述目标文本与所述候选语句的语义相似度;A second obtaining module, configured to input the target text and each candidate sentence into a text matching model formed by a convolutional neural network CNN and a GRU neural network, and obtain that each candidate sentence is semantically similar to the target text Degree; wherein, the text matching model is used to characterize the semantic similarity between the target text and the candidate sentence;
    推荐模块,用于根据每个所述候选语句对应的语义相似度,向用户推荐所述候选语句。The recommendation module is configured to recommend the candidate sentence to the user according to the semantic similarity corresponding to each candidate sentence.
  9. 一种计算机设备,包括:A computer device, including:
    一个或多个处理器;One or more processors;
    存储器;Memory
    一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个计算机程序配置用于执行一种文本匹配方法,所述文本匹配方法包括以下步骤:One or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, the one or more computer programs are configured to execute A text matching method, the text matching method includes the following steps:
    接收输入的目标文本;Receive the input target text;
    获取根据所述目标文本进行初步匹配得到的多个候选语句;Acquiring multiple candidate sentences obtained by preliminary matching according to the target text;
    将所述目标文本与每个所述候选语句输入卷积神经网络CNN与GRU神经网络构成的文本匹配模型,得到每个所述候选语句与所述目标文本的语义相似度;其中,所述文本匹配模型用于表征所述目标文本与所述候选语句的语义相似度;Input the target text and each candidate sentence into a text matching model composed of a convolutional neural network CNN and a GRU neural network to obtain a semantic similarity between each candidate sentence and the target text; wherein, the text The matching model is used to characterize the semantic similarity between the target text and the candidate sentence;
    根据每个所述候选语句对应的语义相似度,向用户推荐所述候选语句。According to the semantic similarity corresponding to each candidate sentence, the candidate sentence is recommended to the user.
  10. 根据权利要求9所述的计算机设备,所述将所述目标文本与每个所述候选语句输入卷积神经网络CNN与GRU神经网络构成的文本匹配模型,得到每个所述候选语句与所述目标文本的语义相似度,包括:The computer device according to claim 9, wherein the target text and each candidate sentence are input into a text matching model formed by a convolutional neural network CNN and a GRU neural network, and each candidate sentence and the The semantic similarity of the target text, including:
    将所述目标文本输入所述卷积神经网络CNN进行卷积处理,得到第一卷积向量,将所述候选语句输入所述卷积神经网络CNN进行卷积处理,得到第二卷积向量;Input the target text into the convolutional neural network CNN to perform convolution processing to obtain a first convolution vector, and input the candidate sentence into the convolutional neural network CNN to perform convolution processing to obtain a second convolution vector;
    将所述第一卷积向量输入所述GRU神经网络,到第一神经网络向量,将所述第二卷积向量输入所述GRU神经网络,得到第二神经网络向量;Input the first convolution vector into the GRU neural network to the first neural network vector, and input the second convolution vector into the GRU neural network to obtain a second neural network vector;
    根据所述第一神经网络向量和所述第二神经网络向量的余弦相似度,得到所述候选语句与所述目标文本的语义相似度。According to the cosine similarity between the first neural network vector and the second neural network vector, a semantic similarity between the candidate sentence and the target text is obtained.
  11. 根据权利要求9所述的计算机设备,所述卷积神经网络CNN与GRU神经网络构成的文本匹配模型根据以下方式进行训练:According to the computer device of claim 9, the text matching model composed of the CNN and GRU neural network is trained according to the following manner:
    获取目标训练语句,与所述目标训练语句语义相似的第一训练语句,以及与所述目标训练语句语义不相似的第二训练语句;Acquiring a target training sentence, a first training sentence semantically similar to the target training sentence, and a second training sentence not semantically similar to the target training sentence;
    利用所述卷积神经网络CNN分别对所述目标训练语句、所述第一训练语句及所述第二训练语句进行卷积处理,得到与所述目标训练语句对应的第一向量、与所述第一训练语句对应的第二向量,及与所述第二训练语句对应的第三向量;Use the convolutional neural network CNN to perform convolution processing on the target training sentence, the first training sentence, and the second training sentence, respectively, to obtain a first vector corresponding to the target training sentence, and the A second vector corresponding to the first training sentence, and a third vector corresponding to the second training sentence;
    分别将所述第一向量、所述第二向量及所述第三向量输入所述GRU神经网络,得到与所述第一向量对应的第四向量、与所述第二向量对应的第五向量及与所述第三向量对应的第六向量;Input the first vector, the second vector and the third vector into the GRU neural network respectively to obtain a fourth vector corresponding to the first vector and a fifth vector corresponding to the second vector And a sixth vector corresponding to the third vector;
    分别根据所述第四向量与第五向量的余弦相似度,以及所述第四向量与第六向量的余弦相似度,得到所述目标训练语句与所述第一训练语句的第一分值,以及所述目标训练语句与所述第二训练语句的第二分值;Obtain the first score of the target training sentence and the first training sentence based on the cosine similarity between the fourth vector and the fifth vector, and the cosine similarity between the fourth vector and the sixth vector, And the second score of the target training sentence and the second training sentence;
    根据所述第一分值和所述第二分值确定所述文本匹配模型中相关联的参数。The associated parameters in the text matching model are determined according to the first score and the second score.
  12. 根据权利要求11所述的计算机设备,所述卷积神经网络CNN分别对所述目标训练语句、所述第一训练语句及所述第二训练语句进行卷积处理,包括:The computer device according to claim 11, wherein the convolutional neural network CNN respectively performs convolution processing on the target training sentence, the first training sentence, and the second training sentence, including:
    将所述卷积神经网络CNN的卷积窗口设置为预设N个词;Setting the convolution window of the convolutional neural network CNN to preset N words;
    利用设置后的所述卷积神经网络CNN分别对所述目标训练语句、所述第一训练语句及所述第二训练语句进行卷积处理。The convolutional neural network CNN is used to perform convolution processing on the target training sentence, the first training sentence, and the second training sentence, respectively.
  13. 根据权利要求11所述的计算机设备,所述分别将所述第一向量、所述第二向量及所述第三向量输入所述GRU神经网络,得到与所述第一向量对应的第四向量、与所述第二向量对应的第五向量及与所述第三向量对应的第六向量之后,还包括:分别将所述第四向量、所述第五向量及所述第六向量通过池化层,以对所述第四向量、所述第五向量及所述第六向量进行维度变化处理;The computer device according to claim 11, the inputting the first vector, the second vector and the third vector into the GRU neural network respectively to obtain a fourth vector corresponding to the first vector After the fifth vector corresponding to the second vector and the sixth vector corresponding to the third vector, the method further includes: passing the fourth vector, the fifth vector, and the sixth vector through the pool, respectively A layer to perform dimension change processing on the fourth vector, the fifth vector, and the sixth vector;
    所述分别根据所述第四向量与第五向量的余弦相似度,以及所述第四向量与第六向量的余弦相似度,得到所述目标训练语句与所述第一训练语句的第一分值,以及所述目标训练语句与所述第二训练语句的第二分值,包括:分别根据维度变化处理后的所述第四向量与第五向量的余弦相似度,以及维度变化处理后的所述第四向量与第六向量的余弦相似度,得到所述目标训练语句与所述第一训练语句的第一分值,以及所述目标训练语句与所述第二训练语句的第二分值。Obtaining the first score of the target training sentence and the first training sentence according to the cosine similarity of the fourth vector and the fifth vector, and the cosine similarity of the fourth vector and the sixth vector, respectively Value, and the second score of the target training sentence and the second training sentence, including: the cosine similarity between the fourth vector and the fifth vector after the dimensional change processing and the dimensional change processing The cosine similarity of the fourth vector and the sixth vector to obtain the first score of the target training sentence and the first training sentence, and the second score of the target training sentence and the second training sentence value.
  14. 根据权利要求11所述的计算机设备,所述根据所述第一分值和所述第二分值确定所述文本匹配模型中相关联的参数,包括:The computer device according to claim 11, said determining the associated parameters in the text matching model according to the first score and the second score includes:
    根据所述第一分值和所述第二分值确定所述文本匹配模型对应的代价函数的相关联的参数;所述代价函数包括铰链损失函数Hinge loss。The associated parameters of the cost function corresponding to the text matching model are determined according to the first score and the second score; the cost function includes a hinge loss function Hinge loss.
  15. 根据权利要求9所述的计算机设备,所述根据每个所述候选语句对应的语义相似度,向用户推荐所述候选语句,包括:According to the computer device of claim 9, the recommendation of the candidate sentence to the user according to the semantic similarity corresponding to each of the candidate sentences includes:
    根据每个所述候选语句对应的语义相似度,从所述多个候选语句中筛选出所述语义相似度最高的候选语句,向用户推荐该语义相似度最高的候选语句。According to the semantic similarity corresponding to each candidate sentence, the candidate sentence with the highest semantic similarity is selected from the plurality of candidate sentences, and the candidate sentence with the highest semantic similarity is recommended to the user.
  16. 一种存储介质,其上存储有计算机程序;所述计算机程序适于由处理器加载并执行一种文本匹配方法,包括:A storage medium on which a computer program is stored; the computer program is adapted to be loaded by a processor and execute a text matching method, including:
    接收输入的目标文本;Receive the input target text;
    获取根据所述目标文本进行初步匹配得到的多个候选语句;Acquiring multiple candidate sentences obtained by preliminary matching according to the target text;
    将所述目标文本与每个所述候选语句输入卷积神经网络CNN与GRU神经网络构成的文本匹配模型,得到每个所述候选语句与所述目标文本的语义相似度;其中,所述文本匹配模型用于表征所述目标文本与所述候选语句的语义相似度;Input the target text and each candidate sentence into a text matching model composed of a convolutional neural network CNN and a GRU neural network to obtain a semantic similarity between each candidate sentence and the target text; wherein, the text The matching model is used to characterize the semantic similarity between the target text and the candidate sentence;
    根据每个所述候选语句对应的语义相似度,向用户推荐所述候选语句。According to the semantic similarity corresponding to each candidate sentence, the candidate sentence is recommended to the user.
  17. 根据权利要求16所述的存储介质,所述将所述目标文本与每个所述候选语句输入卷积神经网络CNN与GRU神经网络构成的文本匹配模型,得到每个所述候选语句与所述目标文本的语义相似度,包括:The storage medium according to claim 16, wherein the target text and each candidate sentence are input into a text matching model composed of a convolutional neural network CNN and a GRU neural network, and each candidate sentence and the The semantic similarity of the target text, including:
    将所述目标文本输入所述卷积神经网络CNN进行卷积处理,得到第一卷积向量,将所述候选语句输入所述卷积神经网络CNN进行卷积处理,得到第二卷积向量;Input the target text into the convolutional neural network CNN to perform convolution processing to obtain a first convolution vector, and input the candidate sentence into the convolutional neural network CNN to perform convolution processing to obtain a second convolution vector;
    将所述第一卷积向量输入所述GRU神经网络,到第一神经网络向量,将所述第二卷积向量输入所述GRU神经网络,得到第二神经网络向量;Input the first convolution vector into the GRU neural network to the first neural network vector, and input the second convolution vector into the GRU neural network to obtain a second neural network vector;
    根据所述第一神经网络向量和所述第二神经网络向量的余弦相似度,得到所述候选语句与所述目标文本的语义相似度。According to the cosine similarity between the first neural network vector and the second neural network vector, a semantic similarity between the candidate sentence and the target text is obtained.
  18. 根据权利要求16所述的存储介质,所述卷积神经网络CNN与GRU神经网络构成的文本匹配模型根据以下方式进行训练:The storage medium according to claim 16, the text matching model composed of the convolutional neural network CNN and the GRU neural network is trained according to the following manner:
    获取目标训练语句,与所述目标训练语句语义相似的第一训练语句,以及与所述目标训练语句语义不相似的第二训练语句;Acquiring a target training sentence, a first training sentence semantically similar to the target training sentence, and a second training sentence not semantically similar to the target training sentence;
    利用所述卷积神经网络CNN分别对所述目标训练语句、所述第一训练语句及所述第二训练语句进行卷积处理,得到与所述目标训练语句对应的第一向量、与所述第一训练语句对应的第二向量,及与所述第二训练语句对应的第三向量;Use the convolutional neural network CNN to perform convolution processing on the target training sentence, the first training sentence, and the second training sentence, respectively, to obtain a first vector corresponding to the target training sentence, and the A second vector corresponding to the first training sentence, and a third vector corresponding to the second training sentence;
    分别将所述第一向量、所述第二向量及所述第三向量输入所述GRU神经网络,得到与所述第一向量对应的第四向量、与所述第二向量对应的第五向量及与所述第三向量对应的第六向量;Input the first vector, the second vector and the third vector into the GRU neural network respectively to obtain a fourth vector corresponding to the first vector and a fifth vector corresponding to the second vector And a sixth vector corresponding to the third vector;
    分别根据所述第四向量与第五向量的余弦相似度,以及所述第四向量与第六向量的余弦相似度,得到所述目标训练语句与所述第一训练语句的第一分值,以及所述目标训练语句与所述第二训练语句的第二分值;Obtain the first score of the target training sentence and the first training sentence based on the cosine similarity between the fourth vector and the fifth vector, and the cosine similarity between the fourth vector and the sixth vector, And the second score of the target training sentence and the second training sentence;
    根据所述第一分值和所述第二分值确定所述文本匹配模型中相关联的参数。The associated parameters in the text matching model are determined according to the first score and the second score.
  19. 根据权利要求18所述的存储介质,所述卷积神经网络CNN分别对所述目标训练语句、所述第一训练语句及所述第二训练语句进行卷积处理,包括:The storage medium according to claim 18, wherein the convolutional neural network CNN performs convolution processing on the target training sentence, the first training sentence, and the second training sentence, respectively, including:
    将所述卷积神经网络CNN的卷积窗口设置为预设N个词;Setting the convolution window of the convolutional neural network CNN to preset N words;
    利用设置后的所述卷积神经网络CNN分别对所述目标训练语句、所述第一训练语句及所述第二训练语句进行卷积处理。The convolutional neural network CNN is used to perform convolution processing on the target training sentence, the first training sentence, and the second training sentence, respectively.
  20. 根据权利要求18所述的存储介质,所述分别将所述第一向量、所述第二向量及所述第三向量输入所述GRU神经网络,得到与所述第一向量对应的第四向量、与所述第二向量对应的第五向量及与所述第三向量对应的第六向量之后,还包括:分别将所述第四向量、所述第五向量及所述第六向量通过池化层,以对所述第四向量、所述第五向量及所述第六向量进行维度变化处理;The storage medium according to claim 18, wherein the first vector, the second vector, and the third vector are input to the GRU neural network to obtain a fourth vector corresponding to the first vector After the fifth vector corresponding to the second vector and the sixth vector corresponding to the third vector, the method further includes: passing the fourth vector, the fifth vector, and the sixth vector through the pool, respectively A layer to perform dimension change processing on the fourth vector, the fifth vector, and the sixth vector;
    所述分别根据所述第四向量与第五向量的余弦相似度,以及所述第四向量与第六向量的余弦相似度,得到所述目标训练语句与所述第一训练语句的第一分值,以及所述目标训练语句与所述第二训练语句的第二分值,包括:分别根据维度变化处理后的所述第四向量与第五向量的余弦相似度,以及维度变化处理后的所述第四向量与第六向量的余弦相似度,得到所述目标训练语句与所述第一训练语句的第一分值,以及所述目标训练语句与所述第二训练语句的第二分值。Obtaining the first score of the target training sentence and the first training sentence according to the cosine similarity of the fourth vector and the fifth vector, and the cosine similarity of the fourth vector and the sixth vector, respectively Value, and the second score of the target training sentence and the second training sentence, including: the cosine similarity between the fourth vector and the fifth vector after the dimensional change processing and the dimensional change processing The cosine similarity of the fourth vector and the sixth vector to obtain the first score of the target training sentence and the first training sentence, and the second score of the target training sentence and the second training sentence value.
PCT/CN2019/118532 2019-01-04 2019-11-14 Text matching method and apparatus, storage medium and computer device WO2020140635A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910008683.8 2019-01-04
CN201910008683.8A CN109740126B (en) 2019-01-04 2019-01-04 Text matching method and device, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
WO2020140635A1 true WO2020140635A1 (en) 2020-07-09

Family

ID=66363528

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/118532 WO2020140635A1 (en) 2019-01-04 2019-11-14 Text matching method and apparatus, storage medium and computer device

Country Status (2)

Country Link
CN (1) CN109740126B (en)
WO (1) WO2020140635A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112926340A (en) * 2021-03-25 2021-06-08 东南大学 Semantic matching model for knowledge point positioning
CN114428850A (en) * 2022-04-07 2022-05-03 之江实验室 Text retrieval matching method and system
CN114638212A (en) * 2020-12-16 2022-06-17 科沃斯商用机器人有限公司 Model training method and device, electronic equipment and storage medium
CN117194614A (en) * 2023-11-02 2023-12-08 北京中电普华信息技术有限公司 Text difference recognition method, device and computer readable medium

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109740126B (en) * 2019-01-04 2023-11-21 平安科技(深圳)有限公司 Text matching method and device, storage medium and computer equipment
CN111767737A (en) * 2019-05-30 2020-10-13 北京京东尚科信息技术有限公司 Text intention similarity determining method and device, electronic equipment and storage medium
CN110489730A (en) * 2019-08-14 2019-11-22 腾讯科技(深圳)有限公司 Text handling method, device, terminal and storage medium
CN110674292B (en) * 2019-08-27 2023-04-18 腾讯科技(深圳)有限公司 Man-machine interaction method, device, equipment and medium
CN110532356A (en) * 2019-08-30 2019-12-03 联想(北京)有限公司 Information processing method, device and storage medium
CN110705283A (en) * 2019-09-06 2020-01-17 上海交通大学 Deep learning method and system based on matching of text laws and regulations and judicial interpretations
CN112613320A (en) * 2019-09-19 2021-04-06 北京国双科技有限公司 Method and device for acquiring similar sentences, storage medium and electronic equipment
CN110781686B (en) * 2019-10-30 2023-04-18 普信恒业科技发展(北京)有限公司 Statement similarity calculation method and device and computer equipment
CN110825867B (en) * 2019-11-01 2023-01-17 科大讯飞股份有限公司 Similar text recommendation method and device, electronic equipment and storage medium
CN111178062B (en) * 2019-12-02 2023-05-05 云知声智能科技股份有限公司 Acceleration labeling method and device for man-machine interaction multi-round dialogue corpus
CN113127612A (en) * 2019-12-31 2021-07-16 深圳市优必选科技股份有限公司 Reply feedback method, reply feedback device and intelligent equipment
CN113139034A (en) * 2020-01-17 2021-07-20 深圳市优必选科技股份有限公司 Statement matching method, statement matching device and intelligent equipment
CN111274787B (en) * 2020-02-21 2023-04-18 支付宝(杭州)信息技术有限公司 User intention prediction method and system
CN111797204A (en) * 2020-07-01 2020-10-20 北京三快在线科技有限公司 Text matching method and device, computer equipment and storage medium
CN111859939B (en) * 2020-07-29 2023-07-25 中国平安人寿保险股份有限公司 Text matching method, system and computer equipment
CN112749558B (en) * 2020-09-03 2023-11-24 腾讯科技(深圳)有限公司 Target content acquisition method, device, computer equipment and storage medium
CN112307048B (en) * 2020-10-30 2023-12-05 中国平安财产保险股份有限公司 Semantic matching model training method, matching method, device, equipment and storage medium
CN112732875A (en) * 2021-01-20 2021-04-30 珠海格力电器股份有限公司 Method and device for determining corpus data tags
CN112749268A (en) * 2021-01-30 2021-05-04 云知声智能科技股份有限公司 FAQ system sequencing method, device and system based on hybrid strategy
CN112906381B (en) * 2021-02-02 2024-05-28 北京有竹居网络技术有限公司 Dialog attribution identification method and device, readable medium and electronic equipment
CN113205384B (en) * 2021-05-10 2024-02-06 北京百度网讯科技有限公司 Text processing method, device, equipment and storage medium
CN113704386A (en) * 2021-10-27 2021-11-26 深圳前海环融联易信息科技服务有限公司 Text recommendation method and device based on deep learning and related media
CN114781409B (en) * 2022-05-12 2023-12-01 北京百度网讯科技有限公司 Text translation method, device, electronic equipment and storage medium
CN115860012B (en) * 2022-05-25 2024-06-11 北京中关村科金技术有限公司 User intention recognition method, device, electronic equipment and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160155436A1 (en) * 2014-12-02 2016-06-02 Samsung Electronics Co., Ltd. Method and apparatus for speech recognition
CN107832326A (en) * 2017-09-18 2018-03-23 北京大学 A kind of natural language question-answering method based on deep layer convolutional neural networks
CN107980130A (en) * 2017-11-02 2018-05-01 深圳前海达闼云端智能科技有限公司 It is automatic to answer method, apparatus, storage medium and electronic equipment
CN108197109A (en) * 2017-12-29 2018-06-22 北京百分点信息科技有限公司 A kind of multilingual analysis method and device based on natural language processing
CN108509408A (en) * 2017-02-27 2018-09-07 芋头科技(杭州)有限公司 A kind of sentence similarity judgment method
CN109740126A (en) * 2019-01-04 2019-05-10 平安科技(深圳)有限公司 Text matching technique, device and storage medium, computer equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107577662A (en) * 2017-08-08 2018-01-12 上海交通大学 Towards the semantic understanding system and method for Chinese text
CN108132931B (en) * 2018-01-12 2021-06-25 鼎富智能科技有限公司 Text semantic matching method and device
CN108829719B (en) * 2018-05-07 2022-03-01 中国科学院合肥物质科学研究院 Non-fact question-answer selection method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160155436A1 (en) * 2014-12-02 2016-06-02 Samsung Electronics Co., Ltd. Method and apparatus for speech recognition
CN108509408A (en) * 2017-02-27 2018-09-07 芋头科技(杭州)有限公司 A kind of sentence similarity judgment method
CN107832326A (en) * 2017-09-18 2018-03-23 北京大学 A kind of natural language question-answering method based on deep layer convolutional neural networks
CN107980130A (en) * 2017-11-02 2018-05-01 深圳前海达闼云端智能科技有限公司 It is automatic to answer method, apparatus, storage medium and electronic equipment
CN108197109A (en) * 2017-12-29 2018-06-22 北京百分点信息科技有限公司 A kind of multilingual analysis method and device based on natural language processing
CN109740126A (en) * 2019-01-04 2019-05-10 平安科技(深圳)有限公司 Text matching technique, device and storage medium, computer equipment

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114638212A (en) * 2020-12-16 2022-06-17 科沃斯商用机器人有限公司 Model training method and device, electronic equipment and storage medium
CN112926340A (en) * 2021-03-25 2021-06-08 东南大学 Semantic matching model for knowledge point positioning
CN112926340B (en) * 2021-03-25 2024-05-07 东南大学 Semantic matching model for knowledge point positioning
CN114428850A (en) * 2022-04-07 2022-05-03 之江实验室 Text retrieval matching method and system
CN114428850B (en) * 2022-04-07 2022-08-05 之江实验室 Text retrieval matching method and system
CN117194614A (en) * 2023-11-02 2023-12-08 北京中电普华信息技术有限公司 Text difference recognition method, device and computer readable medium
CN117194614B (en) * 2023-11-02 2024-01-30 北京中电普华信息技术有限公司 Text difference recognition method, device and computer readable medium

Also Published As

Publication number Publication date
CN109740126A (en) 2019-05-10
CN109740126B (en) 2023-11-21

Similar Documents

Publication Publication Date Title
WO2020140635A1 (en) Text matching method and apparatus, storage medium and computer device
WO2020211566A1 (en) Method and device for making recommendation to user, computing apparatus, and storage medium
CN109840287B (en) Cross-modal information retrieval method and device based on neural network
CN108491433B (en) Chat response method, electronic device and storage medium
WO2019242297A1 (en) Method for intelligent dialogue based on machine reading comprehension, device, and terminal
CN108829822B (en) Media content recommendation method and device, storage medium and electronic device
WO2020177282A1 (en) Machine dialogue method and apparatus, computer device, and storage medium
CN107330120B (en) Inquire answer method, inquiry answering device and computer readable storage medium
US20170140248A1 (en) Learning image representation by distilling from multi-task networks
CN111190997B (en) Question-answering system implementation method using neural network and machine learning ordering algorithm
WO2017197806A1 (en) Method for providing intelligent service, intelligent service system and intelligent terminal based on artificial intelligence
US20110106805A1 (en) Method and system for searching multilingual documents
CN110147494B (en) Information searching method and device, storage medium and electronic equipment
CN109710732B (en) Information query method, device, storage medium and electronic equipment
WO2020215683A1 (en) Semantic recognition method and apparatus based on convolutional neural network, and non-volatile readable storage medium and computer device
CN108803890B (en) Input method, input device and input device
WO2023207096A1 (en) Entity linking method and apparatus, device, and nonvolatile readable storage medium
WO2021115277A1 (en) Image retrieval method and apparatus, storage medium, and electronic device
CN111090771A (en) Song searching method and device and computer storage medium
CN110598123B (en) Information retrieval recommendation method, device and storage medium based on image similarity
CN116501960A (en) Content retrieval method, device, equipment and medium
CN106570196B (en) Video program searching method and device
CN113342944B (en) Corpus generalization method, apparatus, device and storage medium
CN111985217B (en) Keyword extraction method, computing device and readable storage medium
WO2020151318A1 (en) Corpus construction method and apparatus based on crawler model, and computer device

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

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

Country of ref document: EP

Kind code of ref document: A1