WO2022061833A1 - 文本相似度确定方法、装置及工业诊断方法、系统 - Google Patents

文本相似度确定方法、装置及工业诊断方法、系统 Download PDF

Info

Publication number
WO2022061833A1
WO2022061833A1 PCT/CN2020/118172 CN2020118172W WO2022061833A1 WO 2022061833 A1 WO2022061833 A1 WO 2022061833A1 CN 2020118172 W CN2020118172 W CN 2020118172W WO 2022061833 A1 WO2022061833 A1 WO 2022061833A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
sentence
sentences
similarity
pairs
Prior art date
Application number
PCT/CN2020/118172
Other languages
English (en)
French (fr)
Inventor
车效音
惠浩添
生若谷
王刚华
陆霆
Original Assignee
西门子股份公司
西门子(中国)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 西门子股份公司, 西门子(中国)有限公司 filed Critical 西门子股份公司
Priority to PCT/CN2020/118172 priority Critical patent/WO2022061833A1/zh
Priority to CN202080104960.6A priority patent/CN116097237A/zh
Priority to EP20954684.5A priority patent/EP4202714A4/en
Publication of WO2022061833A1 publication Critical patent/WO2022061833A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates

Definitions

  • the present invention relates to the technical field of natural language processing, and in particular, to a text similarity determination method and device, and an industrial diagnosis method and system.
  • US Patent No. 5,463,768 describes a method and system for analyzing diagnostic error logs.
  • the features of fault cases are extracted based on specific handwritten rules to form representative vectors of fault cases, and then the similarity between different cases is evaluated by calculating the mathematical distance between the corresponding vectors.
  • the embodiments of the present invention propose a text similarity determination method, device, and industrial diagnosis method and system, which can determine text similarity without setting handwriting rules, which can save costs.
  • a text similarity determination method including:
  • n is a positive integer
  • each of the first sentence pairs includes any one of the m sentences and any one of the n sentences;
  • the similarity between the first text and the second text is determined based on the correlation coefficients of the m*n first sentence pairs.
  • the embodiment of the present invention calculates the similarity of the two sentences in the first sentence pair including any sentence segmented by the first text and any sentence segmented by the second text, and then uses each first sentence pair.
  • the correlation coefficient of calculates the similarity between the first text and the second text, and can determine the text similarity without setting handwriting rules, which avoids the strict requirements for high-level domain knowledge, thereby reducing the cost.
  • the embodiment of the present invention divides the text into sentences, and then determines the relationship between the sentences in the texts compared with each other.
  • the correlation coefficient of sentence pairs, and then the similarity between texts can be determined according to each correlation coefficient. It can be determined at the sentence level whether it is semantically related, which realizes a finer-grained correlation analysis, thus improving the accuracy of the calculated similarity between texts. Spend.
  • the embodiment of the present invention performs correlation analysis based on sentence pairs, rather than directly comparing texts, so it is not sensitive to differences in text lengths, and is suitable for similarity calculation between texts of various lengths, and has wider applicability Scope.
  • the method before determining the correlation coefficient of each sentence pair in the m*n first sentence pairs, the method further includes:
  • the pre-trained natural language model is trained by using the automatically labeled second sentence to obtain the sentence-related model
  • the determining the correlation coefficient between two sentences in each of the m*n first sentence pairs includes: based on the sentence correlation model, determining the m*n first sentence pairs in the The correlation coefficient between the two sentences in each sentence pair of .
  • the embodiment of the present invention trains a pre-trained natural language model to obtain a sentence correlation model, and then uses the sentence correlation model to determine the correlation coefficient of the first sentence pair, which improves processing efficiency.
  • the automatic labeling of the second sentence pair used as training data includes:
  • the second sentence pair is automatically marked as a negative example.
  • the embodiment of the present invention can quickly label the second sentence pair by judging whether two sentences in the second sentence pair belong to the same text, which realizes a fast automatic labeling method and improves the labeling efficiency.
  • determining the similarity between the first text and the second text based on the correlation coefficients of m*n first sentence pairs includes at least one of the following:
  • the embodiments of the present invention can calculate the similarity between the first text and the second text in various ways, have a wide range of applications, and are conducive to user selection.
  • a text similarity determination device including:
  • a first segmentation module configured to segment the first text to generate m sentences, where m is a positive integer
  • the second segmentation module is used to segment the second text to generate n sentences, where n is a positive integer
  • Sentence pair determination module for determining m*n first sentence pairs, wherein each of the first sentence pairs includes any one of the m sentences and any one of the n sentences;
  • a correlation coefficient determination module for determining a correlation coefficient between two sentences in each of the m*n first sentence pairs
  • a similarity determination module configured to determine the similarity between the first text and the second text based on the correlation coefficients of the m*n first sentence pairs.
  • the embodiment of the present invention calculates the similarity of the two sentences in the first sentence pair including any sentence segmented by the first text and any sentence segmented by the second text, and then uses each first sentence pair.
  • the correlation coefficient of calculates the similarity between the first text and the second text, and can determine the text similarity without setting handwriting rules, which avoids the strict requirements for high-level domain knowledge, thereby reducing the cost.
  • the embodiment of the present invention divides the text into sentences, and then determines the sentences formed between the sentences in the texts compared with each other.
  • the correlation coefficients are correct, and then the similarity between texts can be determined according to each correlation coefficient. It can be determined at the sentence level whether it is semantically related, and a finer-grained correlation analysis is realized, thus improving the accuracy of the calculated similarity between texts.
  • the embodiment of the present invention performs correlation analysis based on sentence pairs, rather than directly comparing texts, so it is not sensitive to differences in text lengths, and is suitable for similarity calculation between texts of various lengths, and has wider applicability Scope.
  • the device further includes:
  • a labeling module for automatically labeling the second sentence pair as training data before the correlation coefficient determination module determines the correlation coefficient of each sentence pair in the m*n first sentence pairs;
  • a training module for training a pre-trained natural language model by using the automatically labeled second sentence to obtain the sentence-related model
  • the correlation coefficient determination module is used to determine the correlation coefficient between two sentences in each sentence pair of the m*n first sentence pairs based on the sentence correlation model.
  • the embodiment of the present invention trains a pre-trained natural language model to obtain a sentence correlation model, and then uses the sentence correlation model to determine the correlation coefficient of the first sentence pair, which improves processing efficiency.
  • the labeling module is configured to automatically label the second sentence pair as a positive example when two sentences in the second sentence pair belong to the same text; when two sentences in the second sentence pair belong to the same text When the sentences belong to different texts, the second sentence pair is automatically marked as a negative example.
  • the embodiment of the present invention can quickly label the second sentence pair by judging whether two sentences in the second sentence pair belong to the same text, which realizes a fast automatic labeling method and improves the labeling efficiency.
  • the similarity determination module is configured to perform at least one of the following:
  • the embodiments of the present invention can calculate the similarity between the first text and the second text in various ways, have a wide range of applications, and are conducive to user selection.
  • the third aspect provides industrial diagnostic systems, including:
  • Human-machine interface module for receiving query case text
  • Historical case database used to save K historical case texts, where K is a positive integer
  • a processor coupled to the human-machine interface module and the historical case database, respectively, is configured to:
  • the embodiment of the present invention calculates the similarity of the two sentences in the first sentence pair including any sentence segmented from the query case text and any sentence segmented from the historical case text, and then uses each first sentence pair.
  • the correlation coefficient calculates the similarity between the query case text and the historical case text, and the text similarity can be determined without setting handwriting rules, avoiding the harsh requirements for high-level domain knowledge, thereby reducing costs.
  • the embodiment of the present invention divides the text into sentences, and then determines the relationship between the sentences in the texts compared with each other.
  • the correlation coefficient of sentence pairs, and then the similarity between texts can be determined according to each correlation coefficient. It can be determined at the sentence level whether it is semantically related, which realizes a finer-grained correlation analysis, thus improving the accuracy of the calculated similarity between texts.
  • the retrieved historical case texts are more relevant to the query case texts, which is conducive to quick processing of industrial faults.
  • the embodiment of the present invention performs correlation analysis based on sentence pairs, rather than directly comparing texts, so it is not sensitive to differences in text lengths, and is suitable for similarity calculation between texts of various lengths, and has wider applicability Scope.
  • the processor is configured to:
  • the determining the correlation coefficient between two sentences in each of the m*n k first sentence pairs includes: based on the sentence correlation model, determining m*n k first sentences For each sentence in the pair, the correlation coefficient between the two sentences in the pair.
  • the embodiment of the present invention trains a pre-trained natural language model to obtain a sentence correlation model, and then uses the sentence correlation model to determine the correlation coefficient of the first sentence pair, which improves processing efficiency.
  • the processor is further configured to: when two sentences in the second sentence pair belong to the same text, automatically mark the second sentence pair as a positive example; when the second sentence pair When the two sentences in the text belong to different texts, the second sentence pair is automatically marked as a negative example.
  • the embodiment of the present invention can quickly label the second sentence pair by judging whether two sentences in the second sentence pair belong to the same text, which realizes a fast automatic labeling method and improves the labeling efficiency.
  • the processor is further configured to execute at least one of the following:
  • the arithmetic mean value of the correlation coefficients of the m*n k first sentence pairs is determined as the first text and the second text similarity between
  • the embodiments of the present invention can calculate the similarity between the query case text and the historical case text in a variety of ways, have a wide range of applications, and are conducive to user selection.
  • an industrial diagnostic method including:
  • each of the first sentence pairs includes any one of the m sentences and any one of the n k sentences;
  • a historical case text as an output is determined from the K historical case texts based on the ranking result.
  • the embodiment of the present invention calculates the similarity of the two sentences in the first sentence pair including any sentence segmented from the query case text and any sentence segmented from the historical case text, and then uses each first sentence pair.
  • the correlation coefficient calculates the similarity between the query case text and the historical case text, and the text similarity can be determined without setting handwriting rules, avoiding the harsh requirements for high-level domain knowledge, thereby reducing costs.
  • the embodiment of the present invention determines the similarity between texts through the correlation coefficient of sentence pairs, and can determine whether they are semantically related at the sentence level, which improves the accuracy of the calculated similarity between texts, and the retrieved historical case texts and the query Case texts are more relevant and facilitate quick handling of industrial faults.
  • the method before determining the correlation coefficient of each sentence pair in the m*n first sentence pairs, the method further includes:
  • the pre-trained natural language model is trained by using the automatically labeled second sentence to obtain the sentence-related model
  • the determining the correlation coefficient between two sentences in each of the m*n first sentence pairs includes: based on the sentence correlation model, determining the m*n first sentence pairs in the The correlation coefficient between the two sentences in each sentence pair of .
  • the embodiment of the present invention trains a pre-trained natural language model to obtain a sentence correlation model, and then uses the sentence correlation model to determine the correlation coefficient of the first sentence pair, which improves processing efficiency.
  • the automatic labeling of the second sentence pair used as training data includes at least one of the following:
  • the second sentence pair is automatically marked as a negative example.
  • the embodiment of the present invention can quickly label the second sentence pair by judging whether two sentences in the second sentence pair belong to the same text, which realizes a fast automatic labeling method and improves the labeling efficiency.
  • determining the similarity between the query case text and the kth historical case text based on the correlation coefficients of the m*n k first sentence pairs including:
  • the arithmetic mean value of the correlation coefficients of the m*n k first sentence pairs is determined as the first text and the second text similarity between
  • the embodiments of the present invention can calculate the similarity between the query case text and the historical case text in a variety of ways, have a wide range of applications, and are conducive to user selection.
  • a text similarity determination device including a processor and a memory;
  • An application program executable by the processor is stored in the memory, for causing the processor to execute the text similarity determination method described in any one of the above.
  • a computer-readable storage medium in which computer-readable instructions are stored, and the computer-readable instructions are used to perform the text similarity determination method described in any one of the above.
  • FIG. 1 is an exemplary flowchart of a text similarity determination method according to an embodiment of the present invention.
  • FIG. 2 is an exemplary structural diagram of an apparatus for determining text similarity according to an embodiment of the present invention.
  • FIG. 3 is an exemplary structural diagram of an industrial diagnostic system according to an embodiment of the present invention.
  • FIG. 4 is an exemplary flowchart of an industrial diagnostic method according to an embodiment of the present invention.
  • FIG. 5 is an exemplary process diagram of a retrieval-based industrial diagnosis process according to an embodiment of the present invention.
  • FIG. 6 is an exemplary structural diagram of an apparatus for determining text similarity according to an embodiment of the present invention.
  • the applicant proposes a technical solution for determining text similarity based on the correlation coefficient of sentence pairs, which can overcome or One or more of the aforementioned disadvantages of the prior art are mitigated.
  • FIG. 1 is an exemplary flowchart of a text similarity determination method according to an embodiment of the present invention.
  • the method includes:
  • Step 101 Segment the first text to generate m sentences, where m is a positive integer.
  • the first text can be segmented in various ways to generate m sentences.
  • word segmentation processing is performed on the first text to generate a word segmentation sequence corresponding to the first text.
  • the part-of-speech of each participle in the first text participle sequence is determined, and according to the part-of-speech of each participle, the part-of-speech sequence is segmented to generate m sentences.
  • m sentences are generated according to the parts of speech of the segmented words.
  • Step 102 Segment the second text to generate n sentences, where n is a positive integer.
  • the second text can be segmented in a number of ways to generate n sentences.
  • word segmentation processing is performed on the second text to generate a word segmentation sequence corresponding to the second text.
  • the part-of-speech of each participle in the participle sequence of the second text is determined, and according to the part of speech of each participle, the part-of-speech sequence is segmented to generate n sentences.
  • n sentences can be generated according to the part of speech of the segmented words.
  • step 102 may be performed after step 101, step 102 may be performed before step 101, or step 101 and step 102 may be performed simultaneously.
  • Step 103 Determine m*n first sentence pairs, wherein each of the first sentence pairs includes any one of the m sentences and any one of the n sentences.
  • m*n sentence pairs are combined, which are called m*n first sentence pairs.
  • Each first sentence pair contains any one of m sentences and any one sentence of n sentences.
  • 3*4(12) first sentence pairs can be determined, namely: sentence pair (a1, b1), sentence pair (a1, b2), sentence pair (a1, b3), sentence pair (a1, b4) , sentence pair (a2, b1), sentence pair (a2, b2), sentence pair (a2, b3), sentence pair (a2, b4), sentence pair (a3, b1), sentence pair (a3, b2), sentence pair pair (a3, b3) and sentence pair (a3, b4).
  • Step 104 Determine the correlation coefficient between two sentences in each of the m*n first sentence pairs.
  • a sentence correlation model can be used to determine the correlation coefficient between two sentences in each of the m*n first sentence pairs.
  • the method 100 further includes: automatically labeling the second sentence pair as training data; using the automatically labelled second sentence to train the pre-trained natural language model to obtain a sentence-related model;
  • determining the correlation coefficient between two sentences in each of the m*n first sentence pairs in step 104 includes: based on the sentence correlation model, determining m*n first sentences For each sentence in the pair, the correlation coefficient between the two sentences in the pair.
  • the pre-trained natural language model may include: BERT model, RoBERTa model, ELMo model, GPT series model or XLNet model, and so on.
  • Pre-trained natural language models are characterized by the ability to perform simple pre-training tasks on particularly large corpora, such as the Masked Language Modelling task. With long pre-training, the pre-trained natural language model can vectorize the input text with high quality. That is to say, when a text consisting of N words, words or placeholders is input to the pre-trained natural language model, N fixed-dimensional, context-sensitive vectors can be obtained through calculation to correspond one-to-one with the input text.
  • a specific fine-tuning task selectively using some or all of the N vectors can be used as input for a new fine-tuning task. For example, adding a classifier to the top layer of a pre-trained natural language model, and then training to get a sentence-related model.
  • the embodiment of the present invention trains a pre-trained natural language model to obtain a sentence correlation model, and then uses the sentence correlation model to determine the correlation coefficient of the first sentence pair, which improves processing efficiency.
  • the predetermined corpus text can be segmented to generate a second sentence pair for training a sentence correlation model.
  • the second sentence pair used as training data can be manually labeled, or the second sentence pair used as training data can be automatically labeled.
  • automatic annotation is preferred.
  • the embodiment of the present invention can quickly label the second sentence pair by judging whether two sentences in the second sentence pair belong to the same text, which realizes a fast automatic labeling method and improves the labeling efficiency.
  • Step 105 Determine the similarity between the first text and the second text based on the correlation coefficients of the m*n first sentence pairs.
  • the similarity between the first text and the second text is determined, so as to realize the conversion from the sentence pair level similarity calculation to the text level similarity calculate.
  • the specific manner of determining the similarity between the first text and the second text may include:
  • Mode (1) The arithmetic mean of the correlation coefficients of m*n first sentence pairs is determined as the similarity between the first text and the second text.
  • Mode (2) The median of the correlation coefficients of m*n first sentence pairs is determined as the similarity between the first text and the second text.
  • Mode (3) Determine the maximum value of the correlation coefficients of m*n first sentence pairs as the similarity between the first text and the second text.
  • Mode (4) determine the maximum value of the correlation coefficients of the n first sentence pairs containing any one of the m sentences, and set the arithmetic mean of the m maximum values corresponding to the respective same sentences, It is determined as the similarity between the first text and the second text.
  • FIG. 2 is an exemplary structural diagram of an apparatus for determining text similarity according to an embodiment of the present invention.
  • the text similarity determination device 200 includes:
  • the first segmentation module 201 is used to segment the first text to generate m sentences, where m is a positive integer;
  • the second segmentation module 202 is used to segment the second text to generate n sentences, where n is a positive integer;
  • Sentence pair determination module 203 for determining m*n first sentence pairs, wherein each of the first sentence pairs includes any one of the m sentences and any one of the n sentences;
  • a correlation coefficient determination module 204 configured to determine the correlation coefficient between two sentences in each of the m*n first sentence pairs
  • the similarity determination module 205 is configured to determine the similarity between the first text and the second text based on the correlation coefficients of the m*n first sentence pairs.
  • the text similarity determining apparatus 200 further includes:
  • the labeling module (not shown in FIG. 2 ) is used for, before the correlation coefficient determination module determines the correlation coefficient of each sentence pair in the m*n first sentence pairs, to mark the second sentence as training data automatic labeling;
  • a training module (not shown in FIG. 2 ), used to train a pre-trained natural language model by using the automatically labeled second sentence to obtain the sentence-related model;
  • the correlation coefficient determination module 204 is configured to determine the correlation coefficient between two sentences in each of the m*n first sentence pairs based on the sentence correlation model.
  • the labeling module is configured to automatically label the second sentence pair as a positive example when two sentences in the second sentence pair belong to the same text; when the second sentence pair is in the middle When the two sentences belong to different texts, the second sentence pair is automatically marked as a negative example.
  • the similarity determination module 205 is configured to perform at least one of the following: determine the arithmetic mean of the correlation coefficients of m*n first sentence pairs as the first text and The similarity between the second texts; the median of the correlation coefficients of the m*n first sentence pairs is determined as the similarity between the first text and the second text; the The maximum value of the correlation coefficients of the m*n pairs of the first sentences is determined as the similarity between the first text and the second text; it is determined that the number of n that contains the same sentence in any of the m sentences The maximum value of the correlation coefficients of the first sentence pairs is determined as the similarity between the first text and the second text by the arithmetic mean of the m maximum values corresponding to the respective same sentences, etc.
  • the embodiment of the present invention proposes a retrieval-based industrial diagnosis system.
  • FIG. 3 is an exemplary structural diagram of an industrial diagnostic system according to an embodiment of the present invention.
  • the industrial diagnostic system 30 includes:
  • the human-machine interface module 31 is used to receive the query case text
  • Historical case database 32 used to save K historical case texts, where K is a positive integer
  • a processor 33 respectively coupled to the human-machine interface module 31 and the historical case database 32 via a bus 34, is configured to:
  • the user typically provides the query case text to the industrial diagnostic system 30 based on the human-machine interface module 31 .
  • the query case text describe the fault phenomenon that the user is currently encountering.
  • the historical case text stored in the historical case database 32 the failure phenomenon, failure cause and solution of the historical case are described.
  • the processor 33 may output a predetermined number (eg, 10 or 20) of historical case texts with the highest similarity to the query case texts based on the sorting results. Therefore, users can refer to these historical case texts to quickly understand the failure causes and solutions of the currently encountered failure phenomena.
  • the processor 33 is configured to:
  • the correlation coefficient between two sentences in each sentence pair in the first sentence pair includes: based on the sentence correlation model, determining the two sentences in each of the m*n k first sentence pairs. correlation coefficient between sentences.
  • the processor 33 is configured to: when two sentences in the second sentence pair belong to the same text, automatically mark the second sentence pair as a positive example; when the second sentence pair is a positive example; When the two sentences in the second sentence pair belong to different texts, the second sentence pair is automatically marked as a negative example.
  • the processor (33) is configured to:
  • the median of the correlation coefficients of the m*n k pairs of the first sentences is determined as the similarity between the first text and the second text;
  • Q is the query case text
  • H is the historical case text
  • m is the total number of sentences segmented in Q
  • n is the total number of sentences segmented in H
  • i is the number of m
  • j is the number of n
  • q i is the number from Q
  • the i-th sentence split from H; h j is the j-th sentence split from H; (q i , h j ) is a sentence pair composed of q i and h j ;
  • Corr(q i , h j ) is the correlation coefficient of the sentence pair (q i , h j );
  • R(Q, H) is the similarity between Q and H;
  • t is the average number of sentences in all historical case texts.
  • FIG. 4 is an exemplary flowchart of an industrial diagnostic method according to an embodiment of the present invention.
  • the method 400 includes:
  • Step 401 Receive query case text.
  • Step 402 Acquire K historical case texts from the historical case database, where K is a positive integer.
  • Step 403 Segment the query case text to generate m sentences, where m is a positive integer.
  • Step 404 Segment the kth historical case text to generate n k sentences, where n k is a positive integer, and the value range of k is [1, K].
  • Step 405 Determine m*n k first sentence pairs, wherein each of the first sentence pairs includes any one of the m sentences and any one of the n k sentences.
  • Step 406 Determine the correlation coefficient between two sentences in each of the m* nk first sentence pairs.
  • Step 407 Determine the similarity between the query case text and the kth historical case text based on the correlation coefficients of the m*n k first sentence pairs.
  • Step 408 Rank the similarity between the query case text and the K historical case texts.
  • Step 409 Determine a historical case text as an output from the K historical case texts based on the sorting result.
  • the method before step 406, further includes: automatically labeling the second sentence pair as training data; using the automatically labelled second sentence to train the pre-trained natural language model to Obtaining the sentence correlation model; wherein the determining the correlation coefficient between two sentences in each of the m*n first sentence pairs includes: based on the sentence correlation model, determining m*n Correlation coefficient between two sentences in each sentence pair in the first sentence pair.
  • the automatic labeling of the second sentence pair as training data includes: when two sentences in the second sentence pair belong to the same text, automatically labeling the second sentence pair as a positive example ; When two sentences in the second sentence pair belong to different texts, automatically mark the second sentence pair as a negative example.
  • the similarity between the query case text and the kth historical case text is determined based on the correlation coefficients of the m*n k first sentence pairs, including: when m is greater than all
  • the arithmetic mean of the correlation coefficients of the m*n k first sentence pairs is determined as the similarity between the first text and the second text degree
  • the median of the correlation coefficients of the m*n k pairs of the first sentences is determined as the similarity between the first text and the second text
  • the maximum value of the correlation coefficient of a sentence pair is determined as the similarity between the first text and the second text
  • when m is less than or equal to the average number of sentences t of the K historical case texts it is determined to include the
  • the maximum value of the correlation coefficients of the n first sentence pairs of any one identical sentence among the m sentences is determined as the arithmetic mean of the m maximum values corresponding to the respective identical sentences as the first text and the
  • FIG. 5 is an exemplary process diagram of a retrieval-based industrial diagnosis process according to an embodiment of the present invention.
  • the industrial diagnostic process includes a model training phase 50 and an application phase 60 . After the model training phase 50 is performed, the application phase 60 is performed.
  • the model training stage 50 includes: extracting one or more historical cases from the historical case database 53, dividing each historical case into sentences, and combining a second sentence pair 54, wherein when two sentences in the second sentence pair 54 When they belong to the same historical case, the second sentence pair 54 is automatically marked as a positive example, and when two sentences in the second sentence pair 54 belong to different historical cases, the second sentence pair 54 is automatically marked as a negative example. Then, using the second sentence pair 54 (preferably, there are multiple second sentence pairs 54 ) as training data, training is performed on the pre-trained natural language model 51 to obtain the sentence correlation model 52 .
  • the application phase 60 includes receiving the query case text 62 via the human-machine interface.
  • the query case text 62 is split into m sentences.
  • K historical case texts are extracted from the historical case database 53 .
  • the following processes are respectively performed: segment the k-th historical case text to generate n k sentences; Any sentence and the first sentence pair 63 of any one of the n k sentences, so that m*n k first sentence pairs 63 can be obtained; the sentence correlation model 52 is applied to determine m*n k first sentence pairs 63 The correlation coefficient between the two sentences in each first sentence pair 63 in the The text similarity between the kth historical case texts is 65.
  • similar historical case texts 66 are selected from the K historical case texts as output. For example, 10 historical case texts with the highest similarity are selected as similar historical case texts66.
  • the historical case database used in the application phase 60 and the historical case database used in the model training phase 50 are the same historical case database, which can facilitate rapid industrial deployment.
  • the historical case database used in the application phase 60 and the historical case database used in the model training phase 50 may also be different historical case databases, which are not limited in the embodiment of the present invention.
  • FIG. 6 is an exemplary structural diagram of an apparatus for determining text similarity according to an embodiment of the present invention.
  • the text similarity determination apparatus 600 includes a memory 602 and a processor 601; the memory 602 stores an application program executable by the processor 601, so as to cause the processor 601 to execute any one of the above Text similarity determination method.
  • the hardware modules in various embodiments may be implemented mechanically or electronically.
  • a hardware module may include specially designed permanent circuits or logic devices (eg, special purpose processors, such as FPGAs or ASICs) for performing specific operations.
  • Hardware modules may also include programmable logic devices or circuits (eg, including general-purpose processors or other programmable processors) temporarily configured by software for performing particular operations.
  • programmable logic devices or circuits eg, including general-purpose processors or other programmable processors
  • the present invention also provides a machine-readable storage medium storing instructions for causing a machine to perform a method as described herein.
  • a system or device equipped with a storage medium on which software program codes for realizing the functions of any one of the above-described embodiments are stored, and make the computer (or CPU or MPU of the system or device) ) to read and execute the program code stored in the storage medium.
  • a part or all of the actual operation can also be completed by an operating system or the like operating on the computer based on the instructions of the program code.
  • the program code read from the storage medium can also be written into the memory provided in the expansion board inserted into the computer or into the memory provided in the expansion unit connected to the computer, and then the instructions based on the program code make the device installed in the computer.
  • the CPU on the expansion board or the expansion unit or the like performs part and all of the actual operations, so as to realize the functions of any one of the above-mentioned embodiments.
  • Embodiments of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (eg, CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), Magnetic tapes, non-volatile memory cards and ROMs.
  • the program code may be downloaded from a server computer or cloud over a communications network.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

文本相似度确定方法和装置与工业诊断方法和系统。方法包括:对第一文本分割以生成m个句子,其中m为正整数(101);对第二文本分割以生成n个句子,其中n为正整数(102);确定m*n个第一句子对,其中每个所述第一句子对包含所述m个句子中的任一个句子及所述n个句子中的任一个句子(103);确定m*n个所述第一句子对中的每个第一句子对中两个句子之间的相关系数(104);基于m*n个所述第一句子对的相关系数,确定所述第一文本与所述第二文本之间的相似度(105)。无需设置手写规则即可确定文本相似度,节约了成本。还可以确定句子层面的相关系数,尤其适用于工业诊断系统。

Description

文本相似度确定方法、装置及工业诊断方法、系统 技术领域
本发明涉及自然语言处理技术领域,尤其涉及文本相似度确定方法、装置及工业诊断方法、系统。
背景技术
在现代工业生产场景中,仍然难以完全避免故障。随着工业数字化概念的迅速传播,许多工厂或综合性工业公司通常会记录日常发生的故障。通常在历史案例数据库中保存包含故障现象、故障原因和解决方案的文本描述。当发生新的故障事件时,可以在历史案例数据库中搜索相关的历史案例,然后参考其记录的解决方案,以协助处理新的故障事件。
美国专利号5463768记载了用于分析诊断错误日志的方法和系统。在该专利披露中,基于特定手写规则提取故障案例的特征,以形成故障案例的代表向量,然后通过计算对应向量之间的数学距离来评估不同案例之间的相似性。
然而,设置特定手写规则需要高水平的领域知识,这通常意味着昂贵的劳动力成本。
发明内容
本发明实施方式提出文本相似度确定方法、装置及工业诊断方法、系统,无需设置手写规则即可确定文本相似度,可以节约成本。
第一方面,提供文本相似度确定方法,包括:
对第一文本分割以生成m个句子,其中m为正整数;
对第二文本分割以生成n个句子,其中n为正整数;
确定m*n个第一句子对,其中每个所述第一句子对包含所述m个句子中的任一个句子及所述n个句子中的任一个句子;
确定m*n个所述第一句子对中的每个第一句子对中两个句子之间的相关系数;
基于m*n个所述第一句子对的相关系数,确定所述第一文本与所述第二文本之间的相似度。
可见,本发明实施方式计算包含第一文本分割出的任一个句子及第二文本分割出的任一个句子的第一句子对中的这两个句子的相似度,然后再利用各个第一句子对的相关系数计算第一文本与第二文本之间的相似度,无需设置手写规则即可确定文本相似度,避免了对高水 平领域知识的苛刻要求,从而降低了成本。
另外,相比较现有技术直接在文本(文本通常包含多个句子)层面上的相似度分析,本发明实施方式通过将文本分割成句子,再确定相互比较的文本中的句子之间形成的的句子对的相关系数,进而根据各个相关系数确定文本间的相似度,可以在句子层面上确定是否语义相关,实现了颗粒度更细的相关分析,因此提高了计算出的文本间相似度的准确度。
此外,本发明实施方式基于句子对执行相关分析,而不是直接对文本进行对比,因此对文本的长度差异并不敏感,适用于各种长度的文本之间的相似度计算,具有更广的适用范围。
优选的,在确定m*n个所述第一句子对中的每个句子对的相关系数之前,该方法还包括:
对作为训练数据的第二句子对进行自动标注;
利用已自动标注的所述第二句子对预训练的自然语言模型进行训练,以获得所述句子相关模型;
其中所述确定m*n个所述第一句子对中的每个句子对中两个句子之间的相关系数包括:基于所述句子相关模型,确定m*n个所述第一句子对中的每个句子对中两个句子之间的相关系数。
可见,本发明实施方式对预训练的自然语言模型进行训练以得到句子相关模型,再利用句子相关模型确定第一句子对的相关系数,提高了处理效率。
优选的,所述对作为训练数据的第二句子对进行自动标注包括:
当所述第二句子对中的两个句子属于同一文本时,自动标注所述第二句子对为正例;
当所述第二句子对中的两个句子属于不同的文本时,自动标注所述第二句子对为反例。
因此,本发明实施方式通过判断第二句子对中的两个句子是否属于同一文本,可以快速标注第二句子对,实现了一种快速的自动标注方法,提高了标注效率。
优选的,所述基于m*n个所述第一句子对的相关系数,确定所述第一文本与所述第二文本之间的相似度包括下列中的至少一个:
将m*n个所述第一句子对的相关系数的算术平均值,确定为所述第一文本与所述第二文本之间的相似度;
将m*n个所述第一句子对的相关系数的中位数,确定为所述第一文本与所述第二文本之间的相似度;
将m*n个所述第一句子对的相关系数的最大值,确定为所述第一文本与所述第二文本之间的相似度;
确定包含该m个句子中的任一个相同句子的n个第一句子对的相关系数的最大值,将对 应于各自的相同句子的m个所述最大值的算术平均值,确定为所述第一文本与所述第二文本之间的相似度。
可见,本发明实施方式可以通过多种方式计算第一文本与第二文本之间的相似度,适用范围广,有利于用户选择。
第二方面,提供文本相似度确定装置,包括:
第一分割模块,用于对第一文本分割以生成m个句子,其中m为正整数;
第二分割模块,用于对第二文本分割以生成n个句子,其中n为正整数;
句子对确定模块,用于确定m*n个第一句子对,其中每个所述第一句子对包含所述m个句子中的任一个句子及所述n个句子中的任一个句子;
相关系数确定模块,用于确定m*n个所述第一句子对中的每个第一句子对中两个句子之间的相关系数;
相似度确定模块,用于基于m*n个所述第一句子对的相关系数,确定所述第一文本与所述第二文本之间的相似度。
可见,本发明实施方式计算包含第一文本分割出的任一个句子及第二文本分割出的任一个句子的第一句子对中的这两个句子的相似度,然后再利用各个第一句子对的相关系数计算第一文本与第二文本之间的相似度,无需设置手写规则即可确定文本相似度,避免了对高水平领域知识的苛刻要求,从而降低了成本。
另外,相比较现有技术直接在文本(文本通常包含多个句子)层面上的相似度分析,本发明实施方式通过将文本分割成句子,再确定相互比较的文本中的句子之间形成的句子对的相关系数,进而根据各个相关系数确定文本间的相似度,可以在句子层面上确定是否语义相关,实现了颗粒度更细的相关分析,因此提高了计算出的文本间相似度的准确度。此外,本发明实施方式基于句子对执行相关分析,而不是直接对文本进行对比,因此对文本的长度差异并不敏感,适用于各种长度的文本之间的相似度计算,具有更广的适用范围。
优选的,该装置还包括:
标注模块,用于在所述相关系数确定模块确定m*n个所述第一句子对中的每个句子对的相关系数之前,对作为训练数据的第二句子对进行自动标注;
训练模块,用于利用已自动标注的所述第二句子对预训练的自然语言模型进行训练,以获得所述句子相关模型;
其中所述相关系数确定模块,用于基于所述句子相关模型,确定m*n个所述第一句子对 中的每个句子对中两个句子之间的相关系数。
可见,本发明实施方式对预训练的自然语言模型进行训练以得到句子相关模型,再利用句子相关模型确定第一句子对的相关系数,提高了处理效率。
优选的,所述标注模块,用于当所述第二句子对中的两个句子属于同一文本时,自动标注所述第二句子对为正例;当所述第二句子对中的两个句子属于不同的文本时,自动标注所述第二句子对为反例。
因此,本发明实施方式通过判断第二句子对中的两个句子是否属于同一文本,可以快速标注第二句子对,实现了一种快速的自动标注方法,提高了标注效率。
优选的,所述相似度确定模块,用于执行下列中的至少一个:
将m*n个所述第一句子对的相关系数的算术平均值,确定为所述第一文本与所述第二文本之间的相似度;
将m*n个所述第一句子对的相关系数的中位数,确定为所述第一文本与所述第二文本之间的相似度;
将m*n个所述第一句子对的相关系数的最大值,确定为所述第一文本与所述第二文本之间的相似度;
确定包含该m个句子中的任一个相同句子的n个第一句子对的相关系数的最大值,将对应于各自的相同句子的m个所述最大值的算术平均值,确定为所述第一文本与所述第二文本之间的相似度。
可见,本发明实施方式可以通过多种方式计算第一文本与第二文本之间的相似度,适用范围广,有利于用户选择。
第三方面,提供工业诊断系统,包括:
人机接口模块,用于接收查询案例文本;
历史案例数据库,用于保存K个历史案例文本,其中K为正整数;
处理器,与所述人机接口模块与所述历史案例数据库分别耦合,被配置用于:
对所述查询案例文本分割以生成m个句子,其中m为正整数;对第k个历史案例文本分割以生成n k个句子,其中n k为正整数,k的取值范围为[1,K];确定m*n k个第一句子对,其中每个所述第一句子对包含所述m个句子中的任一个句子及所述n k个句子中的任一个句子;确定m*n k个所述第一句子对中的每个第一句子对中两个句子之间的相关系数;基于m*n k个所述第一句子对的相关系数,确定所述查询案例文本与第k个历史案例文本之间的相似度; 对所述查询案例文本与K个历史案例文本的相似度进行排序;基于排序结果从所述K个历史案例文本确定作为输出的历史案例文本。
可见,本发明实施方式计算包含查询案例文本分割出的任一个句子及历史案例文本分割出的任一个句子的第一句子对中的这两个句子的相似度,然后再利用各个第一句子对的相关系数计算查询案例文本与历史案例文本之间的相似度,无需设置手写规则即可确定文本相似度,避免了对高水平领域知识的苛刻要求,从而降低了成本。
另外,相比较现有技术直接在文本(文本通常包含多个句子)层面上的相似度分析,本发明实施方式通过将文本分割成句子,再确定相互比较的文本中的句子之间形成的的句子对的相关系数,进而根据各个相关系数确定文本间的相似度,可以在句子层面上确定是否语义相关,实现了颗粒度更细的相关分析,因此提高了计算出的文本间相似度的准确度。检索到的历史案例文本与查询案例文本更加相关,有利于对工业故障的快速处理。
此外,本发明实施方式基于句子对执行相关分析,而不是直接对文本进行对比,因此对文本的长度差异并不敏感,适用于各种长度的文本之间的相似度计算,具有更广的适用范围。
优选的,处理器,被配置用于:
对作为训练数据的第二句子对进行自动标注;利用已自动标注的所述第二句子对预训练的自然语言模型进行训练,以获得所述句子相关模型;
其中所述确定m*n k个所述第一句子对中的每个句子对中两个句子之间的相关系数包括:基于所述句子相关模型,确定m*n k个所述第一句子对中的每个句子对中两个句子之间的相关系数。
可见,本发明实施方式对预训练的自然语言模型进行训练以得到句子相关模型,再利用句子相关模型确定第一句子对的相关系数,提高了处理效率。
优选的,所述处理器,还被配置用于:当所述第二句子对中的两个句子属于同一文本时,自动标注所述第二句子对为正例;当所述第二句子对中的两个句子属于不同的文本时,自动标注所述第二句子对为反例。
因此,本发明实施方式通过判断第二句子对中的两个句子是否属于同一文本,可以快速标注第二句子对,实现了一种快速的自动标注方法,提高了标注效率。
优选的,所述处理器,还被配置用于执行下列中的至少一个:
当m大于所述K个历史案例文本的平均句子数t时,将m*n k个所述第一句子对的相关系数的算术平均值,确定为所述第一文本与所述第二文本之间的相似度;
将m*n k个所述第一句子对的相关系数的中位数,确定为所述第一文本与所述第二文本之 间的相似度;
将m*n k个所述第一句子对的相关系数的最大值,确定为所述第一文本与所述第二文本之间的相似度;
当m小于等于所述K个历史案例文本的平均句子数t时,确定包含该m个句子中的任一个相同句子的n个第一句子对的相关系数的最大值,将对应于各自的相同句子的m个所述最大值的算术平均值,确定为所述第一文本与所述第二文本之间的相似度。
可见,本发明实施方式可以通过多种方式计算查询案例文本与历史案例文本之间的相似度,适用范围广,有利于用户选择。
第四方面,提供工业诊断方法,包括:
接收查询案例文本;
从历史案例数据库获取K个历史案例文本,其中K为正整数;
对所述查询案例文本分割以生成m个句子,其中m为正整数;
对第k个历史案例文本分割以生成n k个句子,其中n k为正整数;
确定m*n k个第一句子对,其中每个所述第一句子对包含所述m个句子中的任一个句子及所述n k个句子中的任一个句子;
确定m*n k个所述第一句子对中的每个第一句子对中两个句子之间的相关系数;
基于m*n k个所述第一句子对的相关系数,确定所述查询案例文本与第k个历史案例文本之间的相似度;
对所述查询案例文本与K个历史案例文本的相似度进行排序;
基于排序结果从所述K个历史案例文本确定作为输出的历史案例文本。
可见,本发明实施方式计算包含查询案例文本分割出的任一个句子及历史案例文本分割出的任一个句子的第一句子对中的这两个句子的相似度,然后再利用各个第一句子对的相关系数计算查询案例文本与历史案例文本之间的相似度,无需设置手写规则即可确定文本相似度,避免了对高水平领域知识的苛刻要求,从而降低了成本。
另外,本发明实施方式通过句子对的相关系数确定文本间的相似度,可以在句子层面上确定是否语义相关,提高了计算出的文本间相似度的准确度,检索到的历史案例文本与查询案例文本更加相关,有利于对工业故障的快速处理。
优选的,在确定m*n个所述第一句子对中的每个句子对的相关系数之前,该方法还包括:
对作为训练数据的第二句子对进行自动标注;
利用已自动标注的所述第二句子对预训练的自然语言模型进行训练,以获得所述句子相关模型;
其中所述确定m*n个所述第一句子对中的每个句子对中两个句子之间的相关系数包括:基于所述句子相关模型,确定m*n个所述第一句子对中的每个句子对中两个句子之间的相关系数。
可见,本发明实施方式对预训练的自然语言模型进行训练以得到句子相关模型,再利用句子相关模型确定第一句子对的相关系数,提高了处理效率。
优选的,所述对作为训练数据的第二句子对进行自动标注包括下列中的至少一个:
当所述第二句子对中的两个句子属于同一文本时,自动标注所述第二句子对为正例;
当所述第二句子对中的两个句子属于不同的文本时,自动标注所述第二句子对为反例。
因此,本发明实施方式通过判断第二句子对中的两个句子是否属于同一文本,可以快速标注第二句子对,实现了一种快速的自动标注方法,提高了标注效率。
优选的,所述基于m*n k个所述第一句子对的相关系数,确定所述查询案例文本与第k个历史案例文本之间的相似度,包括:
当m大于所述K个历史案例文本的平均句子数t时,将m*n k个所述第一句子对的相关系数的算术平均值,确定为所述第一文本与所述第二文本之间的相似度;
将m*n k个所述第一句子对的相关系数的中位数,确定为所述第一文本与所述第二文本之间的相似度;
将m*n k个所述第一句子对的相关系数的最大值,确定为所述第一文本与所述第二文本之间的相似度;
当m小于等于所述K个历史案例文本的平均句子数t时,确定包含该m个句子中的任一个相同句子的n个第一句子对的相关系数的最大值,将对应于各自的相同句子的m个所述最大值的算术平均值,确定为所述第一文本与所述第二文本之间的相似度。
可见,本发明实施方式可以通过多种方式计算查询案例文本与历史案例文本之间的相似度,适用范围广,有利于用户选择。
第五方面,提供文本相似度确定装置,包括处理器和存储器;
所述存储器中存储有可被所述处理器执行的应用程序,用于使得所述处理器执行如上任一项所述的文本相似度确定方法。
第六方面,提供计算机可读存储介质,其中存储有计算机可读指令,该计算机可读指令用于执行如上任一项所述的文本相似度确定方法。
附图说明
图1为本发明实施方式的文本相似度确定方法的示范性流程图。
图2为本发明实施方式的文本相似度确定装置的示范性结构图。
图3为本发明实施方式的工业诊断系统的示范性结构图。
图4为本发明实施方式的工业诊断方法的示范性流程图。
图5为本发明实施方式的基于检索的工业诊断过程的示范性处理图。
图6为本发明实施方式的文本相似度确定装置的示范性结构图。
其中,附图标记如下:
标号 含义
100 文本相似度确定方法
101~105 步骤
200 文本相似度确定装置
201 第一分割模块
202 第二分割模块
203 句子对确定模块
204 相关系数确定模块
205 相似度确定模块
30 工业诊断系统
31 人机接口模块
32 历史案例数据库
33 处理器
34 总线
400 工业诊断方法
401~409 步骤
50 模型训练阶段
60 应用阶段
51 预训练的自然语言模型
52 句子相关模型
53 历史案例数据库
54 第二句子对
62 查询案例文本
63 第一句子对
64 第一句子对相关系数
65 文本相似度
66 输出的相似历史案例文本
600 文本相似度确定装置
601 处理器
602 存储器
具体实施方式
为了使本发明的技术方案及优点更加清楚明白,以下结合附图及实施方式,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施方式仅仅用以阐述性说明本发明,并不被配置为用于限定本发明的保护范围。
为了描述上的简洁和直观,下文通过描述若干代表性的实施方式来对本发明的方案进行阐述。实施方式中大量的细节仅被配置为用于帮助理解本发明的方案。但是很明显,本发明的技术方案实现时可以不局限于这些细节。为了避免不必要地模糊了本发明的方案,一些实施方式没有进行细致地描述,而是仅给出了框架。下文中,“包括”是指“包括但不限于”,“根据……”是指“至少根据……,但不限于仅根据……”。由于汉语的语言习惯,下文中没有特别指出一个成分的数量时,意味着该成分可以是一个也可以是多个,或可理解为至少一个。
申请人发现:现有技术中基于特定手写规则提取故障案例的特征,以形成故障案例的代表向量,然后通过计算对应向量之间的数学距离来评估不同案例之间的相似性的处理方式具有诸多缺点。比如,设置特定手写规则需要高水平的领域知识,这通常意味着昂贵的劳动力成本。而且,不同案例的长度可能有很大差异。采用相同格式/维度的向量表示所有情况并不恰当。另外,通过一般统计分析提取的特征,如单词包或给定文本中N个项目(item)的序列(n-grams),往往在词汇上敏感,但在语义上不敏感,这使得检索到的案例只是在措辞上 相似,而不是语义上相似。
鉴于现有技术中基于特定手写规则提取特征以确定不同案例之间的相似性的诸多缺点,申请人提出一种基于句子对(sentence pair)的相关系数确定文本相似度的技术方案,可以克服或减缓现有技术的一或多个上述缺点。
图1为本发明实施方式的文本相似度确定方法的示范性流程图。
如图1所示,该方法包括:
步骤101:对第一文本分割以生成m个句子,其中m为正整数。
在这里,可以采用多种方式将第一文本分割以生成m个句子。比如,在一个实施方式中,对第一文本进行分词处理,以生成第一文本对应的分词序列。确定第一文本分词序列中每个分词的词性,根据每个分词的词性,对分词序列进行分句以生成m个句子。由此,实现通过对第一文本进行分词处理,根据分词的词性生成m个句子。
步骤102:对第二文本分割以生成n个句子,其中n为正整数。
类似地,可以采用多种方式将第二文本分割以生成n个句子。比如,在一个实施方式中,对第二文本进行分词处理,以生成第二文本对应的分词序列。确定第二文本的分词序列中每个分词的词性,根据每个分词的词性,对分词序列进行分句以生成n个句子。由此,实现通过对第二文本进行分词处理,根据分词的词性生成n个句子。
以上示范性描述了分割第一文本和第二文本的典型实例,本领域技术人员可以意识到,这种描述是示范性的,并不用于限定本发明实施方式的保护范围。实际上,目前已有的成熟的分句方式,或将来出现的新颖分句方式都应该涵盖在本发明实施方式的保护范围之内。
其中,步骤101和步骤102的执行顺序并无严格约定。比如:可以在步骤101之后执行步骤102,可以在步骤101之前执行步骤102,还可以同时执行步骤101和步骤102。
步骤103:确定m*n个第一句子对,其中每个所述第一句子对包含所述m个句子中的任一个句子及所述n个句子中的任一个句子。
在这里,基于步骤101中生成的第一文本的m个句子和步骤102中生成的第二文本的n个句子,组合出m*n个句子对,称为m*n个第一句子对。每个第一句子对中包含m个句子中的任一个句子以及n个句子中的任一个句子。
举例,假定第一文本分割出3个句子,分别为句子a1,句子a2,句子a3;第二文本分割出4个句子,分别为句子b1,句子b2,句子b3,句子b4。因此可以确定出3*4(12)个第一句子对,分别为:句子对(a1,b1)、句子对(a1,b2)、句子对(a1,b3)、句子对(a1,b4)、句子对(a2,b1)、句子对(a2,b2)、句子对(a2,b3)、句子对(a2,b4)、句子对(a3, b1)、句子对(a3,b2)、句子对(a3,b3)和句子对(a3,b4)。
步骤104:确定m*n个所述第一句子对中的每个第一句子对中两个句子之间的相关系数。
优选地,可以使用句子相关模型,确定m*n个所述第一句子对中的每个第一句子对中两个句子之间的相关系数。其中,在步骤104之前,该方法100还包括:对作为训练数据的第二句子对进行自动标注;利用已自动标注的第二句子对预训练的自然语言模型进行训练,以获得句子相关模型;其中步骤104中的确定m*n个所述第一句子对中的每个句子对中两个句子之间的相关系数包括:基于所述句子相关模型,确定m*n个所述第一句子对中的每个句子对中两个句子之间的相关系数。
具体地,预训练的自然语言模型可以包括:BERT模型、RoBERTa模型、ELMo模型、GPT系列模型或XLNet模型,等等。预训练的自然语言模型的特点是可以在特别巨大的语料库中执行简单的预训练任务,比如掩码语言模型(Masked Language Modelling)任务。通过长时间的预训练,预训练的自然语言模型可以对输入文本进行质量较高的向量化。也就是说,当向预训练的自然语言模型输入由N个字、词或者占位符组成的文本,通过计算就可以得到N个固定维度的、上下文敏感的向量以与输入文本一一对应。然后,通过具体的微调任务,选择性使用N个向量的部分或全部,可以作为新的微调任务的输入。比如,在预训练的自然语言模型的顶层增加分类器,再通过训练即可得到句子相关模型。
可见,本发明实施方式对预训练的自然语言模型进行训练以得到句子相关模型,再利用句子相关模型确定第一句子对的相关系数,提高了处理效率。
可以分割预定的语料文本以生成用于训练得到句子相关模型的第二句子对。其中:可以人工标注作为训练数据的第二句子对,也可以自动标注作为训练数据的第二句子对。考虑到语料文本通常数目众多,优选采用自动标注方式。
在自动标注方式中:当所述第二句子对中的两个句子属于同一文本时,自动标注所述第二句子对为正例;当所述第二句子对中的两个句子属于不同的文本时,自动标注所述第二句子对为反例。因此,本发明实施方式通过判断第二句子对中的两个句子是否属于同一文本,可以快速标注第二句子对,实现了一种快速的自动标注方法,提高了标注效率。
步骤105:基于m*n个所述第一句子对的相关系数,确定所述第一文本与所述第二文本之间的相似度。
在这里,基于m*n个第一句子对的相关系数,确定出第一文本与所述第二文本之间的相似度,从而实现由句子对级别的相似度计算转换到文本级别的相似度计算。
具体地,基于m*n个第一句子对的相关系数,确定第一文本与第二文本之间的相似度的 具体方式,可以包括:
方式(1):将m*n个所述第一句子对的相关系数的算术平均值,确定为所述第一文本与所述第二文本之间的相似度。
方式(2):将m*n个所述第一句子对的相关系数的中位数,确定为所述第一文本与所述第二文本之间的相似度。
方式(3):将m*n个所述第一句子对的相关系数的最大值,确定为所述第一文本与所述第二文本之间的相似度。
方式(4):确定包含该m个句子中的任一个相同句子的n个第一句子对的相关系数的最大值,将对应于各自的相同句子的m个所述最大值的算术平均值,确定为所述第一文本与所述第二文本之间的相似度。
以上示范性描述了基于m*n个第一句子对的相关系数确定第一文本与第二文本之间的相似度的具体实例,本领域技术人员可以意识到,这种描述仅是示范性的,并不用于限定本发明实施方式的保护范围。
图2为本发明实施方式的文本相似度确定装置的示范性结构图。
如图2所示,文本相似度确定装置200,包括:
第一分割模块201,用于对第一文本分割以生成m个句子,其中m为正整数;
第二分割模块202,用于对第二文本分割以生成n个句子,其中n为正整数;
句子对确定模块203,用于确定m*n个第一句子对,其中每个所述第一句子对包含所述m个句子中的任一个句子及所述n个句子中的任一个句子;
相关系数确定模块204,用于确定m*n个所述第一句子对中的每个第一句子对中两个句子之间的相关系数;
相似度确定模块205,用于基于m*n个所述第一句子对的相关系数,确定所述第一文本与所述第二文本之间的相似度。
在一个实施方式中,文本相似度确定装置200还包括:
标注模块(图2中没有示出),用于在所述相关系数确定模块确定m*n个所述第一句子对中的每个句子对的相关系数之前,对作为训练数据的第二句子对进行自动标注;
训练模块(图2中没有示出),用于利用已自动标注的所述第二句子对预训练的自然语言模型进行训练,以获得所述句子相关模型;
其中所述相关系数确定模块204,用于基于所述句子相关模型,确定m*n个所述第一句 子对中的每个句子对中两个句子之间的相关系数。
在一个实施方式中,所述标注模块,用于当所述第二句子对中的两个句子属于同一文本时,自动标注所述第二句子对为正例;当所述第二句子对中的两个句子属于不同的文本时,自动标注所述第二句子对为反例。
在一个实施方式中,所述相似度确定模块205,用于执行下列中的至少一个:将m*n个所述第一句子对的相关系数的算术平均值,确定为所述第一文本与所述第二文本之间的相似度;将m*n个所述第一句子对的相关系数的中位数,确定为所述第一文本与所述第二文本之间的相似度;将m*n个所述第一句子对的相关系数的最大值,确定为所述第一文本与所述第二文本之间的相似度;确定包含该m个句子中的任一个相同句子的n个第一句子对的相关系数的最大值,将对应于各自的相同句子的m个所述最大值的算术平均值,确定为所述第一文本与所述第二文本之间的相似度,等等。
目前,基于检索的工业诊断系统的相关工作似乎仍然是空白。本发明实施方式提出一种基于检索的工业诊断系统。
图3为本发明实施方式的工业诊断系统的示范性结构图。
如图3所示,工业诊断系统30,包括:
人机接口模块31,用于接收查询案例文本;
历史案例数据库32,用于保存K个历史案例文本,其中K为正整数;
处理器33,经由总线34与所述人机接口模块31与所述历史案例数据库32分别耦合,被配置用于:
对所述查询案例文本分割以生成m个句子,其中m为正整数;对第k个历史案例文本分割以生成n k个句子,其中n k为正整数,k的取值范围为[1,K];确定m*n k个第一句子对,其中每个所述第一句子对包含所述m个句子中的任一个句子及所述n k个句子中的任一个句子;确定m*n k个所述第一句子对中的每个第一句子对中两个句子之间的相关系数;基于m*n k个所述第一句子对的相关系数,确定所述查询案例文本与第k个历史案例文本之间的相似度;对所述查询案例文本与K个历史案例文本的相似度进行排序;基于排序结果从所述K个历史案例文本确定作为输出的历史案例文本。
用户通常基于人机接口模块31向工业诊断系统30提供查询案例文本。在查询案例文本中,描述有用户当前遇到的故障现象。在历史案例数据库32中保存的历史案例文本中,描述有历史案例的故障现象、故障原因和解决方案。处理器33可以基于排序结果输出预定数目(比如,10或20)的、与查询案例文本相似度最高的历史案例文本。因此,用户可以参照这些历 史案例文本,快速了解当前遇到的故障现象的故障原因和解决方案。
在一个实施方式中,所述处理器33,被配置用于:
对作为训练数据的第二句子对进行自动标注;利用已自动标注的所述第二句子对预训练的自然语言模型进行训练,以获得所述句子相关模型;其中所述确定m*n k个所述第一句子对中的每个句子对中两个句子之间的相关系数包括:基于所述句子相关模型,确定m*n k个所述第一句子对中的每个句子对中两个句子之间的相关系数。
在一个实施方式中,所述处理器33,被配置用于:当所述第二句子对中的两个句子属于同一文本时,自动标注所述第二句子对为正例;当所述第二句子对中的两个句子属于不同的文本时,自动标注所述第二句子对为反例。
在一个实施方式中,所述处理器(33),被配置用于:
(1)、当m大于所述K个历史案例文本的平均句子数t时,将m*n k个所述第一句子对的相关系数的算术平均值,确定为所述第一文本与所述第二文本之间的相似度;
(2)、将m*n k个所述第一句子对的相关系数的中位数,确定为所述第一文本与所述第二文本之间的相似度;
(3)、将m*n k个所述第一句子对的相关系数的最大值,确定为所述第一文本与所述第二文本之间的相似度;
(4)、当m小于等于所述K个历史案例文本的平均句子数t时,确定包含该m个句子中的任一个相同句子的n个第一句子对的相关系数的最大值,将对应于各自的相同句子的m个所述最大值的算术平均值,确定为所述第一文本与所述第二文本之间的相似度。
比如,参照下列公式:
Figure PCTCN2020118172-appb-000001
其中Q为查询案例文本;H为历史案例文本;m为Q中分割出的句子总数;n为H中分割出的句子总数;i为m的编号;j为n的编号;q i为从Q中分割出的第i个句子;h j为从H中分割出的第j个句子;(q i,h j)为由q i和h j组成的句子对;Corr(q i,h j)为句子对(q i,h j)的相关系数;R(Q,H)为Q和H的相似度;t为全部历史案例文本的平均句子数。
图4为本发明实施方式的工业诊断方法的示范性流程图。
如图4所示,该方法400包括:
步骤401:接收查询案例文本。
步骤402:从历史案例数据库获取K个历史案例文本,其中K为正整数。
步骤403:对所述查询案例文本分割以生成m个句子,其中m为正整数。
步骤404:对第k个历史案例文本分割以生成n k个句子,其中n k为正整数,k的取值范围为[1,K]。
步骤405:确定m*n k个第一句子对,其中每个所述第一句子对包含所述m个句子中的任一个句子及所述n k个句子中的任一个句子。
步骤406:确定m*n k个所述第一句子对中的每个第一句子对中两个句子之间的相关系数。
步骤407:基于m*n k个所述第一句子对的相关系数,确定所述查询案例文本与第k个历史案例文本之间的相似度。
步骤408:对所述查询案例文本与K个历史案例文本的相似度进行排序。
步骤409:基于排序结果从所述K个历史案例文本确定作为输出的历史案例文本。
在一个实施方式中,在步骤406之前,该方法还包括:对作为训练数据的第二句子对进行自动标注;利用已自动标注的所述第二句子对预训练的自然语言模型进行训练,以获得所述句子相关模型;其中所述确定m*n个所述第一句子对中的每个句子对中两个句子之间的相关系数包括:基于所述句子相关模型,确定m*n个所述第一句子对中的每个句子对中两个句子之间的相关系数。
在一个实施方式中,所述对作为训练数据的第二句子对进行自动标注包括:当所述第二句子对中的两个句子属于同一文本时,自动标注所述第二句子对为正例;当所述第二句子对中的两个句子属于不同的文本时,自动标注所述第二句子对为反例。
在一个实施方式中,步骤407的基于m*n k个所述第一句子对的相关系数,确定所述查询案例文本与第k个历史案例文本之间的相似度,包括:当m大于所述K个历史案例文本的平均句子数t时,将m*n k个所述第一句子对的相关系数的算术平均值,确定为所述第一文本与所述第二文本之间的相似度;将m*n k个所述第一句子对的相关系数的中位数,确定为所述第一文本与所述第二文本之间的相似度;将m*n k个所述第一句子对的相关系数的最大值,确定为所述第一文本与所述第二文本之间的相似度;当m小于等于所述K个历史案例文本的平均句子数t时,确定包含该m个句子中的任一个相同句子的n个第一句子对的相关系数的最大值,将对应于各自的相同句子的m个所述最大值的算术平均值,确定为所述第一文本与所述第二文本之间的相似度,等等。
下面描述基于检索的工业诊断过程的典型过程。
图5为本发明实施方式的基于检索的工业诊断过程的示范性处理图。
该工业诊断过程包括模型训练阶段50和应用阶段60。执行模型训练阶段50后,再执行应用阶段60。
模型训练阶段50包括:从历史案例数据库53中提取一或多个历史案例,将各个历史案例分别分割为句子,并组合出第二句子对54,其中当第二句子对54中的两个句子属于同一历史案例时,自动标志第二句子对54为正例,当第二句子对54中的两个句子属于不同的历史案例时,自动标注第二句子对54为反例。然后,将第二句子对54(优选的,第二句子对54为多个)作为训练数据,针对预训练的自然语言模型51执行训练以得到句子相关模型52。
应用阶段60包括:通过人机接口接收查询案例文本62。将查询案例文本62分割为m个句子。从历史案例数据库53中提取出K个历史案例文本。针对所提取的第k个历史案例文本(k的取值范围为[1,K]),分别执行下列过程:分割第k个历史案例文本以生成n k个句子;建立包含m个句子中的任一个句子及n k个句子中的任一个句子的第一句子对63,从而可以得到m*n k个第一句子对63;应用句子相关模型52确定m*n k个第一句子对63中的每个第一句子对63中的两个句子之间的相关系数,即为第一句子对相似系数64;基于m*n k个第一句子对相似系数64,确定查询案例文本62与第k个历史案例文本之间的文本相似度65。接着,对查询案例文本62与全部K个历史案例文本的相似度进行排序;基于排序结果从K个历史案例文本选择相似历史案例文本66以作为输出。比如,选择相似度最高的10个历史案例文本,以作为相似历史案例文本66。
在图5中,应用阶段60中所采用的历史案例数据库与模型训练阶段50中所采用的历史案例数据库为同一个历史案例数据库,这样可以便于快速工业部署。实际上,应用阶段60中所采用的历史案例数据库与模型训练阶段50中所采用的历史案例数据库还可以为不同的历史案例数据库,本发明实施方式对此并无限定。
图6为本发明实施方式的文本相似度确定装置的示范性结构图。
在图6中,文本相似度确定装置600包括一个存储器602和一个处理器601;存储器602中存储有可被处理器601执行的应用程序,用于使得处理器601执行如上任一项所述的文本相似度确定方法。
需要说明的是,上述各流程和各结构图中不是所有的步骤和模块都是必须的,可以根据实际的需要忽略某些步骤或模块。各步骤的执行顺序不是固定的,可以根据需要进行调整。各模块的划分仅仅是为了便于描述采用的功能上的划分,实际实现时,一个模块可以分由多个模块实现,多个模块的功能也可以由同一个模块实现,这些模块可以位于同一个设备中,也可以位于不同的设备中。
各实施方式中的硬件模块可以以机械方式或电子方式实现。例如,一个硬件模块可以包括专门设计的永久性电路或逻辑器件(如专用处理器,如FPGA或ASIC)用于完成特定的操作。硬件模块也可以包括由软件临时配置的可编程逻辑器件或电路(如包括通用处理器或其它可编程处理器)用于执行特定操作。至于具体采用机械方式,或是采用专用的永久性电路,或是采用临时配置的电路(如由软件进行配置)来实现硬件模块,可以根据成本和时间上的考虑来决定。
本发明还提供了一种机器可读的存储介质,存储用于使一机器执行如本文所述方法的指令。具体地,可以提供配有存储介质的系统或者装置,在该存储介质上存储着实现上述实施例中任一实施方式的功能的软件程序代码,且使该系统或者装置的计算机(或CPU或MPU)读出并执行存储在存储介质中的程序代码。此外,还可以通过基于程序代码的指令使计算机上操作的操作系统等来完成部分或者全部的实际操作。还可以将从存储介质读出的程序代码写到插入计算机内的扩展板中所设置的存储器中或者写到与计算机相连接的扩展单元中设置的存储器中,随后基于程序代码的指令使安装在扩展板或者扩展单元上的CPU等来执行部分和全部实际操作,从而实现上述实施方式中任一实施方式的功能。
用于提供程序代码的存储介质实施方式包括软盘、硬盘、磁光盘、光盘(如CD-ROM、CD-R、CD-RW、DVD-ROM、DVD-RAM、DVD-RW、DVD+RW)、磁带、非易失性存储卡和ROM。可选择地,可以由通信网络从服务器计算机或云上下载程序代码。
以上所述,仅为本发明的较佳实施方式而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
上文通过附图和优选实施例对本发明进行了详细展示和说明,然而本发明不限于这些已揭示的实施例。基与上述多个实施例,本领域技术人员可以知晓,可以组合上述不同实施例中的代码审核手段得到本发明更多的实施例,这些实施例也在本发明的保护范围之内。

Claims (18)

  1. 文本相似度确定方法(100),其特征在于,包括:
    对第一文本分割(101)以生成m个句子,其中m为正整数;
    对第二文本分割(102)以生成n个句子,其中n为正整数;
    确定(103)m*n个第一句子对,其中每个所述第一句子对包含所述m个句子中的任一个句子及所述n个句子中的任一个句子;
    确定(104)m*n个所述第一句子对中的每个第一句子对中两个句子之间的相关系数;
    基于m*n个所述第一句子对的相关系数,确定(105)所述第一文本与所述第二文本之间的相似度。
  2. 根据权利要求1所述的文本相似度确定方法(100),其特征在于,在确定(104)m*n个所述第一句子对中的每个句子对的相关系数之前,该方法(100)还包括:
    对作为训练数据的第二句子对进行自动标注;
    利用已自动标注的所述第二句子对预训练的自然语言模型进行训练,以获得所述句子相关模型;
    其中所述确定(104)m*n个所述第一句子对中的每个句子对中两个句子之间的相关系数包括:基于所述句子相关模型,确定m*n个所述第一句子对中的每个句子对中两个句子之间的相关系数。
  3. 根据权利要求2所述的文本相似度确定方法(100),其特征在于,
    所述对作为训练数据的第二句子对进行自动标注包括:
    当所述第二句子对中的两个句子属于同一文本时,自动标注所述第二句子对为正例;
    当所述第二句子对中的两个句子属于不同的文本时,自动标注所述第二句子对为反例。
  4. 根据权利要求1所述的文本相似度确定方法(100),其特征在于,所述基于m*n个所述第一句子对的相关系数,确定(105)所述第一文本与所述第二文本之间的相似度包括下列中的至少一个:
    将m*n个所述第一句子对的相关系数的算术平均值,确定为所述第一文本与所述第二文本之间的相似度;
    将m*n个所述第一句子对的相关系数的中位数,确定为所述第一文本与所述第二文本之间的相似度;
    将m*n个所述第一句子对的相关系数的最大值,确定为所述第一文本与所述第二文本之间的相似度;
    确定包含该m个句子中的任一个相同句子的n个第一句子对的相关系数的最大值,将对应于各自的相同句子的m个所述最大值的算术平均值,确定为所述第一文本与所述第二文本 之间的相似度。
  5. 文本相似度确定装置(200),其特征在于,包括:
    第一分割模块(201),用于对第一文本分割以生成m个句子,其中m为正整数;
    第二分割模块(202),用于对第二文本分割以生成n个句子,其中n为正整数;
    句子对确定模块(203),用于确定m*n个第一句子对,其中每个所述第一句子对包含所述m个句子中的任一个句子及所述n个句子中的任一个句子;
    相关系数确定模块(204),用于确定m*n个所述第一句子对中的每个第一句子对中两个句子之间的相关系数;
    相似度确定模块(205),用于基于m*n个所述第一句子对的相关系数,确定所述第一文本与所述第二文本之间的相似度。
  6. 根据权利要求5所述的文本相似度确定装置(200),其特征在于,还包括:
    标注模块,用于在所述相关系数确定模块(204)确定m*n个所述第一句子对中的每个句子对的相关系数之前,对作为训练数据的第二句子对进行自动标注;
    训练模块,用于利用已自动标注的所述第二句子对预训练的自然语言模型进行训练,以获得所述句子相关模型;
    其中所述相关系数确定模块(204),用于基于所述句子相关模型,确定m*n个所述第一句子对中的每个句子对中两个句子之间的相关系数。
  7. 根据权利要求6所述的文本相似度确定装置(200),其特征在于,
    所述标注模块,用于当所述第二句子对中的两个句子属于同一文本时,自动标注所述第二句子对为正例;当所述第二句子对中的两个句子属于不同的文本时,自动标注所述第二句子对为反例。
  8. 根据权利要求5所述的文本相似度确定装置(200),其特征在于,
    所述相似度确定模块(205),用于执行下列中的至少一个:
    将m*n个所述第一句子对的相关系数的算术平均值,确定为所述第一文本与所述第二文本之间的相似度;
    将m*n个所述第一句子对的相关系数的中位数,确定为所述第一文本与所述第二文本之间的相似度;
    将m*n个所述第一句子对的相关系数的最大值,确定为所述第一文本与所述第二文本之间的相似度;
    确定包含该m个句子中的任一个相同句子的n个第一句子对的相关系数的最大值,将对 应于各自的相同句子的m个所述最大值的算术平均值,确定为所述第一文本与所述第二文本之间的相似度。
  9. 工业诊断系统(30),其特征在于,包括:
    人机接口模块(31),用于接收查询案例文本;
    历史案例数据库(32),用于保存K个历史案例文本,其中K为正整数;
    处理器(33),与所述人机接口模块(31)与所述历史案例数据库(32)分别耦合,被配置用于:
    对所述查询案例文本分割以生成m个句子,其中m为正整数;对第k个历史案例文本分割以生成n k个句子,其中n k为正整数,k的取值范围为[1,K];确定m*n k个第一句子对,其中每个所述第一句子对包含所述m个句子中的任一个句子及所述n k个句子中的任一个句子;确定m*n k个所述第一句子对中的每个第一句子对中两个句子之间的相关系数;基于m*n k个所述第一句子对的相关系数,确定所述查询案例文本与第k个历史案例文本之间的相似度;对所述查询案例文本与K个历史案例文本的相似度进行排序;基于排序结果从所述K个历史案例文本确定作为输出的历史案例文本。
  10. 根据权利要求9所述的工业诊断系统(30),其特征在于,
    所述处理器(33),被配置用于:
    对作为训练数据的第二句子对进行自动标注;利用已自动标注的所述第二句子对预训练的自然语言模型进行训练,以获得所述句子相关模型;
    其中所述确定m*n k个所述第一句子对中的每个句子对中两个句子之间的相关系数包括:基于所述句子相关模型,确定m*n k个所述第一句子对中的每个句子对中两个句子之间的相关系数。
  11. 根据权利要求10所述的工业诊断系统(30),其特征在于,
    所述处理器(33),被配置用于:当所述第二句子对中的两个句子属于同一文本时,自动标注所述第二句子对为正例;当所述第二句子对中的两个句子属于不同的文本时,自动标注所述第二句子对为反例。
  12. 根据权利要求10所述的工业诊断系统(30),其特征在于,
    所述处理器(33),被配置用于执行下列中的至少一个:
    当m大于所述K个历史案例文本的平均句子数t时,将m*n k个所述第一句子对的相关系数的算术平均值,确定为所述第一文本与所述第二文本之间的相似度;
    将m*n k个所述第一句子对的相关系数的中位数,确定为所述第一文本与所述第二文本之 间的相似度;
    将m*n k个所述第一句子对的相关系数的最大值,确定为所述第一文本与所述第二文本之间的相似度;
    当m小于等于所述K个历史案例文本的平均句子数t时,确定包含该m个句子中的任一个相同句子的n个第一句子对的相关系数的最大值,将对应于各自的相同句子的m个所述最大值的算术平均值,确定为所述第一文本与所述第二文本之间的相似度。
  13. 工业诊断方法(400),其特征在于,包括:
    接收(401)查询案例文本;
    从历史案例数据库获取(402)K个历史案例文本,其中K为正整数;
    对所述查询案例文本分割(403)以生成m个句子,其中m为正整数;
    对第k个历史案例文本分割(404)以生成n k个句子,其中n k为正整数,k的取值范围为[1,K];
    确定(405)m*n k个第一句子对,其中每个所述第一句子对包含所述m个句子中的任一个句子及所述n k个句子中的任一个句子;
    确定(406)m*n k个所述第一句子对中的每个第一句子对中两个句子之间的相关系数;
    基于m*n k个所述第一句子对的相关系数,确定(407)所述查询案例文本与第k个历史案例文本之间的相似度;
    对所述查询案例文本与K个历史案例文本的相似度进行排序(408);
    基于排序结果从所述K个历史案例文本确定(409)作为输出的历史案例文本。
  14. 根据权利要求13所述的工业诊断方法(400),其特征在于,在确定m*n个所述第一句子对中的每个句子对的相关系数(406)之前,该方法还包括:
    对作为训练数据的第二句子对进行自动标注;
    利用已自动标注的所述第二句子对预训练的自然语言模型进行训练,以获得所述句子相关模型;
    其中所述确定m*n个所述第一句子对中的每个句子对中两个句子之间的相关系数包括:基于所述句子相关模型,确定m*n个所述第一句子对中的每个句子对中两个句子之间的相关系数。
  15. 根据权利要求14所述的工业诊断方法(400),其特征在于,所述对作为训练数据的第二句子对进行自动标注包括:
    当所述第二句子对中的两个句子属于同一文本时,自动标注所述第二句子对为正例;
    当所述第二句子对中的两个句子属于不同的文本时,自动标注所述第二句子对为反例。
  16. 根据权利要求13所述的工业诊断方法(400),其特征在于,所述基于m*n k个所述第一句子对的相关系数,确定(407)所述查询案例文本与第k个历史案例文本之间的相似度,包括下列中的至少一个:
    当m大于所述K个历史案例文本的平均句子数t时,将m*n k个所述第一句子对的相关系数的算术平均值,确定为所述第一文本与所述第二文本之间的相似度;
    将m*n k个所述第一句子对的相关系数的中位数,确定为所述第一文本与所述第二文本之间的相似度;
    将m*n k个所述第一句子对的相关系数的最大值,确定为所述第一文本与所述第二文本之间的相似度;
    当m小于等于所述K个历史案例文本的平均句子数t时,确定包含该m个句子中的任一个相同句子的n个第一句子对的相关系数的最大值,将对应于各自的相同句子的m个所述最大值的算术平均值,确定为所述第一文本与所述第二文本之间的相似度。
  17. 文本相似度确定装置(600),其特征在于,包括处理器(601)和存储器(602);
    所述存储器中(602)存储有可被所述处理器(601)执行的应用程序,用于使得所述处理器(601)执行如权利要求1至4中任一项所述的文本相似度确定方法。
  18. 计算机可读存储介质,其特征在于,其中存储有计算机可读指令,该计算机可读指令用于执行如权利要求1至4中任一项所述的文本相似度确定方法。
PCT/CN2020/118172 2020-09-27 2020-09-27 文本相似度确定方法、装置及工业诊断方法、系统 WO2022061833A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/CN2020/118172 WO2022061833A1 (zh) 2020-09-27 2020-09-27 文本相似度确定方法、装置及工业诊断方法、系统
CN202080104960.6A CN116097237A (zh) 2020-09-27 2020-09-27 文本相似度确定方法、装置及工业诊断方法、系统
EP20954684.5A EP4202714A4 (en) 2020-09-27 2020-09-27 METHOD AND DEVICE FOR DETERMINING TEXT SIMILARITY AND INDUSTRIAL DIAGNOSTIC METHOD AND SYSTEM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/118172 WO2022061833A1 (zh) 2020-09-27 2020-09-27 文本相似度确定方法、装置及工业诊断方法、系统

Publications (1)

Publication Number Publication Date
WO2022061833A1 true WO2022061833A1 (zh) 2022-03-31

Family

ID=80844862

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/118172 WO2022061833A1 (zh) 2020-09-27 2020-09-27 文本相似度确定方法、装置及工业诊断方法、系统

Country Status (3)

Country Link
EP (1) EP4202714A4 (zh)
CN (1) CN116097237A (zh)
WO (1) WO2022061833A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5463768A (en) 1994-03-17 1995-10-31 General Electric Company Method and system for analyzing error logs for diagnostics
US7778817B1 (en) * 2000-09-30 2010-08-17 Intel Corporation Method and apparatus for determining text passage similarity
CN106202055A (zh) * 2016-07-27 2016-12-07 湖南蚁坊软件有限公司 一种针对长文本的相似性判定方法
JP2018036725A (ja) * 2016-08-29 2018-03-08 日本電信電話株式会社 整合性判定装置、方法、及びプログラム
CN109033413A (zh) * 2018-03-12 2018-12-18 上海大学 一种基于神经网络的需求文档和服务文档匹配方法
CN109145299A (zh) * 2018-08-16 2019-01-04 北京金山安全软件有限公司 一种文本相似度确定方法、装置、设备及存储介质
CN111368037A (zh) * 2020-03-06 2020-07-03 平安科技(深圳)有限公司 基于Bert模型的文本相似度计算方法和装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110046244B (zh) * 2019-04-24 2021-06-08 中国人民解放军国防科技大学 一种用于问答系统的答案选择方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5463768A (en) 1994-03-17 1995-10-31 General Electric Company Method and system for analyzing error logs for diagnostics
US7778817B1 (en) * 2000-09-30 2010-08-17 Intel Corporation Method and apparatus for determining text passage similarity
CN106202055A (zh) * 2016-07-27 2016-12-07 湖南蚁坊软件有限公司 一种针对长文本的相似性判定方法
JP2018036725A (ja) * 2016-08-29 2018-03-08 日本電信電話株式会社 整合性判定装置、方法、及びプログラム
CN109033413A (zh) * 2018-03-12 2018-12-18 上海大学 一种基于神经网络的需求文档和服务文档匹配方法
CN109145299A (zh) * 2018-08-16 2019-01-04 北京金山安全软件有限公司 一种文本相似度确定方法、装置、设备及存储介质
CN111368037A (zh) * 2020-03-06 2020-07-03 平安科技(深圳)有限公司 基于Bert模型的文本相似度计算方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4202714A4

Also Published As

Publication number Publication date
EP4202714A1 (en) 2023-06-28
EP4202714A4 (en) 2024-05-22
CN116097237A (zh) 2023-05-09

Similar Documents

Publication Publication Date Title
US11475209B2 (en) Device, system, and method for extracting named entities from sectioned documents
Jung Semantic vector learning for natural language understanding
CN105988990B (zh) 汉语零指代消解装置和方法、模型训练方法和存储介质
CN106407113B (zh) 一种基于Stack Overflow和commit库的bug定位方法
CN108255813B (zh) 一种基于词频-逆文档与crf的文本匹配方法
CN111353306B (zh) 基于实体关系和依存Tree-LSTM的联合事件抽取的方法
KR20100031800A (ko) 병렬 코퍼스를 이용한 기계번역 오류 탐지 방법 및 장치
CN106570180A (zh) 基于人工智能的语音搜索方法及装置
CN110232112A (zh) 文章中关键词提取方法及装置
CN110362678A (zh) 一种自动提取中文文本关键词的方法与装置
CN109408802A (zh) 一种提升句向量语义的方法、系统及存储介质
CN107526721B (zh) 一种对电商产品评论词汇的歧义消除方法及装置
CN113360654B (zh) 文本分类方法、装置、电子设备及可读存储介质
CN109213998A (zh) 中文错字检测方法及系统
US20210103699A1 (en) Data extraction method and data extraction device
CN111091009B (zh) 一种基于语义分析的文档关联审核方法
CN108536673B (zh) 新闻事件抽取方法及装置
CN110751234A (zh) Ocr识别纠错方法、装置及设备
CN112183102A (zh) 基于注意力机制与图注意力网络的命名实体识别方法
Singh et al. Sentiment analysis using lexicon based approach
Korpusik et al. Data collection and language understanding of food descriptions
CN110309513B (zh) 一种文本依存分析的方法和装置
CN110929509B (zh) 一种基于louvain社区发现算法的领域事件触发词聚类方法
KR102351745B1 (ko) 사용자 리뷰 기반 평점 재산정 장치 및 방법
WO2022061833A1 (zh) 文本相似度确定方法、装置及工业诊断方法、系统

Legal Events

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

Ref document number: 20954684

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020954684

Country of ref document: EP

Effective date: 20230324

NENP Non-entry into the national phase

Ref country code: DE