Text processing method and device, computer device and storage medium
By obtaining similar text information from a spoken text database and using weighted similarity processing, combined with text prefix trees and information type processing, the problem of low accuracy in text recognition models is solved, and the accuracy and consistency of written text information are improved.
Patent Information
- Application Number
- CN202210216377.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-07
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2042-03-07
AI Technical Summary
In existing technologies, text recognition models are not accurate enough in determining the meaning of user-input text information, resulting in low accuracy of the identified written text information.
By obtaining second text information similar to the input spoken text information from the first knowledge base, and using weighted similarity processing, the target written text information is determined from the second knowledge base storing written text information. Combining text prefix tree and information type processing, the accuracy of the determined written text information is ensured.
It improves the accuracy of identifying written text information, ensures that the target written text information is semantically identical to the input text information, and achieves accuracy and consistency of text information.
Smart Images

Figure CN116775803B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of computer technology, and particularly relate to a text processing method and device, computer equipment and a storage medium. BACKGROUND
[0002] With the development of computer technology, human-computer interaction scenarios are becoming more and more widespread. In a human-computer interaction scenario, a computer device usually interacts with a user based on text information input by the user. Since the text information input by the user can contain misspelt words or contain simplified words, etc., it is necessary to first determine written text information that has the same meaning as the input text information, and then process based on the determined written text information.
[0003] In related technologies, a text recognition model that is pre-trained is used to recognize text information input by a user, so as to determine written text information that has the same meaning as the text information input by the user. However, the accuracy of the text recognition model is not high enough, resulting in low accuracy of the determined written text information. SUMMARY
[0004] Embodiments of the present application provide a text processing method and device, computer equipment and a storage medium, which can improve the accuracy of the determined written text information. The technical solution is as follows:
[0005] On the one hand, a text processing method is provided, which comprises:
[0006] obtaining, from a first knowledge base, second text information similar to first text information currently input, the first knowledge base being used to store spoken text information, the spoken text information referring to text information input on any device;
[0007] For each written text information in a second knowledge base, a first similarity between the written text information and the first text information is obtained, and a second similarity between the written text information and the second text information is obtained; the first similarity and the second similarity are weighted to obtain a weighted similarity corresponding to the written text information, the second knowledge base being used to store written text information, the written text information being text information conforming to a standard written format;
[0008] Based on the weighted similarity corresponding to each written text information in the second knowledge base, a target written text information corresponding to the first text information is determined from the second knowledge base, the weighted similarity corresponding to the target written text information being greater than the weighted similarity corresponding to other written text information.
[0009] In a possible implementation manner, the determining of the association degree between the written text information and each word in the plurality of words comprises:
[0010] For each of the plurality of words, a degree of association between the written text information and the word is determined based on a frequency of occurrence of the word in the written text information.
[0011] In another aspect, a text processing apparatus is provided, the apparatus comprising:
[0012] An obtaining module is configured to obtain, from a first knowledge base, second text information similar to first text information currently input, the first knowledge base being configured to store spoken text information, the spoken text information referring to text information input on any device;
[0013] A weighting processing module is configured to, for each piece of written text information in a second knowledge base, obtain a first similarity between the written text information and the first text information and a second similarity between the written text information and the second text information, and perform weighting processing on the first similarity and the second similarity to obtain a weighted similarity corresponding to the written text information, the second knowledge base being configured to store written text information, the written text information being text information conforming to a standard written format;
[0014] A determining module is configured to determine, from the second knowledge base, target written text information corresponding to the first text information based on the weighted similarity corresponding to each piece of written text information in the second knowledge base, the target written text information corresponding to a weighted similarity greater than that of other written text information.
[0015] In a possible implementation, the obtaining module is configured to obtain a text prefix tree corresponding to the first knowledge base, the text prefix tree being generated based on text information in the first knowledge base, the text prefix tree comprising a plurality of characters, at least one character contained in any path constituting one piece of text information in the first knowledge base, obtain a text feature of the first text information, extract, from the text prefix tree, a first character matching the text feature based on the text feature, and extract, from characters connected after the (i-1)th character, an ith character matching the text feature based on a connection relationship between the plurality of characters in the text prefix tree, the text feature and the (i-1)th character, until no other character is connected after the currently extracted character, i being an integer greater than 1, and concatenate the extracted plurality of characters to obtain the second text information.
[0016] In a possible implementation, the obtaining module is configured to obtain a text prefix tree corresponding to the first knowledge base, the text prefix tree is generated based on text information in the first knowledge base, the text prefix tree comprises a plurality of characters, and at least one character contained in any path constitutes a text information in the first knowledge base; obtain a text feature of the first text information; based on the text feature, extract a first character matching the text feature from the text prefix tree; based on a connection relationship between the plurality of characters in the text prefix tree, the text feature, and an (i-1)th character, extract an ith character matching the text feature from characters connected after the (i-1)th character, until an nth character matching the text feature is obtained, i is an integer greater than 1 and less than or equal to n, and n is an integer greater than 1; and determine a target path, the target path being a path in the text prefix tree containing the n characters extracted, and each character contained in each target path constituting the second text information.
[0017] In a possible implementation, the apparatus further comprises:
[0018] The determining module is further configured to determine an information type to which the first text information belongs.
[0019] The obtaining module is further configured to obtain, from a third knowledge base corresponding to the information type, a keyword group corresponding to at least one character in the first text information, the keyword group corresponding to the character being a keyword group containing the character, and the third knowledge base comprising keyword groups belonging to the information type.
[0020] The deduplication module is configured to replace each keyword group with a character corresponding to the keyword group in the first text information, and perform deduplication on continuous and repeated keyword groups to obtain updated first text information.
[0021] In a possible implementation, the weighting processing module is configured to obtain a first similarity between a text feature of the written text information and a text feature of the first text information.
[0022] In a possible implementation, the apparatus further comprises:
[0023] The word segmentation module is configured to perform word segmentation processing on the first text information to obtain a plurality of words.
[0024] The obtaining module is further configured to obtain a word feature of each word in the plurality of words.
[0025] The obtaining module is further configured to obtain a text feature of the first text information based on the word features of the plurality of words.
[0026] In a possible implementation, the obtaining module is configured to, when the word feature is a feature vector, determine an average value of the feature vectors of the plurality of words as the text feature of the first text information; or perform weighting processing on the word features of the plurality of words, and determine the weighted features as the text feature of the first text information; or splice the word features of the plurality of words according to the order of the plurality of words in the first text information, to obtain the text feature of the first text information.
[0027] In a possible implementation, the weighting processing module includes:
[0028] The word segmentation unit is configured to perform word segmentation processing on the first text information to obtain a plurality of words.
[0029] The weighting processing unit is configured to determine an association degree between the written text information and each word in the plurality of words, perform weighting processing on the determined plurality of association degrees, and obtain a first similarity between the written text information and the first text information.
[0030] In a possible implementation, the weighting processing unit is configured to, for each word in the plurality of words, determine the association degree between the written text information and the word based on the frequency of occurrence of the word in the written text information.
[0031] In a possible implementation, the determining module is configured to, when the maximum weighted similarity in the determined plurality of weighted similarities is not less than a similarity threshold, determine the text information corresponding to the maximum weighted similarity as the target written text information; and when the maximum weighted similarity is less than the similarity threshold, determine a target number of text information with greater weighted similarities in the second knowledge base as the target written text information, the target number being greater than 1.
[0032] In a possible implementation, the second knowledge base includes a plurality of question text information and corresponding answer text information, and the written text information is question text information; and the apparatus further includes:
[0033] The sending module is configured to, when a target written text information is determined, obtain, from the second knowledge base, answer text information corresponding to the target written text information; and send the answer text information to a terminal, the terminal being configured to display the answer text information, and the terminal being a terminal that sends the first text information to the apparatus.
[0034] The sending module is further configured to, in a case where a plurality of target written text information is determined, send the plurality of target written text information to the terminal, the terminal is configured to display the plurality of target written text information, obtain selected written text information from the plurality of target written text information, and return the selected written text information; receive the selected written text information returned by the terminal; obtain answer text information corresponding to the selected written text information from the second knowledge base; and send the answer text information to the terminal, the terminal is configured to display the answer text information.
[0035] In another possible implementation, the second knowledge base includes a plurality of question text information and corresponding answer text information, and the written text information is question text information; the apparatus further includes:
[0036] The display module is configured to, in a case where a target written text information is determined, obtain answer text information corresponding to the target written text information from the second knowledge base; and display the answer text information.
[0037] The display module is further configured to, in a case where a plurality of target written text information is determined, display the plurality of target written text information, obtain selected written text information from the plurality of target written text information, obtain answer text information corresponding to the selected written text information from the second knowledge base; and display the answer text information.
[0038] In another aspect, a computer device is provided, which includes a processor and a memory, the memory stores at least one computer program, the at least one computer program is loaded and executed by the processor to implement the operations performed by the text processing method according to the above aspects.
[0039] In another aspect, a computer readable storage medium is provided, which stores at least one computer program, the at least one computer program is loaded and executed by a processor to implement the operations performed by the text processing method according to the above aspects.
[0040] In still another aspect, a computer program product is provided, which includes a computer program, the computer program is executed by a processor to implement the operations performed by the text processing method according to the above aspects.
[0041] In the scheme provided by the embodiments of the present application, considering that the input text information is spoken language text information, after the input text information is acquired, similar text information to the input text information is acquired from a first knowledge base storing spoken language text information, so as to expand the text information, and then, by using the input text information and the expanded text information, a multi-path recall manner is adopted to determine target written text information most similar to the input text information from a second knowledge base storing written text information, so as to ensure that the determined target written text information is as same as possible in semantics to the input text information, and the accuracy of the determined target written text information is ensured. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.
[0043] Figure 1 is a structural schematic diagram of an implementation environment provided by the embodiments of the present application;
[0044] Figure 2 is a flowchart of a text processing method provided by the embodiments of the present application;
[0045] Figure 3 is a flowchart of another text processing method provided by the embodiments of the present application;
[0046] Figure 4 is a schematic diagram of a text prefix tree provided by the embodiments of the present application;
[0047] Figure 5 is a flowchart of acquiring second text information based on an intention recognition model provided by the embodiments of the present application;
[0048] Figure 6 is a flowchart of acquiring target written text information provided by the embodiments of the present application;
[0049] Figure 7 is a flowchart of acquiring second text information provided by the embodiments of the present application;
[0050] Figure 8 is a flowchart of a server providing question and answer service for a terminal provided by the embodiments of the present application;
[0051] Figure 9 is a flowchart of another server providing question and answer service for a terminal provided by the embodiments of the present application;
[0052] Figure 10 is a structural schematic diagram of a text processing device provided by an embodiment of the present application;
[0053] Figure 11 is a structural schematic diagram of another text processing device provided by an embodiment of the present application;
[0054] Figure 12 is a structural schematic diagram of a terminal provided by an embodiment of the present application;
[0055] Figure 13 is a structural schematic diagram of a server provided by an embodiment of the present application. DETAILED DESCRIPTION
[0056] To make the objectives, technical solutions and advantages of embodiments of the present application clearer, the following further describes the embodiments of the present application with reference to the accompanying drawings.
[0057] The terms “first”, “second”, “third”, “fourth”, “fifth”, “sixth” and the like as used in this application can be used in this application to describe various concepts, but unless specifically stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the present application, the first text information can be referred to as the second text information, and similarly, the second text information can be referred to as the first text information.
[0058] The terms “at least one”, “multiple”, “each”, “any” used in this application include one, two or more than two, multiple includes two or more than two, and each refers to each of the corresponding multiple, and any refers to any one of the multiple. For example, multiple text information includes 3 text information, and each refers to each of the 3 text information, and any refers to any one of the 3 text information, which can be the first, or the second, or the third.
[0059] In the specific embodiments of the present application, the first text information, the text information in the knowledge base and other related data involved in the present application need to obtain the permission or consent of the user when the above embodiments of the present application are applied to specific products or technologies, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0060] The text processing method provided by the embodiments of the present application is executed by a computer device. Optionally, the computer device is a terminal or a server. Optionally, the server is a physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN (Content Delivery Network), and big data and artificial intelligence platform. Optionally, the terminal is a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart voice interaction device, a smart home appliance, a vehicle terminal, and the like, but is not limited thereto.
[0061] In a possible implementation, the computer program related to the embodiments of the present application can be deployed to execute on a server, or on multiple servers located in one place, or on multiple servers distributed in multiple places and interconnected through a communication network, and the multiple servers distributed in multiple places and interconnected through a communication network can constitute a blockchain system.
[0062] In a possible implementation, the computer device is provided as a server. Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by the embodiments of the present application. Referring to FIG. 1, Figure 1 The implementation environment includes a terminal 101 and a server 102, and the terminal 101 and the server 102 are connected through a wireless or wired network.
[0063] The terminal 101 is configured to acquire input text information, send the text information to the server 102 through a network connection between the terminal 101 and the server 102, and then process the text information sent by the terminal 101 by the server 102 to determine corresponding written text information of the text information.
[0064] In a possible implementation, a target application provided by the server 102 is installed on the terminal 101, and the terminal 101 can implement functions such as question and answer service and message interaction through the target application. Optionally, the target application is a target application in an operating system of the terminal 101, or a target application provided by a third party. For example, the target application is a question and answer application, which has a question and answer function, and of course, the question and answer application can also have other functions, such as a comment function, a shopping function, a navigation function, a game function, and the like.
[0065] The terminal 101 is configured to log in to the target application based on a user identifier, acquire input text information through the target application, and interact with the server 102 through the target application, so that the server 102 processes the text information.
[0066] Figure 2 is a flowchart of a text processing method provided by an embodiment of the present application, which is executed by a computer device, as shown in Figure 2 The method comprises the following steps.
[0067] 201. The computer device acquires second text information similar to the first text information input currently from a first knowledge base, the first knowledge base being used to store spoken text information, the spoken text information referring to text information input on any device.
[0068] The language structure of the spoken text information is simple, the spoken text information has the characteristics of being easy to understand and easy to express, and conforms to the habits of users in speaking. The first knowledge base is used to store the spoken text information, that is, the text information in the first knowledge base is all spoken text information. Any device is a device inputting text information to the computer device, and since the text information input by any device usually conforms to the spoken text information, the first knowledge base is constituted by collecting the text information input on any device.
[0069] In the embodiment of the present application, the first text information is spoken text information. Considering that the input first text information may contain misspelt words or simplified words, etc., leading to ambiguity of the first text information, and the first knowledge base contains complete text information, the semantics of the text information in the first knowledge base is clear, therefore, the second text information similar to the input first text information is selected from the first knowledge base, so that the selected second text information is as similar to the first text information as possible, and the first text information is expanded to ensure the accuracy of the selected second text information.
[0070] 202. The computer device acquires, for each written text information in a second knowledge base, a first similarity between the written text information and the first text information, and a second similarity between the written text information and the second text information, and performs weighted processing on the first similarity and the second similarity to obtain a weighted similarity corresponding to the written text information, the second knowledge base being used to store written text information, the written text information being text information conforming to a standard written format.
[0071] The language structure of the written text information conforming to the standard written format is normative and rigorous, and the written text information conforms to reading habits. The second knowledge base is used to store written text information, that is, the second knowledge base is a knowledge base corresponding to the standard written format. The first similarity represents the similarity between the written text information and the first text information, and the second similarity represents the similarity between the written text information and the second text information.
[0072] Since the spoken text information can contain misspelt words or simplified words, etc., leading to ambiguity of the spoken text information, the second text information similar to the first text information is first expanded based on the first knowledge base, the similarity between the first text information and the second text information and the written text information is obtained through the first text information and the expanded second text information, and the obtained similarity is weighted to ensure that the weighted similarity can better reflect the similarity between the written text information and the first text information.
[0073] The written text information is any text information in the second knowledge base. For each written text information in the third knowledge base, the weighted similarity between each written text information and the first text information can be obtained according to the above step 202.
[0074] 203. The computer device determines the target written text information corresponding to the first text information from the second knowledge base based on the weighted similarity corresponding to each written text information in the second knowledge base.
[0075] The weighted similarity corresponding to the target written text information is greater than the weighted similarity corresponding to other written text information, and the other written text information is the written text information in the second knowledge base except the target written text information.
[0076] After determining the weighted similarity corresponding to each written text information in the second knowledge base, a plurality of weighted similarities are determined, and at least one written text information with the maximum weighted similarity can be determined from the plurality of weighted similarities. The at least one written text information with the maximum weighted similarity is determined as the target written text information corresponding to the first text information, to ensure that the determined target written text information is as similar to the first text information as possible.
[0077] In the scheme provided by the embodiments of the present application, considering that the input text information is a spoken text information, after obtaining the input text information, the text information similar to the input text information is first obtained from the first knowledge base storing the spoken text information, to realize the expansion of the text information. Then, the input text information and the expanded text information are used to determine the target written text information most similar to the input text information from the second knowledge base storing the written text information, to ensure that the determined target written text information is as same as the semantic of the input text information as possible, and to ensure the accuracy of the determined target written text information.
[0078] In Figure 2On the basis of the embodiment shown, since the current input first text information can exist ambiguity, therefore, after obtaining the input first text information, first, the first text information is perfected in combination with the knowledge base corresponding to the information type to which the first text information belongs, and then, the first text information is expanded by using the perfected first text information and in combination with the text prefix tree corresponding to the first knowledge base, the process is described in detail in the following embodiment.
[0079] Figure 3 is a flowchart of a text processing method provided by the embodiment of the application, the method is executed by a computer device, and the method comprises the following steps of:
[0080] 301. The computer device determines an information type to which current input first text information belongs.
[0081] The information type indicates that the first text information contains content related to the information type. In a possible implementation manner, the information type comprises a fund type, a game type, etc. If the first text information contains fund-related content, the first text information belongs to the fund type; if the first text information contains game-related content, the first text information belongs to the game type.
[0082] In a possible implementation manner, the process of determining the information type to which the first text information belongs comprises the following two manners.
[0083] The first manner: obtaining a text feature of the first text information, classifying the text feature of the first text information, and determining the information type to which the first text information belongs.
[0084] The text feature of the first text information is used to represent the first text information, and the text feature can be represented in any form, such as a feature vector or a feature matrix. In the embodiment of the application, a plurality of information types are provided in the computer device, the text feature can represent the first text information, the information type to which the first text information belongs is determined by classifying the text feature, so as to ensure the accuracy of the determined information type.
[0085] Optionally, the process of classifying the text feature comprises the following steps: obtaining type features of a plurality of information types, obtaining a similarity between the text feature and each type feature, and determining, as the information type to which the first text information belongs, the information type corresponding to the type feature with the maximum similarity in the determined plurality of similarities.
[0086] The type feature is used to represent the corresponding information type, and can be represented in any form, such as a feature vector or a feature matrix. The similarity between the text feature and the type feature of any information type represents the possibility that the first text information belongs to the information type, and the plurality of similarities represent the possibility that the first text information belongs to the plurality of information types.
[0087] The second mode is to extract a keyword from the first text information, query a keyword library corresponding to the plurality of information types based on the keyword, and determine the information type to which the first text information belongs in response to the keyword library corresponding to any information type including the keyword.
[0088] In the embodiment of the present application, the keyword is a word in the first text information that can represent the meaning of the first text information, and each information type corresponds to a keyword library including words related to the corresponding information type. The keyword library corresponding to any information type includes the keyword in the first text information, indicating that the keyword in the first text information is related to the information type, i.e., indicating that the first text information belongs to the information type.
[0089] In a possible implementation, the computer device is provided as a server, and the step 301 includes: the terminal obtains the first text information currently input, sends the first text information to the server, the server receives the first text information, and determines the information type to which the first text information belongs.
[0090] Optionally, the terminal installs a target application provided by the server, and the terminal obtains the first text information currently input through the target application, and sends the first text information to the server based on the target application.
[0091] In a possible implementation, the computer device is provided as a terminal, the terminal obtains the first text information currently input, and determines the information type to which the first text information belongs.
[0092] 302. The computer device obtains a keyword group corresponding to at least one character in the first text information from a third knowledge base corresponding to the information type.
[0093] The keyword group corresponding to the character refers to a keyword group containing the character. The third knowledge base includes keyword groups belonging to the information type. In the embodiments of the present application, each information type corresponds to a knowledge base, and each knowledge base includes a plurality of keyword groups. The keyword groups included in the knowledge base all belong to the information type corresponding to the knowledge base. For example, the information type to which the first text information belongs is the fund type, and the keyword groups included in the third knowledge base are all fund names. Or, the information type to which the first text information belongs is the game type, and the keyword groups included in the third knowledge base are game names or game prop names. Among the knowledge bases corresponding to a plurality of information types, the knowledge base corresponding to the information type to which the first information text belongs is the third knowledge base.
[0094] In a possible implementation manner, the step 302 includes: extracting a plurality of target characters from the first text information, and for each target character, if there is a keyword group containing the target character in the third knowledge base, obtaining the keyword group.
[0095] The target character is any character in the first text information, that is, each character contained in the first text information can be a target character. For example, the first text information includes three characters, and the three characters are all target characters. In the embodiments of the present application, the first text information includes a plurality of target characters. For any target character, if none of the keyword groups in the third knowledge base contains the target character, no keyword group containing the target character can be obtained from the third knowledge base. If any keyword group in the third knowledge base contains the target character, a keyword group containing the target character can be obtained from the third knowledge base. Based on the plurality of target characters contained in the first text information, at least one keyword group can be obtained from the third knowledge base. In the embodiments of the present application, the keyword group containing the target character can be obtained from the third knowledge base in the manner of inverted index.
[0096] Optionally, for any target character in the plurality of target characters, if a plurality of keyword groups in the third knowledge base contain the target character, a plurality of keyword groups containing the target character are obtained.
[0097] 303, the computer device replaces each keyword group with the character corresponding to each keyword group in the first text information respectively, and removes duplicate keyword groups that are continuous and repetitive, to obtain an updated first text information.
[0098] In this embodiment of the application, since there may be cases where adjacent characters in the first text information are contained in the same keyword group, after obtaining the keyword group corresponding to at least one character in the first text information, the keyword group replaces the first text information and the character corresponding to each keyword group respectively. At this time, the replaced first text information contains continuous and repeated keyword groups. Therefore, the continuous and repeated keyword groups are deduplicated to obtain the updated first text information, so as to ensure that the updated first text information has the same meaning as the original first text information, thereby ensuring the accuracy of the updated first text information.
[0099] For example, the first text information is "abc fund how is it", the keyword group corresponding to the character "a" is "abcd", the keyword group corresponding to the character "b" is "abcd", and the keyword group corresponding to the character "c" is "abcd". After replacing the first text information with the characters corresponding to each keyword group, the resulting text information is "abcdabcdabcd fund how is it", that is, there are 3 consecutive repeated "abcd" in this text information. After removing the duplicates of the consecutive and repeated keyword groups, the updated first text information is "abcd fund how is it".
[0100] In this embodiment of the application, the obtained keyword groups may contain other characters in addition to the characters in the first text information. By replacing the characters corresponding to each keyword group with the first text information, and deduplicating consecutive and repeated keyword groups, the content in the first text information is expanded, ensuring the accuracy of the updated first text information.
[0101] In one possible implementation, the process of replacing characters in the first text information based on keyword groups includes: for any keyword group, determining a common string between the keyword group and the first text information, and replacing the common string in the text information with the keyword group.
[0102] The common string is a string consisting of at least one consecutive character that is shared by the keyword group and the first text information. For example, if the keyword group is "1234" and the first text information is "1278910", then the common string between the keyword group and the first text information is "12". In this case, replacing "12" in the first text information with "1234" will result in the updated first text information being "123478910".
[0103] In a possible implementation, the obtained keyword group includes a plurality of keyword groups, and in the plurality of keyword groups, there can be a plurality of keyword groups corresponding to the same target character in the first text information. That is, for any target character in the first text information, the target character is included in a plurality of keyword groups, and then the corresponding target character in the first text information is replaced based on the plurality of keyword groups to form a new first text information, that is, a plurality of updated first text information is obtained.
[0104] For example, the first text information is "abc fund how", and the keyword group includes "abcde fund" and "aabac fund". Both the keyword groups include "abc fund" in the first text information. "abcde fund" is replaced with "abc fund" in the first text information to obtain the updated first text information "abcde fund how". "aabac fund" is replaced with "abc fund" in the first text information to obtain the updated first text information "aabac fund how". That is, two updated first text information is obtained.
[0105] 304, the computer device obtains a text prefix tree corresponding to the first knowledge base.
[0106] The text prefix tree is generated based on the text information in the first knowledge base, as shown in the following table, the text prefix tree includes a plurality of characters, and at least one character included in any path constitutes a text information in the first knowledge base. The text information in the first knowledge base is a spoken text information. Figure 4
[0107] In a possible implementation, the first knowledge base corresponds to a plurality of text prefix trees.
[0108] In the same text prefix tree, different paths can include the same character, as shown in the following table, path 1 is "XX fund loss", path 2 is "XX fund rose", and path 1 and path 2 include the same character "XX fund". The first character in different text prefix trees is different, and the first character is the first character in the text prefix tree. Figure 4
[0109] In a possible implementation, the text information input by any device is collected, and the first knowledge base is generated based on the collected text information. For example, a user inputs text information through any device, and the wrong characters or simplified word groups in the text information input by the user are changed to obtain complete spoken text information. The changed spoken text information constitutes the first knowledge base.
[0110] In a possible implementation, the step 304 comprises: the computer device obtaining the text prefix tree corresponding to the first knowledge base from a target storage location, wherein the text prefix tree corresponding to the first knowledge base is stored in the target storage location, and the text prefix tree is pre-generated and stored in the target storage location. In the embodiment of the present application, the computer device can obtain the text prefix tree from the target storage location. Alternatively, the computer device generates the text prefix tree in real time based on the text information in the first knowledge base, which is not limited in the present application.
[0111] 305. The computer device obtains the text feature of the updated first text information.
[0112] The text feature of the updated first text information is used to represent the updated first text information, and the text feature can be represented in any form, such as a feature vector or a feature matrix.
[0113] 306. The computer device extracts the first character matching the text feature from the text prefix tree based on the text feature of the updated first text information.
[0114] In the case where the first knowledge base corresponds to one text prefix tree, the first character extracted from the text prefix tree is the first character of the text prefix tree; in the case where the first knowledge base corresponds to multiple text prefix trees, the first character extracted is the first character of any one of the multiple text prefix trees.
[0115] In the embodiment of the present application, the multiple characters contained in the text prefix tree have a connection relationship, and when the character is extracted from the text prefix tree by the text feature of the updated first text information, the first character is extracted from the first character in the text prefix tree according to the connection relationship between the multiple characters in the text prefix tree, that is, the first character extracted is the first character in the text prefix tree.
[0116] In a possible implementation, the first knowledge base corresponds to multiple text prefix trees, and the step 306 comprises: determining the first character contained in each text prefix tree, determining the character feature of each first character, determining the matching degree between the text feature of the updated first text information and the character feature of each first character, and determining the first character with the largest matching degree in the determined multiple matching degrees as the first character matching the text feature.
[0117] The matching degree between the text feature of the updated first text information and the character feature can represent the matching degree between the first character and the updated first text information.
[0118] 307、the computer device extracts, from the character connected after the (i-1)th character, an ith character matching the text feature of the updated first text information based on the connection relationship between the characters in the text prefix tree, the text feature of the updated first text information, and the (i-1)th character, until no other character is connected after the currently extracted character, splices the extracted characters to obtain the second text information similar to the updated first text information, i being an integer greater than 1.
[0119] After the 1st character is extracted from the text prefix tree, the 2nd character matching the text feature of the updated first text information is extracted from the character connected after the 1st character based on the text feature of the updated first text information and the 1st character, the 3rd character matching the text feature of the updated first text information is extracted from the character connected after the 2nd character based on the text feature of the updated first text information and the 2nd character, the above steps are repeated to extract the next character until no other character is connected after the currently extracted character, and the currently extracted character is represented as the tail character in the text prefix tree, and the extracted characters are spliced into the second text information according to the connection relationship between the characters. That is, the extracted second text information is the text information composed of the characters in a path in the text prefix tree.
[0120] In the embodiments of the present application, the characters in any text information have an association relationship, and the characters in the text prefix tree have a connection relationship, so in the process of extracting characters from the text prefix tree, the (i-1)th character is extracted from the character connected after the (i-1)th character based on the text feature of the updated first text information and the (i-1)th character, and the (i-1)th character is related to the (i-1)th character, which ensures the accuracy of the extracted characters, and the extracted characters are spliced into the second text information according to the connection relationship, so that the second text information conforms to the language logic and is similar to the first text information, to ensure the accuracy of the second text information.
[0121] In a possible implementation manner, the step 307 includes: obtaining a character feature of the (i-1)th character, performing weighted processing on the text feature of the updated first text information and the character feature of the (i-1)th character to obtain a weighted feature, determining a character feature of each other character connected after the (i-1)th character, determining a similarity between the weighted feature and the character feature of each other character connected after the (i-1)th character, and determining the other character connected after the (i-1)th character and having the largest similarity as the ith character.
[0122] It should be noted that the embodiments of the present application take the text prefix tree corresponding to the first knowledge base and the updated first text information to obtain the second text information as an example, and in another embodiment, the intent recognition model includes the text prefix tree corresponding to the first knowledge base, and after obtaining the updated first text information, the steps 304-307 do not need to be performed, but based on the intent recognition model, the text features of the updated first text information are obtained; based on the intent recognition model and the text features of the updated first text information, the first character matching the text features is extracted from the text prefix tree; based on the intent recognition model, the connection relationship between the characters in the text prefix tree, the text features of the updated first text information, and the (i-1)th character, the ith character matching the text features of the updated first text information is extracted from the characters connected after the (i-1)th character, until no other character is connected after the currently extracted character, and the extracted multiple characters are spliced to obtain the second text information similar to the updated first text information. Wherein, the intent recognition model is any network model, for example, the intent recognition model is Seq2Seq (Sequence to Sequence, a deep network model), or BERT (Bidirectional Encoder Representation from Transformers, a language representation model). The process of obtaining the second text information similar to the updated first text information based on the intent recognition model is as shown in Figure 5
[0123] It should be noted that the embodiments of the present application are first updated to the first text information, and then based on the updated first text information, the second text information similar to the first text information is obtained, and in another embodiment, the steps 301-303 do not need to be performed, but after obtaining the first text information, the second text information is obtained based on the first text information according to the steps 304-307.
[0124] It should be noted that the embodiments of the present application only take one updated first text information as an example to obtain the second text information, and in another embodiment, multiple updated first text information is obtained through the steps 301-303, and then the second text information of each updated first text information is obtained according to the steps 304-307, so as to obtain multiple second text information.
[0125] 308、The computer device obtains a first similarity between the written text information and the updated first text information and a second similarity between the written text information and the second text information for each written text information in the second knowledge base; and performs weighted processing on the first similarity and the second similarity to obtain a weighted similarity corresponding to the written text information.
[0126] The second knowledge base is used to store written text information, which is text information conforming to a standard written format. Since the spoken text information can contain misspelled words or simplified words, etc., the spoken text information has ambiguity. The second text information similar to the first text information is expanded based on the first knowledge base. The similarities between the first text information and the second text information and the written text information are obtained based on the first text information and the expanded second text information. The obtained similarities are weighted processed to ensure that the weighted similarity better reflects the similarity between the written text information and the first text information.
[0127] In a possible implementation, text information input on any device is collected, and written text information with the same semantics as the collected text information is generated according to a standard written format. The generated text information is used to constitute the second knowledge base. For example, a user inputs text information through any device. The text information input by the user is collected. It is considered that the text information input by the user is usually spoken text information. The text information input by the user is converted according to a standard written format to obtain written text information with the same semantics as the text information input by the user and conforming to a standard written format. In this way, multiple written text information can be obtained, and the obtained multiple written text information is used to constitute the second knowledge base.
[0128] It should be noted that the above step 308 is only described by taking one written text information in the second knowledge base as an example. For each written text information in the second knowledge base, the first similarity corresponding to each written text information in the second knowledge base and the second similarity corresponding to each written text information in the second knowledge base can be obtained according to the above step 308. Then, the first similarity and the second similarity corresponding to the same written text information in the second knowledge base are weighted processed to obtain the weighted similarity corresponding to each written text information in the second knowledge base.
[0129] In a possible implementation, the first similarity corresponding to each written text information in the second knowledge base satisfies the following relationship:
[0130]
[0131] D j, j = 1, 2,..., z where D represents a set of the first similarity degrees corresponding to each written text information in the second knowledge base, j represents a serial number of the written text information in the second knowledge base, j is an integer greater than 0 and less than or equal to z, z is an integer greater than 1; cosin(·) represents a function for obtaining a similarity degree, z represents the updated first text information, y represents the input text information, and D j represents the first similarity degree corresponding to the jth written text information in the second knowledge base. j D j represents the jth written text information in the second knowledge base. ∪ represents a universal set.
[0132] 309. The computer device determines the target written text information corresponding to the first text information from the second knowledge base based on the weighted similarity degrees corresponding to each written text information in the second knowledge base.
[0133] In the second knowledge base, the weighted similarity degree corresponding to the target written text information is greater than the weighted similarity degrees corresponding to other written text information. After determining the weighted similarity degrees corresponding to each text information in the second knowledge base, at least one written text information with the greatest weighted similarity degree is determined from the plurality of weighted similarity degrees. The at least one written text information with the greatest weighted similarity degree is determined as the target written text information corresponding to the first text information, so as to ensure that the determined target written text information is as similar to the first text information as possible. Figure 6 As shown in the figure, after obtaining the input text information, the target written text information corresponding to the first text information is recalled from the second knowledge base by using the input text information and the expanded text information. The expanded text information is expanded from the first knowledge base based on the input text information.
[0134] In a possible implementation, the step 309 includes: in a case where the greatest weighted similarity degree in the determined plurality of weighted similarity degrees is not less than a similarity threshold, determining the text information corresponding to the greatest weighted similarity degree as the target written text information; and in a case where the greatest weighted similarity degree is less than the similarity threshold, determining a target number of text information with greater weighted similarity degrees in the second knowledge base as the target written text information.
[0135] The target number is greater than 1, for example, the target number is 2 or 5, etc. The similarity threshold is an arbitrary value, for example, the similarity threshold is 0.8 or 0.9, etc.
[0136] In the plurality of weighted similarities of the second knowledge base text information, if the maximum weighted similarity is not less than the similarity threshold, it indicates that the similarity degree of the written text information corresponding to the maximum weighted similarity and the first text information meets the requirement, i.e., the meaning represented by the written text information is the same as the meaning represented by the first text information, so the written text information can replace the first text information for subsequent processing. If the maximum weighted similarity is less than the similarity threshold, it indicates that the similarity degree of the written text information corresponding to the maximum weighted similarity and the first text information does not meet the requirement, i.e., the target number of written text information with larger weighted similarity may be the same as the first text information, so the target number of written text information is taken as the target written text information to ensure that the determined target written text information is as same as the first text information as possible.
[0137] It should be noted that the embodiments of the present application only take one second text information as an example to determine the target written text information by using the second text information, and in another embodiment, a plurality of updated first text information is obtained according to steps 301-303; for each updated first text information, the second text information corresponding to each updated first text information can be obtained according to steps 304-307, that is, a plurality of second text information is obtained; for each second text information, at least one written text information with the maximum weighted similarity can be selected from the second knowledge base according to steps 308-309, that is, each second text information corresponds to at least one written text information. For example, the selected written text information constitutes an information set, and each second text information corresponds to an information set. For a plurality of second text information, at least one written text information with the maximum similarity is determined as the target written text information corresponding to the first text information based on the weighted similarity of the selected written text information.
[0138] For example, three second text information is obtained, and for each second text information, five text information with the maximum weighted similarity is selected from the second knowledge base, that is, for a plurality of second text information, a total of 15 text information is selected from the second knowledge base, and then at least one text information with the maximum weighted similarity is selected from the 15 text information as the target written text information.
[0139] In a possible implementation, after the plurality of second text information is selected from the written text information in the second knowledge base, in the case that there is repetition in the selected written text information, for the same plurality of written text information, the same plurality of written text information is de-duplicated, and the average value of the weighted similarities corresponding to the same plurality of written text information is determined as the weighted similarity corresponding to the de-duplicated written text information.
[0140] The selected written text information is de-duplicated to ensure that there is no repeated text information in the de-duplicated written text information, so as to subsequently determine the target written text information from the de-duplicated text information.
[0141] For example, based on the plurality of second text information, 15 text information are selected from the second knowledge base, of which 3 text information are the same, 2 of the 3 text information are deleted, i.e., only one text information is left, and the average of the weighted similarity corresponding to the 3 text information is taken as the weighted similarity corresponding to the remaining one text information.
[0142] In the scheme provided by the embodiments of the present application, considering that the input text information is spoken text information, after obtaining the input text information, the text information similar to the input text information is obtained from the first knowledge base storing the spoken text information, to realize the expansion of the text information, and then the input text information and the expanded text information are used to determine the target written text information most similar to the input text information from the second knowledge base storing the written text information, to ensure that the determined target written text information is as same as possible in semantics with the input text information, thereby ensuring the accuracy of the determined target written text information. Moreover, in the scheme provided by the embodiments of the present application, a user intention guiding process is provided, which has high timeliness and no complex calculation, can meet the timeliness requirement on line, and can accurately understand the user's intention, thereby ensuring the accuracy of the determined target written text information.
[0143] Moreover, since the input first text information can contain misspelled words or simplified words, etc., after obtaining the first text information, the keyword group corresponding to at least one character in the first text information is obtained from the knowledge base corresponding to the information type to which the first text information belongs, and then the first text information is updated based on the obtained keyword group. Since the keyword group can contain other characters in addition to the characters in the first text information, the input text information is perfected, and it is ensured that the updated first text information has the same meaning as the original first text information, thereby ensuring the accuracy of the updated first text information.
[0144] Moreover, since the first knowledge base stores spoken text information, and the input first text information is also spoken text information, the second text information similar to the first text information and conforming to the language logic is expanded from the prefix text tree corresponding to the first knowledge base by using the updated first text information, to realize the expansion of the input text information, ensure that the expanded text information is as similar as possible to the input text information, and thereby ensure the accuracy of the expanded text information.
[0145] It should be noted that in the above Figure 3On the basis of the embodiment shown, the process of obtaining the first similarity between the written text information and the first text information includes the following two ways.
[0146] The first way: the computer device obtains the first similarity between the text features of the written text information and the text features of the first text information.
[0147] The text features of the written text information are used to represent the written text information, and the text features of the first text information are used to represent the first text information. The text features can be represented in any form, for example, in the form of a feature vector or a feature matrix.
[0148] In a possible implementation manner, the first similarity between the text features of the written text information and the text features of the first text information is obtained in the form of cosine similarity, or Euclidean distance, etc.
[0149] In a possible implementation manner, the process of obtaining the text features of the first text information includes: performing word segmentation processing on the first text information to obtain a plurality of words; obtaining word features of each word in the plurality of words; and obtaining the text features of the first text information based on the word features of the plurality of words.
[0150] Each word feature is used to represent the corresponding word, and the word feature can be represented in any form, for example, in the form of a word vector. Since the plurality of words can constitute the first text information, after obtaining the word features of the plurality of words included in the first text information, the text features used to represent the first text information can be obtained through the plurality of word features.
[0151] Optionally, the process of obtaining the word feature of each word includes: performing feature extraction on each word in the plurality of words to obtain the word feature of each word; or querying the word feature of each word in the plurality of words from a word feature list. The word feature list includes a plurality of words and word features of each word, for example, the word feature list is a Glove (Global Vectors) dictionary. The word feature of each word can be represented in the form of a word vector (Embedding). After obtaining the plurality of words included in the first text information, the word feature list is queried to determine the word feature of each word included in the first text information.
[0152] Optionally, the process of obtaining the text features of the first text information based on the word features of the plurality of words includes any of the following.
[0153] The first item: the word features are feature vectors, and the average value of the feature vectors of the plurality of words is determined as the text features of the first text information.
[0154] Since the first text information is composed of multiple words, the average of the feature vectors of the multiple words is equivalent to the word features of the multiple words fused together, and taking the average as the text feature of the first text information makes the text feature of the first text information capable of representing the multiple words contained in the first text information, thereby ensuring the accuracy of the text feature of the first text information.
[0155] In a possible implementation, the feature vectors of the multiple words and the text feature of the first text information satisfy the following relationship:
[0156]
[0157] wherein embed(x) is used to represent the text feature of the first text information, x is used to represent the first text information, m is used to represent the number of words contained in the first text information x, m is an integer greater than 1, j is used to represent the serial number of the words contained in the first text information x, j is an integer greater than 0 and not greater than m, and x j is used to represent the jth word in the first text information, and embed(x j ) is used to represent the word feature of the jth word in the first text information.
[0158] Secondly, the word features of the multiple words are weighted, and the weighted features are determined as the text feature of the first text information.
[0159] Since the first text information is composed of multiple words, the word features of the multiple words are weighted, the word features of the multiple words are integrated into the weighted features, the weighted features are capable of representing the multiple words contained in the first text information, and therefore, the weighted features are determined as the text feature of the first text information, thereby ensuring the accuracy of the text feature of the first text information.
[0160] Thirdly, the word features of the multiple words are spliced according to the order of the multiple words in the first text information, and the spliced features are determined as the text feature of the first text information.
[0161] Since the first text information is composed of multiple words, the word features of the multiple words are spliced according to the order of the multiple words in the first text information, the spliced features are capable of representing the multiple words contained in the first text information, and therefore, the spliced features are determined as the text feature of the first text information, thereby ensuring the accuracy of the text feature of the first text information.
[0162] The second way is: performing word segmentation processing on the first text information to obtain a plurality of words; determining the association degree between the written text information and each word in the plurality of words, and performing weighting processing on the determined plurality of association degrees to obtain the first similarity between the written text information and the first text information.
[0163] In the embodiments of the present application, the greater the association degree between the plurality of words in the first text information and the written text information, the greater the determined first similarity, indicating that the first text information is more similar to the written text information. By determining the association degree between the plurality of words contained in the first text information and the written text information, the association degree between the first text information and the written text information is determined, thereby determining the similarity between the first text information and the written text information.
[0164] For the above-mentioned second way, the BM25 (a scoring function) algorithm can be used to obtain the first similarity between the written text information and the first text information.
[0165] In a possible implementation manner, the process of determining the association degree between the word and the written text information includes: for each word in the plurality of words contained in the first text information, determining the association degree between the written text information and the word based on the occurrence frequency of the word in the written text information.
[0166] In the embodiments of the present application, the association degree between the written text information and the word is positively correlated with the occurrence frequency of the word in the written text information. That is, the higher the occurrence frequency of the word in the written text information, the greater the association degree between the word and the written text information.
[0167] It should be noted that the embodiments of the present application only describe the above two ways to obtain the process of obtaining the first similarity between the written text information and the first text information. In another embodiment, the above two ways can also be used to obtain the second similarity between the written text information and the second text information. That is, replacing the first text information in the above two ways with the second text information is to obtain the second similarity between the written text information and the second text information.
[0168] In addition, the first similarity between the written text information and the first text information and the second similarity between the written text information and the second text information can be obtained in the two different manners respectively, that is, the first similarity between the written text information and the first text information is obtained in the first manner, and the second similarity between the written text information and the second text information is obtained in the second manner, or the first similarity between the written text information and the first text information is obtained in the second manner, and the second similarity between the written text information and the second text information is obtained in the first manner, which is not limited in the application.
[0169] It should be noted that the above Figure 3 The embodiment shown in FIG. 4 is to obtain the second text information composed of characters contained in any path from the text prefix tree corresponding to the first knowledge base, and in another embodiment, steps 304-307 are not performed, and other manners are adopted to obtain the second text information similar to the first text information input currently from the first knowledge base.
[0170] In a possible implementation manner, the second text information corresponding to one or more target paths is obtained from the text prefix tree, as shown in FIG. 5, the process of obtaining the second text information similar to the first text information input currently from the first knowledge base comprises the following steps. Figure 7
[0171] 701. The computer device obtains a text prefix tree corresponding to a first knowledge base.
[0172] 702. The computer device obtains text features of the first text information.
[0173] 703. The computer device extracts a first character matching the text features from the text prefix tree based on the text features of the first text information.
[0174] 704. The computer device extracts an i-th character matching the text features from characters connected after an i-1-th character based on the connection relationship between the characters in the text prefix tree, the text features and the i-1-th character, until an n-th character matching the text features is obtained.
[0175] Wherein, i is an integer greater than 1 and not greater than n, and n is an integer greater than 1. In the embodiment of the application, n is any value set in advance, for example, n is 5 or 8, etc. It should be noted that the steps 701-704 are the same as the steps 304-307 described above, and will not be repeated here.
[0176] 705. The computer device determines target paths from the text prefix tree, and the second text information is composed of characters contained in each target path.
[0177] Wherein, the target path is a path in the text prefix tree containing the extracted n characters. In the embodiment of the present application, each target path contains at least n characters, and in any target path, there can be other characters connected after the nth character in the target path.
[0178] For example, n is 4, the text prefix tree is as shown in Figure 4 The fourth character currently obtained is "Jin", the number of target paths containing the first character to the fourth character is 4, and the characters contained in the four target paths form a second text information, that is, four second text information is obtained.
[0179] It should be noted that the embodiment of the present application takes the first text information as an example to extract the second text information similar to the first text information from the text prefix tree, and in another embodiment, on the basis of steps 301-303 in the embodiment shown in Figure 3 The updated first text information is used to extract the second text information similar to the updated first text information from the text prefix tree according to the above steps 701-705.
[0180] Since the input first text information is random, after extracting n characters from the text prefix tree, the characters in the target path of the text prefix tree containing the n characters are constructed into a second text information, so as to enrich and expand the second text information, so that the expanded second text information contains as much text information as the meaning of the input first text information, thereby ensuring the accuracy of the determined second text information.
[0181] It should be noted that on the basis of the embodiment shown in Figure 3 Taking the question and answer scenario as an example, the computer device is provided as a server, the server provides a question and answer service for a terminal, and the server provides a question and answer service for the terminal by interacting with the terminal, as shown in Figure 8 And Figure 9 .
[0182] Figure 8 The flowchart of the server providing a question and answer service for the terminal provided by the embodiment of the present application is shown in Figure 8 The flowchart includes:
[0183] 801, the terminal obtains the current input first text information, and sends the first text information to the server.
[0184] 802, the server receives the first text information sent by the terminal, and determines the target written text information corresponding to the first text information according to the above steps 301-309.
[0185] 803、In the case of determining a target written text information, the server acquires answer text information corresponding to the target written text information from the second knowledge base, and sends the answer text information to the terminal.
[0186] In the embodiment of the present application, the second knowledge base includes a plurality of question text information and corresponding answer text information, the first text information sent by the terminal to the server is question text information, and the written text information in the second knowledge base is question text information. According to the embodiment shown in the above Figure 3 , the target written text information is determined from the question text information contained in the second knowledge base.
[0187] In the case of determining a target written text information, it is indicated that a unique question text information is determined from the second knowledge base, and the determined question text information is the same as the input question text information, that is, the question asked by the user is currently determined. Based on the corresponding relationship between the question text information and the answer text information in the second knowledge base, the answer text information corresponding to the target written text information is determined, and the answer information is sent to the terminal, so as to answer for the user.
[0188] 804、The terminal receives the answer text information sent by the server, and displays the answer text information.
[0189] After the terminal acquires the answer text information sent by the server, the answer text information is displayed, so that the user can view the answer text information corresponding to the first text information, and the scheme of answering for the user is realized.
[0190] In a possible implementation manner, the terminal is installed with a target application provided by the server, the terminal acquires the input first text information through the target application, and sends the first text information to the server through the target application. After the server receives the first text information, the server returns the answer text information to the terminal according to the embodiment shown in the above Figure 3 and the above step 801, and the terminal receives the answer text information returned by the server through the target application, and displays the answer text information through the target application.
[0191] In the scheme provided by the embodiment of the present application, in the question and answer scene, the server provides question and answer service for the terminal through the interaction between the terminal and the server, ensures the accuracy of the answer text information returned to the terminal, and thus ensures the accuracy of the question and answer service.
[0192] Figure 9 is another flowchart of the server providing question and answer service for the terminal provided by the embodiment of the present application, as shown in the above Figure 9 , the flowchart includes:
[0193] 901、the terminal acquires the first text information input currently, and sends the first text information to the server.
[0194] 902、the server receives the first text information sent by the terminal, and determines the target written text information corresponding to the first text information according to the above steps 301-309.
[0195] 903、the server sends the multiple target written text information to the terminal in the case of determining the multiple target written text information.
[0196] In the embodiment of the application, the multiple target written text information determined is multiple question text information, and the multiple question text information is similar to the input first text information, but it is unable to determine the text information similar to the input first text information and unique, so the multiple question text information needs to be returned to the terminal for the user to select the question to be asked by the user.
[0197] 904、the terminal receives the multiple target written text information sent by the server, displays the multiple target written text information, acquires the selected written text information in the multiple target written text information, and sends the selected written text information to the server.
[0198] After the terminal receives the multiple target written text information sent by the server, the multiple target written text information is displayed, so that the user selects the question to be asked by the user from the displayed multiple target written text information, so that the server provides the answer corresponding to the selected question to the terminal.
[0199] 905、the server receives the selected written text information returned by the terminal, acquires the answer text information corresponding to the selected written text information from the second knowledge base, and sends the answer text information to the terminal.
[0200] 906、the terminal receives the answer text information sent by the server, and displays the answer text information.
[0201] The steps 905-906 are the same as the above steps 803-804, and will not be described here.
[0202] In the scheme provided by the embodiment of the application, in the question and answer scene, the server provides the question and answer service for the terminal, and in the case of determining the multiple target written text information similar to the input text information, the server provides the multiple target written text information to the terminal, displays the multiple target written text information to the user for selection, and returns the answer text information to the terminal after the server determines the unique question text information, so as to ensure the accuracy of the provided answer text information, and ensure the accuracy of the question and answer service.
[0203] It should be noted that in the aboveFigure 3 Based on the embodiments shown above, taking the question and answer scenario as an example, the computer device is provided as a terminal, which provides a question and answer service for a user, and after step 309, the method further includes the following two manners:
[0204] The first manner: the terminal determines a target written text information from the second knowledge base, and obtains answer text information corresponding to the target written text information; and displays the answer text information.
[0205] In the embodiments of the present application, the second knowledge base includes a plurality of question text information and corresponding answer text information, and the first text information obtained by the terminal is question text information, and the written text information in the second knowledge base is question text information. According to the above Figure 3 According to the embodiments shown above, after the terminal determines the unique target written text information from the question text information included in the second knowledge base, the answer text information corresponding to the target written text information is displayed for the user to view.
[0206] The second manner: the terminal determines a plurality of target written text information, displays the plurality of target written text information, obtains selected written text information from the plurality of target written text information, obtains answer text information corresponding to the selected written text information from the second knowledge base, and displays the answer text information.
[0207] In the embodiments of the present application, the second knowledge base includes a plurality of question text information and corresponding answer text information, and the first text information obtained by the terminal is question text information, and the written text information in the second knowledge base is question text information. According to the above Figure 3 According to the embodiments shown above, after the terminal determines a plurality of target written text information from the question text information included in the second knowledge base, the plurality of target written text information are all similar in semantic to the input first text information, and therefore, the plurality of target written text information need to be displayed for the user to view and select the question to be asked, and the answer text information of the selected written text information pair is subsequently displayed for the user to view.
[0208] It should be noted that the above is only described by taking the application of the embodiments of the present application to the question and answer scenario as an example, and the embodiments provided by the present application can also be applied in other scenarios, such as the smart home scenario, according to the above Figure 2 or Figure 3 According to the embodiments shown above, after the computer device determines the target written text information that is the same in semantic as the input first text information, the corresponding device is controlled according to the determined target written text information. For example, the computer device is a smart speaker, the target written text information determined by the smart speaker is “turn on the TV”, and then the smart speaker controls the TV to start through the target written text information.
[0209] Figure 10 is a structural schematic diagram of a text processing apparatus provided by an embodiment of the present application, as shown in the figure, the apparatus comprises: Figure 10
[0210] The acquisition module 1001 is configured to acquire second text information similar to the first text information from a first knowledge base, the first knowledge base being configured to store spoken text information, the spoken text information referring to text information input on any device.
[0211] The weighting processing module 1002 is configured to acquire a first similarity between the first text information and each written text information in a second knowledge base and a second similarity between the written text information and the second text information, and perform weighting processing on the first similarity and the second similarity to obtain a weighted similarity corresponding to the written text information, the second knowledge base being configured to store written text information, the written text information being text information conforming to a standard written format.
[0212] The determination module 1003 is configured to determine target written text information corresponding to the first text information from the second knowledge base based on the weighted similarity corresponding to each written text information in the second knowledge base, the weighted similarity corresponding to the target written text information being greater than the weighted similarity corresponding to other written text information.
[0213] In a possible implementation manner, the acquisition module 1001 is configured to acquire a text prefix tree corresponding to the first knowledge base, the text prefix tree being generated based on text information in the first knowledge base, the text prefix tree comprising a plurality of characters, at least one character contained in any path constituting one text information in the first knowledge base; acquire a text feature of the first text information; based on the text feature, extract a first character matching the text feature from the text prefix tree; based on a connection relationship between the plurality of characters in the text prefix tree, the text feature and an (i-1)th character, extract an ith character matching the text feature from characters connected after the (i-1)th character, until no other character is connected after the currently extracted character, and splice the extracted plurality of characters to obtain the second text information, i being an integer greater than 1.
[0214] In another possible implementation, the acquisition module 1001 is configured to acquire a text prefix tree corresponding to the first knowledge base, the text prefix tree is generated based on text information in the first knowledge base, the text prefix tree includes a plurality of characters, and at least one character contained in any path constitutes a text information in the first knowledge base; acquire a text feature of the first text information; based on the text feature, extract a first character matching the text feature from the text prefix tree; based on a connection relationship between the plurality of characters in the text prefix tree, the text feature, and an (i-1)th character, extract an ith character matching the text feature from characters connected after the (i-1)th character, until an nth character matching the text feature is acquired, i is an integer greater than 1 and not greater than n, and n is an integer greater than 1; determine a target path, the target path being a path in the text prefix tree containing the n characters extracted, and each character contained in each target path constituting a second text information.
[0215] In another possible implementation, as shown in Figure 11 the device further includes:
[0216] The determination module 1003 is further configured to determine an information type to which the first text information belongs.
[0217] The acquisition module 1001 is further configured to acquire, from a third knowledge base corresponding to the information type, a keyword group corresponding to at least one character in the first text information, the keyword group corresponding to the character being a keyword group containing the character, and the third knowledge base including keyword groups belonging to the information type.
[0218] The deduplication module 1004 is configured to replace each keyword group with a character corresponding to the keyword group in the first text information, and perform deduplication on continuous and repeated keyword groups to obtain updated first text information.
[0219] In another possible implementation, the weighting processing module 1002 is configured to acquire a first similarity between a text feature of the written text information and a text feature of the first text information.
[0220] In another possible implementation, as shown in Figure 11 the device further includes:
[0221] The word segmentation module 1005 is configured to perform word segmentation processing on the first text information to obtain a plurality of words.
[0222] The acquisition module 1001 is further configured to acquire a word feature of each word in the plurality of words.
[0223] The acquisition module 1001 is further configured to acquire a text feature of the first text information based on the word features of the plurality of words.
[0224] In a possible implementation, the obtaining module 1001 is configured to: when the word feature is a feature vector, determine an average value of the feature vectors of the plurality of words as the text feature of the first text information; or perform weighting processing on the word features of the plurality of words, and determine the weighted features as the text feature of the first text information; or splice the word features of the plurality of words according to the order of the plurality of words in the first text information, to obtain the text feature of the first text information.
[0225] In a possible implementation, as shown in Figure 11 the weighting processing module 1002 includes:
[0226] The word segmentation unit 1021 is configured to perform word segmentation processing on the first text information to obtain the plurality of words.
[0227] The weighting processing unit 1022 is configured to determine the association degree between the written text information and each word in the plurality of words, perform weighting processing on the plurality of determined association degrees, and obtain the first similarity between the written text information and the first text information.
[0228] In a possible implementation, the weighting processing unit 1022 is configured to, for each word in the plurality of words, determine the association degree between the written text information and the word based on the frequency of occurrence of the word in the written text information.
[0229] In a possible implementation, the determining module 1003 is configured to: in a case where the maximum weighted similarity in the plurality of determined weighted similarities is not less than the similarity threshold, determine the text information corresponding to the maximum weighted similarity as the target written text information; or in a case where the maximum weighted similarity is less than the similarity threshold, determine the target number of text information with greater weighted similarities in the second knowledge base as the target written text information, where the target number is greater than 1.
[0230] In a possible implementation, the second knowledge base includes a plurality of question text information and corresponding answer text information, and the written text information is the question text information; as shown in Figure 11 the apparatus further includes:
[0231] The sending module 1006 is configured to: in a case where one target written text information is determined, obtain the answer text information corresponding to the target written text information from the second knowledge base; and send the answer text information to the terminal, where the terminal is configured to display the answer text information, and the terminal is a terminal that sends the first text information to the terminal.
[0232] The sending module 1006 is further configured to, in a case where a plurality of target written text information is determined, send the plurality of target written text information to the terminal, the terminal is configured to display the plurality of target written text information, obtain selected written text information from the plurality of target written text information, and return the selected written text information; receive the selected written text information returned by the terminal; obtain answer text information corresponding to the selected written text information from the second knowledge base; and send the answer text information to the terminal, and the terminal is configured to display the answer text information.
[0233] In another possible implementation, the second knowledge base includes a plurality of question text information and corresponding answer text information, and the written text information is the question text information; as shown in Figure 11 The apparatus further includes:
[0234] The display module 1007 is configured to, in a case where one target written text information is determined, obtain answer text information corresponding to the target written text information from the second knowledge base; and display the answer text information.
[0235] The display module 1007 is further configured to, in a case where a plurality of target written text information is determined, display the plurality of target written text information, obtain selected written text information from the plurality of target written text information; obtain answer text information corresponding to the selected written text information from the second knowledge base; and display the answer text information.
[0236] It should be noted that the text processing apparatus provided in the above embodiments is only exemplified by the division of the above functional modules, and in actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the text processing apparatus and the text processing method provided in the above embodiments belong to the same concept, and the specific implementation process is described in the method embodiments, which will not be repeated here.
[0237] The computer device provided in the embodiments of the present application includes a processor and a memory, and the memory stores at least one computer program, which is loaded and executed by the processor to implement the operations performed by the text processing method of the above embodiments.
[0238] Optionally, the computer device is provided as a terminal. Figure 12 A structural block diagram of a terminal 1200 provided by an example embodiment of the present application is shown. The terminal 1200 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart voice interaction device, a smart home appliance, and a vehicle-mounted terminal, etc. The terminal 1200 can also be referred to as a user equipment, a portable terminal, a laptop terminal, a desktop terminal, and other names.
[0239] The terminal 1200 comprises a processor 1201 and a memory 1202.
[0240] The processor 1201 can comprise one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 1201 can be implemented in the form of at least one of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), a PLA (Programmable Logic Array). The processor 1201 can also comprise a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1201 can be integrated with a GPU (Graphics Processing Unit) for rendering and drawing content to be displayed by a display screen. In some embodiments, the processor 1201 can further comprise an AI (Artificial Intelligence) processor for processing machine learning-related computing operations.
[0241] The memory 1202 can comprise one or more computer-readable storage media that can be non-transitory. The memory 1202 can also include high-speed random access memory and nonvolatile, computer-readable storage media such as one or more magnetic disk storage devices, flash memory devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1202 is used to store at least one computer program for being executed by the processor 1201 to implement the text processing method provided by the method embodiments in the present application.
[0242] In some embodiments, the terminal 1200 can also optionally comprise a peripheral device interface 1203 and at least one peripheral device. The processor 1201, the memory 1202, and the peripheral device interface 1203 can be connected through a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 1203 through a bus, a signal line, or a circuit board. Specifically, the peripheral device comprises at least one of a radio frequency circuit 1204, a display screen 1205, a camera assembly 1206, an audio circuit 1207, and a power supply 1208.
[0243] The peripheral interface 1203 can be used to connect at least one I / O (Input / Output) related peripheral device to the processor 1201 and the memory 1202. In some embodiments, the processor 1201, the memory 1202 and the peripheral interface 1203 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1201, the memory 1202 and the peripheral interface 1203 can be implemented on a separate chip or circuit board, and the present embodiments are not limited in this regard.
[0244] The radio frequency circuit 1204 is configured to receive and send RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1204 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 1204 converts electric signals into electromagnetic signals for transmission, or converts electromagnetic signals received into electric signals. Optionally, the radio frequency circuit 1204 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. The radio frequency circuit 1204 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network, and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1204 can also include NFC (Near Field Communication) related circuitry, and the present application is not limited in this regard.
[0245] The display screen 1205 is configured to display a UI (User Interface). The UI can include graphics, text, icons, video, and any combination thereof. When the display screen 1205 is a touch display screen, the display screen 1205 is further configured to capture touch signals on or above the surface of the display screen 1205. The touch signals can be input to the processor 1201 as control signals for processing. In this case, the display screen 1205 can also be configured to provide virtual buttons and / or virtual keyboard, also known as soft buttons and / or soft keyboard. In some embodiments, the display screen 1205 can be one, arranged on the front panel of the terminal 1200; in other embodiments, the display screen 1205 can be at least two, arranged on different surfaces of the terminal 1200 or in a folding design; in other embodiments, the display screen 1205 can be a flexible display screen, arranged on a curved surface or a folding surface of the terminal 1200. Even, the display screen 1205 can also be arranged in an irregular shape, i.e. a special-shaped screen. The display screen 1205 can be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc.
[0246] The camera assembly 1206 is configured to capture images or videos. Optionally, the camera assembly 1206 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, the rear camera is at least two, which is any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, to realize the background blur function of the main camera and the depth-of-field camera, the panoramic shooting and VR (Virtual Reality) shooting function of the main camera and the wide-angle camera, or other fusion shooting functions. In some embodiments, the camera assembly 1206 can further include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. The dual-color temperature flash refers to the combination of a warm light flash and a cold light flash, which can be used for light compensation under different color temperatures.
[0247] The audio circuit 1207 can include a microphone and a speaker. The microphone is used to collect sound waves of a user and an environment, and convert the sound waves into an electrical signal input to the processor 1201 for processing, or input to the radio frequency circuit 1204 to realize voice communication. For the purpose of stereo sound collection or noise reduction, the microphone can be multiple, respectively arranged at different parts of the terminal 1200. The microphone can also be an array microphone or an omnidirectional collection type microphone. The speaker is used to convert the electrical signal from the processor 1201 or the radio frequency circuit 1204 into sound waves. The speaker can be a traditional diaphragm speaker, or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only can the electrical signal be converted into a sound wave audible to humans, but also can be converted into a sound wave inaudible to humans for ranging purposes. In some embodiments, the audio circuit 1207 can also include a headphone jack.
[0248] The power supply 1208 is used to supply power to each component in the terminal 1200. The power supply 1208 can be alternating current, direct current, disposable battery or rechargeable battery. When the power supply 1208 includes a rechargeable battery, the rechargeable battery can be a wired charging battery or a wireless charging battery. The wired charging battery is a battery charged through a wired line, and the wireless charging battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0249] Those skilled in the art can understand that the structure shown in the above description is not a limitation on the terminal 1200, and the terminal 1200 can include more or fewer components than the structure shown in the figure, or combine certain components, or use different component arrangements. Figure 12
[0250] Optionally, the computer device is provided as a server. Figure 13 The server 1300 provided by the embodiments of the present application can have a large difference due to different configurations or performances, and can include one or more processors (Central Processing Units, CPUs) 1301 and one or more memories 1302, wherein the memory 1302 stores at least one computer program, and the at least one computer program is loaded and executed by the processor 1301 to realize the method provided by each method embodiment. Of course, the server can also have a wired or wireless network interface, a keyboard and an input / output interface, etc., so as to perform input / output, and the server can also include other components for realizing the functions of the device, which are not described here.
[0251] The embodiments of the present application also provide a computer readable storage medium, which stores at least one computer program, and the at least one computer program is loaded and executed by a processor to realize the operations performed by the text processing method of the above embodiments.
[0252] The embodiment of the present application further provides a computer program product comprising a computer program which, when executed by a processor, implements the operations performed by the text processing method according to the above aspect.
[0253] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or can be instructed by a program to complete the related hardware, and the program can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0254] The above description is only optional embodiments of the present application, and does not limit the embodiments of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present application shall be included in the protection scope of the present application.
Claims
1. A text processing method characterized by, The method comprises: obtaining second text information similar to the first text information from a first knowledge base, the first knowledge base being used to store spoken text information, the spoken text information referring to text information input on any device; for each written text information in a second knowledge base, obtaining a first similarity between the written text information and the first text information, and a second similarity between the written text information and the second text information, and performing weighted processing on the first similarity and the second similarity to obtain a weighted similarity corresponding to the written text information, the second knowledge base being used to store written text information, the written text information being text information conforming to a standard written format; based on the weighted similarity corresponding to each written text information in the second knowledge base, determining target written text information corresponding to the first text information from the second knowledge base, the target written text information corresponding to a weighted similarity greater than the weighted similarity corresponding to other written text information.
2. The method of claim 1, wherein, The method comprises: obtaining a text prefix tree corresponding to the first knowledge base, the text prefix tree being generated based on text information in the first knowledge base, the text prefix tree comprising a plurality of characters, at least one character contained in any path constituting one text information in the first knowledge base; obtaining a text feature of the first text information; based on the text feature, extracting a first character matching the text feature from the text prefix tree; based on a connection relationship between the plurality of characters in the text prefix tree, the text feature, and an i-1th character, extracting an ith character matching the text feature from characters connected after the i-1th character, until no other character is connected after the currently extracted character, and concatenating the extracted plurality of characters to obtain the second text information, i being an integer greater than 1.
3. The method of claim 1, wherein, The method comprises: obtaining a text prefix tree corresponding to the first knowledge base, the text prefix tree being generated based on text information in the first knowledge base, the text prefix tree comprising a plurality of characters, at least one character contained in any path constituting one text information in the first knowledge base; obtaining a text feature of the first text information; based on the text feature, extracting a first character matching the text feature from the text prefix tree; based on a connection relationship between the plurality of characters in the text prefix tree, the text feature, and an i-1th character, extracting an ith character matching the text feature from characters connected after the i-1th character, until an nth character matching the text feature is obtained, i being an integer greater than 1 and not greater than n, n being an integer greater than 1; determining a target path, the target path being a path in the text prefix tree containing the extracted n characters, and the characters contained in each target path constituting the second text information.
4. The method of claim 1, wherein, Before the obtaining, from the first knowledge base, the second text information similar to the current input first text information, the method further comprises: determining an information type to which the first text information belongs; obtaining, from a third knowledge base corresponding to the information type, a keyword group corresponding to at least one character in the first text information, the keyword group corresponding to the character referring to a keyword group containing the character, the third knowledge base comprising keyword groups belonging to the information type; replacing each keyword group with a character corresponding to the keyword group in the first text information, and removing duplicate keyword groups to obtain updated first text information.
5. The method of claim 1, wherein, The obtaining of the first similarity between the written text information and the first text information comprises: obtaining a first similarity between text features of the written text information and text features of the first text information.
6. The method of claim 5, wherein, Before the obtaining of the first similarity between the text features of the written text information and the text features of the first text information, the method further comprises: performing word segmentation on the first text information to obtain a plurality of words; obtaining word features of each word in the plurality of words; obtaining text features of the first text information based on the word features of the plurality of words.
7. The method of claim 6, wherein, The obtaining of the text features of the first text information based on the word features of the plurality of words comprises any one of the following: the word features are feature vectors, and an average value of the feature vectors of the plurality of words is determined as the text features of the first text information; performing weighted processing on the word features of the plurality of words, and determining the weighted features as the text features of the first text information; splicing the word features of the plurality of words in the order of the plurality of words in the first text information to obtain the text features of the first text information.
8. The method of claim 1, wherein, The obtaining of the first similarity between the written text information and the first text information comprises: performing word segmentation on the first text information to obtain a plurality of words; determining an association degree between the written text information and each word in the plurality of words, and performing weighted processing on the determined plurality of association degrees to obtain the first similarity between the written text information and the first text information.
9. The method according to any one of claims 1 to 8, characterized in that, The determining of the target written text information corresponding to the first text information from the second knowledge base based on the weighted similarity corresponding to each written text information in the second knowledge base comprises: in a case where a maximum weighted similarity in the determined plurality of weighted similarities is not less than a similarity threshold, determining a text information corresponding to the maximum weighted similarity as the target written text information; in a case where the maximum weighted similarity is less than the similarity threshold, determining a target number of text information with a larger weighted similarity in the second knowledge base as the target written text information, the target number being greater than 1.
10. The method according to any one of claims 1 to 8, characterized in that, The second knowledge base comprises a plurality of question text information and corresponding answer text information, the written text information is question text information; after determining the target written text information corresponding to the first text information from the second knowledge base based on the weighted similarity corresponding to each written text information in the second knowledge base, the method further comprises any one of the following: In the case of determining a target written text information, the answer text information corresponding to the target written text information is obtained from the second knowledge base; the answer text information is sent to the terminal, and the terminal is used to display the answer text information, and the terminal is a terminal for sending the first text information to the terminal device; In the case of determining a plurality of target written text information, the plurality of target written text information is sent to the terminal, the terminal is used to display the plurality of target written text information, the selected written text information in the plurality of target written text information is obtained, and the selected written text information is returned; the selected written text information returned by the terminal is received; the answer text information corresponding to the selected written text information is obtained from the second knowledge base; the answer text information is sent to the terminal, and the terminal is used to display the answer text information.
11. The method according to any one of claims 1 to 8, characterized in that, The second knowledge base comprises a plurality of question text information and corresponding answer text information, the written text information is question text information; after determining the target written text information corresponding to the first text information from the second knowledge base based on the weighted similarity corresponding to each written text information in the second knowledge base, the method further comprises any one of the following: In the case of determining a target written text information, the answer text information corresponding to the target written text information is obtained from the second knowledge base; the answer text information is displayed; In the case of determining a plurality of target written text information, the plurality of target written text information is displayed, the selected written text information in the plurality of target written text information is obtained; the answer text information corresponding to the selected written text information is obtained from the second knowledge base; the answer text information is displayed.
12. A text processing apparatus characterized by comprising: The device comprises: An acquisition module is configured to acquire second text information similar to the first text information input currently from a first knowledge base, wherein the first knowledge base is configured to store spoken text information, and the spoken text information refers to text information input on any device; A weighting processing module is configured to acquire a first similarity between each written text information in a second knowledge base and the first text information, and a second similarity between the written text information and the second text information, and perform weighting processing on the first similarity and the second similarity to obtain a weighted similarity corresponding to the written text information, wherein the second knowledge base is configured to store written text information, and the written text information is text information conforming to a standard written format; The determining module is configured to determine, from the second knowledge base, target written text information corresponding to the first text information based on a weighted similarity corresponding to each piece of written text information in the second knowledge base, the weighted similarity corresponding to the target written text information being greater than the weighted similarity corresponding to other written text information.
13. A computer device, comprising: The computer device comprises a processor and a memory, and the memory stores at least one computer program, which is loaded and executed by the processor to implement the operations performed by the text processing method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, The computer readable storage medium stores at least one computer program, which is loaded and executed by the processor to implement the operations performed by the text processing method according to any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the operations performed by the text processing method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Artificial intelligence based voice search result processing method and device
CN106571139A
Method and system for expanding text sample
CN110727767A