WO2021208703A1 - 问题解析方法、装置、电子设备及存储介质 - Google Patents

问题解析方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2021208703A1
WO2021208703A1 PCT/CN2021/083188 CN2021083188W WO2021208703A1 WO 2021208703 A1 WO2021208703 A1 WO 2021208703A1 CN 2021083188 W CN2021083188 W CN 2021083188W WO 2021208703 A1 WO2021208703 A1 WO 2021208703A1
Authority
WO
WIPO (PCT)
Prior art keywords
question
sentence
prediction
text
original
Prior art date
Application number
PCT/CN2021/083188
Other languages
English (en)
French (fr)
Inventor
张师琲
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021208703A1 publication Critical patent/WO2021208703A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/335Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/338Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Definitions

  • This application relates to artificial intelligence technology, in particular to a problem analysis method, device, electronic equipment, and computer-readable storage medium.
  • the question analysis model is a model that tries to analyze the intent of the user's question and match the answer.
  • the current problem analysis model mainly has two implementation methods: one is to refine keywords through the TF-IDF algorithm, form a text vector, and then classify them; the other uses machine learning to train multiple classification models.
  • the inventor realizes that although these two methods can achieve the purpose of intent analysis and answer matching of user questions, they have the following shortcomings: 1. Through the TF-IDF algorithm, some scenarios where customer questions are relatively brief, There is a problem that the classification accuracy and precision are not particularly high; 2. By training multiple classification models, the model classification is more and it takes a lot of time to adjust the model parameters and structure, so there is the problem of low efficiency of problem analysis.
  • a problem analysis method provided by this application includes:
  • the question query sentence is used to query the database content, and the question and answer analysis result is obtained and fed back to the query terminal.
  • the present application also provides a problem analysis device, which includes:
  • the model training module is used to obtain the original question set, train the pre-built first language model using the original question set and the preset sentence classification template to obtain the question distribution model; and train the pre-built first language model using the original question set
  • the second language model, the semantic extraction model is obtained;
  • the question analysis module is configured to use the question distribution model to classify the question to be parsed to obtain a classification result; and use the semantic extraction model to perform semantic analysis on the question to be parsed to obtain the semantic analysis result;
  • the question query module is configured to find a matching query sentence template according to the classification result and the semantic analysis result, and obtain a question query sentence according to the query sentence template;
  • the result feedback module is used for querying the content of the database by using the question query sentence, obtaining the Q&A analysis result and feeding it back to the query terminal.
  • This application also provides an electronic device, which includes:
  • At least one processor and,
  • a memory communicatively connected with the at least one processor; wherein,
  • the memory stores computer program instructions executable by the at least one processor, and the computer program instructions are executed by the at least one processor, so that the at least one processor can execute the problem analysis method described below :
  • the question query sentence is used to query the database content, and the question and answer analysis result is obtained and fed back to the query terminal.
  • the present application also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the following problem analysis method is implemented:
  • the question query sentence is used to query the database content, and the question and answer analysis result is obtained and fed back to the query terminal.
  • FIG. 1 is a schematic flowchart of a problem analysis method provided by an embodiment of the application
  • Figure 2 is a schematic diagram of a detailed implementation process of one of the steps in Figure 1;
  • FIG. 3 is a functional module diagram of a problem analysis device provided by an embodiment of the application.
  • FIG. 4 is a schematic structural diagram of an electronic device that implements the problem analysis method provided by an embodiment of the application.
  • the embodiment of the present application provides a method for problem analysis, and the execution subject of the method for problem analysis includes but is not limited to at least one of the electronic devices that can be configured to execute the method provided in the embodiment of the present application, such as a server and a terminal.
  • the problem analysis method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform.
  • the server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
  • the problem analysis method includes:
  • the original question set comes from customer questions collected from different fields.
  • the customer problem can be retrieved from the background database of a public customer problem website, or can be retrieved from a storage node in the blockchain.
  • the questions in the original question set include triplet information, and the triplet refers to a ternary relationship formed by a relationship between an entity and an entity.
  • the triplet may be an SPO triplet, that is, "Subject-Predicate-Object", and the SPO triplet can be used to simply describe the entity and the entity Relationship between.
  • the SPO triplet is obtained as "cat-belongs-feline" animal.
  • the preset sentence classification template may be eight templates set according to the hexagram theory.
  • the hexagram theory is a combination of ancient mathematics, physics, chemistry and philosophy, and it can explain everything in the world.
  • the Zhouyi includes eight basic symbols consisting of the symbol "" representing Yang Yao and the symbol “" representing Yin Yao, which are respectively dry Kun shock Sunda Hom Leave Gen against Among them, the symbol "" of Yang Yao has an unknown meaning, and the symbol of Yin Yao "" has a known meaning.
  • the three-tuple presented in any problem can be explained by the eight kinds of symbols.
  • the three lines represent the state of spo triples, namely, known S, known P, and unknown O. Therefore, for all known S, known P, and unknown O problems, such as "The CEO of Company A is anyone can be classified under this template.
  • Another example, with Zhen Corresponding Sunda The template indicates that the "host” (S) and “predicate” (P) are unknown, and the "guest” (O) is known.
  • the pre-built first language model includes a BERT (Bidirectional Encoder Representations from Transformers) model based on intensive training and a first classification function
  • the BERT model includes an encoding conversion layer (Transformer Encoder)
  • the code conversion layer includes a first training layer and a second training layer.
  • the first classification function may use the currently published Softmax function, and the Softmax function is used to divide the problem into the eight templates.
  • the first training layer can optionally replace the training layer (MaskedLM) with a currently published mark.
  • MaskedLM is described as: given a sentence in the original question set, randomly erase and replace one or several words in this sentence, and it is required to predict what the replaced words are based on the remaining vocabulary. For words that are erased in the original sentence, a special symbol [MASK] is used in 80% of cases, an arbitrary word is used in 10% of cases, and the original word is kept unchanged in the remaining 10%, and the original replacement text set is obtained; Traverse the text in the original replacement text set, predict the replaced words in the text, and obtain a prediction problem set.
  • the main advantage of MaskedLM is that when predicting a vocabulary, the model does not know whether the vocabulary corresponding to the input position is the correct vocabulary (10% probability is correct), which forces the model to rely more on context information to predict the vocabulary and give
  • the model has a certain error correction capability.
  • the embodiment of the present application can use the MaskedLM to erase the entities or relationships in the SPO triples in the original problem set, and according to the above prediction, it is possible to accurately determine the lack of triples in the problem.
  • the second training layer may select the currently published next sentence prediction training layer (NextSentencePrediction).
  • the next sentence prediction training layer can predict the next sentence through the previous sentence through training, so as to capture the dependency relationship between sentences.
  • the training description of the next sentence prediction training layer is as follows: in the original question set, a special character [CLS] is added to indicate the beginning of a sentence, and [SEP] is used to indicate the boundary between two different sentences.
  • the output result of [CLS] can be used to judge whether these two sentences should be connected together, and the output result of [CLS] can be summarized to get the initial problem set.
  • the next sentence prediction training layer randomly selects 50% of the sentence pairs that are not shuffled and sorted from the prediction question set, selects 50% of the sentence pairs that are shuffled and sorted, and summarizes all word order pairs to obtain a sentence pair set. Concentrated sentence pairs are judged.
  • the Softmax function can determine the type of sentence based on the output result of the [CLS], and classify all sentences into eight pre-labeled templates.
  • the pre-built second language model includes a BERT (Bidirectional Encoder Representations from Transformers) model based on intensive training and a two-classifier.
  • BERT Bidirectional Encoder Representations from Transformers
  • the training a pre-built second language model using the original question set to obtain a semantic extraction model includes:
  • the semantic extraction model completed by the training is generated.
  • the embodiment of this application uses the following formula to calculate the accuracy rate L:
  • e r, s are entities that are truly related, e r, c are predicted entities that are related, R is the number of all entities, and r is the r-th entity.
  • the extracting entity information in the original question set, and predicting the entity and entity relationship corresponding to the entity information according to the entity information includes:
  • the coding vector as a condition to perform layer standardization on the coding sequence, and predict the entity and entity relationship corresponding to the entity information on the sequence after the layer standardization.
  • the original problem set is vectorized, and the two classifiers are used for prediction.
  • the two classifiers can use the currently published SVM two classifiers, using The SVM two classifier can accurately predict the entity information in the coding sequence.
  • the layer normalization (LayerNormalization) is an independent algorithm that normalizes the coding sequence, thereby accelerating the prediction and training of the model.
  • the use of the problem distribution model to classify the problem to be parsed to obtain the classification result includes:
  • S21 Use the second training layer in the question distribution model to identify the dependency relationship between sentences in the question text in the prediction question, to obtain an initial question;
  • the first training layer may be the mark replacement training layer (MaskedLM)
  • the second training layer may be the next sentence prediction training layer (NextSentencePrediction)
  • the classification function may be a Softmax function.
  • said using the first training layer in the question distribution model to identify the missing information of the question text in the question to be parsed to obtain the prediction question includes:
  • the first training layer given a sentence in the original question set, randomly erase and replace one or more words in this sentence, and predict what the replaced words are based on the remaining words .
  • a special symbol [MASK] is used in 80% of the cases, an arbitrary word is used in 10% of the cases, and the original vocabulary remains unchanged in the remaining 10%, and the original replacement problem is obtained.
  • the original text in the question is replaced, and the word to be replaced in the text is predicted to obtain the prediction question.
  • the use of the second training layer in the question distribution model to identify the dependency relationship between sentences in the question text in the prediction question to obtain the initial question includes:
  • the embodiment of the present application uses the semantic extraction model to perform semantic analysis on the question to be parsed to obtain the entities and entity relationships in the question to be parsed, and summarize the entities and entity relationships to obtain the semantic analysis result.
  • the embodiment of the present application searches for a matching query sentence template according to the preset classification result and the mapping relationship between the semantic analysis result and the query sentence template.
  • the query statement in the embodiment of the present application may use a SQL statement.
  • the query sentence template corresponds to the above eight kinds of templates, and each template corresponds to one kind of query sentence template.
  • the question to be resolved submitted by the user is “Who is the CEO of Company A?”
  • the question distribution model first classifies the question to “shock "Template corresponding to the type, and then extract the three-tuple semantics of the question to be parsed, predict the entity in the question to be parsed and the entity relationship between the entities, to obtain the semantic analysis result
  • the semantic analysis result includes the entity ( S) "Company A” is known, the relationship (P) "CEO" is known, and the entity (O) is unknown.
  • the query sentence preset in the template and the semantic analysis result are mapped using the preset SQL sentence to obtain the question query sentence.
  • the database may be various databases that are currently publicly available, such as MySQL, oracle, graph database neo4j, HBAS, etc.
  • the query statement can select different query statements according to different databases.
  • the query terminal can be a computer or other equipment.
  • the embodiments of this application are based on two BERT models, the first model is only used for classification, and the second model is used for semantic extraction.
  • the first model is only used for classification
  • the second model is used for semantic extraction.
  • the first model is required to determine how many relationships are in the problem to be resolved It is predicted, classified, and then semantic analysis is performed on the analytical questions to be analyzed. Combining the query sentences corresponding to different classification templates, the analytical questions can be more accurately analyzed for Q&A.
  • FIG. 3 it is a functional block diagram of a problem analysis device provided by an embodiment of the present application.
  • the problem analysis apparatus 100 described in this application can be installed in an electronic device.
  • the question analysis device 100 may include a model training module 101, a question analysis module 102, a question query module 103, and a result feedback module 104.
  • the module described in this application can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the information processing module 101 is configured to obtain an original question set, use the original question set and a preset sentence classification template to train a pre-built first language model, obtain a question distribution model, and train using the original question set
  • the pre-built second language model obtains the semantic extraction model.
  • the original question set comes from customer questions collected from different fields.
  • the customer problem can be retrieved from the background database of the public customer problem website, or can be retrieved from a storage node in the blockchain.
  • the questions in the original question set include triplet information, and the triplet refers to a ternary relationship formed by a relationship between an entity and an entity.
  • the triplet may be an SPO triplet, that is, "Subject-Predicate-Object", and the SPO triplet can be used to simply describe the entity and the entity Relationship between.
  • the SPO triplet is obtained as "cat-belongs-feline" animal.
  • the preset sentence classification template may be eight templates set according to the hexagram theory.
  • the hexagram theory is a combination of ancient mathematics, physics, chemistry and philosophy, and it can explain everything in the world.
  • the Zhouyi includes eight basic symbols consisting of the symbol "" representing Yang Yao and the symbol “" representing Yin Yao, which are respectively dry Kun shock Sunda Hom Leave Gen against Among them, the symbol "" of Yang Yao has an unknown meaning, and the symbol of Yin Yao "" has a known meaning.
  • the three-tuple presented in any problem can be explained by the eight kinds of symbols.
  • the three lines represent the state of spo triples, namely, known S, known P, and unknown O. Therefore, for all known S, known P, and unknown O problems, such as "The CEO of Company A is anyone can be classified under this template.
  • Another example, with Zhen Corresponding Sunda The template indicates that the "host” (S) and “predicate” (P) are unknown, and the "guest” (O) is known.
  • the pre-built first language model includes a BERT (Bidirectional Encoder Representations from Transformers) model based on intensive training and a first classification function
  • the BERT model includes an encoding conversion layer (Transformer Encoder)
  • the code conversion layer includes a first training layer and a second training layer.
  • the first classification function may use the currently published Softmax function, and the Softmax function is used to divide the problem into the eight templates.
  • the first training layer can optionally replace the training layer (MaskedLM) with a currently published mark.
  • MaskedLM is described as: given a sentence in the original question set, randomly erase and replace one or several words in this sentence, and it is required to predict what the replaced words are based on the remaining vocabulary. For words that are erased in the original sentence, a special symbol [MASK] is used in 80% of cases, an arbitrary word is used in 10% of cases, and the original word is kept unchanged in the remaining 10%, and the original replacement text set is obtained; Traverse the text in the original replacement text set, predict the replaced words in the text, and obtain a prediction problem set.
  • the main advantage of MaskedLM is that when predicting a vocabulary, the model does not know whether the vocabulary corresponding to the input position is the correct vocabulary (10% probability is correct), which forces the model to rely more on context information to predict the vocabulary and give
  • the model has a certain error correction capability.
  • the embodiment of the present application can use the MaskedLM to erase the entities or relationships in the SPO triples in the original problem set, and according to the above prediction, it is possible to accurately determine the lack of triples in the problem.
  • the second training layer may select the currently published next sentence prediction training layer (NextSentencePrediction).
  • the next sentence prediction training layer can predict the next sentence through the previous sentence through training, so as to capture the dependency relationship between sentences.
  • the training description of the next sentence prediction training layer is as follows: in the original question set, a special character [CLS] is added to indicate the beginning of a sentence, and [SEP] is used to indicate the boundary between two different sentences.
  • the output result of [CLS] can be used to judge whether these two sentences should be connected together, and the output result of [CLS] can be summarized to get the initial problem set.
  • the next sentence prediction training layer randomly selects 50% of the sentence pairs that are not shuffled and sorted from the prediction question set, selects 50% of the sentence pairs that are shuffled and sorted, and summarizes all word order pairs to obtain a sentence pair set. Concentrated sentence pairs are judged.
  • the Softmax function can determine the type of sentence based on the output result of the [CLS], and classify all sentences into eight pre-labeled templates.
  • the pre-built second language model includes a BERT (Bidirectional Encoder Representations from Transformers) model based on intensive training and a two-classifier.
  • BERT Bidirectional Encoder Representations from Transformers
  • the model training module 101 obtains the semantic extraction model through the following operations:
  • the semantic extraction model completed by the training is generated.
  • the embodiment of this application uses the following formula to calculate the accuracy rate L:
  • e r, s are entities that are truly related, e r, c are predicted entities that are related, R is the number of all entities, and r is the r-th entity.
  • model training module 101 predicts the entity corresponding to the entity information and the entity relationship through the following operations:
  • the coding vector as a condition to perform layer standardization on the coding sequence, and predict the entity and entity relationship corresponding to the entity information on the sequence after the layer standardization.
  • the original problem set is vectorized, and the two classifiers are used for prediction.
  • the two classifiers can use the currently published SVM two classifiers, using The SVM two classifier can accurately predict the entity information in the coding sequence.
  • the layer normalization (LayerNormalization) is an independent algorithm that normalizes the coding sequence, thereby accelerating the prediction and training of the model.
  • the question analysis module 102 is configured to use the question distribution model to classify the question to be parsed to obtain a classification result, and use the semantic extraction model to perform semantic analysis on the question to be parsed to obtain a semantic analysis result.
  • the problem analysis module 102 obtains the classification result through the following operations:
  • the question text in the initial question is classified according to the sentence classification template to obtain the classification result.
  • the first training layer may be the mark replacement training layer (MaskedLM)
  • the second training layer may be the next sentence prediction training layer (NextSentencePrediction)
  • the classification function may be a Softmax function.
  • the problem analysis module 102 obtains the prediction problem through the following operations:
  • the first training layer given a sentence in the original question set, randomly erase and replace one or more words in this sentence, and predict what the replaced words are based on the remaining words .
  • a special symbol [MASK] is used in 80% of the cases, an arbitrary word is used in 10% of the cases, and the original vocabulary remains unchanged in the remaining 10%, and the original replacement problem is obtained.
  • the original text in the question is replaced, and the word to be replaced in the text is predicted to obtain the prediction question.
  • the problem analysis module 102 obtains the initial problem through the following operations:
  • the embodiment of the present application uses the semantic extraction model to perform semantic analysis on the question to be parsed to obtain the entities and entity relationships in the question to be parsed, and summarize the entities and entity relationships to obtain the semantic analysis result.
  • the question query module 103 is configured to find a matching query sentence template according to the classification result and the semantic analysis result, and obtain a question query sentence according to the query sentence template.
  • the embodiment of the present application searches for a matching query sentence template according to the preset classification result and the mapping relationship between the semantic analysis result and the query sentence template.
  • the query statement in the embodiment of the present application may use a SQL statement.
  • the query sentence template corresponds to the above eight kinds of templates, and each template corresponds to one kind of query sentence template.
  • the question to be resolved submitted by the user is “Who is the CEO of Company A?”
  • the question distribution model first classifies the question to “shock "Template corresponding to the type, and then extract the three-tuple semantics of the question to be parsed, predict the entity in the question to be parsed and the entity relationship between the entities, to obtain the semantic analysis result
  • the semantic analysis result includes the entity ( S) "Company A” is known, the relationship (P) "CEO" is known, and the entity (O) is unknown.
  • the query sentence preset in the template and the semantic analysis result are mapped using the preset SQL sentence to obtain the question query sentence.
  • the result feedback module 104 is configured to use the question query sentence to query the content of the database, obtain the question and answer analysis result, and feed it back to the query terminal.
  • the database may be various databases that are currently publicly available, such as MySQL, oracle, graph database neo4j, HBAS, etc.
  • the query statement can select different query statements according to different databases.
  • the query terminal can be a computer or other equipment.
  • the embodiments of this application are based on two BERT models, the first model is only used for classification, and the second model is used for semantic extraction.
  • the first model is only used for classification
  • the second model is used for semantic extraction.
  • the first model is required to determine how many relationships are in the problem to be resolved It is predicted, classified, and then semantic analysis is performed on the analytical questions to be analyzed. Combining the query sentences corresponding to different classification templates, the analytical questions can be more accurately analyzed for Q&A.
  • FIG. 4 it is a schematic structural diagram of an electronic device for implementing a problem analysis method provided by an embodiment of the present application.
  • the electronic device 1 may include a processor 10, a memory 11, and a bus, and may also include a computer program stored in the memory 11 and running on the processor 10, such as a problem analysis program 12.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium may be volatile or nonvolatile.
  • the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, for example, a mobile hard disk of the electronic device 1.
  • the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (SmartMediaCard, SMC), and a secure digital (SecureDigital, SD) equipped on the electronic device 1. Card, flash card (FlashCard), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can be used not only to store application software and various data installed in the electronic device 1, such as the code of the problem analysis program 12, etc., but also to temporarily store data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Central Processing Unit (CPU), microprocessor, digital processing chip, graphics processor and a combination of various control chips, etc.
  • the processor 10 is the control core (ControlUnit) of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules stored in the memory 11 (such as problem analysis). Programs, etc.), and call data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • ControlUnit the control core of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules stored in the memory 11 (such as problem analysis). Programs, etc.), and call data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • the bus may be a peripheral component interconnection standard (PCI for short) bus or an extended industry standard architecture (EISA for short) bus or the like.
  • PCI peripheral component interconnection standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection and communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 4 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 4 does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure. Components, or a combination of certain components, or different component arrangements.
  • the electronic device 1 may also include a power source (such as a battery) for supplying power to various components.
  • the power source may be logically connected to the at least one processor 10 through a power management device, thereby controlling power
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators.
  • the electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface.
  • the network interface may include a wired interface and/or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may also include a user interface.
  • the user interface may be a display (Display) and an input unit (such as a keyboard (Keyboard)).
  • the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light emitting diode) touch device, etc.
  • the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
  • the problem analysis program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, it can realize:
  • the question query sentence is used to query the database content, and the question and answer analysis result is obtained and fed back to the query terminal.
  • the integrated module/unit of the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the computer-readable storage medium may be volatile or non-volatile.
  • the computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read -OnlyMemory).
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional modules.
  • the blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种问题解析方法,涉及人工智能技术,该方法包括:利用原始问题集及预先设定的语句分类模板训练得到问题分发模型及语义抽取模型,利用所述问题分发模型对待解析问题进行分类,得到分类结果,利用所述语义抽取模型对所述待解析问题进行语义解析,得到语义解析结果,根据所述分类结果以及所述语义解析结果查找相匹配的查询语句模板,根据所述查询语句模板得到问题查询语句,并利用所述问题查询语句查询数据库内容,得到问答解析结果并提交给查询终端。还涉及区块链技术,所述问答解析结果可存储于区块链的节点。还提出一种问题解析装置、电子设备以及计算机可读存储介质。可以解决问题解析效率低下的问题。

Description

问题解析方法、装置、电子设备及存储介质
本申请要求于2020年11月19日提交中国专利局、申请号为202011305368.0,发明名称为“问题解析方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术,尤其涉及一种问题解析方法、装置、电子设备及计算机可读存储介质。
背景技术
问题解析模型是尝试对用户问题进行意图分析和答案匹配的模型。当前的问题解析模型主要有两种实施方式:一种是通过TF-IDF算法提炼关键词,组成文本向量,再对其进行分类的方式;另一种采用机器学习的方式训练多个分类模型。发明人意识到,虽然这两种方式都可达到对用户问题进行意图分析和答案匹配的目的,但有以下缺陷:1、通过TF-IDF算法的方式,对某些客户问题较为简短的场景,存在分类准确率和精度都不是特别高的问题;2、通过训练多个分类模型的方式,模型分类较多且需要花大量时间调整模型参数和结构,因此存在问题解析效率低下的问题。
发明内容
本申请提供的一种问题解析方法,包括:
获取原始问题集,利用所述原始问题集以及预先设定的语句分类模板训练预构建的第一语言模型,得到问题分发模型;及利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型;
利用所述问题分发模型对待解析问题进行分类,得到分类结果;及利用所述语义抽取模型对所述待解析问题进行语义解析,得到语义解析结果;
根据所述分类结果以及所述语义解析结果查找相匹配的查询语句模板,根据所述查询语句模板得到问题查询语句;
利用所述问题查询语句查询数据库内容,得到问答解析结果并反馈给查询终端。
本申请还提供一种问题解析装置,所述装置包括:
模型训练模块,用于获取原始问题集,利用所述原始问题集以及预先设定的语句分类模板训练预构建的第一语言模型,得到问题分发模型;及利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型;
问题解析模块,用于利用所述问题分发模型对待解析问题进行分类,得到分类结果;及利用所述语义抽取模型对所述待解析问题进行语义解析,得到语义解析结果;
问题查询模块,用于根据所述分类结果以及所述语义解析结果查找相匹配的查询语句模板,根据所述查询语句模板得到问题查询语句;
结果反馈模块,用于利用所述问题查询语句查询数据库内容,得到问答解析结果并反馈给查询终端。
本申请还提供一种电子设备,所述电子设备包括:
至少一个处理器;以及,
与所述至少一个处理器通信连接的存储器;其中,
所述存储器存储有可被所述至少一个处理器执行的计算机程序指令,所述计算机程序 指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下所述的问题解析方法:
获取原始问题集,利用所述原始问题集以及预先设定的语句分类模板训练预构建的第一语言模型,得到问题分发模型;及利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型;
利用所述问题分发模型对待解析问题进行分类,得到分类结果;及利用所述语义抽取模型对所述待解析问题进行语义解析,得到语义解析结果;
根据所述分类结果以及所述语义解析结果查找相匹配的查询语句模板,根据所述查询语句模板得到问题查询语句;
利用所述问题查询语句查询数据库内容,得到问答解析结果并反馈给查询终端。
为了解决上述问题,本申请还提供一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现如下所述的问题解析方法:
获取原始问题集,利用所述原始问题集以及预先设定的语句分类模板训练预构建的第一语言模型,得到问题分发模型;及利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型;
利用所述问题分发模型对待解析问题进行分类,得到分类结果;及利用所述语义抽取模型对所述待解析问题进行语义解析,得到语义解析结果;
根据所述分类结果以及所述语义解析结果查找相匹配的查询语句模板,根据所述查询语句模板得到问题查询语句;
利用所述问题查询语句查询数据库内容,得到问答解析结果并反馈给查询终端。
附图说明
图1为本申请一实施例提供的问题解析方法的流程示意图;
图2为图1中其中一个步骤的详细实施流程示意图;
图3为本申请一实施例提供的问题解析装置的功能模块图;
图4为本申请一实施例提供的实现所述问题解析方法的电子设备的结构示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例提供一种问题解析方法,所述问题解析方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述问题解析方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。
参照图1所示,为本申请一实施例提供的问题解析方法的流程示意图。在本实施例中,所述问题解析方法包括:
S1、获取原始问题集,利用所述原始问题集以及预先设定的语句分类模板训练预构建的第一语言模型,得到问题分发模型,及利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型。
本申请实施例中,所述原始问题集来自于从不同领域采集的客户问题。所述客户问题可以从公开的客户问题网站的后台数据库中检索获取,也可以从区块链中的存储节点中获取。本申请实施例中,所述原始问题集中的问题包括三元组信息,所述三元组是指实体与实体关系构成的三元关系。本申请实施例中,所述三元组可以为SPO三元组,即“主(Subject)-谓(Predicate)-宾(Object)”,利用所述SPO三元组可以简单地描述实体 与实体间的关系。比如,问题文本为“猫属于猫科动物”,主语“猫”,宾语“猫科动物”作为实体信息,宾语“属于”作为实体关系,则得到SPO三元组为“猫-属于-猫科动物”。
优选地,本申请实施例中,所述预先设定的语句分类模板可以是根据卦象理论设置的八种模板。所述卦象理论是古代数理化与哲学的一种结合,它可以解释世间万物。《周易》中包括由代表阳爻的符号“”和代表阴爻的符号“”组成的八种基本符号,分别是乾
Figure PCTCN2021083188-appb-000001
Figure PCTCN2021083188-appb-000002
Figure PCTCN2021083188-appb-000003
Figure PCTCN2021083188-appb-000004
Figure PCTCN2021083188-appb-000005
Figure PCTCN2021083188-appb-000006
Figure PCTCN2021083188-appb-000007
Figure PCTCN2021083188-appb-000008
其中,阳爻的符号“”为未知的意思,阴爻的符号“”为已知的意思。本申请实施例中,对于任何问题所呈现的三元组,都可以用所述八种符号来解释。以震
Figure PCTCN2021083188-appb-000009
为例,三条线分别代表spo三元组的状态,即已知S、已知P、未知O,因此,对于所有已知S、已知P、未知O的问题,如“A公司的CEO是谁”都可划为此模板下。又如,与震
Figure PCTCN2021083188-appb-000010
对应的巽
Figure PCTCN2021083188-appb-000011
模板表示“主”(S)与“谓”(P)未知,“宾”(O)已知。
较佳地,所述预构建的第一语言模型包括基于强化训练的BERT(BidirectionalEncoderRepresentationsfromTransformers,来自变换器的双向编码器表征量)模型和第一分类函数,所述BERT模型包括编码转换层(TransformerEncoder),所述编码转换层包括第一训练层和第二训练层。所述第一分类函数可以使用当前已公开的Softmax函数,所述Softmax函数用来将问题划分到所述八种模板下。
具体地,所述第一训练层可选用当前已公开的标记替代训练层(MaskedLM)。所述MaskedLM的训练描述为:给定所述原始问题集中的一句话,随机抹去并替换这句话中的一个或几个词,要求根据剩余词汇预测被替换的几个词分别是什么。对于在原句中被抹去的词汇,80%情况下采用一个特殊符号[MASK]替换,10%情况下采用一个任意词替换,剩余10%情况下保持原词汇不变,得到原始替换文本集;遍历所述原始替换文本集中的文本,预测所述文本中被替换的词,得到预测问题集。MaskedLM的主要好处是:预测一个词汇时,模型并不知道输入对应位置的词汇是否为正确的词汇(10%概率为正确),这就迫使模型更多地依赖于上下文信息去预测词汇,并且赋予了模型一定的纠错能力。本申请实施例可以利用所述MaskedLM抹去原始问题集中的SPO三元组中的实体或关系,根据上述预测,可以准确的判断问题中三元组的缺失情况。
具体地,所述第二训练层可选用当前已公开的下一句预测训练层(NextSentencePrediction)。所述下一句预测训练层可以通过训练通过前一句话预测下一句话,以捕获句子之间的依赖关系。所述下一句预测训练层的训练描述为:在所述原始问题集中通过添加特殊的字符[CLS]表示句子的开始,利用[SEP]用来表示两个不同句子之间的边界。通过[CLS]的输出结果可以判断这两个句子是否应该接在一起,汇总所述[CLS]的输出结果得到初始问题集。所述下一句预测训练层从所述预测问题集中随机选择50%未打乱排序的语句对,选取50%打乱排序的语句对,汇总所有语序对,得到语句对集,对所述语句对集中的语句对进行判断。
所述Softmax函数通过训练可以基于所述[CLS]的输出结果来判断句子的种类,将所有句子分类至预先标注的八个模板内。
进一步地,所述预构建的第二语言模型包括基于强化训练的BERT(BidirectionalEncoderRepresentationsfromTransformers,来自变换器的双向编码器表征量)模型和二分类器。
优选地,所述利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型,包括:
利用所述第二语言模型提取所述原始问题集中的实体信息,并根据所述实体信息预测与所述实体信息对应的实体和实体关系;
计算所述实体信息预测的准确率;
当所述预测的准确率高于预设的阈值时,生成所述训练完成的语义抽取模型。
其中,本申请实施例利用下述公式计算准确率L:
Figure PCTCN2021083188-appb-000012
e r,s为真正有关系的实体,e r,c为预测的有关系的实体,R为所有实体个数,r为第r个实体。
进一步地,所述提取所述原始问题集中的实体信息,并根据所述实体信息预测与所述实体信息对应的实体和实体关系,包括:
将所述原始问题集转化为原始序列,并利用所述第二语言模型的编码器对所述原始序列进行编码,得到编码序列;
利用所述二分类器预测所述编码序列中的实体信息;
从所述编码序列中抽取出所述实体信息首尾对应的编码向量;
以所述编码向量作为条件对所述编码序列做层标准化,对所述层标准化后的序列预测与所述实体信息对应的实体和实体关系。
其中,通过将所述原始问题集转化为原始编码,将所述原始问题集向量化,并利用所述二分类器进行预测,所述二分类器可以使用当前已公开的SVM二分类器,利用所述SVM二分类器可以准确地预测所述编码序列中的实体信息。所述层标准化(LayerNormalization)是一个独立的算法,对所述编码序列做归一化处理,从而加速模型的预测和训练。
S2、利用所述问题分发模型对待解析问题进行分类,得到分类结果,及利用所述语义抽取模型对所述待解析问题进行语义解析,得到语义解析结果。
详细地,参考图2所示,所述利用所述问题分发模型对待解析问题进行分类,得到分类结果,包括:
S20、利用所述问题分发模型中的第一训练层识别所述待解析问题中的问题文本的缺失信息,得到预测问题;
S21、利用所述问题分发模型中的第二训练层识别所述预测问题中的问题文本中句子之间的依赖关系,得到初始问题;
S22、利用所述问题分发模型中的分类函数,对所述初始问题中的问题文本按照所述语句分类模板进行分类,得到所述分类结果。
其中,所述第一训练层可以为所述标记替代训练层(MaskedLM),所述第二训练层可以为所述下一句预测训练层(NextSentencePrediction),所述分类函数可以为Softmax函数。
优选地,所述利用所述问题分发模型中的第一训练层识别所述待解析问题中的问题文本的缺失信息,得到预测问题,包括:
遍历所述待解析问题中的问题文本,随机替换所述问题文本内的一个或多个词,得到原始替换问题;
遍历所述原始替换问题中的文本,预测所述文本中被替换的词,得到所述预测问题。
其中,对于所述第一训练层:给定所述原始问题集中的一句话,随机抹去并替换这句话中的一个或多个词,根据剩余词汇预测被替换的多个词分别是什么。对于在原句中被抹去的词汇,80%情况下采用一个特殊符号[MASK]替换,10%情况下采用一个任意词替换,剩余10%情况下保持原词汇不变,得到原始替换问题,遍历所述原始替换问题中的文本,预测所述文本中被替换的词,得到所述预测问题。
较佳地,所述利用所述问题分发模型中的第二训练层识别所述预测问题中的问题文本中句子之间的依赖关系,得到初始问题,包括:
将所述预测问题中的语句排列顺序打乱,得到乱序预测问题;
从所述预测问题中选取第一数量的未打乱排序的语句对,及从所述乱序预测问题中选 取第二数量的打乱排序的语句对,汇总所有语序对,得到语句对集;
遍历所述语句对集中的语句对,判断所述语句对中第二句话在文本中是否紧跟在第一句话之后,以得到排序正确的语句,其中,当语句对中第二句话在文本中紧跟在第一句话之后,则这两句话为排序正确的语句;
汇总所有排序正确的语句,得到所述初始问题。
其中,对于所述第二训练层:在所述预测问题中通过添加特殊的字符[CLS]表示句子的开始,利用[SEP]用来表示两个不同句子之间的边界。通过[CLS]的输出结果可以判断这两个句子是否应该接在一起,汇总所述[CLS]的输出结果得到初始问题集。比如,从预测问题集中随机选择50%(第一数量)未打乱排序的语句对,选取50%(第二数量)打乱排序的语句对,汇总所有语序对,得到语句对集,对所述语句对集中的语句对进行判断。
进一步地,本申请实施例利用所述语义抽取模型对所述待解析问题进行语义解析,得到所述待解析问题中的实体和实体关系,汇总所述实体和实体关系得到语义解析结果。
S3、根据所述分类结果以及所述语义解析结果查找相匹配的查询语句模板,根据所述查询语句模板得到问题查询语句。
本申请实施例根据预先设置的分类结果以及语义解析结果与查询语句模板之间的映射关系,查找相匹配的查询语句模板。
优选地,本申请实施例中所述查询语句可以使用SQL语句。所述查询语句模板对应于上述八种模板,每种模板对应于一种查询语句模板。
比如,用户提交的待解析问题为“A公司的CEO是谁?”,所述问题分发模型先将所述问题分类至“震
Figure PCTCN2021083188-appb-000013
”模板对应的类型,再对所述待解析问题进行三元组语义抽取,预测所述待解析问题中的实体及实体之间的实体关系,得到语义解析结果,所述语义解析结果包括实体(S)“A公司”已知,关系(P)“CEO”已知,实体(O)未知,将“震
Figure PCTCN2021083188-appb-000014
”模板中预设的查询语句与所述语义解析结果利用预设的SQL语句进行映射,得到问题查询语句。
S4、利用所述问题查询语句查询数据库内容,得到问答解析结果并反馈给查询终端。
所述数据库可以为当前已公开的各种数据库,如MySQL,oracle,图数据库neo4j,HBAS等。同时,所述查询语句可以根据数据库的不同选用不同的查询语句。利用所述查询终端可以为计算机等设备。
本申请实施例中基于两个BERT模型,第一个模型仅用于分类,第二个模型用于语义抽取。对于待解析问题,如果只采用第二个模型,根据当前的关系只能预测出一种三元组,不符合实际场景的应用,所以先需要第一个模型将待解析问题中有多少种关系预测出来,进行分类,然后再对待解析问题进行语义分析,结合不同分类模板对应的查询语句,可以更加精确地对待解析问题进行问答解析。
如图3所示,是本申请一实施例提供的问题解析装置的功能模块图。
本申请所述问题解析装置100可以安装于电子设备中。根据实现的功能,所述问题解析装置100可以包括模型训练模块101、问题解析模块102、问题查询模块103及结果反馈模块104。本申请所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。
在本实施例中,关于各模块/单元的功能如下:
所述信息处理模块101,用于获取原始问题集,利用所述原始问题集以及预先设定的语句分类模板训练预构建的第一语言模型,得到问题分发模型,及利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型。
本申请实施例中,所述原始问题集来自于从不同领域采集的客户问题。所述客户问题可以从公开的客户问题网站的后台数据库中检索获取,也可以从区块链中的存储节点中获 取。本申请实施例中,所述原始问题集中的问题包括三元组信息,所述三元组是指实体与实体关系构成的三元关系。本申请实施例中,所述三元组可以为SPO三元组,即“主(Subject)-谓(Predicate)-宾(Object)”,利用所述SPO三元组可以简单地描述实体与实体间的关系。比如,问题文本为“猫属于猫科动物”,主语“猫”,宾语“猫科动物”作为实体信息,宾语“属于”作为实体关系,则得到SPO三元组为“猫-属于-猫科动物”。
优选地,本申请实施例中,所述预先设定的语句分类模板可以是根据卦象理论设置的八种模板。所述卦象理论是古代数理化与哲学的一种结合,它可以解释世间万物。《周易》中包括由代表阳爻的符号“”和代表阴爻的符号“”组成的八种基本符号,分别是乾
Figure PCTCN2021083188-appb-000015
Figure PCTCN2021083188-appb-000016
Figure PCTCN2021083188-appb-000017
Figure PCTCN2021083188-appb-000018
Figure PCTCN2021083188-appb-000019
Figure PCTCN2021083188-appb-000020
Figure PCTCN2021083188-appb-000021
Figure PCTCN2021083188-appb-000022
其中,阳爻的符号“”为未知的意思,阴爻的符号“”为已知的意思。本申请实施例中,对于任何问题所呈现的三元组,都可以用所述八种符号来解释。以震
Figure PCTCN2021083188-appb-000023
为例,三条线分别代表spo三元组的状态,即已知S、已知P、未知O,因此,对于所有已知S、已知P、未知O的问题,如“A公司的CEO是谁”都可划为此模板下。又如,与震
Figure PCTCN2021083188-appb-000024
对应的巽
Figure PCTCN2021083188-appb-000025
模板表示“主”(S)与“谓”(P)未知,“宾”(O)已知。
较佳地,所述预构建的第一语言模型包括基于强化训练的BERT(BidirectionalEncoderRepresentationsfromTransformers,来自变换器的双向编码器表征量)模型和第一分类函数,所述BERT模型包括编码转换层(TransformerEncoder),所述编码转换层包括第一训练层和第二训练层。所述第一分类函数可以使用当前已公开的Softmax函数,所述Softmax函数用来将问题划分到所述八种模板下。
具体地,所述第一训练层可选用当前已公开的标记替代训练层(MaskedLM)。所述MaskedLM的训练描述为:给定所述原始问题集中的一句话,随机抹去并替换这句话中的一个或几个词,要求根据剩余词汇预测被替换的几个词分别是什么。对于在原句中被抹去的词汇,80%情况下采用一个特殊符号[MASK]替换,10%情况下采用一个任意词替换,剩余10%情况下保持原词汇不变,得到原始替换文本集;遍历所述原始替换文本集中的文本,预测所述文本中被替换的词,得到预测问题集。MaskedLM的主要好处是:预测一个词汇时,模型并不知道输入对应位置的词汇是否为正确的词汇(10%概率为正确),这就迫使模型更多地依赖于上下文信息去预测词汇,并且赋予了模型一定的纠错能力。本申请实施例可以利用所述MaskedLM抹去原始问题集中的SPO三元组中的实体或关系,根据上述预测,可以准确的判断问题中三元组的缺失情况。
具体地,所述第二训练层可选用当前已公开的下一句预测训练层(NextSentencePrediction)。所述下一句预测训练层可以通过训练通过前一句话预测下一句话,以捕获句子之间的依赖关系。所述下一句预测训练层的训练描述为:在所述原始问题集中通过添加特殊的字符[CLS]表示句子的开始,利用[SEP]用来表示两个不同句子之间的边界。通过[CLS]的输出结果可以判断这两个句子是否应该接在一起,汇总所述[CLS]的输出结果得到初始问题集。所述下一句预测训练层从所述预测问题集中随机选择50%未打乱排序的语句对,选取50%打乱排序的语句对,汇总所有语序对,得到语句对集,对所述语句对集中的语句对进行判断。
所述Softmax函数通过训练可以基于所述[CLS]的输出结果来判断句子的种类,将所有句子分类至预先标注的八个模板内。
进一步地,所述预构建的第二语言模型包括基于强化训练的BERT(BidirectionalEncoderRepresentationsfromTransformers,来自变换器的双向编码器表征量)模型和二分类器。
较佳地,所述模型训练模块101通过下述操作得到语义抽取模型:
利用所述第二语言模型提取所述原始问题集中的实体信息,并根据所述实体信息预测与所述实体信息对应的实体和实体关系;
计算所述实体信息预测的准确率;
当所述预测的准确率高于预设的阈值时,生成所述训练完成的语义抽取模型。
其中,本申请实施例利用下述公式计算准确率L:
Figure PCTCN2021083188-appb-000026
e r,s为真正有关系的实体,e r,c为预测的有关系的实体,R为所有实体个数,r为第r个实体。
进一步地,所述模型训练模块101通过下述操作预测与所述实体信息对应的实体和实体关系:
将所述原始问题集转化为原始序列,并利用所述第二语言模型的编码器对所述原始序列进行编码,得到编码序列;
利用所述二分类器预测所述编码序列中的实体信息;
从所述编码序列中抽取出所述实体信息首尾对应的编码向量;
以所述编码向量作为条件对所述编码序列做层标准化,对所述层标准化后的序列预测与所述实体信息对应的实体和实体关系。
其中,通过将所述原始问题集转化为原始编码,将所述原始问题集向量化,并利用所述二分类器进行预测,所述二分类器可以使用当前已公开的SVM二分类器,利用所述SVM二分类器可以准确地预测所述编码序列中的实体信息。所述层标准化(LayerNormalization)是一个独立的算法,对所述编码序列做归一化处理,从而加速模型的预测和训练。
所述问题解析模块102,用于利用所述问题分发模型对待解析问题进行分类,得到分类结果,及利用所述语义抽取模型对所述待解析问题进行语义解析,得到语义解析结果。
详细地,所述问题解析模块102通过下述操作得到所述分类结果:
利用所述问题分发模型中的第一训练层识别所述待解析问题中的问题文本的缺失信息,得到预测问题;
利用所述问题分发模型中的第二训练层识别所述预测问题中的问题文本中句子之间的依赖关系,得到初始问题;
利用所述问题分发模型中的分类函数,对所述初始问题中的问题文本按照所述语句分类模板进行分类,得到所述分类结果。
其中,所述第一训练层可以为所述标记替代训练层(MaskedLM),所述第二训练层可以为所述下一句预测训练层(NextSentencePrediction),所述分类函数可以为Softmax函数。
优选地,所述问题解析模块102通过下述操作得到所述预测问题:
遍历所述待解析问题中的问题文本,随机替换所述问题文本内的一个或多个词,得到原始替换问题;
遍历所述原始替换问题中的文本,预测所述文本中被替换的词,得到所述预测问题。
其中,对于所述第一训练层:给定所述原始问题集中的一句话,随机抹去并替换这句话中的一个或多个词,根据剩余词汇预测被替换的多个词分别是什么。对于在原句中被抹去的词汇,80%情况下采用一个特殊符号[MASK]替换,10%情况下采用一个任意词替换,剩余10%情况下保持原词汇不变,得到原始替换问题,遍历所述原始替换问题中的文本,预测所述文本中被替换的词,得到所述预测问题。
较佳地,所述问题解析模块102通过下述操作得到所述初始问题:
将所述预测问题中的语句排列顺序打乱,得到乱序预测问题;
从所述预测问题中选取第一数量的未打乱排序的语句对,及从所述乱序预测问题中选取第二数量的打乱排序的语句对,汇总所有语序对,得到语句对集;
遍历所述语句对集中的语句对,判断所述语句对中第二句话在文本中是否紧跟在第一句话之后,以得到排序正确的语句,其中,当语句对中第二句话在文本中紧跟在第一句话之后,则这两句话为排序正确的语句;
汇总所有排序正确的语句,得到所述初始问题。
其中,对于所述第二训练层:在所述预测问题中通过添加特殊的字符[CLS]表示句子的开始,利用[SEP]用来表示两个不同句子之间的边界。通过[CLS]的输出结果可以判断这两个句子是否应该接在一起,汇总所述[CLS]的输出结果得到初始问题集。比如,从预测问题集中随机选择50%(第一数量)未打乱排序的语句对,选取50%(第二数量)打乱排序的语句对,汇总所有语序对,得到语句对集,对所述语句对集中的语句对进行判断。
进一步地,本申请实施例利用所述语义抽取模型对所述待解析问题进行语义解析,得到所述待解析问题中的实体和实体关系,汇总所述实体和实体关系得到语义解析结果。
所述问题查询模块103,用于根据所述分类结果以及所述语义解析结果查找相匹配的查询语句模板,根据所述查询语句模板得到问题查询语句。
本申请实施例根据预先设置的分类结果以及语义解析结果与查询语句模板之间的映射关系,查找相匹配的查询语句模板。
优选地,本申请实施例中所述查询语句可以使用SQL语句。所述查询语句模板对应于上述八种模板,每种模板对应于一种查询语句模板。
比如,用户提交的待解析问题为“A公司的CEO是谁?”,所述问题分发模型先将所述问题分类至“震
Figure PCTCN2021083188-appb-000027
”模板对应的类型,再对所述待解析问题进行三元组语义抽取,预测所述待解析问题中的实体及实体之间的实体关系,得到语义解析结果,所述语义解析结果包括实体(S)“A公司”已知,关系(P)“CEO”已知,实体(O)未知,将“震
Figure PCTCN2021083188-appb-000028
”模板中预设的查询语句与所述语义解析结果利用预设的SQL语句进行映射,得到问题查询语句。
所述结果反馈模块104,用于利用所述问题查询语句查询数据库内容,得到问答解析结果并反馈给查询终端。
所述数据库可以为当前已公开的各种数据库,如MySQL,oracle,图数据库neo4j,HBAS等。同时,所述查询语句可以根据数据库的不同选用不同的查询语句。利用所述查询终端可以为计算机等设备。
本申请实施例中基于两个BERT模型,第一个模型仅用于分类,第二个模型用于语义抽取。对于待解析问题,如果只采用第二个模型,根据当前的关系只能预测出一种三元组,不符合实际场景的应用,所以先需要第一个模型将待解析问题中有多少种关系预测出来,进行分类,然后再对待解析问题进行语义分析,结合不同分类模板对应的查询语句,可以更加精确地对待解析问题进行问答解析。
如图4所示,是本申请一实施例提供的实现问题解析方法的电子设备的结构示意图。
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如问题解析程序12。
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质可以是易失性的,也可以是非易失性的。具体的,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(SmartMediaCard,SMC)、安全数字(SecureDigital,SD)卡、闪存卡(FlashCard)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1 的应用软件及各类数据,例如问题解析程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(CentralProcessingunit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(ControlUnit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如问题解析程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。
所述总线可以是外设部件互连标准(peripheralcomponentinterconnect,简称PCI)总线或扩展工业标准结构(extendedindustrystandardarchitecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。
图4仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图4示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(OrganicLight-EmittingDiode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。
所述电子设备1中的所述存储器11存储的问题解析程序12是多个指令的组合,在所述处理器10中运行时,可以实现:
获取原始问题集,利用所述原始问题集以及预先设定的语句分类模板训练预构建的第一语言模型,得到问题分发模型;及利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型;
利用所述问题分发模型对待解析问题进行分类,得到分类结果;及利用所述语义抽取模型对所述待解析问题进行语义解析,得到语义解析结果;
根据所述分类结果以及所述语义解析结果查找相匹配的查询语句模板,根据所述查询语句模板得到问题查询语句;
利用所述问题查询语句查询数据库内容,得到问答解析结果并反馈给查询终端。
具体地,所述处理器10对上述指令的具体实现方法可参考图1至图2对应实施例中相关步骤的描述,在此不赘述。
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为 独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。所述计算机可读存储介质可以是易失性的,也可以是非易失性的。具体的,所述计算机可读存储介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-OnlyMemory)。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。***权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。

Claims (20)

  1. 一种问题解析方法,其中,所述方法包括:
    获取原始问题集,利用所述原始问题集以及预先设定的语句分类模板训练预构建的第一语言模型,得到问题分发模型,及利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型;
    利用所述问题分发模型对待解析问题进行分类,得到分类结果,及利用所述语义抽取模型对所述待解析问题进行语义解析,得到语义解析结果;
    根据所述分类结果以及所述语义解析结果查找相匹配的查询语句模板,根据所述查询语句模板得到问题查询语句;
    利用所述问题查询语句查询数据库内容,得到问答解析结果并反馈给查询终端。
  2. 如权利要求1所述的问题解析方法,其中,所述利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型,包括:
    利用所述第二语言模型提取所述原始问题集中的实体信息,并根据所述实体信息预测与所述实体信息对应的实体和实体关系;
    计算所述实体信息预测的准确率;
    当所述预测的准确率高于预设的阈值时,生成所述训练完成的语义抽取模型。
  3. 如权利要求2所述的问题解析方法,其中,所述计算所述实体信息预测的准确率,包括:
    采用下述公式计算所述准确率L:
    Figure PCTCN2021083188-appb-100001
    e r,s为真正有关系的实体,e r,c为预测的有关系的实体,R为所有实体个数,r为第r个实体。
  4. 如权利要求2所述的问题解析方法,其中,所述提取所述原始问题集中的实体信息,并根据所述实体信息预测与所述实体信息对应的实体和实体关系,包括:
    将所述原始问题集转化为原始序列,并利用所述第二语言模型的编码器对所述原始序列进行编码,得到编码序列;
    利用预设的二分类器预测所述编码序列中的实体信息;
    从所述编码序列中抽取出所述实体信息首尾对应的编码向量;
    以所述编码向量作为条件对所述编码序列做层标准化,对所述层标准化后的序列预测与所述实体信息对应的实体和实体关系。
  5. 如权利要求1所述的问题解析方法,其中,所述利用所述问题分发模型对待解析问题进行分类,得到分类结果,包括:
    利用所述问题分发模型中的第一训练层识别所述待解析问题中的问题文本的缺失信息,得到预测问题;
    利用所述问题分发模型中的第二训练层识别所述预测问题中的问题文本中句子之间的依赖关系,得到初始问题;
    利用所述问题分发模型中的分类函数,对所述初始问题中的问题文本按照所述语句分类模板进行分类,得到所述分类结果。
  6. 如权利要求5所述的问题解析方法,其中,所述利用所述问题分发模型中的第一训练层识别所述待解析问题中的问题文本的缺失信息,得到预测问题,包括:
    遍历所述待解析问题中的问题文本,随机替换所述问题文本内的一个或多个词,得到原始替换问题;
    遍历所述原始替换问题中的文本,预测所述文本中被替换的词,得到所述预测问题。
  7. 如权利要求5所述的问题解析方法,其中,所述利用所述问题分发模型中的第二训 练层识别所述预测问题中的问题文本中句子之间的依赖关系,得到初始问题,包括:
    将所述预测问题中的语句排列顺序打乱,得到乱序预测问题;
    从所述预测问题中选取第一数量的未打乱排序的语句对,及从所述乱序预测问题中选取第二数量的打乱排序的语句对,汇总所有语序对,得到语句对集;
    遍历所述语句对集中的语句对,判断所述语句对中第二句话在文本中是否紧跟在第一句话之后,以得到排序正确的语句,其中,当语句对中第二句话在文本中紧跟在第一句话之后,则这两句话为排序正确的语句;
    汇总所有排序正确的语句,得到所述初始问题。
  8. 一种问题解析装置,其中,所述装置包括:
    模型训练模块,用于获取原始问题集,利用所述原始问题集以及预先设定的语句分类模板训练预构建的第一语言模型,得到问题分发模型;及利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型;
    问题解析模块,用于利用所述问题分发模型对待解析问题进行分类,得到分类结果;及利用所述语义抽取模型对所述待解析问题进行语义解析,得到语义解析结果;
    问题查询模块,用于根据所述分类结果以及所述语义解析结果查找相匹配的查询语句模板,根据所述查询语句模板得到问题查询语句;
    结果反馈模块,用于利用所述问题查询语句查询数据库内容,得到问答解析结果并反馈给查询终端。
  9. 一种电子设备,其中,所述电子设备包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的计算机程序指令,所述计算机程序指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下所述的问题解析方法:
    获取原始问题集,利用所述原始问题集以及预先设定的语句分类模板训练预构建的第一语言模型,得到问题分发模型,及利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型;
    利用所述问题分发模型对待解析问题进行分类,得到分类结果,及利用所述语义抽取模型对所述待解析问题进行语义解析,得到语义解析结果;
    根据所述分类结果以及所述语义解析结果查找相匹配的查询语句模板,根据所述查询语句模板得到问题查询语句;
    利用所述问题查询语句查询数据库内容,得到问答解析结果并反馈给查询终端。
  10. 如权利要求9所述的电子设备,其中,所述利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型,包括:
    利用所述第二语言模型提取所述原始问题集中的实体信息,并根据所述实体信息预测与所述实体信息对应的实体和实体关系;
    计算所述实体信息预测的准确率;
    当所述预测的准确率高于预设的阈值时,生成所述训练完成的语义抽取模型。
  11. 如权利要求10所述的电子设备,其中,所述计算所述实体信息预测的准确率,包括:
    采用下述公式计算所述准确率L:
    Figure PCTCN2021083188-appb-100002
    e r,s为真正有关系的实体,e r,c为预测的有关系的实体,R为所有实体个数,r为第r个实体。
  12. 如权利要求9所述的电子设备,其中,所述利用所述问题分发模型对待解析问题 进行分类,得到分类结果,包括:
    利用所述问题分发模型中的第一训练层识别所述待解析问题中的问题文本的缺失信息,得到预测问题;
    利用所述问题分发模型中的第二训练层识别所述预测问题中的问题文本中句子之间的依赖关系,得到初始问题;
    利用所述问题分发模型中的分类函数,对所述初始问题中的问题文本按照所述语句分类模板进行分类,得到所述分类结果。
  13. 如权利要求12所述的电子设备,其中,所述利用所述问题分发模型中的第一训练层识别所述待解析问题中的问题文本的缺失信息,得到预测问题,包括:
    遍历所述待解析问题中的问题文本,随机替换所述问题文本内的一个或多个词,得到原始替换问题;
    遍历所述原始替换问题中的文本,预测所述文本中被替换的词,得到所述预测问题。
  14. 如权利要求12所述的电子设备,其中,所述利用所述问题分发模型中的第二训练层识别所述预测问题中的问题文本中句子之间的依赖关系,得到初始问题,包括:
    将所述预测问题中的语句排列顺序打乱,得到乱序预测问题;
    从所述预测问题中选取第一数量的未打乱排序的语句对,及从所述乱序预测问题中选取第二数量的打乱排序的语句对,汇总所有语序对,得到语句对集;
    遍历所述语句对集中的语句对,判断所述语句对中第二句话在文本中是否紧跟在第一句话之后,以得到排序正确的语句,其中,当语句对中第二句话在文本中紧跟在第一句话之后,则这两句话为排序正确的语句;
    汇总所有排序正确的语句,得到所述初始问题。
  15. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下所述的问题解析方法:
    获取原始问题集,利用所述原始问题集以及预先设定的语句分类模板训练预构建的第一语言模型,得到问题分发模型,及利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型;
    利用所述问题分发模型对待解析问题进行分类,得到分类结果,及利用所述语义抽取模型对所述待解析问题进行语义解析,得到语义解析结果;
    根据所述分类结果以及所述语义解析结果查找相匹配的查询语句模板,根据所述查询语句模板得到问题查询语句;
    利用所述问题查询语句查询数据库内容,得到问答解析结果并反馈给查询终端。
  16. 如权利要求15所述的计算机可读存储介质,其中,所述利用所述原始问题集训练预构建的第二语言模型,得到语义抽取模型,包括:
    利用所述第二语言模型提取所述原始问题集中的实体信息,并根据所述实体信息预测与所述实体信息对应的实体和实体关系;
    计算所述实体信息预测的准确率;
    当所述预测的准确率高于预设的阈值时,生成所述训练完成的语义抽取模型。
  17. 如权利要求16所述的计算机可读存储介质,其中,所述计算所述实体信息预测的准确率,包括:
    采用下述公式计算所述准确率L:
    Figure PCTCN2021083188-appb-100003
    e r,s为真正有关系的实体,e r,c为预测的有关系的实体,R为所有实体个数,r为第r个实体。
  18. 如权利要求15所述的计算机可读存储介质,其中,所述利用所述问题分发模型对待解析问题进行分类,得到分类结果,包括:
    利用所述问题分发模型中的第一训练层识别所述待解析问题中的问题文本的缺失信息,得到预测问题;
    利用所述问题分发模型中的第二训练层识别所述预测问题中的问题文本中句子之间的依赖关系,得到初始问题;
    利用所述问题分发模型中的分类函数,对所述初始问题中的问题文本按照所述语句分类模板进行分类,得到所述分类结果。
  19. 如权利要求18所述的计算机可读存储介质,其中,所述利用所述问题分发模型中的第一训练层识别所述待解析问题中的问题文本的缺失信息,得到预测问题,包括:
    遍历所述待解析问题中的问题文本,随机替换所述问题文本内的一个或多个词,得到原始替换问题;
    遍历所述原始替换问题中的文本,预测所述文本中被替换的词,得到所述预测问题。
  20. 如权利要求18所述的计算机可读存储介质,其中,所述利用所述问题分发模型中的第二训练层识别所述预测问题中的问题文本中句子之间的依赖关系,得到初始问题,包括:
    将所述预测问题中的语句排列顺序打乱,得到乱序预测问题;
    从所述预测问题中选取第一数量的未打乱排序的语句对,及从所述乱序预测问题中选取第二数量的打乱排序的语句对,汇总所有语序对,得到语句对集;
    遍历所述语句对集中的语句对,判断所述语句对中第二句话在文本中是否紧跟在第一句话之后,以得到排序正确的语句,其中,当语句对中第二句话在文本中紧跟在第一句话之后,则这两句话为排序正确的语句;
    汇总所有排序正确的语句,得到所述初始问题。
PCT/CN2021/083188 2020-11-19 2021-03-26 问题解析方法、装置、电子设备及存储介质 WO2021208703A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011305368.0A CN112380343B (zh) 2020-11-19 2020-11-19 问题解析方法、装置、电子设备及存储介质
CN202011305368.0 2020-11-19

Publications (1)

Publication Number Publication Date
WO2021208703A1 true WO2021208703A1 (zh) 2021-10-21

Family

ID=74584404

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/083188 WO2021208703A1 (zh) 2020-11-19 2021-03-26 问题解析方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN112380343B (zh)
WO (1) WO2021208703A1 (zh)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114299955A (zh) * 2021-11-12 2022-04-08 北京百度网讯科技有限公司 语音交互的方法、装置、电子设备及存储介质
CN114420102A (zh) * 2022-01-04 2022-04-29 广州小鹏汽车科技有限公司 语音断句方法、装置、电子设备及存储介质
CN115270801A (zh) * 2022-09-28 2022-11-01 浙江太美医疗科技股份有限公司 文本信息抽取模型的训练方法、文本信息抽取方法和应用
CN115587175A (zh) * 2022-12-08 2023-01-10 阿里巴巴达摩院(杭州)科技有限公司 人机对话及预训练语言模型训练方法、***及电子设备
WO2023125718A1 (zh) * 2021-12-29 2023-07-06 中兴通讯股份有限公司 基于知识图谱的数据查询方法、***、设备及存储介质
CN117273151A (zh) * 2023-11-21 2023-12-22 杭州海康威视数字技术股份有限公司 基于大语言模型的科学仪器使用分析方法、装置及***
CN117591547A (zh) * 2024-01-18 2024-02-23 中昊芯英(杭州)科技有限公司 数据库的查询方法、装置、终端设备以及存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112380343B (zh) * 2020-11-19 2024-06-25 平安科技(深圳)有限公司 问题解析方法、装置、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100076746A1 (en) * 2008-09-25 2010-03-25 Microsoft Corporation Computerized statistical machine translation with phrasal decoder
CN105930452A (zh) * 2016-04-21 2016-09-07 北京紫平方信息技术股份有限公司 一种识别自然语言的智能应答方法
CN111858877A (zh) * 2020-06-17 2020-10-30 平安科技(深圳)有限公司 多类型问题智能问答方法、***、设备及可读存储介质
CN112380343A (zh) * 2020-11-19 2021-02-19 平安科技(深圳)有限公司 问题解析方法、装置、电子设备及存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101662450B1 (ko) * 2015-05-29 2016-10-05 포항공과대학교 산학협력단 다중 소스 하이브리드 질의응답 방법 및 시스템
US11106664B2 (en) * 2018-05-03 2021-08-31 Thomson Reuters Enterprise Centre Gmbh Systems and methods for generating a contextually and conversationally correct response to a query
CN110727779A (zh) * 2019-10-16 2020-01-24 信雅达***工程股份有限公司 基于多模型融合的问答方法及***
CN111339246B (zh) * 2020-02-10 2023-03-21 腾讯云计算(北京)有限责任公司 查询语句模板的生成方法、装置、设备及介质
CN111368093B (zh) * 2020-02-26 2024-04-30 京东方科技集团股份有限公司 信息获取方法、装置、电子设备及计算机可读存储介质
CN111831801B (zh) * 2020-05-27 2022-02-25 北京市农林科学院 一种人机对话方法及***
CN111506723B (zh) * 2020-07-01 2020-11-13 平安国际智慧城市科技股份有限公司 问答响应方法、装置、设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100076746A1 (en) * 2008-09-25 2010-03-25 Microsoft Corporation Computerized statistical machine translation with phrasal decoder
CN105930452A (zh) * 2016-04-21 2016-09-07 北京紫平方信息技术股份有限公司 一种识别自然语言的智能应答方法
CN111858877A (zh) * 2020-06-17 2020-10-30 平安科技(深圳)有限公司 多类型问题智能问答方法、***、设备及可读存储介质
CN112380343A (zh) * 2020-11-19 2021-02-19 平安科技(深圳)有限公司 问题解析方法、装置、电子设备及存储介质

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114299955A (zh) * 2021-11-12 2022-04-08 北京百度网讯科技有限公司 语音交互的方法、装置、电子设备及存储介质
CN114299955B (zh) * 2021-11-12 2022-09-23 北京百度网讯科技有限公司 语音交互的方法、装置、电子设备及存储介质
WO2023125718A1 (zh) * 2021-12-29 2023-07-06 中兴通讯股份有限公司 基于知识图谱的数据查询方法、***、设备及存储介质
CN114420102A (zh) * 2022-01-04 2022-04-29 广州小鹏汽车科技有限公司 语音断句方法、装置、电子设备及存储介质
CN114420102B (zh) * 2022-01-04 2022-10-14 广州小鹏汽车科技有限公司 语音断句方法、装置、电子设备及存储介质
CN115270801A (zh) * 2022-09-28 2022-11-01 浙江太美医疗科技股份有限公司 文本信息抽取模型的训练方法、文本信息抽取方法和应用
CN115587175A (zh) * 2022-12-08 2023-01-10 阿里巴巴达摩院(杭州)科技有限公司 人机对话及预训练语言模型训练方法、***及电子设备
CN115587175B (zh) * 2022-12-08 2023-03-14 阿里巴巴达摩院(杭州)科技有限公司 人机对话及预训练语言模型训练方法、***及电子设备
CN117273151A (zh) * 2023-11-21 2023-12-22 杭州海康威视数字技术股份有限公司 基于大语言模型的科学仪器使用分析方法、装置及***
CN117273151B (zh) * 2023-11-21 2024-03-15 杭州海康威视数字技术股份有限公司 基于大语言模型的科学仪器使用分析方法、装置及***
CN117591547A (zh) * 2024-01-18 2024-02-23 中昊芯英(杭州)科技有限公司 数据库的查询方法、装置、终端设备以及存储介质

Also Published As

Publication number Publication date
CN112380343B (zh) 2024-06-25
CN112380343A (zh) 2021-02-19

Similar Documents

Publication Publication Date Title
WO2021208703A1 (zh) 问题解析方法、装置、电子设备及存储介质
WO2022134759A1 (zh) 关键词生成方法、装置、电子设备及计算机存储介质
WO2021212682A1 (zh) 知识抽取方法、装置、电子设备及存储介质
WO2021208721A1 (zh) 联邦学习防御方法、装置、电子设备及存储介质
WO2021151270A1 (zh) 图像结构化数据提取方法、装置、设备及存储介质
WO2022121171A1 (zh) 相似文本匹配方法、装置、电子设备及计算机存储介质
WO2022222300A1 (zh) 开放关系抽取方法、装置、电子设备及存储介质
CN112016304A (zh) 文本纠错方法、装置、电子设备及存储介质
WO2021208696A1 (zh) 用户意图分析方法、装置、电子设备及计算机存储介质
WO2022105179A1 (zh) 生物特征图像识别方法、装置、电子设备及可读存储介质
WO2022222943A1 (zh) 科室推荐方法、装置、电子设备及存储介质
CN112559687A (zh) 问题识别及查询方法、装置、电子设备及存储介质
WO2023159755A1 (zh) 虚假新闻检测方法、装置、设备及存储介质
CN113378970B (zh) 语句相似性检测方法、装置、电子设备及存储介质
WO2022134355A1 (zh) 基于关键词提示的检索方法、装置、电子设备及存储介质
WO2022222942A1 (zh) 问答记录生成方法、装置、电子设备及存储介质
CN113704429A (zh) 基于半监督学习的意图识别方法、装置、设备及介质
CN113268615A (zh) 资源标签生成方法、装置、电子设备及存储介质
CN111753089A (zh) 话题聚类方法、装置、电子设备及存储介质
WO2023137906A1 (zh) 文档标题生成方法、装置、设备及存储介质
WO2023178979A1 (zh) 问题标注方法、装置、电子设备及存储介质
CN116720525A (zh) 基于问诊数据的疾病辅助分析方法、装置、设备及介质
WO2021151303A1 (zh) 命名实体对齐方法、装置、电子设备及可读存储介质
WO2022142019A1 (zh) 基于智能机器人的问题分发方法、装置、电子设备及存储介质
CN116739001A (zh) 基于对比学习的文本关系提取方法、装置、设备及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21789027

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21789027

Country of ref document: EP

Kind code of ref document: A1