Multilingual question and answer method and device, electronic equipment and storage medium

By using a paragraph selection model and a multilingual vocabulary to determine the paragraphs to be selected, and using an answer generation model to generate the answer, the time consumption and semantic deviation problems caused by multiple translations in multilingual question-answering systems are solved, thereby improving the user experience and the intelligence of the system.

CN113971212BActive Publication Date: 2026-01-09COLORFULCLOUDS PACIFIC TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010728828.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-23
Publication Date
2026-01-09
Estimated Expiration
2040-07-23

AI Technical Summary

Technical Problem

Existing multilingual question-answering systems require multiple translations, which leads to long processing times and semantic errors, impacting user experience.

Method used

The system uses a paragraph selection model and a multilingual vocabulary to determine the paragraphs to be selected from a pre-set resource library corresponding to the question text, and uses an answer generation model to generate the answer, thus avoiding multiple translations.

Benefits of technology

It enables the rapid generation of multilingual question-and-answer formats, enhances the user experience, and is suitable for international promotion and multilingual environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113971212B_ABST
    Figure CN113971212B_ABST
Patent Text Reader

Abstract

The application provides a multilingual question and answer method and device, electronic equipment and storage medium. The question text input by a user is first acquired, then a paragraph selection model and a multilingual word list are used to determine a to-be-selected paragraph corresponding to the question text from a preset resource library, and finally an answer generation model and the multilingual word list are used to determine an answer of the question text from the to-be-selected paragraph. In the stages of searching for the to-be-selected paragraph and generating the answer, the multilingual word list is used to avoid multiple translations, solve the problem that multiple translations consume a long time and may cause semantic deviation and affect the quality of the answer, and thus affect the user experience. The technical effects of quickly generating a multilingual question and answer answer and providing a convenient and efficient solution for internationalization promotion or multilingual environment use of an intelligent question and answer system are achieved, and the user needs to set a language mode or select an intelligent question and answer system product corresponding to different languages.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of natural language processing, and in particular to a multilingual question and answer method and device, an electronic device and a storage medium. BACKGROUND

[0002] With the development of computer technology, natural language processing technology is increasingly widely used in the field of intelligent question and answer robots, such as Xiao Bing of Microsoft, Xiao Du of Baidu, Siri of Apple, Xiao Ai of Xiaomi, etc. They mostly adopt an open domain question and answer processing method.

[0003] At present, an open domain question and answer system mainly consists of question text analysis, paragraph extraction, and answer extraction. Different algorithms can be used in each module to obtain better accuracy. The answer extraction module almost always uses four structures of CNN (Convolutional Neural Networks), RNN (Recurrent Neural Networks), LSTM (Long-Short Term Memory), and Transformer (self-attention model), or their combinations to extract or generate answers in a database or semantic library. However, with the international popularization of intelligent application products, some users may use different natural language varieties to interact with intelligent question and answer robots at different times, or even use multiple natural language varieties in the same conversation, such as using Cantonese, English, and Mandarin to form a question text in a conversation. Existing multilingual question and answer systems can generally only switch between two languages, or translate the user's input language into the corresponding language of the natural language processing model through a translator, generate an answer, and then translate the answer into the corresponding language of the user's input natural language through a translator.

[0004] This results in the existing multilingual question and answer system needing to go through at least two translation processes, which is very time-consuming, and translation can also cause semantic deviation. The original semantic deviation may be caused by the deviation of the translated user's question text, resulting in poor answer quality, or the deviation of the translated answer, which will affect the user's experience and increase the user's waiting time to obtain the expected answer. SUMMARY

[0005] The present application provides a multilingual question and answer method, device, electronic device and storage medium to solve the technical problem that the existing technology needs to be translated multiple times to obtain a question and answer result, which is time-consuming and prone to semantic deviation, resulting in poor answer quality and affecting the user's experience.

[0006] In a first aspect, the present application provides a multilingual question answering method, comprising:

[0007] obtaining a question text input by a user, the question text comprising at least one language text;

[0008] determining a to-be-selected passage corresponding to the question text from a preset resource library by using a passage selection model and a multilingual vocabulary, the multilingual vocabulary being used to analyze words in all languages in the question text, and the to-be-selected passage output by the passage selection model matching language features of the input question text;

[0009] determining an answer to the question text from the to-be-selected passage by using an answer generation model and the multilingual vocabulary, the answer output by the answer generation model matching language features of the input to-be-selected passage.

[0010] In a possible design, the determining the to-be-selected passage corresponding to the question text from the preset resource library by using the passage selection model and the multilingual vocabulary comprises:

[0011] determining a retrieval result corresponding to the question text from the preset resource library by using a retrieval model;

[0012] determining a passage text according to the retrieval result and the multilingual vocabulary by using a preset word segmentation algorithm;

[0013] determining a first text vector according to the passage text and a combination algorithm;

[0014] determining a second text vector according to the first text vector and a passage selection model;

[0015] determining the to-be-selected passage according to the second text vector and a preset screening algorithm.

[0016] In a possible design, the determining the to-be-selected passage according to the second text vector and the preset screening algorithm comprises:

[0017] extracting a first word segmentation vector of the second text vector;

[0018] determining a selection probability of the passage text according to the first word segmentation vector and a preset decoding model;

[0019] if the selection probability is greater than or equal to a preset probability threshold, regarding the passage text as the to-be-selected passage.

[0020] Optionally, the determining the retrieval result corresponding to the question text from the preset resource library by using the retrieval model comprises:

[0021] The question text is cleaned by using a question text cleaning algorithm to determine a cleaned question text meeting a preset format;

[0022] The cleaned question text and the retrieval model are used to determine a to-be-cleaned retrieval result;

[0023] The to-be-cleaned retrieval result and a result cleaning algorithm are used to determine the retrieval result.

[0024] In a possible design, the determination of the to-be-cleaned retrieval result based on the cleaned question text and the retrieval model includes:

[0025] The cleaned question text is input into a search engine to determine a web page address;

[0026] A content crawling model is used to crawl content in a web page corresponding to the web page address as the to-be-cleaned retrieval result.

[0027] In a possible design, the determination of the to-be-cleaned retrieval result based on the cleaned question text and the retrieval model includes:

[0028] A matching algorithm is used to screen an adaptive answer file corresponding to the cleaned question text from a preset question and answer file library;

[0029] The adaptive answer file and a content crawling model are used to determine the to-be-cleaned retrieval result.

[0030] Optionally, the determination of the answer of the question text from the to-be-selected paragraph based on the answer generation model and the multilingual word table includes:

[0031] The question text and the to-be-selected paragraph are combined to generate a third text vector;

[0032] A sentence encoding vector is determined based on the third text vector and a language representation model, the language representation model being matched with the multilingual word table;

[0033] A score of the sentence encoding vector is determined based on the sentence encoding vector and a scoring decoding model;

[0034] If the score is greater than or equal to a preset score threshold, the answer corresponding to the sentence encoding vector is determined based on the answer generation model and the multilingual word table;

[0035] If the score is less than the preset score threshold, the answer is generated based on a preset reply template.

[0036] Optionally, the sentence encoding vector comprises: paragraph segmentation, multi-lingual vocabulary segmentation, first attribute information, and second attribute information, the first attribute information being attribute information corresponding to the paragraph segmentation, and the second attribute information being attribute information corresponding to the multi-lingual vocabulary segmentation.

[0037] In a possible design, the determining the score of the sentence encoding vector according to the sentence encoding vector and the scoring decoding model comprises:

[0038] extracting a second segmentation vector located at a first position of the sentence encoding vector;

[0039] determining the score of the sentence encoding vector according to the second segmentation vector and the scoring decoding model.

[0040] Optionally, the determining the answer corresponding to the sentence encoding vector by using the answer generation model and the multi-lingual vocabulary comprises:

[0041] decoding the sentence encoding vector by using a conversion decoding model to determine a decoding word vector;

[0042] determining a paragraph score matrix according to a first multi-layer perception network and the decoding word vector;

[0043] determining a vocabulary score matrix according to a second multi-layer perception network and the decoding word vector;

[0044] determining a comprehensive score matrix according to the paragraph score matrix and the vocabulary score matrix by using a superposition algorithm;

[0045] determining the answer by using the answer generation model, the sentence encoding vector, and the multi-lingual vocabulary according to the comprehensive score matrix.

[0046] Optionally, after the obtaining the question text input by the user, the method further comprises:

[0047] segmenting the question text by using a segmentation algorithm to determine a question text word vector;

[0048] determining a language corresponding to the question text according to the question text word vector and a language matching algorithm;

[0049] determining the multi-lingual vocabulary from candidate multi-lingual vocabularies according to the language, the multi-lingual vocabulary comprising at least two languages.

[0050] In a second aspect, the present application provides a multi-lingual question answering device, comprising:

[0051] a obtaining module configured to obtain a question text input by a user;

[0052] The paragraph selection module is configured to determine the to-be-selected paragraph according to the question text by using a paragraph selection model and a multilingual vocabulary, wherein the multilingual vocabulary contains words of all languages related to the question text.

[0053] The answer generation module is configured to determine the answer of the question text from the to-be-selected paragraph by using an answer generation model and the multilingual vocabulary, wherein the answer output by the answer generation model matches the language feature of the to-be-selected paragraph input.

[0054] In a possible design, the paragraph selection module is configured to determine the to-be-selected paragraph according to the question text by using a paragraph selection model and a multilingual vocabulary, wherein the multilingual vocabulary contains words of all languages related to the question text, and the paragraph selection module includes:

[0055] The paragraph selection module is configured to determine the search result corresponding to the question text from the preset resource library by using a search model.

[0056] The paragraph selection module is further configured to determine a paragraph text according to the search result and the multilingual vocabulary by using a preset word segmentation algorithm.

[0057] The paragraph selection module is further configured to determine a first text vector according to the paragraph text and a combination algorithm.

[0058] The paragraph selection module is further configured to determine a second text vector according to the first text vector and a paragraph selection model.

[0059] The paragraph selection module is further configured to determine the to-be-selected paragraph according to the second text vector and a preset screening algorithm.

[0060] In a possible design, the paragraph selection module is further configured to determine the to-be-selected paragraph according to the second text vector and a preset screening algorithm, and the paragraph selection module includes:

[0061] The paragraph selection module is further configured to extract a first word segmentation vector of the second text vector.

[0062] The paragraph selection module is further configured to determine a selection probability of the paragraph text according to the first word segmentation vector and a preset decoding model.

[0063] The paragraph selection module is further configured to take the paragraph text as the to-be-selected paragraph if the selection probability is greater than or equal to a preset probability threshold.

[0064] Optionally, the paragraph selection module is configured to determine the search result corresponding to the question text from the preset resource library by using a search model, and the paragraph selection module includes:

[0065] The paragraph selection module is configured to perform content cleaning on the question text by using a question text cleaning algorithm to determine a cleaned question text meeting a preset format.

[0066] The paragraph selection module is further configured to determine a to-be-cleaned search result according to the cleaned question text and the search model.

[0067] The paragraph selection module is further configured to determine the search result according to the to-be-cleaned search result and a result cleaning algorithm.

[0068] In a possible design, the paragraph selection module is further configured to determine a to-be-cleaned search result according to the cleaned question text and the search model, including:

[0069] The paragraph selection module is further configured to input the cleaned question text into a search engine to determine a web page address.

[0070] The paragraph selection module is further configured to use a content crawling model to crawl content in a web page corresponding to the web page address as the to-be-cleaned search result.

[0071] In a possible design, the paragraph selection module is further configured to determine a to-be-cleaned search result according to the cleaned question text and the search model, including:

[0072] The paragraph selection module is further configured to use a matching algorithm to screen an adaptive answer file corresponding to the cleaned question text from a preset question and answer file library.

[0073] The paragraph selection module is further configured to determine the to-be-cleaned search result according to the adaptive answer file and a content crawling model.

[0074] Optionally, the answer generation module is configured to determine an answer of the question text from the to-be-selected paragraph by using an answer generation model and the multilingual word table, including:

[0075] The answer generation module is configured to combine the question text and the to-be-selected paragraph to generate a third text vector.

[0076] The answer generation module is further configured to determine a sentence encoding vector according to the third text vector and a language representation model, the language representation model being matched with the multilingual word table.

[0077] The answer generation module is further configured to determine a score of the sentence encoding vector according to the sentence encoding vector and a scoring decoding model.

[0078] The answer generation module is further configured to, if the score is greater than or equal to a preset score threshold, determine the answer corresponding to the sentence encoding vector by using the answer generation model and the multilingual vocabulary.

[0079] The answer generation module is further configured to, if the score is less than the preset score threshold, generate the answer according to a preset reply template.

[0080] In a possible design, the answer generation module is further configured to determine a score of the sentence encoding vector according to the sentence encoding vector and a scoring decoding model, including:

[0081] The answer generation module is further configured to extract a second token vector located at a first position of the sentence encoding vector.

[0082] The answer generation module is further configured to determine the score of the sentence encoding vector according to the second token vector and a scoring decoding model.

[0083] Optionally, the answer generation module is further configured to, if the score is greater than or equal to a preset score threshold, determine the answer corresponding to the sentence encoding vector by using the answer generation model and the multilingual vocabulary, including:

[0084] If the score is greater than or equal to a preset score threshold, the answer generation module is further configured to decode the sentence encoding vector by using a conversion decoding model to determine a decoding token vector.

[0085] The answer generation module is further configured to determine a paragraph score matrix according to a first multi-layer perception network and the decoding token vector.

[0086] The answer generation module is further configured to determine a vocabulary score matrix according to a second multi-layer perception network and the decoding token vector.

[0087] The answer generation module is further configured to determine a comprehensive score matrix according to the paragraph score matrix and the vocabulary score matrix by using a superposition algorithm.

[0088] The answer generation module is further configured to determine the answer according to the comprehensive score matrix by using the answer generation model, the sentence encoding vector and the multilingual vocabulary.

[0089] Optionally, after the obtaining module is configured to obtain the question text input by a user, the obtaining module further includes:

[0090] The preprocessing module is configured to tokenize the question text by using a tokenization algorithm to determine a question text token vector.

[0091] The preprocessing module is further configured to determine the language corresponding to the question text according to the vector of the question text and a language matching algorithm.

[0092] The preprocessing module is further configured to determine the multilingual word table from a plurality of candidate multilingual word tables according to the language, the multilingual word table containing at least two languages.

[0093] In a third aspect, the present application provides an electronic device, comprising:

[0094] a processor; and

[0095] a memory configured to store executable instructions of the processor.

[0096] The processor is configured to execute any one of the possible multilingual question and answer methods provided in the first aspect via execution of the executable instructions.

[0097] In a fourth aspect, the present application provides a storage medium having a computer program stored thereon, the program being executed by a processor to implement any one of the possible multilingual question and answer methods provided in the first aspect.

[0098] The present application provides a multilingual question and answer method, device, electronic device and storage medium. The method comprises the following steps: obtaining a question text input by a user; determining a to-be-selected paragraph corresponding to the question text from a preset resource library by using a paragraph selection model and a multilingual word table; and determining an answer to the question text from the to-be-selected paragraph by using an answer generation model and the multilingual word table. The method uses the multilingual word table in the stages of searching for a to-be-selected paragraph and generating an answer, thereby avoiding multiple translations, solving the problem of long time consumption and semantic deviation caused by multiple translations, and improving the quality of answers and user experience. The method quickly generates multilingual question and answer answers, and provides a convenient and efficient solution for internationalization of intelligent question and answer systems or use of multilingual environments, thereby avoiding the need for users to set language modes or select intelligent question and answer system products corresponding to different languages. BRIEF DESCRIPTION OF DRAWINGS

[0099] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiment or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0100] Figure 1 The working principle of the existing multilingual question and answer system provided by the present application is shown in the figure;

[0101] Figure 2A flowchart of a multilingual question and answer method provided by an embodiment of the present application is shown in FIG. 1.

[0102] Figure 3 A flowchart of a process of determining a to-be-selected paragraph in a multilingual question and answer method provided by an embodiment of the present application is shown in FIG. 2.

[0103] Figure 4 A principle diagram of a to-be-selected paragraph determination process provided by an embodiment of the present application is shown in FIG. 3.

[0104] Figure 5 A specific flowchart of generating an answer in a multilingual question and answer method provided by an embodiment of the present application is shown in FIG. 4.

[0105] Figure 6 A principle diagram of generating an answer in a multilingual question and answer method provided by an embodiment of the present application is shown in FIG. 5.

[0106] Figure 7 A diagram of a change of vector dimension when a decoding layer of an answer scoring decodes an input vector provided by an embodiment of the present application is shown in FIG. 6.

[0107] Figure 8 A diagram of a working principle of a pointer network provided by an embodiment of the present application is shown in FIG. 7.

[0108] Figure 9 A structural diagram of a multilingual question and answer device provided by an embodiment of the present application is shown in FIG. 8.

[0109] Figure 10 A structural diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 9. DETAILED DESCRIPTION

[0110] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative work, such as simple combination of the embodiments of the present application or combination of some steps in the embodiments or changing the order, all belong to the scope of protection of the present application.

[0111] The terms "first", "second", "third", "fourth" and the like in the description and in the claims of the present application, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of these terms herein is merely for distinguishing between the similar objects and the same can be referenced by different terms and can be mutually exchanged under proper circumstances without changing the scope and spirit of the present application. The terms "comprise", "comprising", "include", "including", and the like, used in the present description and in the claims are intended to specify the presence of stated features, integers, steps, components, or combinations thereof, but they do not preclude the presence or addition of one or more other features, integers, steps, components, or combinations thereof.

[0112] As the intelligent question and answer system is popular in various application products, the application scenarios faced by the intelligent question and answer system are more and more complex and diversified. One of the application scenarios is multi-lingual question and answer. Usually many users will use multiple languages to ask questions and answer questions at the same time, for example, some words or sentences are used in the dialect of Ba-Shu when asking questions and some fashionable words are used in English, and then the problem is composed of multiple languages combined with Chinese. In another case, the employees of an enterprise will use multiple languages to ask questions to the intelligent question and answer system, or different employees will use different languages to ask questions. This makes the multi-lingual question and answer system an important development direction of the intelligent question and answer system.

[0113] Figure 1 The working principle of the existing multi-lingual question and answer system provided in the present application is shown in the figure. Figure 1 As shown in the figure, the existing multi-lingual question and answer system will first receive the question input by the user, and then translate the question into the language that the question and answer system developers are used to, or into the core language corresponding to the natural language processing model. For example, the user inputs a question expressed in English, and the core language corresponding to the natural language processing model is Chinese, at this time the English will be translated into Chinese through the translation module. Then the natural language processing model analyzes the translated question, searches the database for semantic paragraphs that can be used to organize the answer to the question, extracts the selected paragraphs, and then uses algorithms to filter and organize the selected paragraphs into an answer that conforms to the grammar of human language or the habit of natural language. In the above example, the answer is in Chinese, so it needs to be translated into English again through the translation module and then output.

[0114] Figure 1The existing multilingual question and answer system shown can only be applied to two languages in most cases, and a small number of them can be applied to multiple languages. However, as the number of languages increases, the translation time required will greatly increase, and the existing translation algorithm cannot completely guarantee that the translated semantics will not deviate. This makes the quality of the generated answer largely dependent on the quality of the translation. For example, if the translation of the question deviates, the generated answer will certainly deviate from the user's expectations; or the translation of the question is not a problem, but the translation of the generated answer deviates. In either case, it will inevitably increase the number of conversations, and even increasing the number of conversations cannot make the user get satisfactory answers, which will seriously affect the user's experience, and translation increases processing time, which may increase the user's waiting time and affect the user's experience. There is also a situation where the user uses multiple languages in a question. The existing translation module is difficult to accurately grasp the accurate semantics, and the final output answer can only be in one language, which may not conform to the user's language habits, making the user feel that the system is not intelligent enough. For example, many foreign companies or joint ventures have a common habit of using English and Chinese, or some research institutions or enterprises often use English and Chinese in the field they study. In some areas, such as the Pearl River Delta region, English and Chinese are often used in combination with Cantonese, and in the Yangtze River Delta region, English and Chinese are often used in combination with Wu. There is also a situation where more than three languages are used in some international organizations with multiple countries participating. It is not necessarily that the same user uses multiple languages, but different users may use different languages to interact with the intelligent question and answer system. The existing intelligent question and answer system can handle a small number of languages, and from the perspective of saving development and use costs, it will only support a limited number of commonly used languages, or through the switching of language modes to improve the processing efficiency of the intelligent question and answer system. And when the existing intelligent question and answer system cannot obtain a high-quality answer, it outputs the answer with the highest score, but this answer may still deviate significantly from the range of the answer the user expects to obtain.

[0115] The present application is to solve the above-mentioned various problems, the present application inventors in the study of the above-mentioned problems, found that the core of the above-mentioned problems is transition dependent on translation, further analysis, the root of the dependence on translation is that the natural language processing model is only fixedly used a language or a limited number of languages to train the model when developing, so that the natural language processing model is strongly coupled with the language. Therefore, the present application inventors put forward the invention idea of separating the natural language processing algorithm from the language of natural language, introducing a multilingual vocabulary that can dynamically change according to actual needs, and separating the processing logic from the language involved in natural language. In the training stage of the natural language processing model, the multilingual vocabulary has been introduced, which maximally weakens or even eliminates the influence of language on the processing ability of the model. In this way, multiple translations are avoided, and the generated answers can also be a mixture of multiple languages, which can make the user feel that the intelligent question and answer system is more intelligent and professional, and can give the user a feeling of talking to a technical expert or a colleague, and improve the user's experience.

[0116] The technical solutions of the present application will be described in detail below with specific examples. The following specific examples can be combined with each other, and the same or similar concepts or processes may not be described in detail in some examples.

[0117] Figure 2 A flowchart of a multilingual question and answer method provided by an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, the multilingual question and answer method provided by the embodiment includes the following steps. Figure 2

[0118] S201, obtaining a question text input by a user.

[0119] In this step, the question text includes at least one language text.

[0120] Specifically, the user inputs a question in the form of text through a keyboard or a touch screen on an intelligent question and answer input interface, or inputs a voice through a microphone, and the intelligent question and answer system converts the voice question into a question in the form of text through a voice recognition module, that is, obtains the question text input by the user. The question text input by the user can contain multiple languages, and can use multiple language words alternately in a sentence or alternately between short sentences. For example, the user inputs "Who is the winner of this Shanghai Marathon? And tell me, how many people participate in this competition?"

[0121] S202, determining a to-be-selected paragraph corresponding to the question text from a preset resource library by using a paragraph selection model and a multilingual vocabulary.

[0122] ​In this step, the multilingual word list is used to parse the vocabulary of all languages in the problem text, and the selected paragraph output by the paragraph selection model matches the language characteristics of the input problem text.

[0123] Specifically, the problem text can be input into a search engine to retrieve from the local area network or the Internet, extract all text paragraphs in the web page related to the problem text, and perform word segmentation processing to obtain multiple selected paragraphs. Optionally, the problem text can also be input into a database retrieval engine to retrieve the corresponding document files in the pre-set database, and perform word segmentation processing on these files to split them into multiple selected paragraphs.

[0124] It should be noted that since the input problem text contains multiple languages, it is necessary to first perform word segmentation and splitting on the problem text, and use a multilingual word list to expand the word segmentation of a certain language into a complete sentence, or replace the word with a translation in another language to form a problem sentence with only one language, or search for similar multilingual combinations in the multilingual word list. For example, "I served you", "Walmart supermarket", "CNN model", "EV (Eletic Vehicle) new energy vehicle" and other multilingual combination expressions. The problem text processed according to the above method is input into a web search engine or a database retrieval engine to obtain selected paragraphs containing only one language or multiple languages. The language characteristics of the selected paragraphs match the language characteristics of the problem text.

[0125] S203, using an answer generation model and a multilingual word list to determine the answer to the problem text from the selected paragraphs.

[0126] In this step, the answer output by the answer generation model matches the language characteristics of the input selected paragraph. Specifically, the output answer can be an answer text sentence composed of a selected paragraph in a certain language, or an answer text sentence composed of several selected paragraphs in different languages. Then the multilingual question and answer system can display the answer text on the display screen or convert it into speech through a text-to-speech conversion module.

[0127] It should be noted that for the answer generation model, those skilled in the art can select according to actual needs, such as CNN model, RNN model and other models that can generate natural language dialogue processing. And when generating answers, if necessary, a multilingual vocabulary needs to be called to connect the selected paragraphs, or a multilingual vocabulary is used to split and reorganize the selected paragraphs in different languages to obtain an answer text containing multiple languages and understandable by users.

[0128] It should also be noted that the answer generated by the answer generation model can be multiple answers, and then the scoring module or scoring algorithm in the answer generation model is used to filter out the answer with the highest quality.

[0129] Optionally, when the scores of all answers are too low or lower than the preset threshold, the answer is selected from the preset reply sentence for output, and the generated answer text is not output. Because the score is too low, it means that the generated answer does not have practical significance, or cannot be understood by the user, or deviates too much from the user's original expectation. In this case, the user is guided to ask and answer by outputting words such as "I'm sorry, I can't understand your question", "Please refine your question, I can't answer your question now" to get more useful information to generate the answer the user expects. Instead of directly outputting the low-quality answer, it gives the user the feeling that the question and answer system is answering randomly, thereby affecting the user experience.

[0130] The application provides a multilingual question and answer method, which acquires a question text input by a user, determines a selected paragraph corresponding to the question text from a preset resource library by using a paragraph selection model and a multilingual vocabulary, and determines an answer to the question text from the selected paragraph by using an answer generation model and the multilingual vocabulary. The multilingual vocabulary is used in the stages of searching for the selected paragraph and generating the answer, multiple translations are avoided, the problem that multiple translations consume a long time and cause semantic deviation and affect the quality of the answer and the user experience is solved, the answer to the multilingual question and answer is quickly generated, and a convenient and efficient solution is provided for internationalization promotion or multilingual environment use of the intelligent question and answer system, and the technical effect of avoiding the user from setting a language mode or selecting an intelligent question and answer system product corresponding to different languages is achieved.

[0131] For ease of understanding, the specific implementation of determining the selected paragraph will be described below with reference to Figure 3

[0132] Figure 3 A flowchart for determining a selected paragraph in a multilingual question and answer method provided by the application is shown in Figure 3 The specific implementation steps for determining the selected paragraph provided by the embodiment are specifically as follows:​

[0133] S301. Using the retrieval model, determine the retrieval results corresponding to the question text from the preset resource database.

[0134] In this step, the preset resource library includes document libraries in multiple languages, local area network web page resource libraries, and internet web page resource libraries. The retrieval models include search engines such as Baidu, Google, and Sogou, as well as various database retrieval models and data retrieval algorithms.

[0135] Search results include: web pages or their corresponding URLs, and documents or their corresponding storage locations.

[0136] In one possible design, the specific implementation of this step can be described in detail as follows:

[0137] First, a problem text cleaning algorithm is used to clean the problem text to determine those that meet a preset format. This step filters out erroneous or meaningless symbols, including special characters and whitespace characters such as commas (","), if there is no other content between them. Alternatively, if the input is incomplete, the cleaning algorithm can complete it. For example, if the input problem text is "the best supermarket," the algorithm can complete it to "the nearest supermarket" or "the cheapest supermarket," etc.

[0138] Then, based on the text to be cleaned and the retrieval model, the retrieval results to be cleaned are determined. This step can be implemented in at least two ways:

[0139] One approach is to first input the text of the cleaning question into a search engine to determine the webpage address; then, use a content crawling model to crawl the content of the webpage corresponding to the webpage address as the retrieval result to be cleaned. Another approach is to first use a matching algorithm to filter suitable answer files corresponding to the cleaning question text from a pre-set question-and-answer file library; then, determine the retrieval result to be cleaned based on the suitable answer files and the content crawling model. It is understandable that the two approaches can be combined, i.e., both crawling from the webpage and filtering from the pre-set question-and-answer file library can be used.

[0140] Finally, the retrieval result to be cleaned is determined according to the retrieval result to be cleaned and the result cleaning algorithm. Specifically, the text data of the retrieval result to be cleaned is subjected to semantic screening by using the result cleaning algorithm, and the text without actual meaning or the text with low relevance to the question text is deleted. Optionally, the retrieval result to be cleaned can also be organized into a preset format, including cutting the data captured from the webpage into K paragraphs (the size of K varies with the data of the webpage) according to the paragraph marker "\n". For example, the format of the preset retrieval result is to contain 30 token vectors, but the number of tokens of the retrieval result to be cleaned is less than 30, and the 30 token vectors are completed by supplementing 0. Of course, it can be understood that if the number of tokens exceeds 30, the retrieval result to be cleaned is split into two retrieval result data.

[0141] The data cleaning is performed on the retrieval result to be cleaned, and retrieval data with higher relevance to the question text can be obtained. Because the question contains multiple languages, more irrelevant data will be obtained during retrieval, which requires joint cleaning of multiple languages, rather than cleaning of a single language as in the prior art. In this way, the cleaned retrieval result can meet the requirements of the multilingual question and answer system, otherwise the quality of the multilingual answer generated based on the retrieval result will not be good.

[0142] S302, determining the paragraph text according to the retrieval result and the multilingual word table by using a preset tokenization algorithm.

[0143] In this embodiment, the preset tokenization algorithm is set as a FullTokenizer model. When the FullTokenizer model is used to tokenize the text, if each token unit can find a corresponding word in the basic semantic library, the token unit is a valid token unit, and if the corresponding word cannot be found in the basic semantic library, the token unit is marked as UNK, meaning that the token unit cannot be recognized by the model. In this application, the multilingual word table is used as the basic semantic library, so that the efficiency of the token unit processed by the FullTokenizer model can be greatly improved, because the basic semantic library of a single language cannot recognize the token of another language. Therefore, the multilingual word table can improve the efficiency of the token unit, and further improve the model performance of the multilingual question and answer system, i.e., a more reasonable and effective answer can be generated.

[0144] Figure 4 A principle schematic diagram of a process for determining a selected paragraph is provided for the embodiments of the application. As shown in FIG. 1, the process for determining a selected paragraph includes the following steps. Figure 4As shown, the lowermost "question, paragraph 1" to "question, paragraph k" are k paragraph texts, [CLS] represents the first token unit of the paragraph text, which can be understood as a start token, [SEP] represents the separator between sentences in the paragraph text, which can be understood as a sentence separator token, Tok1 to Tokk or Tokm represent the various token units (Token) in the paragraph text.

[0145] For ease of understanding, the following steps are combined Figure 4 for description.

[0146] S303, determining a first text vector according to the paragraph text and the combination algorithm.

[0147] In this step, each token unit in the paragraph text has a corresponding index number in the multilingual vocabulary. It can be understood that if the token unit does not have a corresponding word in the multilingual vocabulary, the token unit is assigned an unrecognizable identifier, such as 0. Replace the token units in the paragraph text with index numbers. As Figure 4 shown, add the row vectors formed after replacement at the same position to obtain the first text vector. Because the dimension of each paragraph text output by the full tokenizer model is consistent, in this embodiment, the dimension is taken as 768, as described above, if the dimension of a single paragraph text is less than 768, it is supplemented with 0. Then, the token units at the same position of all paragraph texts are superimposed and combined to obtain a first text vector with a dimension of 768. As Figure 4 shown, "E(CLS), E1,..., En, E(SEP), E1,..., Em" in the first text vector.

[0148] S304, determining a second text vector according to the first text vector and the paragraph selection model.

[0149] In this embodiment, the paragraph selection model is a BERT (Bidirectional Encoder Representation from Transformers) model, and it needs to be pre-trained with the multilingual vocabulary. As Figure 4 shown, after inputting the first text vector "E(CLS), E1,..., En, E(SEP), E1,..., Em" into the BERT model, a second text vector "C, T1,..., Tk, T(SEP), T1,..., Tm" with the same dimension can be obtained.

[0150] The role of the paragraph selection model is to reorganize and expand the search results based on the multilingual vocabulary to obtain more semantic materials that are more suitable for the question, providing support for generating more accurate multilingual answers later.

[0151] It should be noted that the person skilled in the art can select the specific implementation of the paragraph selection model according to the actual situation, and it is not limited to the BERT model described in the embodiment.

[0152] S305, determining the to-be-selected paragraph according to the second text vector and a preset screening algorithm.

[0153] In the embodiment, the step specifically comprises: extracting a first segmented word vector of the second text vector; determining a selection probability of the paragraph text according to the first segmented word vector and a preset decoding model; and if the selection probability is greater than or equal to a preset probability threshold, taking the paragraph text as the to-be-selected paragraph.

[0154] As shown in Figure 4 , the first segmented word unit of the second text vector, i.e., the first segmented word vector "C", is extracted and decoded by using a preset screening algorithm. Specifically, the first segmented word vector "C" is sequentially subjected to: a full connection layer (768*768 linear layer), an activation layer, a Dropout (dropout) layer (coefficient 0.2), a paragraph linear layer, and a Softmax (flexible maximum value) layer (normalizing the probabilities of K paragraphs so that the probability sum is 1), and then a probability array with a length of K is sorted from large to small, and a paragraph with a probability ranking meeting a preset condition is selected as the to-be-selected paragraph, for example, a paragraph with a high probability in the top N positions can be selected, or a paragraph with a probability value greater than a certain preset threshold can be selected, and the person skilled in the art can select a specific screening form according to the actual situation, which is not limited in the present application.

[0155] To facilitate understanding, a possible implementation of the S203 step will be specifically described below in conjunction with Figure 5 .

[0156] Figure 5 A specific flowchart of a multi-language question answering method provided by the embodiment of the present application for generating an answer. As shown in Figure 5 , the specific steps of the embodiment of the present application for determining the answer of the question text from the to-be-selected paragraph by using an answer generation model and the multi-language word table are as follows:

[0157] S501, combining the question text and the to-be-selected paragraph to generate a third text vector.

[0158] In this step, the paragraph vector corresponding to the cleaned and segmented question text is combined with the vector of the paragraph to be selected to form a third text vector. The combination method can be to place the segmented units of the question text at the beginning of the third text vector, followed by the paragraphs to be selected, with a sentence separator (SEP) added in between. It is understood that there are many possible combinations; the segmented units of the question text can also be placed at the end of the third text vector, or interspersed between the paragraphs to be selected. Those skilled in the art can choose the combination method according to the specific application scenario; this application does not impose any limitations.

[0159] Figure 6 This is a schematic diagram illustrating the principle of a multilingual question-answering method for generating answers, as provided in an embodiment of this application. Figure 6 As shown, the word segmentation unit corresponding to the question text is placed in front of the third text vector. The first word segmentation unit of the third text vector is the [CLS] starting paragraph marker. Then, each paragraph to be selected is arranged in sequence and separated by the sentence separator [SEP].

[0160] S502. Determine the sentence encoding vector based on the third text vector and the language representation model.

[0161] In this step, the language representation model is matched with the multilingual vocabulary. Specifically, such as... Figure 6 As shown, in this embodiment, the BERT model is selected as the language representation model. The third text vector is input into the BERT model. After processing by the BERT model, and combined with a multilingual vocabulary, multilingual answer text materials are generated. This expands the resource reserve for subsequent multilingual answer generation, thereby generating higher quality multilingual answers. The output of the BERT model is the so-called sentence encoding vector.

[0162] It should be noted that the BERT model needs to be pre-trained with a multilingual vocabulary beforehand, so that it can more effectively expand and enrich the selected paragraphs by combining the multilingual vocabulary.

[0163] Optionally, the sentence encoding vector includes: paragraph segmentation, multilingual vocabulary segmentation, first attribute information, and second attribute information. The first attribute information is the attribute information corresponding to the paragraph segmentation, and the second attribute information is the attribute information corresponding to the multilingual vocabulary segmentation. Specifically, the attribute information may include the index position information of the paragraph segmentation or multilingual vocabulary segmentation in the paragraph text or in the multilingual vocabulary, the part-of-speech of the segmentation (e.g., whether the segmentation represents a person's name, place name, or action), the characteristic attributes of the segmentation (e.g., the application scenario represented by the segmentation, such as the characteristic attribute of a supermarket being shopping), etc.

[0164] S503. Determine the score of the sentence encoding vector based on the sentence encoding vector and the scoring decoding model.

[0165] In this step, the specific steps include:

[0166] S503_1, extracting the second token vector located at the first position of the sentence encoding vector.

[0167] As shown in the following formula (1), the first token unit "C" of the sentence encoding vector is taken as the second token vector and extracted and input to the answer scoring decoding layer shown in the following formula (2). Figure 6 Figure 6

[0168] S503_2, determining the score of the sentence encoding vector according to the second token vector and the scoring decoding model.

[0169] As shown in the following formula (3), the second token vector "C" is sequentially subjected to a full connection layer (768*768 linear layer), an activation layer, a Dropout (dropout) layer (coefficient 0.2), a paragraph linear layer, and a Softmax (flexible maximum value) layer (so that the score of the valid answer and the sum of the scores of the invalid answers are 1). Figure 6

[0170] The answer scoring decoding layer provided in the embodiments of the present application is a schematic diagram of the change of the vector dimension when the vector is decoded. As shown in the following formula (4), [CLS] is a second token vector, which is a 1*768-dimensional vector. After being subjected to a full connection layer, an activation layer, and a Dropout layer, the dimension does not change. After being subjected to a paragraph linear layer, the dimension becomes 1*2. Finally, after being subjected to a Softmax layer, an array with a length of 2 is output. The two numbers in the array are respectively set to index 0 position and index 1 position. The index 0 position represents the score of the answer without a valid answer, and the index 1 position represents the score of the answer with a valid answer. That is, for the sentence encoding vector, the scoring decoding model will respectively predict whether the answer generated by the sentence encoding vector is valid from two directions. Of course, when evaluating, the constraint condition that the sum of the valid score and the invalid score is 1 needs to be met. Then, a preset score threshold is set to screen whether the answer needs to be generated. The preset score threshold can be a fixed value, such as 0.5, or a dynamic value generated according to the input question and / or the intermediate parameter of the BERT model. A person skilled in the art can select the setting method of the preset score threshold according to the specific application scenario. Figure 7 Figure 7

[0171] S504, if the score is greater than or equal to the preset score threshold, determining the answer corresponding to the sentence encoding vector by using the answer generation model and the multilingual word table.

[0172] In this step, the specific steps include:

[0173] ​​​​S5041, decode the sentence encoding vector by using the conversion decoding model to determine a decoding word vector.

[0174] As shown in the figure, after scoring by the scoring decoding model, if the valid answer score of the sentence encoding vector is greater than or equal to a preset score threshold, the sentence encoding vector is input into the conversion decoding model for decoding to obtain a decoding word vector, which functions to extract the answer text material in the sentence encoding vector. Then input into the pointer network to organize and generate the final answer by the pointer network in combination with a multilingual vocabulary. Figure 6 The working principle of the pointer network is explained below in combination with the following steps. Figure 8

[0175] S5042, determine a paragraph score matrix according to the first multilayer perception network and the decoding word vector.

[0176] Figure 8 The working principle diagram of the pointer network provided by the embodiments of the present application is shown in the figure. Figure 8 As shown in the figure, the decoding word vector output by the conversion decoding model is input into two different multilayer perception networks, i.e. the first multilayer perception network and the second multilayer perception network. The multilayer perception network is a network composed of a series of multilayer linear layers and activation layers. The function of the first multilayer perception network is to obtain a paragraph score matrix. The paragraph score matrix is a score matrix of T len ×S len , where T len represents the sequence length of the answer, and S len represents the length of the decoding word vector. It can be understood that each row of the score matrix represents an answer token unit, and the score in each decoding word vector, so it can be understood that the paragraph score matrix represents the score of each answer token unit in the decoding word vector. For example, one row of the paragraph score matrix is [0.3, 0.1, 0, 0.8], 0.3 represents the score of a certain answer token unit Tokn in the first decoding word vector, and 0.8 represents the score in the fourth decoding word vector. The function of the paragraph score matrix is to enable the selection of the corresponding word from the decoding word vector when generating the answer, for example, the higher the score, the greater the probability of being selected.

[0177] S5043, determine a vocabulary score matrix according to the second multilayer perception network and the decoding word vector.

[0178] The function of the second multilayer perception network is to obtain a vocabulary score matrix. The vocabulary score matrix is a score matrix of T len ×V len , where T len represents the sequence length of the answer, and V len ​The length of the multilingual vocabulary is represented.

[0179] The role of the vocabulary score matrix is to enable the selection of corresponding words from the multilingual vocabulary when generating the answer.

[0180] S5044, using a superposition algorithm, determining a comprehensive score matrix according to the paragraph score matrix and the vocabulary score matrix.

[0181] In this step, as shown in Figure 8 each position of each matrix has its own index number, so the scores in the corresponding index numbers of the paragraph score matrix and the vocabulary score matrix can be added or subtracted according to the preset rules, for example, the scores in the same index number can be added / subtracted, i.e. the first position of the paragraph score matrix and the first position of the vocabulary score matrix are added / subtracted. Those skilled in the art can choose different superposition forms according to specific conditions, which are not limited in the present application.

[0182] S5045, using the answer generation model, the sentence encoding vector and the multilingual vocabulary, determining the answer according to the comprehensive score matrix.

[0183] The answer generation model determines whether to select a word unit in the multilingual vocabulary or a word in the decoding word vector according to the score of each answer word unit given in the comprehensive score matrix to combine to obtain the final answer.

[0184] S505, if the score is less than the preset score threshold, generating the answer according to the preset reply template.

[0185] In this step, if the effective answer score of the sentence encoding vector is less than the preset score threshold after the scoring and decoding model scores, it is considered that the sentence encoding vector cannot generate an answer that satisfies the user, at which time an answer is selected from the reply template, for example: a reply similar to "The question you asked is beyond my understanding range. Please change your way of asking questions or questions." Instead of giving an answer that is meaningless to the user.

[0186] The application provides a multilingual question and answer method, which comprises the following steps: firstly, obtaining a question text input by a user; secondly, determining a to-be-selected paragraph corresponding to the question text from a preset resource library by using a paragraph selection model and a multilingual vocabulary; and finally, determining an answer of the question text from the to-be-selected paragraph by using an answer generation model and the multilingual vocabulary. In the stages of searching for the to-be-selected paragraph and generating the answer, the multilingual vocabulary is used, so that the problem of long time consumption and semantic deviation caused by multiple translations is solved, the quality of the answer is affected, and the user experience is affected. The technical effects of quickly generating a multilingual question and answer answer and providing a convenient and efficient solution for internationalization popularization or multilingual environment use of an intelligent question and answer system are achieved.

[0187] Figure 9 A structure diagram of a multilingual question and answer device provided by an embodiment of the application is shown in the figure. Figure 9 As shown in the figure, the multilingual question and answer device 900 provided by the embodiment comprises:

[0188] An acquisition module 901, configured to acquire a question text input by a user;

[0189] A paragraph selection module 902, configured to determine a to-be-selected paragraph according to the question text by using a paragraph selection model and a multilingual vocabulary, wherein the multilingual vocabulary contains all the vocabularies of all languages related to the question text.

[0190] An answer generation module 903, configured to determine an answer of the question text from the to-be-selected paragraph by using an answer generation model and the multilingual vocabulary, wherein the answer output by the answer generation model matches the language features of the to-be-selected paragraph input.

[0191] In a possible design, the paragraph selection module 902 is configured to determine a to-be-selected paragraph according to the question text by using a paragraph selection model and a multilingual vocabulary, wherein the multilingual vocabulary contains all the vocabularies of all languages related to the question text, and the paragraph selection module 902 comprises:

[0192] The paragraph selection module 902 is configured to determine a retrieval result corresponding to the question text from the preset resource library by using a retrieval model.

[0193] The paragraph selection module 902 is further configured to determine a paragraph text according to the retrieval result and the multilingual vocabulary by using a preset word segmentation algorithm.

[0194] The paragraph selection module 902 is further configured to determine a first text vector according to the paragraph text and a combination algorithm.

[0195] The paragraph selection module 902 is further configured to determine a second text vector according to the first text vector and a paragraph selection model.

[0196] The paragraph selection module 902 is further configured to determine the to-be-selected paragraph according to the second text vector and a preset screening algorithm.

[0197] In a possible design, the paragraph selection module 902 is further configured to determine the to-be-selected paragraph according to the second text vector and a preset screening algorithm, including:

[0198] The paragraph selection module 902 is further configured to extract a first tokenization vector of the second text vector.

[0199] The paragraph selection module 902 is further configured to determine a selection probability of the paragraph text according to the first tokenization vector and a preset decoding model.

[0200] The paragraph selection module 902 is further configured to, if the selection probability is greater than or equal to a preset probability threshold, determine the paragraph text as the to-be-selected paragraph.

[0201] Optionally, the paragraph selection module 902 is configured to determine a search result corresponding to the question text from the preset resource library by using a search model, including:

[0202] The paragraph selection module 902 is configured to perform content cleaning on the question text by using a question text cleaning algorithm, to determine a cleaned question text satisfying a preset format.

[0203] The paragraph selection module 902 is further configured to determine a to-be-cleaned search result according to the cleaned question text and the search model.

[0204] The paragraph selection module 902 is further configured to determine the search result according to the to-be-cleaned search result and a result cleaning algorithm.

[0205] In a possible design, the paragraph selection module 902 is further configured to determine a to-be-cleaned search result according to the cleaned question text and the search model, including:

[0206] The paragraph selection module 902 is further configured to input the cleaned question text into a search engine, to determine a web page address.

[0207] The paragraph selection module 902 is further configured to perform content grabbing on a web page corresponding to the web page address by using a content grabbing model, to obtain content of the web page as the to-be-cleaned search result.

[0208] In a possible design, the paragraph selection module 902 is further configured to determine the to-be-cleaned search result according to the cleaning question text and the search model, including:

[0209] The paragraph selection module 902 is further configured to screen an adaptive answer file corresponding to the cleaning question text from a preset question and answer file library by using a matching algorithm.

[0210] The paragraph selection module 902 is further configured to determine the to-be-cleaned search result according to the adaptive answer file and a content crawling model.

[0211] Optionally, the answer generation module 903 is configured to determine an answer of the question text from the to-be-selected paragraph by using an answer generation model and the multilingual word table, including:

[0212] The answer generation module 903 is configured to combine the question text and the to-be-selected paragraph to generate a third text vector.

[0213] The answer generation module 903 is further configured to determine a sentence encoding vector according to the third text vector and a language representation model, where the language representation model is matched with the multilingual word table.

[0214] The answer generation module 903 is further configured to determine a score of the sentence encoding vector according to the sentence encoding vector and a scoring decoding model.

[0215] The answer generation module 903 is further configured to, if the score is greater than or equal to a preset score threshold, determine the answer corresponding to the sentence encoding vector by using the answer generation model and the multilingual word table.

[0216] The answer generation module 903 is further configured to, if the score is less than the preset score threshold, generate the answer according to a preset reply template.

[0217] In a possible design, the answer generation module 903 is further configured to determine a score of the sentence encoding vector according to the sentence encoding vector and a scoring decoding model, including:

[0218] The answer generation module 903 is further configured to extract a second word segmentation vector located at a head of the sentence encoding vector.

[0219] The answer generation module 903 is further configured to determine the score of the sentence encoding vector according to the second word segmentation vector and the scoring decoding model.

[0220] Optionally, the answer generation module 903 is further configured to, if the score is greater than or equal to a preset score threshold, determine the answer corresponding to the sentence encoding vector by using the answer generation model and the multilingual vocabulary, including:

[0221] If the score is greater than or equal to a preset score threshold, the answer generation module 903 is further configured to decode the sentence encoding vector by using a conversion decoding model to determine a decoding word vector.

[0222] The answer generation module 903 is further configured to determine a paragraph score matrix according to a first multi-layer perception network and the decoding word vector.

[0223] The answer generation module 903 is further configured to determine a vocabulary score matrix according to a second multi-layer perception network and the decoding word vector.

[0224] The answer generation module 903 is further configured to determine a comprehensive score matrix according to the paragraph score matrix and the vocabulary score matrix by using a superposition algorithm.

[0225] The answer generation module 903 is further configured to determine the answer according to the comprehensive score matrix by using the answer generation model, the sentence encoding vector and the multilingual vocabulary.

[0226] Optionally, after the obtaining module 901 is configured to obtain the question text input by the user, the obtaining module 901 is further configured to:

[0227] The preprocessing module 904 is configured to determine a question text word vector by using a word segmentation algorithm to perform word segmentation on the question text.

[0228] The preprocessing module 904 is further configured to determine the language corresponding to the question text according to the question text word vector and a language matching algorithm.

[0229] The preprocessing module 904 is further configured to determine the multilingual vocabulary from a plurality of candidate multilingual vocabularies according to the language, the multilingual vocabulary including at least two languages.

[0230] It is worth noting that, Figure 9 The multilingual question and answer device provided by the embodiment can be used to execute the multilingual question and answer method provided by any of the above embodiments, and the specific implementation manner and technical effects are similar, which will not be described here.

[0231] Figure 10 The electronic device structure schematic diagram provided by the embodiment of the application is shown in FIG. 10. Figure 10 The electronic device 1000 provided by the embodiment includes:

[0232] a processor 1001; and

[0233] a memory 1002 for storing executable instructions of the processor, and the memory can also be a flash memory;

[0234] The processor 1001 is configured to perform each step in the above method by executing the executable instructions. Details can be referred to the related description in the foregoing method embodiments.

[0235] Optionally, the memory 1002 can be independent or integrated with the processor 1001.

[0236] When the memory 1002 is independent of the processor 1001, the electronic device 1000 can further include:

[0237] a bus 1003 for connecting the processor 1001 and the memory 1002.

[0238] The embodiment also provides a readable storage medium, which stores a computer program. When at least one processor of an electronic device executes the computer program, the electronic device executes the method provided in the various embodiments.

[0239] The embodiment also provides a program product, which includes a computer program stored in a readable storage medium. At least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to make the electronic device implement the method provided in the various embodiments.

[0240] Those skilled in the art can understand that all or part of the steps of the above method embodiments can be completed by program instructions related to hardware. The foregoing program can be stored in a computer readable storage medium. When the program is executed, the steps of the above method embodiments are executed; and the foregoing storage medium includes: ROM, RAM, magnetic disk or optical disk and various media that can store program codes.

[0241] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A multi-lingual question answering method, characterized by, The method comprises the following steps: acquiring user input question text, the question text comprising at least one language text; performing word segmentation on the question text by using a word segmentation algorithm to determine a question text word vector; determining the language corresponding to the question text according to the question text word vector and a language matching algorithm; determining a multilingual word table from a candidate multilingual word table according to the language, the multilingual word table comprising at least two languages; determining a candidate passage corresponding to the question text from a preset resource library by using a passage selection model and the multilingual word table, the multilingual word table being used to analyze the vocabulary of all languages in the question text, and the candidate passage output by the passage selection model matching the language features of the input question text; combining the question text and the candidate passage to generate a third text vector, determining a sentence encoding vector according to the third text vector and a language representation model, the language representation model matching the multilingual word table, and determining a score of the sentence encoding vector according to the sentence encoding vector and a scoring decoding model; if the score is greater than or equal to a preset score threshold, determining an answer corresponding to the sentence encoding vector by using an answer generation model and the multilingual word table, and if the score is less than the preset score threshold, generating the answer according to a preset reply template; the answer output by the answer generation model matching the language features of the input candidate passage.

2. The multilingual question answering method of claim 1, wherein, The method of determining the candidate passage corresponding to the question text from the preset resource library by using the passage selection model and the multilingual word table comprises the following steps: determining a search result corresponding to the question text from the preset resource library by using a search model; determining a passage text according to the search result and the multilingual word table by using a preset word segmentation algorithm; determining a first text vector according to the passage text and a combination algorithm; determining a second text vector according to the first text vector and a passage selection model; determining the candidate passage according to the second text vector and a preset screening algorithm.

3. The multi-lingual question answering method of claim 2, wherein, The method of determining the candidate passage according to the second text vector and the preset screening algorithm comprises the following steps: extracting a first word segmentation vector of the second text vector; determining a selection probability of the passage text according to the first word segmentation vector and a preset decoding model; if the selection probability is greater than or equal to a preset probability threshold, taking the passage text as the candidate passage.

4. The multi-lingual question answering method of claim 2 or 3, wherein, The method of determining the search result corresponding to the question text from the preset resource library by using the search model comprises the following steps: performing content cleaning on the question text by using a question text cleaning algorithm to determine a cleaned question text meeting a preset format; determining a to-be-cleaned search result according to the cleaned question text and the search model; determining the search result according to the to-be-cleaned search result and a result cleaning algorithm.

5. The multi-lingual question answering method of claim 4, wherein, The method of determining the to-be-cleaned search result according to the cleaned question text and the search model comprises the following steps: inputting the cleaned question text into a search engine to determine a web address; The content in the webpage corresponding to the webpage address is captured as the to-be-cleaned search result by using a content capturing model.

6. The multi-lingual question answering method of claim 4, wherein, The to-be-cleaned search result is determined according to the cleaning question text and the search model, and the method comprises the steps of: An adaptive answer file corresponding to the cleaning question text is screened from a preset answer file library by using a matching algorithm; The to-be-cleaned search result is determined according to the adaptive answer file and a content capturing model.

7. The multi-lingual question answering method of claim 1, wherein, The sentence encoding vector comprises a paragraph segmentation, a multi-lingual word table segmentation, first attribute information and second attribute information, the first attribute information is attribute information corresponding to the paragraph segmentation, and the second attribute information is attribute information corresponding to the multi-lingual word table segmentation.

8. The multi-lingual question answering method of claim 7, wherein, The score of the sentence encoding vector is determined according to the sentence encoding vector and a scoring decoding model, and the method comprises the steps of: A second segmentation vector located at the first position of the sentence encoding vector is extracted; The score of the sentence encoding vector is determined according to the second segmentation vector and a scoring decoding model.

9. The multi-lingual question answering method of claim 7 or 8, wherein, The answer corresponding to the sentence encoding vector is determined by using the answer generation model and the multi-lingual word table, and the method comprises the steps of: The sentence encoding vector is decoded by using a conversion decoding model to determine a decoding word vector; A paragraph score matrix is determined according to a first multi-layer perception network and the decoding word vector; A word table score matrix is determined according to a second multi-layer perception network and the decoding word vector; A comprehensive score matrix is determined according to the paragraph score matrix and the word table score matrix by using a superposition algorithm; The answer is determined according to the comprehensive score matrix by using the answer generation model, the sentence encoding vector and the multi-lingual word table.

10. A multi-lingual question answering apparatus characterized by comprising: The method comprises the steps of: An acquisition module is configured to acquire a question text input by a user; The question text comprises at least one language text; A preprocessing module is configured to segment the question text by using a segmentation algorithm to determine a question text word vector; The preprocessing module is further configured to determine a language of the question text according to the question text word vector and a language matching algorithm; The preprocessing module is further configured to determine a multi-lingual word table from a to-be-selected multi-lingual word table according to the language, the multi-lingual word table comprising at least two languages; A paragraph selection module is configured to determine a to-be-selected paragraph corresponding to the question text from a preset resource library by using a paragraph selection model and the multi-lingual word table, the multi-lingual word table being used to analyze words in all languages in the question text, and the to-be-selected paragraph output by the paragraph selection model matching a language feature of the input question text; An answer generation module is configured to combine the question text and the to-be-selected paragraph to generate a third text vector, determine a sentence encoding vector according to the third text vector and a language representation model, the language representation model matching the multi-lingual word table, and determine a score of the sentence encoding vector according to the sentence encoding vector and a scoring decoding model. If the score is greater than or equal to a preset score threshold, an answer corresponding to the sentence encoding vector is determined by using an answer generation model and the multilingual word table; if the score is less than the preset score threshold, the answer is generated according to a preset reply template; the answer output by the answer generation model matches the language feature of the inputted to-be-selected paragraph.

11. A multi-lingual question answering device, characterized by Comprise: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the multilingual question and answer method of any one of claims 1 to 9 via execution of the executable instructions.

12. A storage medium having stored thereon a computer program, characterized in that The program is executed by the processor to implement the multilingual question and answer method of any one of claims 1 to 9.