Open question and answer model generation method and device

By using multi-layer Transformer models and vector conversion modules to process training data, it solves the problem of large language models being unable to understand Internet information, and improves the accuracy of user intent understanding and answer generation.

CN118760746APending Publication Date: 2024-10-11SHANGHAI BILIBILI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410750855.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Due to the large number of parameters, existing large language models are difficult to update in real time, resulting in the inability to effectively understand the information on the Internet, the inability to accurately understand user intentions, and poor answer generation results.

Method used

Using a multi-layer Transformer model and vector conversion module, we obtain training data to avoid bias for word segmentation processing and feature extraction, train the target open question and answer model, support independent processing of Chinese and non-Chinese data, and increase the depth of the model to improve the prediction effect.

Benefits of technology

It achieves a more accurate understanding of user intentions, improves the prediction effect of the model, and makes the generated answers more in line with user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760746A_ABST
    Figure CN118760746A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an open question and answer model generation method and device, and the method comprises the steps: obtaining training data which has the characteristic of avoiding bias; obtaining an initial open question and answer model, wherein the initial open question and answer model comprises a multi-layer Transform model and a vector conversion module; the vector conversion module supports independent processing of Chinese data and non-Chinese data; performing word segmentation processing on the training data through a vector conversion module to obtain one or more segmented words, and performing feature extraction on the one or more segmented words to obtain a feature vector corresponding to each segmented word; and training the initial open question and answer model according to the feature vector to obtain a target open question and answer model. According to the method, the model architecture is set to comprise the multi-layer Transform model and the vector conversion module, the vector conversion module can improve the effect of extracting the features from the input data by the model, and the expression of the model can be improved by properly increasing the depth of the model, so that the model can more accurately understand the intention of a user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of Internet technology, and in particular, to a method, apparatus, computer device, computer-readable storage medium, and computer program product for generating an open question-answering model. Background Art

[0002] With the improvement of computer computing power and the development of deep learning technology, the number of model parameters is getting larger and larger, and the capabilities are gradually improving. Big models have brought natural language processing into a new era. Big models can answer users' questions in the form of dialogue, give their own solutions and answers, or create according to users' instructions.

[0003] Currently, many users like to surf the Internet, and the questions they ask or the answers they want tend to contain some information from the Internet. However, due to the huge number of parameters in large language models, they cannot be updated in real time. As a result, existing large language models often ignore the attributes of the Internet and cannot understand the user's intention, resulting in poor results in the generated answers.

[0004] It should be noted that the above content is not necessarily prior art, nor is it intended to limit the scope of patent protection of this application. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for generating an open question-answering model to solve or alleviate one or more of the technical problems raised above.

[0006] One aspect of an embodiment of the present application provides a method for generating an open question answering model, the method comprising:

[0007] Obtaining training data, wherein the training data has a characteristic of avoiding bias;

[0008] Acquire an initial open question answering model, wherein the initial open question answering model is composed of a multi-layer Transformer model and a vector conversion module; wherein the vector conversion module supports independent processing of Chinese data and non-Chinese data;

[0009] Performing word segmentation processing on the training data through the vector conversion module to obtain one or more word segments, and performing feature extraction on the one or more word segments to obtain a feature vector corresponding to each word segment;

[0010] The initial open question answering model is trained according to the feature vector to obtain a target open question answering model.

[0011] Optionally, before the step of performing word segmentation processing on the training data by the vector conversion module to obtain one or more word segments, the method further includes:

[0012] Performing data cleaning on the training data according to heuristic rules;

[0013] The cleaned training data is subjected to global data deduplication processing.

[0014] Optionally, performing global data deduplication processing on the cleaned training data includes:

[0015] Based on the character string dimension of any length or any position, global data deduplication processing is performed on the cleaned training data.

[0016] Optionally, the training data includes interaction data, and the interaction data includes interactive data and dynamic data.

[0017] Optionally, the training data includes Chinese data and non-Chinese data, and the word segmentation processing of the training data by the vector conversion module to obtain one or more word segmentations includes:

[0018] The vector conversion module performs word segmentation processing on the Chinese data in the training data to obtain one or more word segments according to the principle that the maximum word length is the first value; and

[0019] The vector conversion module performs word segmentation processing on the non-Chinese data in the training data to obtain one or more word segments according to the principle that the maximum word length is the second value;

[0020] The first value is smaller than the second value.

[0021] Optionally, the performing word segmentation processing on the training data by the vector conversion module to obtain one or more word segmentations includes:

[0022] The vector conversion module performs word segmentation processing on the Chinese data in the training data according to the principle of not adding preset placeholders to obtain one or more word segments.

[0023] Optionally, training the initial open question answering model according to the feature vector to obtain a target open question answering model includes:

[0024] In a first training phase, the initial open question answering model is trained according to the feature vector and a preset learning rate;

[0025] In the second training stage, the preset learning rate is attenuated to obtain a second learning rate, and the initial open question answering model is trained according to the feature vector and the second learning rate to obtain a target open question answering model.

[0026] Optionally, the method further comprises:

[0027] Receive a first question from a user;

[0028] The first question is input into the target open question answering model for prediction to generate an answer corresponding to the first question.

[0029] Another aspect of an embodiment of the present application provides a device for generating an open question-answering model, the device comprising:

[0030] A data acquisition module, used to acquire training data, wherein the training data has the characteristic of avoiding bias;

[0031] An initial model acquisition module, used to acquire an initial open question answering model, wherein the initial open question answering model is composed of a multi-layer Transformer model and a vector conversion module; wherein the vector conversion module supports independent processing of Chinese data and non-Chinese data;

[0032] A feature extraction module, configured to perform word segmentation processing on the training data through the vector conversion module to obtain one or more word segments, and perform feature extraction on the one or more word segments to obtain a feature vector corresponding to each word segment;

[0033] A model training module is used to train the initial open question answering model according to the feature vector to obtain a target open question answering model.

[0034] Another aspect of an embodiment of the present application provides a computer device, including:

[0035] at least one processor; and

[0036] a memory communicatively coupled to the at least one processor;

[0037] Wherein: the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the open question and answer model generation method as described above.

[0038] Another aspect of an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, the open question and answer model generation method as described above is implemented.

[0039] Another aspect of an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the open question and answer model generation method as described above.

[0040] The embodiments of the present application using the above technical solution may include the following advantages: by obtaining training data with the characteristic of avoiding bias to train the model, the trained model architecture includes a multi-layer Transformer model and a vector conversion module, and the vector conversion module can independently process Chinese data and non-Chinese data, thereby improving the effect of the model in extracting features from the input data. In addition, research has found that appropriately increasing the depth of the model can improve the performance of the model, so that the trained target open question-answering model can more accurately understand the user's intention, thereby further improving the prediction effect of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0042] Figure 1 The operating environment diagram of the open question answering model generation method according to the first embodiment of the present application is schematically shown;

[0043] Figure 2 The flowchart of the method for generating an open question answering model according to the first embodiment of the present application is schematically shown;

[0044] Figure 3 A schematic diagram of an answer generated based on a target open question answering model is schematically shown;

[0045] Figure 4 A block diagram schematically shows an open question answering model generating device according to the second embodiment of the present application; and

[0046] Figure 5 The hardware architecture diagram of the computer device according to the third embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0048] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0049] In the description of the present application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed, but are only used to facilitate the description of the present application and to distinguish each step, and therefore should not be understood as a limitation on the present application.

[0050] First, the following terms are explained:

[0051] Deep Learning: Deep Learning, DL, is the study of the inherent laws and representation levels of sample data. The information obtained in the learning process is of great help in interpreting data such as text, images, and sounds. Its ultimate goal is to enable machines to have analytical learning capabilities like humans and to be able to recognize data such as text, images, and sounds.

[0052] Natural Language Processing: Natural Language Processing, NLP, is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can enable effective communication between humans and computers using natural language.

[0053] Large model: mainly used to process sequence data, with language understanding and text generation capabilities. It is trained by connecting to a large corpus containing real-world conversations, enabling it to understand everything from astronomy to geography, and interact according to the context of the chat, achieving communication that is almost indistinguishable from real humans.

[0054] Transformer model: It is a deep learning model based on the self-attention mechanism. Its core idea is to find relevant information by calculating the similarity between each word and other words, thereby generating an output matrix containing more contextual information. This model architecture has achieved significant performance improvements in the field of natural language processing, especially in multiple tasks such as machine translation, text summarization, and question-answering systems.

[0055] Secondly, in order to facilitate those skilled in the art to understand the technical solutions provided in the embodiments of the present application, the relevant technologies are described below:

[0056] With the improvement of computer computing power and the development of deep learning technology, the number of model parameters is getting larger and larger, and the capabilities are gradually improving. Big models have brought natural language processing into a new era. Big models can answer users' questions in the form of dialogue, give their own solutions and answers, or create according to users' instructions.

[0057] Currently, many users like to surf the Internet, and the questions they ask or the answers they want tend to contain some information from the Internet. However, due to the huge number of parameters in large language models, they cannot be updated in real time. As a result, existing large language models often ignore the attributes of the Internet and cannot understand the user's intention, resulting in poor results in the generated answers.

[0058] To this end, the embodiment of the present application provides a technical solution for generating an open question answering model. In this technical solution, by obtaining training data, the training data has the characteristic of avoiding bias; obtaining an initial open question answering model, the initial open question answering model includes a multi-layer Transformer model and a vector conversion module; wherein the vector conversion module supports independent processing of Chinese data and non-Chinese data respectively; the training data is segmented by the vector conversion module to obtain one or more segmented words, and the one or more segmented words are feature extracted to obtain a feature vector corresponding to each segmented word; the initial open question answering model is trained according to the feature vector to obtain a target open question answering model. Thus, by obtaining training data with the characteristic of avoiding bias to train the model, the trained model architecture includes a multi-layer Transformer model and a vector conversion module, the vector conversion module can independently process Chinese data and non-Chinese data respectively, thereby improving the effect of the model extracting features from the input data, and it has been found through research that appropriately increasing the depth of the model can improve the performance of the model, so that the trained target open question answering model can more accurately understand the user's intention, thereby further improving the prediction effect of the model. See below for details.

[0059] Finally, for ease of understanding, an exemplary operating environment is provided below.

[0060] like Figure 1 As shown, the environment diagram includes a service platform 2, a network 4, and a client 6, wherein:

[0061] The service platform 2 may be composed of a single or multiple computing devices. The multiple computing devices may include virtualized computing instances. Virtualized computing instances may include virtual machines, such as simulations of computer systems, operating systems, servers, etc. The computing device may load a virtual machine based on a virtual image and / or other data defining specific software (e.g., operating system, dedicated application, server) for simulation. As the demand for different types of processing services changes, different virtual machines may be loaded and / or terminated on one or more computing devices. A hypervisor may be implemented to manage the use of different virtual machines on the same computing device.

[0062] The service platform 2 may be configured to communicate with the client 6 or the like via a network 4. The network 4 includes various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or the like. The network 4 may include physical links, such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof, and the like, or wireless links, such as cellular links, satellite links, Wi-Fi links, and the like.

[0063] The service platform 2 can provide storage, reading, writing, querying, deleting and other services, such as providing an open question-answering model generation service for the client.

[0064] Client 6 can be a Windows, Android TM ) or iOS operating systems, such as smartphones, tablet devices, laptops, virtual reality devices, gaming devices, set-top boxes, car terminals, and smart TVs. Based on the above operating systems, various applications can be run, such as programs for generating open question-answering models.

[0065] The client 6 may provide / configure a user access page for manipulating the service platform 2 or uploading an object, etc.

[0066] It should be noted that the above devices are exemplary, and the number and type of devices are adjustable in different scenarios or according to different needs.

[0067] The following uses the service platform 2 as the execution subject to introduce the technical solution of the present application through multiple embodiments. It should be noted that these embodiments can be implemented in a variety of different forms and should not be interpreted as being limited to the embodiments described here.

[0068] Embodiment 1

[0069] Figure 2 The flowchart of the method for generating an open question and answer model according to the first embodiment of the present application is schematically shown.

[0070] like Figure 2As shown, the open question answering model generation method may include steps S202 to S208, wherein:

[0071] Step S202 , obtaining training data, wherein the training data has a characteristic of avoiding bias;

[0072] In this embodiment, the model can be trained on 2.8T data to improve the prediction effect of the model. The training data includes Chinese data and non-Chinese data, such as English data. For example, the ratio of Chinese to English data can be 4:5. The training data can include a certain proportion of code data, such as 6% of code; publicly available books, encyclopedias, papers, and selected data related to STEM can also be collected.

[0073] Step S204 , obtaining an initial open question answering model, wherein the initial open question answering model comprises a multi-layer Transformer model and a vector conversion module; wherein the vector conversion module supports independent processing of Chinese data and non-Chinese data;

[0074] In this embodiment, the initial open question answering model includes a multi-layer Transformer model and a vector conversion module. Research has found that the performance of the model can be improved by appropriately increasing the depth of the model. As an example, the model can be set to include a 36-layer Transformer model.

[0075] Specifically, the architecture of the initial open question answering model can be consistent with the mainstream Decoder-Only Transformer model. The detailed settings follow the settings of Llama, and the number of layers of the Transformer model is set to 36, so that the model can understand the user's intention more accurately. In addition, the gradient generated by the lm-head layer in model training is one order of magnitude higher than other parts, and there is a rare word oscillation problem, which is one of the sources of training instability. In this embodiment, Norm-Head is used to support learning at a higher learning rate to improve the stability of the model.

[0076] In addition, the initial open question answering model also includes a vector conversion module, which supports independent processing of Chinese data and non-Chinese data, for example, different maximum word lengths are set for Chinese data and non-Chinese data for word segmentation. Specifically, the vector conversion module in this embodiment can be a Tokenizer, which is a class for vectorizing text and converting text into a sequence. When processing language and text, computers cannot understand the meaning of text. Tokenizer can convert text into a language that computers can understand. By converting a word (Chinese single character or word) into a positive integer, an input text is turned into a sequence, and then the sequence is vectorized, and the vectorized data can be sent to the model for processing.

[0077] Step S206 , performing word segmentation processing on the training data through the vector conversion module to obtain one or more word segments, and performing feature extraction on the one or more word segments to obtain a feature vector corresponding to each word segment;

[0078] Specifically, after obtaining the training data, the training data is segmented through the vector conversion module to obtain one or more segmented words, wherein the vector conversion module adopts different segmentation standards for Chinese data and non-Chinese data to improve the effect of data segmentation. Then, feature extraction is performed on one or more segmented words according to the preset vocabulary to obtain the feature vector corresponding to each segmented word. Among them, the preset vocabulary is used to convert the segmented words into a language that can be recognized by the computer. In order to make the model applicable on mobile terminals, the model needs to be simplified as much as possible, and the vocabulary size corresponding to the model is large for video memory. The EMB part of the 15w vocabulary easily accounts for 30% of the 1B model + video memory. As an example, the size of the training vocabulary is set to 65029.

[0079] Step S208 , training the initial open question answering model according to the feature vector to obtain a target open question answering model.

[0080] In this embodiment, by training the initial open question answering model according to the feature vector until the prediction effect of the model reaches the expected level, the target open question answering model is outputted, and the target open question answering model can be deployed in a mobile terminal to understand the user's intention and help the user complete a specified task, such as chatting, writing papers, emails and copywriting, etc. Among them, the target open question answering model supports understanding the user's intention from the perspective of Internet attributes, and can also generate corresponding answers from the perspective of Internet attributes.

[0081] In an optional embodiment of the present application, before step S206, the method may further include the following steps:

[0082] The training data is cleaned according to heuristic rules; and global data deduplication processing is performed on the cleaned training data.

[0083] Among them, the heuristic rule is a heuristic-based rule that focuses on the update of feature value recognition technology and aims to solve the defects of single feature code comparison. The purpose of this rule is not to detect all unknown viruses, but to serve as a supplement to feature value scanning technology.

[0084] To avoid introducing too much human bias, most data can be cleaned by heuristic rules. As an example, suppose a large amount of interactive data needs to be collected from the Internet. If the acquired text contains a high proportion of special symbols or short lines, it is likely to be a text with a messy format and low quality. Heuristic rules can be used to automatically identify and exclude such text content by setting a specific threshold.

[0085] In addition, for samples that are difficult to clean using heuristic rules, they can be filtered by carefully training classifiers, and the Index-Large model can be used to annotate sample collection.

[0086] In this embodiment, after the training data is cleaned, the cleaned training data can be further subjected to global data deduplication. Specifically, deduplication of training data is crucial to data quality. By establishing a large-scale deduplication pipeline, a global minimum hash (MinHash) comparison and deduplication of tens of billions of documents can be supported at a time. Different from the deduplication of pre-divided paragraphs and sentences, by supporting the deduplication of strings in documents of any length and any position, difficult-to-find problem texts can be found.

[0087] In an optional embodiment of the present application, the performing global data deduplication processing on the cleaned training data includes:

[0088] Based on the character string dimension of any length or any position, global data deduplication processing is performed on the cleaned training data.

[0089] In this embodiment, the cleaned training data can be deduplicated globally based on the string dimension of any length or any position to improve the deduplication effect of the training data. Specifically, for some data, the deduplication effect of the conventional deduplication scheme in the prior art is not good, such as the month data in English data, which can be accurately deduplicated based on the string dimension.

[0090] In an optional embodiment of the present application, the training data includes Chinese data and non-Chinese data, and step S206 may include the following steps:

[0091] The vector conversion module performs word segmentation processing on the Chinese data in the training data according to the principle that the maximum word length is a first value to obtain one or more word segments; and the vector conversion module performs word segmentation processing on the non-Chinese data in the training data according to the principle that the maximum word length is a second value to obtain one or more word segments; wherein the first value is less than the second value.

[0092] In this embodiment, the training data includes Chinese data and non-Chinese data.

[0093] The inventor found that the open source tool SentencePiece has a natural bias towards Chinese characters when training the BPETokenizer word segmenter, because it regards a Chinese character and a letter as the same coarse and fine granularity, which is unreasonable. In order to adapt to the Chinese granularity, the maximum word length needs to be appropriately reduced. Through the vector conversion module, different maximum word lengths are set for Chinese data and non-Chinese data respectively to improve the encoding effect of the data. As an example, the first value of the maximum length of the Chinese data segmentation is set to 5, and the second value of the maximum length of the non-Chinese data segmentation is set to 16, and the encoding of the Chinese part is trained independently.

[0094] In an optional embodiment of the present application, the training data includes interaction data, and the interaction data includes interactive data and dynamic data.

[0095] In this embodiment, in order to enable the model to understand the intention related to the information on the Internet, the training data may include interactive data, and the interactive data may include interactive data and dynamic data. The interactive data may be comments, messages, likes, reposts, and bullet screen data on various Internet platforms, and the dynamic data may be personal opinions or experience data published on various Internet platforms.

[0096] It should be noted that the data involved in this embodiment (including but not limited to interactive data, dynamic data, books, encyclopedias, papers and STEM-related selected data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0097] In an optional embodiment of the present application, the performing word segmentation processing on the training data by the vector conversion module to obtain one or more word segmentations includes:

[0098] The vector conversion module performs word segmentation processing on the Chinese data in the training data according to the principle of not adding preset placeholders to obtain one or more word segments.

[0099] Among them, the preset placeholder can be used as a placeholder symbol and does not have a specific content meaning. For example, the preset placeholder can be a space.

[0100] Specifically, existing word segmenters are generally developed for English data. For example, Tokenizers such as Llama will automatically add a space before the full text, which is not friendly to Chinese data and makes the "do not predict the first word" principle invalid. In this embodiment, in order to improve the encoding effect of the data, this setting is removed, that is, according to the principle of not adding the leading space, the Chinese data in the training data is segmented to obtain one or more segmented words. The word segmentation method of this embodiment achieves an excellent compression rate while maintaining a Chinese-friendly, small-sized Tokenizer.

[0101] In an optional embodiment of the present application, step S208 may include the following steps:

[0102] In the first training stage, the initial open question answering model is trained according to the feature vector and a preset learning rate; in the second training stage, the preset learning rate is attenuated to obtain a second learning rate, and the initial open question answering model is trained according to the feature vector and the second learning rate to obtain a target open question answering model.

[0103] In this embodiment, the training model is set to include two nodes. In the first training stage (Stable), the initial open question answering model is trained according to the feature vector and the preset learning rate, wherein the preset learning rate is a pre-set fixed learning rate.

[0104] In the second training stage (Decay), the preset learning rate is decayed to obtain the second learning rate, and the initial open question answering model is trained according to the feature vector and the second learning rate to obtain the target open question answering model. Because at the end of the training, it enters the Decay stage, at which time the model enters a fast learning state and can learn by greatly increasing the concentration of selected data.

[0105] Through experimental observation, it is found that the model performance is still improving under more sufficient Decay. The following adjustments are made to the two-stage learning to allow the Decay stage to be fully learned.

[0106] 1. Larger learning rate and larger Decay amplitude: In the fixed learning rate stage, since NormHead is friendly to large learning rates, a larger learning rate can be set to 5 e-4 , Decay ends with the learning rate reduced to 1% for 5 eW6 , which is still a reasonable learning rate range.

[0107] 2. Sufficient Decay corpus: Thanks to the large Decay space of learning rate, up to 400B of data is trained in the Decay stage.

[0108] In an optional embodiment of the present application, the method further includes:

[0109] Receive a first question input by a user; input the first question into the target open question answering model for prediction to generate an answer corresponding to the first question.

[0110] In this embodiment, by deploying the trained target open question-answering model on a mobile terminal, the user can input a first question through the mobile terminal. The first question can be a question describing any information that needs to be obtained, such as "Baiyin is always right, do you know why?", or an instruction describing a certain task, such as "write an essay about maternal love". After receiving the first question input by the user, the first question is input into the target open question-answering model for prediction, and a first answer corresponding to the first question can be generated for the user to review, wherein the target open question-answering model supports understanding the user's intention based on the perspective of Internet attributes, and generates corresponding answers based on the perspective of Internet attributes.

[0111] As an example, Figure 3 A schematic diagram of an answer generated based on a target open question-answering model is shown. The first input question is "Baiyin is always right, do you know why?" After prediction by the target open question-answering model, it can be considered from the perspective of Internet attributes, and the generated answer is "Because what Baiyin said is like a human word said by a patient with advanced cancer. He is like this, why don't you obey him? You have to leave people with a good memory."

[0112] Embodiment 2

[0113] Figure 4 The block diagram of the open question answering model generation device according to the second embodiment of the present application is schematically shown. The device can be divided into one or more program modules, one or more program modules are stored in a storage medium, and are executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment. Figure 4 As shown, the open question answering model generation device 400 may include: a data acquisition module 410, an initial model acquisition module 420, a feature extraction module 430 and a model training module 440, wherein:

[0114] A data acquisition module 410 is used to acquire training data, wherein the training data has the characteristic of avoiding bias;

[0115] An initial model acquisition module 420 is used to acquire an initial open question answering model, wherein the initial open question answering model includes a multi-layer Transformer model and a vector conversion module; wherein the vector conversion module supports independent processing of Chinese data and non-Chinese data;

[0116] A feature extraction module 430 is used to perform word segmentation processing on the training data through the vector conversion module to obtain one or more word segments, and perform feature extraction on the one or more word segments to obtain a feature vector corresponding to each word segment;

[0117] The model training module 440 is used to train the initial open question answering model according to the feature vector to obtain a target open question answering model.

[0118] In an optional embodiment of the present application, the device further includes:

[0119] The data preprocessing module is used to perform data cleaning on the training data according to heuristic rules; and perform global data deduplication processing on the cleaned training data.

[0120] In an optional embodiment of the present application, the data preprocessing module includes:

[0121] The data deduplication processing submodule is used to perform global data deduplication processing on the cleaned training data based on a string dimension of any length or any position.

[0122] In an optional embodiment of the present application, the training data includes interaction data, and the interaction data includes interactive data and dynamic data.

[0123] In an optional embodiment of the present application, the training data includes Chinese data and non-Chinese data, and the feature extraction module 430 includes:

[0124] A first word segmentation submodule is used to perform word segmentation processing on the Chinese data in the training data to obtain one or more word segments according to the principle that the maximum word length is a first value through the vector conversion module; and

[0125] A second word segmentation submodule is used to perform word segmentation processing on the non-Chinese data in the training data to obtain one or more word segments according to the principle that the maximum word length is a second value through the vector conversion module;

[0126] The first value is smaller than the second value.

[0127] In an optional embodiment of the present application, the feature extraction module 430 includes:

[0128] The third word segmentation submodule is used to perform word segmentation processing on the Chinese data in the training data to obtain one or more word segments through the vector conversion module according to the principle of not adding preset placeholders.

[0129] In an optional embodiment of the present application, the model training module 440 includes:

[0130] A first training submodule, configured to train the initial open question answering model according to the feature vector and a preset learning rate in a first training phase;

[0131] The second training submodule is used to, in a second training phase, attenuate the preset learning rate to obtain a second learning rate, and train the initial open question answering model according to the feature vector and the second learning rate to obtain a target open question answering model.

[0132] In an optional embodiment of the present application, the device further includes:

[0133] A question receiving module, used for receiving a first question input by a user;

[0134] An answer generation module is used to input the first question into the target open question answering model for prediction to generate a first answer corresponding to the first question.

[0135] Embodiment 3

[0136] Figure 4 The schematic diagram of the hardware architecture of a computer device 10000 suitable for implementing the open question-answering model generation method according to the third embodiment of the present application is schematically shown. In some embodiments, the computer device 10000 may be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle-mounted terminal, a game console, a virtual device, a workbench, a digital assistant, a set-top box, a robot, etc. In other embodiments, the computer device 10000 may be a rack server, a blade server, a tower server, or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. Figure 4 As shown, the computer device 10000 includes but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate with each other through a system bus. Among them:

[0137] The memory 10010 includes at least one type of computer-readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (such as an SD or DX memory), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 10010 may be an internal storage module of the computer device 10000, such as a hard disk or a memory of the computer device 10000. In other embodiments, the memory 10010 may also be an external storage device of the computer device 10000, such as a plug-in hard disk equipped on the computer device 10000, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 10010 may also include both the internal storage module of the computer device 10000 and its external storage device. In this embodiment, the memory 10010 is generally used to store the operating system and various application software installed in the computer device 10000, such as the program code of the open question answering model generation method, etc. In addition, the memory 10010 can also be used to temporarily store various data that have been output or will be output.

[0138] In some embodiments, the processor 10020 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other chips. The processor 10020 is generally used to control the overall operation of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is used to run the program code stored in the memory 10010 or process data.

[0139] The network interface 10030 may include a wireless network interface or a wired network interface, and the network interface 10030 is generally used to establish a communication link between the computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 10000 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.

[0140] It should be pointed out that Figure 4 Only a computer device having components 10010 - 10030 is shown, but it should be understood that implementation of all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0141] In this embodiment, the open question and answer model generation method stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as processor 10020) to complete the embodiment of the present application.

[0142] Embodiment 4

[0143] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the open question and answer model generation method in the embodiment are implemented.

[0144] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium may also be an external storage device of a computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Of course, the computer-readable storage medium may also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on the computer device, such as the program code of the open question answering model generation method in the embodiment. In addition, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.

[0145] Embodiment 5

[0146] An embodiment of the present application also provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.

[0147] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented by general-purpose computer devices, they can be concentrated on a single computer device, or distributed on a network composed of multiple computer devices, optionally, they can be implemented by executable program codes of computer devices, so that they can be stored in a storage device and executed by the computer device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.

[0148] It should be noted that the above are only preferred embodiments of the present application, and the patent protection scope of the present application is not limited thereto. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for generating an open question answering model, characterized in that: The method comprises: Obtaining training data, wherein the training data has a characteristic of avoiding bias; Acquire an initial open question answering model, wherein the initial open question answering model comprises a multi-layer Transformer model and a vector conversion module; wherein the vector conversion module supports independent processing of Chinese data and non-Chinese data; Performing word segmentation processing on the training data through the vector conversion module to obtain one or more word segments, and performing feature extraction on the one or more word segments to obtain a feature vector corresponding to each word segment; The initial open question answering model is trained according to the feature vector to obtain a target open question answering model.

2. The method for generating an open question answering model according to claim 1, characterized in that: Before the step of performing word segmentation processing on the training data by the vector conversion module to obtain one or more word segments, the method further includes: Performing data cleaning on the training data according to heuristic rules; The cleaned training data is subjected to global data deduplication processing.

3. The method for generating an open question answering model according to claim 2, characterized in that: The performing global data deduplication processing on the cleaned training data includes: Based on the character string dimension of any length or any position, global data deduplication processing is performed on the cleaned training data.

4. The method for generating an open question answering model according to claim 1, characterized in that: The training data includes interaction data, and the interaction data includes interactive data and dynamic data.

5. The method for generating an open question answering model according to claim 1, characterized in that: The training data includes Chinese data and non-Chinese data, and the vector conversion module performs word segmentation processing on the training data to obtain one or more word segments, including: The vector conversion module performs word segmentation processing on the Chinese data in the training data to obtain one or more word segments according to the principle that the maximum word length is the first value; and The vector conversion module performs word segmentation processing on the non-Chinese data in the training data to obtain one or more word segments according to the principle that the maximum word length is the second value; The first value is smaller than the second value.

6. The method for generating an open question answering model according to claim 5, characterized in that: The performing word segmentation processing on the training data by the vector conversion module to obtain one or more word segments includes: The vector conversion module performs word segmentation processing on the Chinese data in the training data according to the principle of not adding preset placeholders to obtain one or more word segments.

7. The method for generating an open question answering model according to claim 1, characterized in that: The step of training the initial open question answering model according to the feature vector to obtain a target open question answering model includes: In a first training phase, the initial open question answering model is trained according to the feature vector and a preset learning rate; In the second training stage, the preset learning rate is attenuated to obtain a second learning rate, and the initial open question answering model is trained according to the feature vector and the second learning rate to obtain a target open question answering model.

8. The method for generating an open question answering model according to claim 1, characterized in that: The method further comprises: Receive a first question from a user; The first question is input into the target open question answering model for prediction to generate an answer corresponding to the first question.

9. An open question answering model generation device, characterized in that: The device comprises: A data acquisition module, used to acquire training data, wherein the training data has the characteristic of avoiding bias; An initial model acquisition module, used to acquire an initial open question answering model, wherein the initial open question answering model includes a multi-layer Transformer model and a vector conversion module; wherein the vector conversion module supports independent processing of Chinese data and non-Chinese data; A feature extraction module, configured to perform word segmentation processing on the training data through the vector conversion module to obtain one or more word segments, and perform feature extraction on the one or more word segments to obtain a feature vector corresponding to each word segment; A model training module is used to train the initial open question answering model according to the feature vector to obtain a target open question answering model.

10. A computer device, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the open question answering model generation method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the open question-answering model generation method according to any one of claims 1 to 8 is implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the open question answering model generation method described in claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Data processing method and device, server and storage medium

    CN112036167A

  • Entity recognition method and device for text, electronic equipment and storage medium

    CN112464667A

  • LLaMA-based finance and taxation question and answer model construction method and device, equipment and medium

    CN117076631A

  • Multi-lingual model training method, apparatus, electronic device and readable storage medium

    US20220171941A1

  • Cross-language data enhancement-based word segmentation method and apparatus

    WO2022148467A1