An information processing method, device, equipment and computer storage medium

By using traditional machine learning and word vector techniques, and leveraging word frequency and cosine similarity algorithms, a sentence vector matching question-and-answer database is generated. This solves the problem of deep learning relying on large amounts of data and achieves efficient and accurate automatic question answering.

CN114239606BActive Publication Date: 2026-06-09CHINA CONSTRUCTION BANK

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2021-12-23
Publication Date
2026-06-09

Smart Images

  • Figure CN114239606B_ABST
    Figure CN114239606B_ABST
Patent Text Reader

Abstract

The application discloses an information processing method, device and equipment and a computer storage medium. The method comprises the following steps: obtaining a question text input by a user, wherein the question text comprises a plurality of first words; calculating the frequency of each first word in a word frequency table; determining the dynamic weight of each first word according to the frequency of each first word; determining the vector of the plurality of first words according to the question text; performing weighted average on the vector of each first word according to the dynamic weight of each first word to obtain the sentence vector of the question text; calculating the similarity between the sentence vector and the question sentence vector in a question and answer database; and outputting the answer information corresponding to the question sentence vector with the highest similarity in the question and answer database. According to the embodiment of the application, the computer resource demand of the automatic question and answer system can be reduced while realizing the automatic question and answer function.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of natural language processing technology, and in particular relates to an information processing method, apparatus, device and computer storage medium. Background Technology

[0002] With the rapid development of the internet and communication technologies, the functions of various systems are becoming increasingly rich, the number of users is gradually increasing, and the coverage is becoming wider. The complexity of the functions of various system applications often leads to users encountering problems and difficulties when operating the system and needing help and guidance.

[0003] Relying solely on manual answers to user questions would consume a significant amount of manpower in repetitive and simple tasks, resulting in a waste of human resources and time. With the rise and maturation of artificial intelligence technology, machine learning-based intelligent question-answering algorithms, offering superior performance, have become an important method for solving such problems.

[0004] Currently, the mainstream intelligent question answering algorithms mainly adopt deep learning-based algorithms. However, deep learning algorithms have the problem of requiring a large amount of data and consuming a lot of computer resources. Summary of the Invention

[0005] This application provides an information processing method, apparatus, device, and computer storage medium that can reduce the computer resource requirements of an automatic question-and-answer system while achieving automatic question-and-answer functionality.

[0006] In a first aspect, embodiments of this application provide an information processing method, the method comprising:

[0007] Obtain the question text input by the user, wherein the question text includes multiple first words;

[0008] Calculate the frequency of each of the plurality of first words in the word frequency table;

[0009] The dynamic weight of each first word is determined based on its frequency.

[0010] Determine the vectors of the plurality of first words based on the question text;

[0011] The sentence vector of the question text is obtained by weighting the vector of each first word according to the dynamic weight of each first word;

[0012] Calculate the similarity between the sentence vector and the question sentence vector in the question-answering database;

[0013] Output the answer information corresponding to the question sentence vector in the question-answering database that has the highest similarity to the question sentence vector.

[0014] Secondly, embodiments of this application provide an information processing apparatus, the apparatus comprising:

[0015] The acquisition module is used to acquire the question text input by the user, wherein the question text includes multiple first words;

[0016] The calculation module is used to calculate the frequency of each of the plurality of first words in the word frequency table;

[0017] The calculation module is also used to determine the dynamic weight of each first word based on the frequency of each first word.

[0018] A determining module is used to determine the vectors of the plurality of first words based on the question text;

[0019] The calculation module is also used to calculate the sentence vector of the question text by performing a weighted average calculation on the vector of each first word according to the dynamic weight of each first word;

[0020] The calculation module is also used to calculate the similarity between the sentence vector and the question sentence vector in the question-answering database;

[0021] The output module is used to output the answer information corresponding to the question sentence vector in the question-and-answer database that has the highest similarity to the question sentence vector.

[0022] Thirdly, embodiments of this application provide an electronic device, the device including: a processor and a memory storing computer program instructions;

[0023] When the processor executes the computer program instructions, it implements the information processing method as described in any one of the claims of this application.

[0024] Fourthly, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the information processing method as described in any one of the claims of this application.

[0025] The information processing method, apparatus, device, and computer storage medium of this application embodiment can acquire words in the question text input by the user, determine the dynamic weight of the words based on their frequency of occurrence in a word frequency table, determine the sentence vector of the question text based on the dynamic weight of the words, and return the answer corresponding to the question with the highest similarity in the database by judging the similarity between the sentence vector of the user's input question and the sentence vector of the question in the question-answering database, thereby realizing automatic answering of the user's input question. This application improves the accuracy of automatic question answering by setting dynamic weights to increase the judgment weight of words with higher frequency of occurrence when judging question similarity, and realizes automatic question answering based on word vector technology and traditional machine learning algorithms, which can quickly and accurately answer the questions raised by the system users while reducing the demand for computer resources. Attached Figure Description

[0026] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart illustrating an information processing method provided in one embodiment of this application;

[0028] Figure 2 This is a schematic diagram of the structure of an information processing apparatus provided in another embodiment of this application;

[0029] Figure 3 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation

[0030] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0031] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0032] To address the problems of the prior art, embodiments of this application provide an information processing method, apparatus, device, and computer storage medium. The information processing method provided in the embodiments of this application will be described first.

[0033] With the rapid development of the internet, communication technologies, and enterprise operations, various systems are becoming increasingly feature-rich, with a wider and larger user base. The complexity of system applications frequently leads to users encountering problems and difficulties while operating the system, requiring assistance from the system development team. Relying solely on manual answers to user questions consumes a significant amount of manpower in repetitive and simple tasks, resulting in a waste of human resources and time. Therefore, alternative methods are needed to alleviate the pressure of answering questions. With the rise and maturity of artificial intelligence technology, intelligent question-answering algorithms, with their superior performance, have become an important method for solving such problems.

[0034] Currently, due to the rapid development of deep learning technologies, intelligent question answering technology mainly utilizes deep learning methods. While deep learning methods do not require complex feature extraction through feature engineering, most are supervised methods (i.e., requiring manual labeling of correct and incorrect answers), demanding high-quality training datasets and requiring significant time to create large amounts of high-quality data. In addition, they suffer from high hardware requirements, long processing times, and strong scene dependence (i.e., the same algorithm requires different models for different scenarios, such as online shopping and online ticketing).

[0035] Building upon this foundation, the inventors proposed an information processing method. Based on traditional machine learning techniques, and employing word vectorization and algorithms such as TF-IDF and sentence2vec, the method uses questions from the system's user manual and frequently asked questions compiled by technical personnel as a dataset to intelligently answer problems encountered by users while operating a system. This reduces the time users spend searching for solutions and alleviates the burden on project developers.

[0036] Figure 1 A flowchart illustrating an embodiment of the information processing method provided in this application is shown. Figure 1 As shown,

[0037] Step 101: Obtain the question text input by the user, wherein the question text includes multiple first words;

[0038] Step 102: Calculate the frequency of each of the plurality of first words in the word frequency table;

[0039] Step 103: Determine the dynamic weight of each first word based on its frequency;

[0040] Step 104: Determine the vectors of the plurality of first words based on the question text;

[0041] Step 105: Calculate the sentence vector of the question text by performing a weighted average of the vectors of each first word based on the dynamic weight of each first word.

[0042] Step 106: Calculate the similarity between the sentence vector and the question sentence vector in the question-answering database;

[0043] Step 107: Output the answer information corresponding to the question sentence vector in the question-and-answer database that has the highest similarity to the question sentence vector.

[0044] The information processing method of this application can acquire words from the question text input by the user, determine the dynamic weight of the words based on their frequency of occurrence in a word frequency table, determine the sentence vector of the question text based on the dynamic weight of the words, and return the answer corresponding to the question with the highest similarity in the database by judging the similarity between the sentence vector of the user's input question and the sentence vector of the question in the question-answering database, thereby realizing automatic answering of the user's input question. This application improves the accuracy of automatic question answering by setting dynamic weights and increasing the judgment weight of words with higher frequency when judging question similarity. Furthermore, it achieves automatic question answering based on word vector technology and traditional machine learning algorithms, which can quickly and accurately answer the questions raised by the system user while reducing the demand for computer resources.

[0045] The information processing method of this application embodiment can be applied to any business system or query system that needs to implement automatic question and answer function. The information processing method of this application embodiment can be executed by an information processing device, which can be a computer or processor with information processing function in the system. For example, in a bank's business system, the information processing method of this application embodiment can be executed by the bank's processor.

[0046] In step 101, the processor can obtain the text of the question entered by the user in the system, the question text including multiple first words.

[0047] The question text can be a problem that a user wants to inquire about or resolve, or it can be a representative text of explanatory or illustrative content that a user wants to find. The question text can be obtained by the user through text input or through methods such as voice recognition.

[0048] The first word is the word in the question text entered by the user that can be used for semantic judgment or recognition.

[0049] For example, suppose a user asks a question in a bank system. The bank processor can obtain the text information of the question entered by the user through text input or voice recognition, and obtain relevant words in the question text that can help identify the question.

[0050] In step 102, the processor can calculate the frequency of each of the plurality of first words in the word frequency table.

[0051] A word frequency table is a statistical table of question text information in the information processing process. The word frequency table records all the first words in the entire question text entered by the user during the information processing process, as well as the number of times each first word appears and the total number of times all first words appear.

[0052] The frequency of the first word in the word frequency table is the ratio of the number of times the first word appears to the total number of times all words in the word frequency table appear.

[0053] For example, suppose a user asks a question in a bank system. The bank's processor can obtain the question text entered by the user and extract multiple first words from it. Then, it can determine the frequency of each first word in the question text entered by the user based on a word frequency table.

[0054] In step 103, the processor can determine the dynamic weight of each first word based on the frequency of each first word.

[0055] The dynamic weight of the first word is the weight value of each first word in the current user-input question text. The dynamic weight is related to the frequency of the first word in the word frequency table. The dynamic weight reflects the semantic importance of each first word; the higher the frequency, the higher its semantic importance.

[0056] For example, suppose a user makes a question in the banking system. The bank's processor can obtain the frequency of each first word in the word frequency table and calculate the weight value of each first word based on the frequency of each first word in the word frequency table.

[0057] In step 104, the processor can determine the vectors of multiple first words of the question text based on the question text.

[0058] The vector of the first word is the vector form obtained by converting the first word in the user-input question text into a pre-trained word vector file.

[0059] For example, suppose a user asks a question in a banking system. The bank processor can obtain multiple first words from the question text entered by the user and convert the first words into vector form to facilitate the calculation of the sentence vector form of the question text.

[0060] In step 105, the processor can perform a weighted average of the vectors of each first word based on the dynamic weight of each first word to obtain the sentence vector of the question text to which the first word belongs.

[0061] In this embodiment of the application, the sentence vector of the question text is a sentence vector calculated based on the weight of each first word in the vector of each first word of the question text. The sentence vector of the question text can represent the vector form of the semantics of the question text.

[0062] The weighted average calculation can be performed by directly adding the weighted word vector matrices one by one and then averaging them to obtain the vector form y of the sentence, where x i is the weighted vector of the i-th word, and N is the number of the first word in the question text, where N is an integer greater than or equal to 1.

[0063]

[0064] For example, suppose a user asks a question in a banking system. The bank processor can perform a weighted average calculation on multiple first words and their corresponding dynamic weights obtained from the user's input question text, and obtain the sentence vector form of the user's input question text based on the calculation result.

[0065] In step 106, the processor can calculate the similarity between the sentence vector of the user-input question text and the sentence vector of the question in the question-answering database.

[0066] A question-and-answer database can be an n-to-1 mapping of questions and answers constructed by question-and-answer system administrators through pre-collection of common questions and corresponding answers from the question-and-answer system.

[0067] The question-and-answer database contains matching pairs of questions and answers, and also includes sentence vectors of questions obtained by preprocessing using the information processing method of this application.

[0068] Similarity can be used to represent the similarity or difference between vectors; the higher the similarity, the smaller the difference between the vectors. Vector similarity can be described as the distance relationship between vectors in a multidimensional geometric space; the greater the distance, the lower the similarity. Similarity can be calculated using similarity algorithms.

[0069] The calculation of the similarity between the sentence vector and the question sentence vector in the question-answering database includes:

[0070] The similarity between the sentence vector and the question sentence vector in the question-answering database is calculated using the cosine similarity algorithm.

[0071] Traditional natural language processing algorithms measure similarity using Euclidean distance. This approach results in a similarity value range of [0, +∞), which is inconvenient to store. Therefore, this application improves the similarity calculation method by using a cosine similarity algorithm to calculate the similarity between the question text vector and the question sentence vector in the question-answering database. The similarity value ranges from [0, 1], and the closer the similarity is to 1, the more similar the two texts are.

[0072]

[0073] This is a vector generated by processing the questions in the database using the algorithm in this embodiment. A corresponding vector needs to be generated for each question in the database. (The user-input question vector is also mentioned.) It needs to be compared with the vector of each question in the database, and the one or more with the highest similarity s are selected to return the corresponding answers to these questions in the database.

[0074] The original natural language processing algorithm uses Euclidean distance to measure similarity, with similarity values ​​ranging from [0, +∞), which is inconvenient to store. This application adopts cosine similarity calculation, with similarity values ​​ranging from [0, 1], improving the convenience of storing similarity values.

[0075] For example, suppose a user asks a question in a banking system. The bank processor can calculate the similarity between the sentence vector of the user's input question text and the sentence vector of each question in the question-and-answer database based on a similarity algorithm, thereby determining the similarity between the user's input question text and each question text in the database.

[0076] In step 107, the processor can control the output of answer information corresponding to the question sentence vector in the question-and-answer database that has the highest similarity to the question sentence vector.

[0077] The output answer information is the answer corresponding to the question in the database whose sentence vector has the highest similarity to the sentence vector of the question text entered by the user.

[0078] For example, suppose a user asks a question in a banking system. The bank processor can compare the sentence vector of the user's input question text with the sentence vector of each question in the question-and-answer database, and return the answer corresponding to the question in the question-and-answer database with the highest similarity to the question text vector.

[0079] In some embodiments, before obtaining the question text input by the user, the method further includes: generating the question-and-answer database based on pre-obtained matching pairs of question and answer information, the question-and-answer database including the sentence vector of the question.

[0080] The pre-acquired question-and-answer matching pairs can be matching pairs of questions and answers within the application domain of the question-and-answer system. These matching pairs can be collected and recorded manually, or obtained from knowledge manuals or guides in the relevant field; this application embodiment does not impose any limitations on this.

[0081] The sentence vector of the question is the sentence vector form obtained by preprocessing the questions in the database according to the information processing method of the embodiments of this application.

[0082] For example, suppose a user asks a question in the banking system. Before obtaining the question text input by the user, the bank processor constructs a question-and-answer database by matching the questions in the user guide manual of the bank's internal system with frequently asked questions and answers compiled by the technical staff. The information processing method of this application embodiment is used to process the questions in the database in advance to obtain the sentence vector form of the questions in the database.

[0083] In this embodiment, the information processing method of this application pre-constructs a question-and-answer database based on the matching pairs of questions and answers, and converts questions into sentence vectors, which reduces the time spent on training data and saves the workload of project developers.

[0084] In some embodiments, prior to S102, the method further includes:

[0085] Create a word frequency table to record the words in all the question text input by the user and the number of times each word appears.

[0086] A word frequency table is a record of words and the number of times each word appears. In this embodiment of the application, the word frequency table is used to record the first word of the current user's input of the entire question text from the start of system operation, as well as the number of times each first word appears.

[0087] For example, suppose a user asks a question in a bank's system. The bank's processor can record the words in the user's question text and the number of times those words appear in a word frequency table.

[0088] In this embodiment, by recording the words and the frequency of their occurrence in the user-input question text, the importance of the words in the user-input question text in the current scenario can be determined, thereby identifying the question based on its importance and improving the accuracy of the information processing method in this application embodiment.

[0089] In some embodiments, calculating the frequency of each of the plurality of first words in the word frequency table includes:

[0090] Calculate the ratio of the number of times each first word appears in the word frequency table to the total number of times all first words appear in the word frequency table.

[0091] The frequency of the first word refers to the number of times the first word in the user's current question text appears in the word frequency table. All first words are the first words in all question texts entered by the user since the system started running.

[0092] The frequency of each first word in the word frequency table is the ratio of the number of times each first word appears to the total number of times all first words appear in the word frequency table.

[0093] For example, suppose a user asks a question in a bank system. The bank's processor can calculate the frequency of each first word based on the ratio of the number of times each first word appears in the word frequency table to the total number of times all first words appear in the word frequency table.

[0094] In this embodiment, the information processing method of this application embodiment can determine the importance of each first word by calculating the ratio of the number of times each first word appears in the word frequency table to the number of times all first words appear in the word frequency table, so as to determine the weight of each first word according to the importance of each first word, thereby improving the accuracy of the information processing method of this application embodiment.

[0095] In some embodiments, determining the dynamic weight of each first word based on the frequency of each first word includes:

[0096] The initial weights of the vector of the first word are calculated using the TF-IDF algorithm;

[0097] The dynamic weight of each first word is determined based on the frequency of each first word and the initial weight.

[0098] TF-IDF (term frequency–inverse document frequency) is a commonly used weighting technique for information retrieval and data mining. TF stands for Term Frequency, and IDF stands for Inverse Document Frequency.

[0099] The TF-IDF algorithm is a statistical method that can be used to evaluate the importance of a word to a document in a document set or a corpus. The importance of a word increases proportionally to the number of times it appears in the document, but decreases inversely proportionally to the frequency of its appearance in the corpus.

[0100] The initial weight of the first word vector is the weight value of the first word vector in the question text calculated according to the TF-IDF algorithm, which reflects the importance of the first word in the question text.

[0101] The step of determining the dynamic weight of each first word based on its frequency and the initial weight includes:

[0102] Calculate 1 minus the frequency of the first word to obtain the first difference;

[0103] The dynamic weight is the initial weight divided by the first difference.

[0104] The first difference is 1 minus the frequency of the first word in the word frequency table. The dynamic weight of each first word is equal to the initial weight of each first word divided by the first difference of each first word.

[0105] For example, suppose a user makes a question in the banking system. The bank's processor calculates the initial weight of each first word according to TF-IDF, and determines the dynamic weight of each first word according to the frequency and initial weight of each first word. The dynamic weight is used to represent the semantic importance of the first word in the question recognition process.

[0106] In this embodiment, the information processing method of this application calculates the dynamic weight of each first word by utilizing the initial weight of each first word and the frequency of each first word. The higher the frequency of the first word, the greater the dynamic weight. By obtaining the dynamic weight, the semantic importance of each first word can be considered in question identification, thereby improving the accuracy of question identification.

[0107] In some embodiments, determining the vectors of the plurality of first words based on the question text includes:

[0108] The problem text is segmented to obtain multiple second words;

[0109] Based on a preset stop word library, stop word removal is performed on the multiple second words to obtain a word sequence of the multiple first words in the question text;

[0110] The word sequence is transformed based on the pre-trained word vector file to obtain the vectors of the multiple first words.

[0111] Word segmentation involves using word segmentation tools to divide the words appearing in the problem text and extracting the second word contained in the problem text.

[0112] The second term refers to all the words contained in the question text obtained after segmenting the question text entered by the user.

[0113] Commonly used word segmentation tools include: jieba, SnowNLP (MIT), and pynlpir.

[0114] Stop words are words that are automatically filtered out before or after processing natural language data (or text) in information retrieval to save storage space and improve search efficiency. These words are called stop words. Stop words are manually entered and not automatically generated, and the generated stop words form a stop word list or stop word library.

[0115] The stop word removal operation involves processing the second word based on the stop word database and deleting any words in the stop word database that appear in the second word.

[0116] The word sequence of the first word consists of all the first words in the question text entered by the user.

[0117] For example, suppose a user inquires about a problem in a bank's system. The bank's processor can use the jieba word segmentation tool to segment the user's input question text. The segmentation process divides all words in the question text. Some of the segmented words have no practical meaning or little contribution to semantic recognition, therefore requiring further segmentation and stop word removal. The bank's processor compares the segmented words with a stop word library, removing words that are identical to those in the stop word library. After stop word removal, the processor reads a pre-trained word vector file. For each first word in the question text, it sequentially reads the vector corresponding to each first word from the pre-trained word vector file. The dimension of the first word's word vector can be determined by the project developers.

[0118] In this embodiment, the information processing method of this application performs word segmentation and stop word removal on the user input text to obtain multiple first words in the user input text, and converts the first words into vector form. The vector form of the first words represents the information in the user input text, thereby better reflecting the topic information of the user input question text.

[0119] In some embodiments, the pre-trained word vector file includes at least two types; the step of weighting the vector of each first word according to the dynamic weight of each first word to obtain the sentence vector of the question text includes:

[0120] Calculate the vector of each first word in the question text based on at least two pre-trained word vector files;

[0121] By using the dynamic weight of each first word, the vectors of the first words calculated for each pre-trained word vector file are weighted and averaged to obtain the first sentence vector of the question text;

[0122] Determine that the sum of at least two first sentence vectors is the sentence vector of the question text.

[0123] In this embodiment, the first sentence vector is the vector of the question text obtained by calculating the vector of each first word based on a pre-trained word vector file and by calculating the vector of each first word and dynamic weights. Each pre-trained word vector file can be processed to obtain a corresponding first sentence vector, and the final sentence vector of the question text is the sum of the obtained first sentence vectors.

[0124] For example, assuming a user makes a question in a banking system, the bank processor can use at least two pre-trained word vector files to calculate the word vector of each first word in the question text, and perform a weighted average of the word vectors of the first words obtained from at least two pre-trained word vector files and the dynamic weights of the first words to calculate the sentence vector of the question text. The final sentence vector of the question text is the sum of the sentence vectors obtained from different pre-trained word vector files.

[0125] Considering that the semantics of the same word can differ in different contexts in natural language, a single word vector is insufficient to accurately represent the semantics of a word. In this embodiment, the information processing method of this application uses at least two word vectors when processing natural language problems, which can improve the accuracy of the semantics of the first word expressed by the word vectors.

[0126] In some embodiments, the at least two pre-trained word vector files include at least two of word2vec, GloVe, or cw2vec.

[0127] In this embodiment of the application, the information processing method can calculate at least two first sentence vectors based on at least two word vector files from word2vec, GloVe, or cw2vec, and the final sentence vector of the question text is the sum of all the calculated first sentence vectors.

[0128] For example, suppose a user asks a question in a banking system. When the bank processor calculates the word vector of the first word, it can use at least two pre-trained word vector files from word2vec, GloVe, or cw2vec.

[0129] In this embodiment, obtaining the word vectors of the first word in the problem text by using at least two pre-trained word vector files from word2vec, GloVe, or cw2vec can achieve semantic complementarity and more accurately express the semantics of the words.

[0130] Based on the information processing method provided in the above embodiments, the present application also provides specific implementations of the information processing device 200.

[0131] like Figure 2 As shown, the information processing apparatus 200 provided in this application embodiment includes:

[0132] The acquisition module 201 is used to acquire the question text input by the user, wherein the question text includes multiple first words;

[0133] Calculation module 202 is used to calculate the frequency of each of the plurality of first words in the word frequency table;

[0134] The calculation module 202 is also used to determine the dynamic weight of each first word based on the frequency of each first word.

[0135] The determining module 203 is used to determine the vectors of the plurality of first words based on the question text;

[0136] The calculation module 202 is further configured to perform a weighted average calculation on the vector of each first word based on the dynamic weight of each first word to obtain the sentence vector of the question text;

[0137] The calculation module 202 is also used to calculate the similarity between the sentence vector and the question sentence vector in the question-answering database;

[0138] The output module 204 is used to output the answer information corresponding to the question sentence vector in the question-and-answer database that has the highest similarity to the question sentence vector.

[0139] The information processing device in this embodiment can acquire words from the question text input by the user, determine the dynamic weight of the words based on their frequency of occurrence in a word frequency table, determine the sentence vector of the question text based on the dynamic weight of the words, and return the answer corresponding to the question with the highest similarity in the database by judging the similarity between the sentence vector of the user's input question and the sentence vector of the question in the question-answering database, thereby realizing automatic answering of the user's input question. This embodiment improves the accuracy of automatic question answering by setting dynamic weights to increase the judgment weight of words with higher frequency of occurrence when judging question similarity. Furthermore, by implementing automatic question answering based on word vector technology and traditional machine learning algorithms, it can quickly and accurately answer the questions asked by the system user while reducing the demand for computer resources.

[0140] In some embodiments, the information processing device 200 further includes:

[0141] The generation module is used to generate the question-and-answer database based on the pre-acquired matching pairs of question and answer information, wherein the question-and-answer database includes the sentence vectors of the questions.

[0142] In some embodiments, the generation module is further configured to establish a word frequency table, recording the words in all the question text input by the user and the number of times the words appear.

[0143] In some embodiments, the calculation module 202 is specifically used to calculate the ratio of the number of times each first word appears in the word frequency table to the total number of times all first words appear in the word frequency table.

[0144] In some embodiments, the calculation module 202 is further specifically used to calculate the initial weights of the vector of the first word according to the TF-IDF algorithm;

[0145] The calculation module 202 is further specifically used to determine the dynamic weight of each first word based on the frequency of each first word and the initial weight.

[0146] In some embodiments, the determining module 203 includes:

[0147] The word segmentation unit is used to segment the question text to obtain multiple second words;

[0148] The stop word removal unit is used to remove stop words from the plurality of second words based on a preset stop word library to obtain a word sequence of the plurality of first words in the question text;

[0149] The transformation unit is used to transform the word sequence based on the pre-trained word vector file to obtain vectors of the plurality of first words.

[0150] In some embodiments, the pre-trained word vector files include at least two types;

[0151] In some embodiments, the calculation module 202 is further specifically used to calculate the vector of each first word in the question text based on at least two pre-trained word vector files;

[0152] The calculation module 202 is further specifically used to use the dynamic weight of each first word to perform a weighted average of the vectors of the first words calculated for each pre-trained word vector file, so as to obtain the first sentence vector of the question text;

[0153] The determining module 203 is further specifically used to determine that the sum of at least two first sentence vectors is the sentence vector of the question text.

[0154] In some embodiments, the at least two pre-trained word vector files include at least two of word2vec, GloVe, or cw2vec.

[0155] Figure 3 A schematic diagram of the hardware structure of the electronic device 300 provided in an embodiment of this application is shown.

[0156] The electronic device 300 may include a processor 301 and a memory 302 storing computer program instructions.

[0157] Specifically, the processor 301 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0158] Memory 302 may include mass storage for data or instructions. For example, and not limitingly, memory 302 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 302 may include removable or non-removable (or fixed) media. Where appropriate, memory 302 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 302 is non-volatile solid-state memory.

[0159] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of the embodiments of this application.

[0160] The processor 301 implements any of the information processing methods described in the above embodiments by reading and executing computer program instructions stored in the memory 302.

[0161] In one example, the electronic device 300 may also include a communication interface 303 and a bus 310. For example, Figure 3 As shown, the processor 301, memory 302, and communication interface 303 are connected through bus 310 and complete communication with each other.

[0162] The communication interface 303 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0163] Bus 310 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 310 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0164] The electronic device can execute the information processing method described in the embodiments of this application, thereby achieving the combination Figure 1 The described information processing method.

[0165] Furthermore, in conjunction with the information processing methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the information processing methods in the above embodiments.

[0166] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0167] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0168] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0169] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0170] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. An information processing method, characterized in that, Applied to business systems or query systems, the method includes: Obtain the question text input by the user, wherein the question text includes multiple first words; Calculate the frequency of each of the plurality of first words in the word frequency table. The word frequency table records the first word and the number of times the first word appears in all the question texts input by the current user since the system started running. The word frequency table is dynamically updated with user input. The dynamic weight of each first word is determined based on its frequency. Determine the vectors of the plurality of first words based on the question text; The sentence vector of the question text is obtained by weighting the vector of each first word according to the dynamic weight of each first word; Calculate the similarity between the sentence vector and the question sentence vector in the question-answering database; Output the answer information corresponding to the question sentence vector in the question-answering database that has the highest similarity to the question sentence vector; The process of determining the dynamic weight of each first word based on its frequency includes: The initial weights of the vector for each first word are calculated using the TF-IDF algorithm. Calculate the first difference between 1 and the frequency, where the first difference is 1 minus the frequency; divide the first difference by the initial weight to obtain the dynamic weight of each first word; The step of determining the vectors of the plurality of first words based on the question text; and performing a weighted average of the vectors of each first word based on the dynamic weight of each first word to obtain the sentence vector of the question text, includes: Calculate the vector of each first word in the question text based on at least two pre-trained word vector files; By using the dynamic weight of each first word, the vectors of the first words calculated for each pre-trained word vector file are weighted and averaged to obtain the first sentence vector of the question text; Determine that the sum of at least two first sentence vectors is the sentence vector of the question text; The calculation of the frequency of each of the plurality of first words in the word frequency table includes: Calculate the ratio of the number of times each first word appears in the word frequency table to the total number of times all first words appear in the word frequency table, and obtain the frequency of each first word in the word frequency table. All first words are the first words in all the question texts entered by the current user when the system starts running.

2. The method according to claim 1, characterized in that, Before obtaining the user-inputted question text, the method further includes: The question-and-answer database is generated based on the pre-acquired matching pairs of question and answer information, and the question-and-answer database includes the sentence vectors of the questions.

3. The method according to claim 1, characterized in that, Determining the vectors of the plurality of first words based on the question text includes: The problem text is segmented to obtain multiple second words; Based on a preset stop word library, stop word removal is performed on the multiple second words to obtain a word sequence of the multiple first words in the question text; The word sequence is transformed based on the pre-trained word vector file to obtain the vectors of the multiple first words.

4. The method according to claim 1, characterized in that, The at least two pre-trained word vector files include at least two of word2vec, GloVe, or cw2vec.

5. An information processing device, characterized in that, The device, used in business systems or query systems, includes: The acquisition module is used to acquire the question text input by the user, wherein the question text includes multiple first words; The calculation module is used to calculate the frequency of each of the plurality of first words in a word frequency table. The word frequency table records the first words and the number of times each first word appears in all the question text input by the current user since the system started running. The word frequency table is dynamically updated with user input. Calculating the frequency of each of the plurality of first words in the word frequency table includes: Calculate the ratio of the number of times each first word appears in the word frequency table to the total number of times all first words appear in the word frequency table, and obtain the frequency of each first word in the word frequency table. All first words are the first words in all the question texts entered by the current user at the start of system operation; The calculation module is also used to determine the dynamic weight of each first word based on the frequency of each first word. A determining module is used to determine the vectors of the plurality of first words based on the question text; The calculation module is also used to calculate the sentence vector of the question text by performing a weighted average calculation on the vector of each first word according to the dynamic weight of each first word; The calculation module is also used to calculate the similarity between the sentence vector and the question sentence vector in the question-answering database; The output module is used to output the answer information corresponding to the question sentence vector in the question-and-answer database that has the highest similarity to the question sentence vector. The computing module is used for: The initial weights of the vector of the first word are calculated using the TF-IDF algorithm; Calculate the first difference between 1 and the frequency, where the first difference is 1 minus the frequency; divide the first difference by the initial weight to obtain the dynamic weight of each first word; The computing module is also used for: Calculate the vector of each first word in the question text based on at least two pre-trained word vector files; By using the dynamic weight of each first word, the vectors of the first words calculated for each pre-trained word vector file are weighted and averaged to obtain the first sentence vector of the question text; The determining module is further configured to determine that the sum of at least two first sentence vectors is the sentence vector of the question text.

6. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the information processing method as described in any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the information processing method as described in any one of claims 1-4.

8. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the information processing method as described in any one of claims 1-4.