Intelligent interaction method and system based on legal consultation

By calculating and screening the scores of dialect data, converting non-standard dialects into standard dialects, solving the problem of inaccurate identification of non-standard dialects in the prior art, improving the recognition accuracy and response quality of the legal consultation system, and maintaining the database Timeliness.

CN119226444AInactive Publication Date: 2024-12-31SUIHUA UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411403090.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2024-12-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art cannot accurately identify the user's legal consultation issues when dealing with users' use of non-standard dialects, resulting in a decrease in the validity score of generated legal response information.

Method used

By collecting multiple dialect data from various dialect areas, calculate the pronunciation accuracy score, validity score and error data judgment value of each language data packet, filter out standard dialect samples, and convert the user's voice data into standard dialects. The transformation samples are determined using characteristic differences values ​​to generate legal terms.

Benefits of technology

It improves the recognition accuracy and speech conversion quality of non-standard dialects, enhances the scope of application and practicality of the interactive platform, ensures the validity score of legal response information, and can scientifically update the dialect database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226444A_ABST
    Figure CN119226444A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent interaction method and system based on legal consultation, and relates to the field of natural language processing, and the main scheme is as follows: comparing a pronunciation accuracy score # imgabs0 #, an effectiveness score # imgabs1 # and an error data judgment value # imgabs2 # with a data screening threshold set, and determining a standard dialect sample of each dialect data; according to the mandarin probability # imgabs3 # and the dialect probability # imgabs4 #, the language category input by the user is judged; when it is judged that the category of the language input by the user is a dialect, voice data of the user is converted into a standard dialect by calculating a feature difference value # imgabs7 # between a user feature vector sequence # imgabs5 # and a sample feature vector sequence # imgabs6 #; the problem that the validity score of generated legal response information is reduced due to the fact that an interaction platform cannot perform accurate recognition when a user puts forward a legal consultation problem by using voice of a non-standard dialect is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to an intelligent interaction method and system based on legal consultation. Background Art

[0002] The working principle of the intelligent interactive method based on legal consultation is: establish a language database, and mark the language samples in the database as standard legal texts; users raise legal consultation questions through text input or voice input; the interactive platform recognizes the content input by the user and searches for the corresponding standard legal text, performs intent recognition based on the standard legal text and determines the core intent of the user's consultation, and generates legal response information based on the core intent of the user's consultation.

[0003] The existing technology still has the following shortcomings: when the user inputs dialect text or dialect voice, which is different from the standard language sample, or when the user uses a non-standard dialect voice to ask legal consultation questions, the interactive platform cannot accurately identify it, which reduces the effectiveness score of the generated legal response information. Summary of the invention

[0004] 1. Technical issues to be resolved In view of the shortcomings of the prior art, the present invention provides an intelligent interactive method based on legal consultation, which uses user feature vector sequences to With the sample feature vector sequence Calculate feature difference values ; Compare different feature difference values ​​and convert the user's voice data into a standard dialect sample corresponding to the minimum feature difference value. This solves the problem that when users ask legal consultation questions in non-standard dialects, the interactive platform cannot accurately identify them, resulting in a lower effectiveness score for the generated legal response information.

[0005] (II) Technical solution To achieve the above objectives, the present invention is implemented through the following technical solutions: an intelligent interactive method based on legal consultation, characterized in that it includes the following steps: Collect multiple dialect data in each major dialect area, each dialect data contains multiple language data packets of the collected objects; Calculate the pronunciation accuracy score, validity score and error data judgment value of each language data packet; preset a data screening threshold set; compare the pronunciation accuracy score, validity score, error data judgment value of different language data packets with the data screening threshold set; determine the standard dialect sample of each dialect data according to the comparison result; input the standard dialect sample into The model performs feature extraction to obtain sample feature vector sequences of different standard dialect samples ; Input the user's voice data System, get the user's voice input word sequence ; Input speech into word sequence Input Mandarin Models and Dialects Model, calculate Mandarin probability and dialect probability ; Based on Mandarin probability and dialect probability Determine the language category of user input; When the user input language category is determined to be Mandarin, the user's voice data is input model, so that the user's Mandarin voice data is converted into legal terms; when the user's input language category is determined to be a dialect, the user's voice data is input into The model performs feature extraction to obtain a user feature vector sequence ; According to the user feature vector sequence With the sample feature vector sequence Calculate feature difference values , according to different feature difference values Determine a conversion sample; convert the user's voice data into a standard dialect through the conversion sample; input the converted standard dialect into Model, which converts the user's dialect speech data into legal terms; Obtain dialect update data and user feedback data; calculate update demand indicators based on dialect update data ; Calculate feedback accuracy based on user feedback data ; Preset update threshold set; According to update demand indicators , feedback accuracy and update threshold set to determine whether the dialect database needs to be updated.

[0006] In the preferred embodiment of the intelligent interactive method based on legal consultation, the method for calculating the pronunciation accuracy score of each language data packet is: No. Language data packages Dialect data including tone matching , Finals matching degree Matching degree with initial consonant ; According to the tone matching , Final matching degree Matching degree with initial consonant Calculating pronunciation accuracy scores , the formula based on is:

[0007] in, For the Pronunciation accuracy scores for the language data packages; The serial numbers corresponding to different language data packages; For the The degree of tone matching between a language data package and the standard dialect pronunciation data; For the The matching degree of the finals of a language data package with the standard dialect pronunciation data; For the The matching degree of initial consonants between the language data package and the standard dialect pronunciation data; Standard dialect pronunciation data coefficient.

[0008] In the preferred embodiment of the intelligent interactive method based on legal consultation, the method for calculating the effectiveness score of each language data packet is: No. The language data package also includes data integrity , grammatical accuracy and pronunciation clarity ; According to data integrity , grammatical accuracy and pronunciation clarity Calculating effectiveness scores , the formula based on is:

[0009] in, For the The effectiveness rating of the language data packages; For the Data integrity of each language data packet; For the The grammatical accuracy of each language data package; For the Articulation clarity of each language data packet; For data integrity The weight coefficient is between 0.2 and 0.5; For grammatical accuracy The weight coefficient is 0.3 to 0.5; For pronunciation clarity The weight coefficient is between 0.2 and 0.5; and 1.

[0010] In the preferred embodiment of the intelligent interaction method based on legal consultation, the method for calculating the error data judgment value of each language data packet is as follows: No. Language data packs also include legal terminology comparisons and differences Compare the difference values ​​with language logic ; Comparison of difference values ​​according to legal terms Compare the difference values ​​with language logic Calculate the error data judgment value , the formula based on is:

[0011] in, For the The error data judgment value of a language data packet; For the The difference between the language data package and the legal terminology; For the The difference value between the language data package and the language logic.

[0012] In the preferred embodiment of the intelligent interactive method based on legal consultation, the method for determining the standard dialect sample of each dialect data according to the comparison result is: Data filtering threshold set including pronunciation accuracy score threshold , effectiveness score threshold and error data judgment value threshold ; According to Pronunciation accuracy scores for language data packages , effectiveness score , Error data judgment value Compared with the data screening threshold set, the specific criteria for determining the standard dialect samples are:

[0013] When there is no language data package that meets the standard for the same dialect data, calculate the comprehensive score of each language data package in this dialect data , keep the overall score The language data packet corresponding to the maximum value; The reserved language data packets are used as standard dialect samples.

[0014] In the preferred embodiment of the intelligent interactive method based on legal consultation: according to the Mandarin probability and dialect probability The method for determining the user input language category is: Input speech into word sequence Input Mandarin Model, calculate Mandarin probability , the formula based on is:

[0015] in, The user input participle, is the serial number corresponding to different participles, and its value is , is the total number of participles; Representation sequence The number of occurrences in the Mandarin corpus; express The number of occurrences in the Mandarin corpus; Indicates the size of the vocabulary obtained by removing duplicates from the Mandarin corpus; In Mandarin Under the model, given the user input The word and When the word The probability of a word appearing; Inputting phonetic input word sequences into dialects Model, calculate dialect probability , the formula based on is:

[0016] in, Representation sequence The number of occurrences in the dialect corpus; Representation sequence The number of occurrences in the dialect corpus; Indicates the size of the vocabulary obtained by removing duplicates from the other party's corpus; Expressed in dialect Under the model, given the user input The word and When the word The probability of a word appearing; According to Mandarin probability and dialect probability The method for determining the user input language category is: .

[0017] In the preferred embodiment of the intelligent interactive method based on legal consultation, the method for determining the conversion sample is: According to the user feature vector sequence and the sample feature vector sequence Calculate feature difference values , the formula based on is:

[0018] in, For user voice data and The feature difference value of the standard dialect samples, are the serial numbers corresponding to different standard dialect samples; For the A sequence of feature vectors of standard dialect samples; Multiple feature difference values Compare and select feature difference values The standard dialect sample corresponding to the minimum value is taken as the conversion sample.

[0019] In the preferred embodiment of the intelligent interactive method based on legal consultation: calculating the update demand index based on the dialect update data The method is: Dialect update data includes the number of new dialect words that appear in a unit of time , the number of vocabulary correspondences affected , the total number of dialect vocabulary collected Total number of vocabulary correspondences ; According to the number of new dialect words appearing in a unit time Total number of dialect vocabulary collections Calculating update probability , the formula based on is:

[0020] The number of affected items according to the vocabulary correspondence Total number of vocabulary correspondences Calculating the impact of legal terminology updates , the formula based on is:

[0021] in, is the number of affected lexical correspondences, indicating the number of changes in the correspondence between dialect vocabulary and legal terms due to the update of legal terminology; is the total number of established correspondences between dialect words and legal terms; According to the update probability and update impact Calculate update demand index , the formula based on is:

[0022] in, The update probability The weight coefficient is between 0.4 and 0.7; To update the impact The weight coefficient is 0.3 to 0.6; and 1.

[0023] In the preferred embodiment of the intelligent interactive method based on legal consultation, the method for determining whether the dialect database needs to be updated is: User feedback data includes the number of correct conversions and feedback error conversion number ; Correctly convert quantity based on feedback and feedback error conversion number Calculating feedback accuracy , the formula based on is:

[0024] Update threshold set includes update requirement indicator threshold and feedback accuracy threshold ; According to the update demand index , feedback accuracy The criteria for determining whether the dialect database needs to be updated and the update threshold set are: .

[0025] The present invention also discloses an intelligent interactive system based on legal consultation, which is characterized by comprising: The data collection module is used to collect data of multiple dialects in each major dialect area, and each dialect data contains language data packets of multiple collection objects; The data screening module is used to calculate the pronunciation accuracy score, validity score and error data judgment value of each language data packet; preset a data screening threshold set; compare the pronunciation accuracy score, validity score, error data judgment value of different language data packets with the data screening threshold set; determine the standard dialect sample of each dialect data according to the comparison result; input the standard dialect sample into the The model performs feature extraction to obtain sample feature vector sequences of different standard dialect samples ; The language category judgment module is used to input the user's voice data into System, get the user's voice input word sequence ; Input speech into word sequence Input Mandarin Models and Dialects Model, calculate Mandarin probability and dialect probability ; Based on Mandarin probability and dialect probability Determine the language category of user input; The legal term conversion module is used to convert the user's voice data into a legal term when the user's input language category is determined to be Mandarin. model, so that the user's Mandarin voice data is converted into legal terms; when the user's input language category is determined to be a dialect, the user's voice data is input into The model performs feature extraction to obtain a user feature vector sequence ; According to the user feature vector sequence With the sample feature vector sequence Calculate feature difference values , according to different feature difference values Determine a conversion sample; convert the user's voice data into a standard dialect through the conversion sample; input the converted standard dialect into Model, which converts user's dialect speech data into legal terms; Update module, used to obtain dialect update data and user feedback data; calculate update demand indicators based on dialect update data ; Calculate feedback accuracy based on user feedback data ; Preset update threshold set; According to update demand indicators , feedback accuracy and update threshold set to determine whether the dialect database needs to be updated.

[0026] (III) Beneficial effects The present invention provides an intelligent interactive method based on legal consultation, which has the following beneficial effects: (1) By calculating the pronunciation accuracy score of each language data package , effectiveness score and error data judgment value , which can quantify the standardization of each language data package; by scoring the pronunciation accuracy of different language data packages , effectiveness score , Error data judgment value By comparing with the data screening threshold set, at least one representative and normative standard dialect sample can be screened out, providing more and more accurate speech conversion options for dialect users; (2) Based on Mandarin probability and dialect probability Determining the language category of user input can more carefully measure the degree of match between the speech and the Mandarin and dialect models, thereby improving the accuracy of determining the language category; (3) By The model converts the Mandarin voice input by the user into legal terms, which can quickly and accurately connect with the legal terminology system, reducing errors and ambiguities in the intermediate links; by converting the user's voice data into standard dialects, it can lay the foundation for subsequent conversion into legal terms, which helps to improve the understanding and processing capabilities of dialect voice input, allowing the interactive platform to adapt to dialect users in different regions, expanding the scope of application and practicality of the system; the converted standard dialect input The model is used to convert legal terms into dialects, which helps solve the difficulty of direct conversion between dialects and legal terms. It also solves the problem that when users use non-standard voice dialects to ask legal consultation questions, the interactive platform cannot accurately identify them, which reduces the effectiveness score of the generated legal response information. (4) Based on the update demand indicators , feedback accuracy The update threshold set is used to determine whether the dialect database needs to be updated, which can make the database update more scientific and standardized, help the dialect database maintain timeliness, and improve user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 The present invention is a schematic diagram of the working steps of an intelligent interactive method based on legal consultation. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] See also Figure 1 The present invention provides a first subject, comprising the following steps: Step 1: Collect multiple dialect data in each major dialect area, each dialect data contains multiple language data packets of the collection object.

[0030] It should be noted that the collection method is mainly field investigation, which includes: selecting representative locations and determining survey subjects of different ages, genders and occupations according to the division of dialect areas; talking to survey subjects, guiding them to talk in dialect and recording. The major dialect areas include the Northern dialect area, Wu dialect area, Xiang dialect area, Gan dialect area, Hakka dialect area, Min dialect area and Yue dialect area.

[0031] Combined with the content of step 1: The dialects within each dialect area may differ due to factors such as region, age, and social groups. By collecting data on multiple dialects in each major dialect area, we can cover the rich and diverse language expressions in each major dialect area and record different language samples as completely as possible.

[0032] Step 2: Calculate the pronunciation accuracy score, validity score and error data judgment value of each language data packet; preset a data screening threshold set; compare the pronunciation accuracy score, validity score, error data judgment value of different language data packets with the data screening threshold set; determine the standard dialect sample of each dialect data according to the comparison results; input the standard dialect sample into The model performs feature extraction to obtain sample feature vector sequences of different standard dialect samples .

[0033] Step 201: The method for calculating the pronunciation accuracy score of each language data packet is: No. Language data packages include tone matching , Finals matching degree Matching degree with initial consonant .

[0034] It should be noted that the tone matching The matching degree of finals is obtained by calculating the ratio of the number of syllable tones in the language data package that matches the standard dialect pronunciation data to the total number of syllables in the language data package. It is measured by calculating the edit distance between the length of the finals in the voice data packet and the length of the finals in the standard dialect pronunciation data. The longer the edit distance, the better the final matching degree. The lower the initial consonant matching degree It is measured by calculating the edit distance between the length of the initial consonant in the voice data packet and the length of the initial consonant in the standard dialect pronunciation data. The longer the edit distance, the better the initial consonant matching. The lower.

[0035] According to the tone matching , Finals matching degree Matching degree with initial consonant Calculating pronunciation accuracy scores , the formula based on is: .

[0036] It should be noted that this formula calculates the tone matching degree , Finals matching degree Matching degree with initial consonant The average value of the standard dialect pronunciation data is multiplied by Make adjustments and finally get a pronunciation accuracy score .

[0037] in, For the Pronunciation accuracy scores for the language data packages; The serial numbers corresponding to different language data packages; For the The degree of tone matching between a language data package and the standard dialect pronunciation data; For the The matching degree of the finals of a language data package with the standard dialect pronunciation data; For the The matching degree of initial consonants between the language data package and the standard dialect pronunciation data; Standard dialect pronunciation data coefficient, obtained by acoustic analysis of a large number of dialect speech samples that are recognized as standard pronunciation, standard dialect pronunciation data coefficient Refer to these data to determine.

[0038] Step 202: The method for calculating the effectiveness score of each language data packet is: No. The language data package also includes data integrity , grammatical accuracy and pronunciation clarity .

[0039] It should be noted that data integrity The method of obtaining is: according to the missing semantic components, each sentence in the voice data packet is scored and the total score of all sentences is calculated, and the ratio of the total score to the total number of sentences in the voice data packet is calculated to obtain the data integrity. ; Grammatical accuracy The method of obtaining the grammatical accuracy is as follows: determine the number of grammatically incorrect sentences in each voice data packet according to the grammatical rules, calculate the ratio of the number of grammatically incorrect sentences to the total number of sentences in the voice data packet, and obtain the grammatical accuracy. ; Articulation The acquisition method is as follows: extract the fundamental frequency in each speech data packet by the autocorrelation method, calculate the periodicity of each speech data packet by the average amplitude difference function method, obtain the pitch change of each speech data packet by the harmonic product spectrum method, input the obtained fundamental frequency, periodicity and pitch change data into the pronunciation clarity evaluation model, and obtain the pronunciation clarity. .

[0040] According to data integrity , grammatical accuracy and pronunciation clarity Calculating effectiveness scores , the formula based on is: .

[0041] It should be noted that this formula takes into account data integrity through a weighted formula. , grammatical accuracy and pronunciation clarity , and finally get the effectiveness score .

[0042] in, For the The effectiveness rating of the language data packages; For the Data integrity of each language data packet; For the The grammatical accuracy of each language data package; For the Articulation clarity of each language data packet; For data integrity The weight coefficient is 0.2 to 0.5, and the data integrity is Score effectiveness Determine the extent of impact; For grammatical accuracy The weight coefficient is 0.3 to 0.5, and the grammatical accuracy is Score effectiveness Determine the extent of impact; For pronunciation clarity The weight coefficient is 0.2 to 0.5, which is based on the pronunciation clarity. Score effectiveness The extent of the impact is determined; and 1.

[0043] Step 203: The method for calculating the error data judgment value of each language data packet is: No. Language data packs also include legal terminology comparisons and differences Compare the difference values ​​with language logic .

[0044] It should be noted that the difference between legal terms and It is obtained by calculating the edit distance between the dialect words in the language data package and the words in the legal terminology collection. The larger the edit distance, the greater the difference value of the legal terminology comparison. The higher the value, the greater the difference in language logic comparison. The similarity between the dialect logic relationship of the language data package and the standard language logic relationship is calculated. The lower the similarity, the higher the difference value of the language logic comparison. The higher; Comparison of difference values ​​according to legal terms Compare the difference values ​​with language logic Calculate the error data judgment value , the formula based on is: .

[0045] It should be noted that the error data judgment value Compare the difference values ​​by calculating the legal terms Compare the difference values ​​with language logic The sum is obtained.

[0046] in, For the The error data judgment value of a language data packet; For the The difference between the language data package and the legal terminology; For the The difference value between the language data package and the language logic.

[0047] Step 204: The method for determining the standard dialect sample of each dialect data according to the comparison result is: Data filtering threshold set including pronunciation accuracy score threshold , effectiveness score threshold and error data judgment value threshold .

[0048] It should be noted that the pronunciation accuracy score threshold is determined The method is: Calculate the pronunciation accuracy score of each language data packet according to the above method , calculate all pronunciation accuracy scores The average value of the pronunciation accuracy score The language data packets above the average value are used as threshold samples; the pronunciation accuracy scores of all language data packets in the threshold samples are calculated. The median of Reference basis.

[0049] Determining the effectiveness score threshold The method is: Calculate the effectiveness score of each language data package according to the above method , the effectiveness score Sort from high to low and calculate the top 10 Effectiveness score The average value of Reference basis.

[0050] Determine the error data judgment value threshold The method is: count the speech content input by users in dialect in the past as the historical data set, calculate the error data judgment value of the historical data set according to the above method, and sort them from low to high, and select the top 20 The error data judgment values ​​​​compose the threshold data set, and the mean and variance of the threshold data values ​​are calculated as the error data judgment value threshold Reference basis.

[0051] According to Pronunciation accuracy scores for language data packages , effectiveness score , Error data judgment value Compared with the data screening threshold set, the specific criteria for determining the standard dialect samples are: .

[0052] It should be noted that when the pronunciation accuracy score Greater than the pronunciation accuracy score threshold , effectiveness score Greater than the effectiveness score threshold and error data judgment value Greater than the error data judgment value threshold When all three conditions are met, the language data package is retained.

[0053] When there is no language data package that meets the standard for the same dialect data, calculate the comprehensive score of each language data package in this dialect data , keep the overall score Language data package corresponding to the maximum value; comprehensive score Rate the pronunciation accuracy of this language data pack and effectiveness rating The sum minus the error data judgment value The value of .

[0054] The reserved language data packets are used as standard dialect samples.

[0055] Combined with the contents of steps 201 to 204: By calculating the pronunciation accuracy score for each language data package , effectiveness score and error data judgment value , which can quantify the standardization of each language data package; by scoring the pronunciation accuracy of different language data packages , effectiveness score , Error data judgment value By comparing with the data screening threshold set, at least one representative and normative standard dialect sample can be screened out, providing more and more accurate speech conversion options for dialect users.

[0056] Step 3: Input the user's voice data System, get the user's voice input word sequence ; Input speech into word sequence Input Mandarin Models and Dialects Model, calculate Mandarin probability and dialect probability ; Based on Mandarin probability and dialect probability Determine the language type of the user input.

[0057] It should be noted that It is a Chinese language processing system used to pre-process and segment Chinese original texts; Mandarin Models and Dialects Model, The model is based on the Markov hypothesis, which assumes that the appearance of a word is only related to a limited number of words before it. Through the multiplication rule of conditional probability, the probability of the entire word sequence is decomposed into the product of multiple conditional probabilities, thus obtaining the probability of Mandarin. and dialect probability .

[0058] Step 301: Based on the probability of Mandarin and dialect probability The method for determining the user input language category is: Input speech into word sequence Input Mandarin Model, calculate Mandarin probability , the formula based on is: .

[0059] It should be noted that is the maximum likelihood estimate, which is obtained by counting the number of occurrences of different word sequences in the Mandarin corpus. At the same time, in order to avoid the zero probability problem, the maximum likelihood estimate is processed using the plus-one smoothing technique, adding a constant 1 to each count, and the denominator is correspondingly added with the size of the Mandarin corpus vocabulary, to obtain , Represents conditional probability. The probability of Mandarin is obtained by calculating the product of different conditional probabilities. .

[0060] Among them, the user's voice input word sequence ; The user input participle, is the serial number corresponding to different participles, and its value is , is the total number of participles; Representation sequence The number of occurrences in the Mandarin corpus is obtained by querying the hash table; express The number of occurrences in the Mandarin corpus is obtained by querying the hash table; It represents the vocabulary size obtained by deduplicating the Mandarin corpus, which is obtained by counting the total number of different words in the Mandarin corpus; In Mandarin Under the model, given the user input The word and When the word The probability of a word appearing.

[0061] Inputting phonetic input word sequences into dialects Model, calculate dialect probability , the formula based on is: .

[0062] It should be noted that is the maximum likelihood estimate, which is obtained by counting the number of occurrences of different word segmentation sequences in the dialect corpus. At the same time, in order to avoid the zero probability problem, the maximum likelihood estimate is processed using the plus-one smoothing technique, adding a constant 1 to each count, and the denominator is correspondingly added with the size of the dialect corpus vocabulary, to obtain , Represents conditional probability, and the dialect probability is obtained by calculating the product of different conditional probabilities .

[0063] in, Representation sequence The number of occurrences in the dialect corpus is obtained by querying the hash table; Representation sequence The number of occurrences in the dialect corpus is obtained by querying the hash table; It indicates the vocabulary size obtained by deduplicating the dialect corpus, which is obtained by counting the total number of different words in the dialect corpus; Expressed in dialect Under the model, given the user input The word and When the word The probability of a word appearing.

[0064] According to Mandarin probability and dialect probability The method for determining the user input language category is: .

[0065] Combined with the content of step 301: According to Mandarin probability and dialect probability Determining the language category of user input can more carefully measure the degree of match between the speech and the Mandarin and dialect models, thereby improving the accuracy of determining the language category.

[0066] Step 4: When the user input language category is determined to be Mandarin, the user's voice data is input model, so that the user's Mandarin voice data is converted into legal terms; when the user's input language category is determined to be a dialect, the user's voice data is input into The model performs feature extraction to obtain a user feature vector sequence ; According to the user feature vector sequence With the sample feature vector sequence Calculate feature difference values , according to different feature difference values Determine a conversion sample; convert the user's voice data into a standard dialect through the conversion sample; input the converted standard dialect into The model converts the user's dialect speech data into legal terms.

[0067] It should be noted that The model is Architecture-based model that learns semantic representation of text through multi-head attention mechanism; The model learns the common semantic information of a large amount of text in the pre-training stage, and then annotates the text into standard legal terms for targeted training in the fine-tuning stage, so that the model can perform conversion accurately.

[0068] The model is trained using a large amount of speech sample data from non-standard dialects and standard dialects; The operating principle of the model is: perform fast Fourier transform on each frame of speech signal in the speech data, convert it into Mel spectrum through Mel filter bank and take the logarithm to obtain the logarithmic Mel spectrum, and finally perform discrete cosine transform to obtain coefficients and a series of Feature vector, a sequence of feature vectors that make up the speech data.

[0069] Step 401: Determine the method of converting the sample: According to the user feature vector sequence and the sample feature vector sequence Calculate feature difference values , the formula based on is: .

[0070] It should be noted that this formula calculates the user feature vector sequence and the sample feature vector sequence The Euclidean distance of the feature difference value is obtained .

[0071] in, For user voice data and The feature difference value of the standard dialect samples, are the serial numbers corresponding to different standard dialect samples; For the A sequence of feature vectors of standard dialect samples.

[0072] Multiple feature difference values Compare and select feature difference values The standard dialect sample corresponding to the minimum value is taken as the conversion sample.

[0073] Combined with the content of step 401: pass The model converts the Mandarin voice input by the user into legal terms, which can quickly and accurately connect with the legal terminology system, reducing errors and ambiguities in the intermediate links; by converting the user's voice data into standard dialects, it can lay the foundation for subsequent conversion into legal terms, which helps to improve the understanding and processing capabilities of dialect voice input, allowing the interactive platform to adapt to dialect users in different regions, expanding the scope of application and practicality of the system; the converted standard dialect input The model can be used to convert legal terms into legal terms, which helps to solve the difficulty of direct conversion between dialects and legal terms. It also solves the problem that when users use non-standard voice dialects to ask legal consultation questions, the interactive platform cannot accurately identify them, which reduces the effectiveness score of the generated legal response information.

[0074] Step 5: Obtain dialect update data and user feedback data; calculate update demand indicators based on dialect update data ; Calculate feedback accuracy based on user feedback data ; Preset update threshold set; According to update demand indicators , feedback accuracy and update threshold set to determine whether the dialect database needs to be updated.

[0075] Step 501: Calculate update demand index based on dialect update data The method is: Dialect update data includes the number of new dialect words that appear in a unit of time , the number of vocabulary correspondences affected , the total number of dialect vocabulary collected Total number of vocabulary correspondences ; According to the number of new dialect words appearing in a unit time Total number of dialect vocabulary collections Calculating update probability , the formula based on is: .

[0076] It should be noted that this formula calculates the number of new dialect words that appear in a unit of time. Total number of dialect vocabulary collections The proportion of determines the update probability ; The number of new dialect words that appear per unit time It is collected through social media platforms, local media or field surveys. The unit time can be one year, one quarter or one month, etc., depending on the actual speed of dialect change.

[0077] The number of affected items according to the vocabulary correspondence Total number of vocabulary correspondences Calculating the impact of legal terminology updates , the formula based on is:

[0078] in, is the number of vocabulary correspondences affected, indicating the number of changes in the correspondence between dialect vocabulary and legal terms due to the update of legal terms. It is obtained by comparing the correspondence tables before and after the update of legal terms. If the correspondence tables before and after the update of legal terms are inconsistent, they will be counted in the number of affected correspondences; is the total number of established correspondences between dialect words and legal terms, obtained through database query; According to the update probability and update impact Calculate update demand index , the formula based on is:

[0079] in, The update probability The weight coefficient is 0.4 to 0.7, based on the update probability Update demand indicators Determine the extent of impact; To update the impact The weight coefficient is 0.3 to 0.6, depending on the update impact Update demand indicators The degree of impact is determined, and 1.

[0080] Step 502: The method for determining whether the dialect database needs to be updated is: User feedback data includes the number of correct conversions and feedback error conversion number ; Correctly convert quantity based on feedback and feedback error conversion number Calculating feedback accuracy , the formula based on is: .

[0081] It should be noted that this formula calculates the correct conversion quantity of feedback The proportion of the total number of feedback to evaluate the accuracy of feedback ; The total number of feedbacks is the number of correct conversions of feedbacks Number of conversions with feedback error The sum of the correct conversion quantity The number of correct feedback on dialect conversion during user use; the number of incorrect feedback on dialect conversion The number of feedbacks about incorrect dialect conversions during user use; the number of feedbacks about correct conversions and feedback error conversion number Obtained by querying feedback records.

[0082] Update threshold set includes update requirement indicator threshold and feedback accuracy threshold .

[0083] It should be noted that the threshold of the update demand indicator is determined The method is: collect historical update data, calculate the update demand index of the historical update data according to the above method to form a historical update data set, calculate the median of the historical update data set as the update demand index threshold Reference basis.

[0084] Determining feedback accuracy threshold The method is to consult the industry's standard documents, technical reports, and academic research papers to understand the general principles and indicators of user feedback accuracy evaluation, and refer to the threshold establishment mechanism of successful cases in the industry to determine the feedback accuracy threshold .

[0085] According to the update demand index , feedback accuracy The criteria for determining whether the dialect database needs to be updated and the update threshold set are: .

[0086] It should be noted that if and only if the update demand indicator Less than the update requirement indicator threshold And feedback accuracy Greater than the feedback accuracy threshold When the dialect database is updated, the dialect database is not updated; in other cases, the dialect database is updated.

[0087] Combined with the contents of steps 501 to 502: According to the update demand index , feedback accuracy The update threshold set is used to determine whether the dialect database needs to be updated, which can make the database update more scientific and standardized, help the dialect database maintain timeliness, and improve user satisfaction when using dialect-related applications.

[0088] On the other hand, the present invention also discloses an intelligent interactive system based on legal consultation, comprising: The data collection module is used to collect data of various dialects in various dialect areas, and each dialect data contains language data packets of multiple collection objects.

[0089] The data screening module is used to calculate the pronunciation accuracy score, validity score and error data judgment value of each language data packet; preset a data screening threshold set; compare the pronunciation accuracy score, validity score, error data judgment value of different language data packets with the data screening threshold set; determine the standard dialect sample of each dialect data according to the comparison result; input the standard dialect sample into the The model performs feature extraction to obtain sample feature vector sequences of different standard dialect samples .

[0090] The language category judgment module is used to input the user's voice data into System, get the user's voice input word sequence ; Input speech into word sequence Input Mandarin Models and Dialects Model, calculate Mandarin probability and dialect probability ; Based on Mandarin probability and dialect probability Determine the language type of the user input.

[0091] The legal term conversion module is used to convert the user's voice data into a legal term when the user's input language category is determined to be Mandarin. model, so that the user's Mandarin voice data is converted into legal terms; when the user's input language category is determined to be a dialect, the user's voice data is input into The model performs feature extraction to obtain a user feature vector sequence ; According to the user feature vector sequence With the sample feature vector sequence Calculate feature difference values , according to different feature difference values Determine a conversion sample; convert the user's voice data into a standard dialect through the conversion sample; input the converted standard dialect into The model converts the user's dialect speech data into legal terms.

[0092] Update module, used to obtain dialect update data and user feedback data; calculate update demand indicators based on dialect update data ; Calculate feedback accuracy based on user feedback data ; Preset update threshold set; According to update demand indicators , feedback accuracy and update threshold set to determine whether the dialect database needs to be updated.

[0093] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. A person of ordinary skill in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented in electronic hardware or in combination with computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution.

[0094] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0095] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. An intelligent interactive method based on legal consultation, characterized in that: The following steps are involved: Collect multiple dialect data in each major dialect area, each dialect data contains multiple language data packets of the collected objects; Calculate the pronunciation accuracy score, validity score and error data judgment value of each language data packet; preset a data screening threshold set; compare the pronunciation accuracy score, validity score, error data judgment value of different language data packets with the data screening threshold set; determine the standard dialect sample of each dialect data according to the comparison result; input the standard dialect sample into The model performs feature extraction to obtain sample feature vector sequences of different standard dialect samples ; Input the user's voice data System, get the user's voice input word sequence ; Input speech into word sequence Input Mandarin Models and Dialects Model, calculate Mandarin probability and dialect probability ; Based on Mandarin probability and dialect probability Determine the language category of user input; When the user input language category is determined to be Mandarin, the user's voice data is input model, so that the user's Mandarin voice data is converted into legal terms; when the user's input language category is determined to be a dialect, the user's voice data is input into The model performs feature extraction to obtain a user feature vector sequence ; According to the user feature vector sequence With the sample feature vector sequence Calculate feature difference values , according to different feature difference values Determine a conversion sample; convert the user's voice data into a standard dialect through the conversion sample; input the converted standard dialect into Model, which converts user's dialect speech data into legal terms; Obtain dialect update data and user feedback data; calculate update demand indicators based on dialect update data ; Calculate feedback accuracy based on user feedback data ; Preset update threshold set; based on update demand indicators , feedback accuracy and update threshold set to determine whether the dialect database needs to be updated.

2. The intelligent interactive method based on legal consultation according to claim 1, characterized in that: The pronunciation accuracy score for each language data pack is calculated as follows: No. Language data packages include tone matching , Finals matching degree Matching degree with initial consonant ; According to the tone matching , Finals matching degree Matching degree with initial consonant Calculating pronunciation accuracy scores , the formula based on is: in, For the Pronunciation accuracy scores for the language data packages; The serial numbers corresponding to different language data packages; For the The degree of tone matching between a language data package and the standard dialect pronunciation data; For the The matching degree of the finals of a language data package with the standard dialect pronunciation data; For the The matching degree of initial consonants between the language data package and the standard dialect pronunciation data; Standard dialect pronunciation data coefficient.

3. The intelligent interactive method based on legal consultation according to claim 2 is characterized by: The effectiveness score for each language data pack is calculated as follows: No. The language data package also includes data integrity , grammatical accuracy and pronunciation clarity ; According to data integrity , grammatical accuracy and pronunciation clarity Calculating effectiveness scores , the formula based on is: in, For the The effectiveness rating of the language data packages; For the Data integrity of each language data packet; For the The grammatical accuracy of each language data package; For the Articulation clarity of each language data packet; For data integrity The weight coefficient is between 0.2 and 0.5; For grammatical accuracy The weight coefficient is 0.3 to 0.5; For pronunciation clarity The weight coefficient is between 0.2 and 0.5; and 1.

4. The intelligent interactive method based on legal consultation according to claim 3 is characterized by: The method for calculating the error data judgment value of each language data packet is: No. Language data packs also include legal terminology comparisons and differences Compare the difference values ​​with language logic ; Comparison of difference values ​​according to legal terms Compare the difference values ​​with language logic Calculate the error data judgment value , the formula based on is: in, For the The error data judgment value of a language data packet; For the The difference between the language data package and the legal terminology; For the The difference value between the language data package and the language logic.

5. The intelligent interactive method based on legal consultation according to claim 4 is characterized by: The method for determining the standard dialect sample of each dialect data according to the comparison results is: Data filtering threshold set including pronunciation accuracy score threshold , effectiveness score threshold and error data judgment value threshold ; According to Pronunciation accuracy scores for language data packages , effectiveness score , Error data judgment value Compared with the data screening threshold set, the specific criteria for determining the standard dialect samples are: When there is no language data package that meets the standard for the same dialect data, calculate the comprehensive score of each language data package in this dialect data , keep the overall score The language data packet corresponding to the maximum value; The reserved language data packets are used as standard dialect samples.

6. The intelligent interactive method based on legal consultation according to claim 5 is characterized by: According to Mandarin probability and dialect probability The method for determining the language category of user input is: Input speech into word sequence Input Mandarin Model, calculate Mandarin probability , the formula based on is: in, The user input participle, is the serial number corresponding to different participles, and its value is , is the total number of participles; Representation sequence The number of occurrences in the Mandarin corpus; express The number of occurrences in the Mandarin corpus; Indicates the size of the vocabulary obtained by removing duplicates from the Mandarin corpus; In Mandarin Under the model, given the user input The word and When the word The probability of a word appearing; Inputting phonetic input word sequences into dialects Model, calculate dialect probability , the formula based on is: in, Representation sequence The number of occurrences in the dialect corpus; Representation sequence The number of occurrences in the dialect corpus; Indicates the size of the vocabulary obtained by removing duplicates from the other party's corpus; Expressed in dialect Under the model, given the user input The word and When the word The probability of a word appearing; According to Mandarin probability and dialect probability The method for determining the language category of user input is: 。 7. The intelligent interactive method based on legal consultation according to claim 6 is characterized by: The method for determining the conversion sample is: According to the user feature vector sequence and the sample feature vector sequence Calculate feature difference values , the formula based on is: in, For voice data and The feature difference value of the standard dialect samples, are the serial numbers corresponding to different standard dialect samples; For the A sequence of feature vectors of standard dialect samples; Multiple feature difference values Compare and select feature difference values The standard dialect sample corresponding to the minimum value is taken as the conversion sample.

8. The intelligent interactive method based on legal consultation according to claim 7 is characterized by: Calculate update demand index based on dialect update data The method is: Dialect update data includes the number of new dialect words that appear in a unit of time , the number of vocabulary correspondences affected , the total number of dialect vocabulary collected Total number of vocabulary correspondences ; According to the number of new dialect words appearing in a unit time Total number of dialect vocabulary collections Calculating update probability , the formula based on is: The number of affected items according to the vocabulary correspondence Total number of vocabulary correspondences Calculating the impact of legal terminology updates , the formula based on is: in, is the number of affected lexical correspondences, indicating the number of changes in the correspondence between dialect vocabulary and legal terms due to the update of legal terminology; is the total number of established correspondences between dialect words and legal terms; According to the update probability and update impact Calculate update demand index , the formula based on is: in, The update probability The weight coefficient is between 0.4 and 0.7; To update the impact The weight coefficient is 0.3 to 0.6; and 1.

9. The intelligent interactive method based on legal consultation according to claim 8, characterized in that: The method to determine whether the dialect database needs to be updated is: User feedback data includes the number of correct conversions and feedback error conversion number ; Correctly convert quantity based on feedback and feedback error conversion number Calculating feedback accuracy , the formula based on is: Update threshold set includes update requirement indicator threshold and feedback accuracy threshold ; According to the update demand index , feedback accuracy The criteria for determining whether the dialect database needs to be updated and the update threshold set are: 。 10. An intelligent interactive system based on legal consultation, characterized by: include: The data collection module is used to collect data of multiple dialects in each major dialect area, and each dialect data contains language data packets of multiple collection objects; A data screening module, used to calculate the pronunciation accuracy score, validity score and error data judgment value of each language data packet; Preset a data screening threshold set; compare the pronunciation accuracy score, validity score, and error data judgment value of different language data packets with the data screening threshold set; determine the standard dialect sample for each dialect data based on the comparison results; input the standard dialect sample into The model performs feature extraction to obtain sample feature vector sequences of different standard dialect samples ; The language category judgment module is used to input the user's voice data into System, get the user's voice input word sequence ; Input speech into word sequence Input Mandarin Models and Dialects Model, calculate Mandarin probability and dialect probability ; Based on Mandarin probability and dialect probability Determine the language category of user input; The legal term conversion module is used to convert the user's voice data into a legal term when the user's input language category is determined to be Mandarin. model, so that the user's Mandarin voice data is converted into legal terms; when the user's input language category is determined to be a dialect, the user's voice data is input into The model performs feature extraction to obtain a user feature vector sequence ; According to the user feature vector sequence With the sample feature vector sequence Calculate feature difference values , according to different feature difference values Determine a conversion sample; convert the user's voice data into a standard dialect through the conversion sample; input the converted standard dialect into Model, which converts user's dialect speech data into legal terms; Update module, used to obtain dialect update data and user feedback data; calculate update demand indicators based on dialect update data ; Calculate feedback accuracy based on user feedback data ; Preset update threshold set; based on update demand indicators , feedback accuracy and update threshold set to determine whether the dialect database needs to be updated.