WO2023246849A1 - 回馈数据图谱生成方法及冰箱 - Google Patents

回馈数据图谱生成方法及冰箱 Download PDF

Info

Publication number
WO2023246849A1
WO2023246849A1 PCT/CN2023/101636 CN2023101636W WO2023246849A1 WO 2023246849 A1 WO2023246849 A1 WO 2023246849A1 CN 2023101636 W CN2023101636 W CN 2023101636W WO 2023246849 A1 WO2023246849 A1 WO 2023246849A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
attribute
segment
information
text
Prior art date
Application number
PCT/CN2023/101636
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 WO2023246849A1 publication Critical patent/WO2023246849A1/zh

Links

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/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • 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/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking

Definitions

  • the existing technology also provides a method of establishing a knowledge graph for the database, refining the core content in the database into entities, thereby establishing entity nodes and associations between entities, so that after the user inputs keywords, the user can extract information based on the keywords and Search based on similarity between entities, thus speeding up retrieval.
  • this technical solution still has some flaws: (1) It pays more attention to the entity itself and the relationship between entities, and underestimates the relationship between the entity and other content in the database, resulting in complicated content output during retrieval and extraction. , and the matching degree with the input search keywords is not high; (2) In the process of extracting entities and related data, when the related data is distributed in multiple locations in the database, it is still necessary to traverse the database to obtain complete related data.
  • One of the purposes of the present invention is to provide a feedback data map generation method to solve the problem that the content of the map built by the generation method in the prior art is complex, the matching degree is low, the extent of improving the retrieval speed is limited, and the granularity level is relatively high.
  • One object of the present invention is to provide a feedback data map generating device.
  • One of the objects of the present invention is to provide a question and answer device.
  • One object of the present invention is to provide a refrigerator.
  • an embodiment of the present invention provides a method for generating a feedback data map, which includes: traversing all original corpus in the original information database to generate basic catalog data; extracting and forming entity information elements based on the basic catalog data and entity relationship elements; according to the basic directory data and the original information database, attribute fusion and same-attribute segment aggregation are sequentially performed to generate multiple groups of segment attribute elements corresponding to different text segment data; wherein, the text Segment data contains multiple groups in the original corpus; entity nodes are constructed based on the entity information elements, association relationships between entities are established based on the entity relationship elements, and the segment attribute elements are configured according to the relationship between segments and entities. The association relationship is correspondingly stored in the entity node, and a feedback data map is generated.
  • one embodiment of the present invention provides a feedback data map generation device, which includes: a catalog generation module for traversing all original corpus in the original information database and generating basic catalog data; and a basic element extraction module for Extract and form entity information elements and entity relationship elements according to the basic directory data; an attribute element analysis module is used to sequentially perform attribute fusion and same-attribute segment aggregation according to the basic directory data and the original information database to generate Multiple groups of segment attribute elements corresponding to different text segment data; wherein the text segment data includes multiple groups in the original corpus; a graph construction module for constructing entity nodes based on the entity information elements, An association relationship between entities is established based on the entity relationship elements, and the segment attribute elements are correspondingly stored in the entity nodes according to the association relationship between the segments and entities, and a feedback data map is generated.
  • an embodiment of the present invention provides a question and answer device, which includes: a memory and a processor.
  • the question and answer device further includes: feedback stored on the memory and operable on the processor.
  • Data map generation program When the feedback data map generation program is executed by the processor, the steps of the feedback data map generation method described in any of the above technical solutions are implemented, and/or stored in the memory, according to the above The feedback data map generated by the feedback data map generation method described in any one of the technical solutions.
  • one embodiment of the present invention provides a refrigerator, which includes storage compartments with different temperature zones, and a door for opening and closing the storage compartment.
  • the refrigerator also includes the above-mentioned technical solution. Question and Answer Equipment.
  • FIG. 2 is a schematic diagram of some steps of a feedback data map generating method in another embodiment of the present invention.
  • FIG. 3 is a schematic diagram of some steps of the first embodiment of the method for generating a feedback data map in another embodiment of the present invention.
  • FIG. 4 is a partial step diagram of a specific example of the first embodiment of the feedback data map generation method in another embodiment of the present invention.
  • FIG. 5 is a schematic diagram of some steps of a second embodiment of a feedback data map generation method in another embodiment of the present invention.
  • FIG. 6 is a partial step schematic diagram of a specific example of the second embodiment of the feedback data map generation method in another embodiment of the present invention.
  • FIG. 7 is a partial step diagram of a third embodiment of a method for generating a feedback data map in another embodiment of the present invention.
  • FIG. 8 is a schematic diagram of some steps of a feedback data map generating method in yet another embodiment of the present invention.
  • FIG. 9 is a schematic diagram of some steps of a specific example of a method for generating a feedback data map in yet another embodiment of the present invention.
  • a refrigerator including storage compartments with different temperatures, and a door for opening and closing the storage compartment.
  • the user can store memory in the storage compartment by opening and closing the door. retrieve items to provide a refrigerated, frozen or variable temperature storage environment for items.
  • the refrigerator also includes a question and answer device, thereby receiving questions or search keywords input by the user, and establishing a feedback data map according to a preset feedback data map, or according to a preset generation program, and then According to the feedback data map, answers or search results corresponding to the questions are generated and fed back to the user side.
  • the question and answer device is installed in the refrigerator.
  • the user may ask questions about the operation of the smart refrigerator, such as how to set up the sensor to automatically open the door, how to set up the refrigerator to automatically close the door, how to set the temperature of the refrigerator compartment and the freezer compartment, etc.
  • the refrigerator calls the question and answer device, performs retrieval and analysis based on the feedback data map established based on the "operation instructions", and outputs the retrieval results or answer corpus to form feedback.
  • the user may ask questions such as what kind of dishes can be made based on the existing ingredients, what kind of ingredients need to be purchased to make a certain dish, etc.
  • the refrigerator calls the question and answer device to perform retrieval and analysis based on the feedback data map, or after crawling the relevant database on the server, performs retrieval analysis based on the relevant database and the feedback data map, thereby outputting the search results or answer corpus. to form feedback.
  • the cooperation between the question and answer device and the refrigerator at the structural level can be that the question and answer device can be installed at any position inside the refrigerator that can receive power and interact with the user, and further, can be installed in the refrigerator. Any location inside that is not unduly affected by the refrigerator's internal refrigeration system and/or is capable of communicating with the server.
  • the question and answer device is configured to have input and output devices such as a display screen, an audio collection device and/or an audio output device, or when the question and answer device is connected to the above input and output device, at least the above input and output device may be disposed on the Said refrigerator is close to On the user's side, the question and answer device may be arranged at least on a side close to the input and output device, thereby simplifying wiring.
  • the present invention also provides a question and answer device, which can be installed in the above-mentioned refrigerator, can also be installed in other devices mentioned above, or devices in other fields not mentioned in this article but can be thought of by those skilled in the art. in order to achieve the corresponding technical effects.
  • the present invention does not exclude the whole thing such as the refrigerator being collectively referred to as a question and answer device.
  • the question and answer device can also With other functional configurations.
  • the processor can be a general-purpose processor, including CPU (Central Processing Unit, central processing unit), NP (Network Processor, network processor), etc., or it can be DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit, application-specific integrated circuit), FPGA (Field-Programmable Gate Array, field programmable gate array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • CPU Central Processing Unit, central processing unit
  • NP Network Processor, network processor
  • DSP Digital Signal Processing, digital signal processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array, field programmable gate array
  • other programmable logic devices discrete gate or transistor logic devices, discrete hardware components.
  • the question and answer device further includes a feedback data map generation program stored in the memory and executable on the processor.
  • a feedback data map generation program is implemented. method, thereby achieving the technical effects of the present invention.
  • the generated feedback data map can be stored in the memory, so that the processor can execute the question and answer retrieval program in the memory, and use the feedback data map in the memory to implement the question and answer function.
  • the question and answer device also includes a feedback data map generated according to a feedback data map method stored in the memory.
  • the processor can also execute the question and answer retrieval program in the memory, using the information already existing in the memory.
  • Feedback data map to implement question and answer function.
  • “already existing” here includes two meanings: “preset” and “generated according to previous steps”.
  • the technical solution provided by the latter corresponding embodiment can be understood as two implementation modes. The combination is to use the former implementation method to execute the program to generate the feedback data map, and then use the latter implementation method to directly implement the question and answer function.
  • the catalog generation module is used to traverse all original corpus in the original information database and generate basic catalog data.
  • the basic element extraction module is used to extract and form entity information elements and entity relationship elements according to the basic directory data.
  • the attribute element analysis module is configured to sequentially perform attribute fusion and same-attribute segment aggregation based on the basic directory data and the original information database to generate multiple groups of segment attribute elements corresponding to different text segment data.
  • the text segment data includes multiple groups in the original corpus.
  • the graph construction module is used to construct entity nodes according to the entity information elements, establish association relationships between entities according to the entity relationship elements, and store the segment attribute elements in the corresponding segments according to the association relationships between segments and entities. In the entity node, a feedback data map is generated.
  • the directory generation module may also include a directory extraction module, a structure analysis module and an integrated arrangement module.
  • the directory extraction module is used to analyze and obtain the directory structure information in the original information database.
  • the structural analysis module is used to iteratively identify multiple sets of original format information corresponding to different original corpus; when the original format information matches the preset standard format information, extract the original corpus corresponding to the original format information as structural corpus information.
  • the integration and arrangement module is used to sort and integrate the directory structure information and the structure corpus information according to the relative positions of the structure corpus information and the directory structure information in the original information database to obtain the Describe the basic directory data.
  • the attribute element extraction module 23 may further include a text retrieval module, an attribute identification module and a fusion aggregation module.
  • the text retrieval module is used to search in the original information database according to the basic directory data to obtain multiple groups of texts to be processed corresponding to different basic directory data.
  • the attribute identification module is configured to sequentially perform bidirectional feature representation and attribute classification identification based on the text to be processed, to obtain multiple sets of primary attribute data corresponding to different text segment data.
  • the fusion aggregation module is configured to sequentially perform attribute fusion and same-attribute segment aggregation based on the primary attribute data, the text segment data, and the entity pointing data to generate the segment attribute elements.
  • the feedback data map generating device may also include a pre-training module, which may be set independently or may be set in any of the above-mentioned modules, models or neural networks.
  • the pre-training module may specifically include a data crawling module, a task training module and a model setting module. Wherein, the data crawling module is used to receive pre-training data sets.
  • the task training module is used to enable the bidirectional feature representation model, perform mask language model tasks and next sentence prediction tasks in sequence, perform iterative traversal prediction and verification on the data in the pre-training data set, and obtain standard model parameters. Group.
  • the model setting module is used to load the standard model parameter set into the two-way feature representation model.
  • the present invention further provides a method for generating a feedback data map as shown in Figure 1, which can be mounted on any of the above-mentioned refrigerators, question and answer equipment and/or feedback data map generating equipment, or can be mounted on In any other device, equipment or system mentioned above.
  • the feedback data map generating method may specifically include the following steps.
  • Step 31 Traverse all original corpus in the original information database and generate basic catalog data.
  • Step 32 Extract and form entity information elements and entity relationship elements based on the basic directory data.
  • Step 33 According to the basic directory data and the original information database, attribute fusion and segment aggregation with the same attribute are sequentially performed to generate multiple sets of segment attribute elements corresponding to different text segment data.
  • Step 34 Construct entity nodes based on entity information elements, establish associations between entities based on entity relationship elements, store segment attribute elements in entity nodes according to the association between segments and entities, and generate a feedback data map.
  • the text segment data includes multiple groups in the original corpus.
  • the above-mentioned original information database can refer to any database, data text or data collection based on which the feedback data map is generated.
  • the present invention does not limit its form and can be flexibly transformed according to actual application scenarios.
  • the feedback data map generation method is installed in a refrigeration device such as a refrigerator. Therefore, the original information database may be the full text of the instruction manual of the refrigerator or other refrigeration device, or a part of the instruction manual such as "Voice Assistant".
  • the original information database The corpus refers to the segment description within the specification, which is also the basis for applying subsequent steps to establish entity information elements, entity relationship elements, and segment attribute elements.
  • the present invention is not limited to having no or only certain pre-processing steps.
  • the construction process of the above-mentioned original information database can also be implemented according to the needs of those skilled in the art, and can be directly crawled
  • the existing database can be a database established in real time based on the collected information. More specifically, in the embodiment where the original information database is a refrigerator manual, before step 51, it may also include: identifying the manual. In text format, the instructions are converted into a preset standard format; and the original information database is established based on the format-converted instructions.
  • the original format of the instruction text may be *.pdf format or other graphic formats
  • the preset standard format may be *.doc, *.docx and other editable text formats
  • the conversion process may be a simple To organize the format, you can also use template matching method or geometric feature extraction method for text recognition. Specifically, you can use OCR (Optical Character Recognition, optical character recognition) technology for text recognition.
  • OCR Optical Character Recognition, optical character recognition
  • the above-mentioned entity information elements, entity relationship elements and segment attribute elements can be specifically configured in the form of a data group containing two or three items of data.
  • the above-mentioned data group can be specifically stored in CSV. (Comma-Separated Values, comma-separated values) format file.
  • CSV Common-Separated Values, comma-separated values
  • the specific form of the above three elements can be the form of comma-separated values.
  • the specific method of establishing a feedback data map can be by importing entity information elements into a graph database engine to establish a graphical database.
  • the graph database engine is preferably a Neo4j graph database, which has both lightweight and For high-performance features, of course, JanusGraph, HugeGraph, Dgraph, etc. can also be used to adapt to scenarios such as higher read and write performance requirements or more complex computing performance requirements.
  • Step 33 describes the generation steps of segment attribute elements, using basic directory data to identify and classify the data in the original database, and further performs attribute fusion and aggregation of segments with the same attribute based on the classification results, expressing the two aspects of progressive settings. step operation.
  • the above process can be implemented through a text clustering algorithm, such as a partition-based clustering algorithm such as the K-means algorithm, a hierarchical-based clustering algorithm such as the Chameleon algorithm, a density-based clustering algorithm such as DBSCAN, CLIQUE Model-based clustering algorithms such as grid-based clustering algorithms, Gaussian mixture models, or some fuzzy set-based clustering algorithms.
  • the present invention further provides a feedback data map generation method as shown in Figure 1 and Figure 2, which can be mounted on any of the above refrigerators, question and answer equipment and/or
  • the feedback data map generation device can also be installed in any other device, equipment or system mentioned above.
  • the feedback data map generating method may specifically include the following steps.
  • Step 31 Traverse all original corpus in the original information database and generate basic catalog data.
  • Step 32 Extract and form entity information elements and entity relationship elements based on the basic directory data.
  • Step 332 Based on the text to be processed, bidirectional feature representation and attribute classification recognition are performed sequentially to obtain multiple sets of primary attribute data corresponding to different text segment data.
  • Step 34 Construct entity nodes based on entity information elements, establish associations between entities based on entity relationship elements, store segment attribute elements in entity nodes according to the association between segments and entities, and generate a feedback data map.
  • the entity pointing data represents the association relationship between the text segment data and the entity.
  • a single piece of basic catalog data contains at least one group of text paragraphs. Taking this text paragraph as the text to be processed, during the traversal process of all the original corpus in the original information database, several texts to be processed are naturally formed according to their positions. Correspondence between basic directory data.
  • a single piece of basic directory data may correspond to multiple groups of texts to be processed, or to a group of texts to be processed. This forms the first splitting of the original corpus and the establishment of correspondence relationships.
  • the text to be processed includes at least one group of text segments, so that two-way feature representation and attribute classification recognition are performed on the text segment as a unit, and one or more groups of text segment data corresponding to each group of text to be processed are obtained, and Corresponding to the primary attribute data of each group of text segment data, the corresponding relationship between the text segment data and the basic directory data can be established, forming the second splitting of the original corpus and the establishment of the corresponding relationship.
  • the aforementioned process aims to analyze based on the inherent location and data form of the original information database. After obtaining the text segment data and the corresponding primary attribute data, the text segment data can be processed with the primary attribute data as the core to form a complete set of the original information. Reorganize the database to create a clearer feedback data map.
  • the above step 331 may further include the following steps.
  • Step 3312 Iteratively generate multiple groups of text to be processed corresponding to all basic directory data.
  • attribute fusion aims to unify the primary attribute data corresponding to all text segment data and prevent attribute data with too subtle differences from being excessively distinguished, resulting in low contribution to the improvement of retrieval efficiency.
  • This problem usually occurs when the primary attribute data contains attribute data with two synonyms. For example, when the primary attribute data corresponding to two sets of text segment data are "clean" and "clean" respectively, the two primary attributes The distinction of data does not have too many beneficial effects on the generation of retrieval results or answer corpus. At this time, the two primary attribute data can be merged into one as long as the distinction error is allowed.
  • the benchmark of the above-mentioned fusion process can be obtained by searching according to the preset thesaurus, or it can be obtained by error calculation training of the output results.
  • the same-attribute segment aggregation aims to aggregate all text segments belonging to the same or similar attribute data.
  • the structure of all text segment data can be further organized to create a better Correspondence to facilitate retrieval.
  • the above process of aggregating segments with the same attribute can be implemented by adding tags to the text segment data or its associated data.
  • the similarity is used to determine whether fusion is needed and the objects of primary attribute data that need to be fused. Attribute fusion is achieved by modifying the primary attribute data. Then, through the redetermined attribute data, the entity pointing data is redetermined to change the segment and the entity. The association relationship between them enables segments with the same attribute to be set to point to entities related to the attribute.
  • the segment attribute element is constructed in the form of a data group or a comma-separated value, it contains the entity pointer data redetermined after segment aggregation, the segment attribute data redetermined after attribute fusion, and split into sentence units. text segment data to create a more sophisticated graph structure.
  • the present invention provides a first embodiment based on the above-mentioned implementation, which determines whether to perform attribute fusion by calculating the similarity between vectors, and further re-establishes based on the similarity and the current status of the association between text segment data and entities.
  • the optimized association between text segment data and entities enables the aggregation of segments with the same attributes.
  • the feedback data map generation method may specifically include the following steps.
  • Step 34 Construct entity nodes based on entity information elements, establish associations between entities based on entity relationship elements, store segment attribute elements in entity nodes according to the association between segments and entities, and generate a feedback data map.
  • TF-IDF Term Frequency-Inverse Document Frequency, Term Frequency-Inverse Text Frequency Index
  • TF-IDF Term Frequency-Inverse Document Frequency, Term Frequency-Inverse Text Frequency Index
  • the segment attribute vectors may be mutually independent word vectors, or may be a segment vector composed of multiple word vectors.
  • the metric of similarity value between two pairs can be established using minimum edit distance, Euclidean Distance, Jaccard Similarity Coefficient, Hamming distance or classifier.
  • Step 32 Extract and form entity information elements and entity relationship elements based on the basic directory data.
  • Step 332 Based on the text to be processed, bidirectional feature representation and attribute classification recognition are performed sequentially to obtain multiple sets of primary attribute data corresponding to different text segment data.
  • Step 41 If the attribute similarity value between the first attribute vector and the second attribute vector satisfies the preset fusion similarity value, it is determined that the first attribute data and the second attribute data have the same connotation.
  • Step 42 Re-determine the first attribute data and the segment position information in sequence according to the corresponding entity pointing data, the data amount of the segment attribute data, the data amount of the text segment data, and the segment position information respectively corresponding to the first attribute data and the second attribute data.
  • segment attribute data can be linguistically streamlined to ensure that the segment attribute data can clearly and concisely describe the category of the current segment text data.
  • step 420 may be before other refinement steps, or may be performed after or between other refinement steps.
  • steps of the present invention also imply the meaning of "when it is determined that the first pointing data and the second pointing data point to the same entity, only step 420 is executed without modifying other data.” This point should be understood by those skilled in the art. understand.
  • Step 420 Compare the data size of the first attribute data and the data size of the second attribute data, and set the first attribute data and the second attribute data to segment attribute data with a smaller data size.
  • Step 34 Construct entity nodes based on entity information elements, establish associations between entities based on entity relationship elements, store segment attribute elements in entity nodes according to the association between segments and entities, and generate a feedback data map.
  • Step 3321' traverse all the data in the text to be processed.
  • the preset clause symbol is recognized, extract the data between the current clause symbol and the previous clause symbol as a set of text segment data, and iterate to obtain all Text segment data.
  • the above technical solution can also be to extract the data between the current clause symbol and the next clause symbol as a set of text segment data. It can be seen that any implementation method of extracting the part between two adjacent clause symbols as a set of text segment data can be alternatively applied to this application.
  • Step 331 Search the original information database according to the basic directory data to obtain multiple sets of text to be processed corresponding to different basic directory data.
  • Step 33222 Enter all the words in the marked segment data into the position embedding layer, segmentation embedding layer and word embedding layer respectively to obtain the position vector representation, segmentation vector representation and word vector representation respectively corresponding to each word, and then The position vector representation, segmentation vector representation and word vector representation are fused to obtain the word input vector corresponding to each word.
  • Step 33224 Connect the word encoding vectors corresponding to the same marked segment data in sequence to obtain the word vector feature representation of the corresponding text segment data.
  • Step 3324 Call the preset first activation function to process the word vector feature set, and identify the primary attribute data corresponding to the text segment data according to the preset attribute classification rules.
  • Step 34 Construct entity nodes based on entity information elements, establish associations between entities based on entity relationship elements, store segment attribute elements in entity nodes according to the association between segments and entities, and generate a feedback data map.
  • step 33221 can also be to add the sentence head vector mark before the first data of the text segment data, Traverse all the data in the text segment data.
  • step 33221 can also be to add the sentence head vector mark before the first data of the text segment data, Traverse all the data in the text segment data.
  • the preset delimiter symbol is recognized, extract the data between the current delimiter symbol and the previous delimiter symbol or the first data as a set of data, and extract the data between the current delimiter symbol and the previous delimiter symbol.
  • Add the inter-sentence vector mark at the symbol iterate until all words in the text segment data are recognized.
  • the text segment data can be split into short sentences with smaller data volume to adapt to the input limitations of various models.
  • the above-mentioned splitting can also be implemented based on standards such as word formation, part of speech, etc., and the present invention does not provide an exhaustive list here.
  • the position vector representation represents the position difference of different words in the marked segment data
  • the segmentation vector representation represents the content difference between different parts in the marked segment data
  • the word vector representation represents the corresponding Vectors of multiple preset dimensions for different words.
  • the position embedding layer, segmentation embedding layer and word embedding layer preferably have the same preset dimension standard, so the output position vector representation, segmentation vector representation and word vector representation, in addition to correspondingly containing the above different feature information, will also mark
  • the segment data is converted into a vector representation with uniform dimensions for subsequent encoding and feature extraction.
  • the two-way self-attention allocation is used to form different ways of vector fusion according to different semantic scenes. In this way, when traversing all word input vectors in text segment data, the relationship between the entire text can be fully reflected, and different weights and attention can be assigned to different context situations to enhance feature representation from the context dimension.
  • the residual connection is used to add the word input vectors before and after bidirectional self-attention allocation as the output, thereby avoiding the dilemma of reconstructing the entire output, allowing the model to be directly back-transmitted to the word input vector layer during model training, thus Simplify the model training process.
  • the layer standardization is used to use the output of residual connection processing as input, and standardize the output of the hidden layer of the neural network with 0 mean and 1 variance, and normalize it to a standard normal distribution, thereby speeding up the training speed and convergence speed.
  • the linear transformation is used to repeatedly perform linear transformation on the input data twice. On the basis of keeping the length of the vector after linear transformation consistent with the original vector, it enhances the expressive ability of the feature, thereby obtaining the word encoding vector.
  • connection operation which can be simple splicing, or other related relationships after the operation, to generate a word vector feature representation in the form of a sequence.
  • the dimension d is preferably 768 dimensions, but of course it can also be adjusted according to the specific conditions of the model.
  • the word vector is repeatedly convolved multiple times, activation is added to the multiple repeated convolutions, and then pooling is performed after each activation, and so on.
  • Feature enhancement and word vector dimension refining are performed multiple times, and finally a word vector feature set with high feature refinement and low overall dimension is obtained, thereby constituting an improvement on step 3323 in the above-mentioned second embodiment.
  • the feedback data map generation method provided in this specific example at the level of step 3323, as shown in Figures 1, 2, 5 and 6, may specifically include the following steps.
  • Step 31 Traverse all original corpus in the original information database and generate basic catalog data.
  • Step 32 Extract and form entity information elements and entity relationship elements based on the basic directory data.
  • Step 331 Search the original information database according to the basic directory data to obtain multiple sets of text to be processed corresponding to different basic directory data.
  • Step 3321 Traverse the text to be processed, split it according to the preset segmentation rules, and obtain text segment data.
  • Step 3322 Input the text segment data into the preset bidirectional feature representation model in sequence, and sequentially perform vectorization representation, vector encoding, and fusion operations to obtain word vector feature representations corresponding to the text segment data.
  • Step 33231 According to the convolution kernel of the preset size, the preset second activation function is called, and the convolution and activation are repeatedly performed twice for each word vector in the word vector feature representation, and the obtained first-order convolution words are The vectors are pooled to obtain multiple sets of intermediate word vector features corresponding to the word vector feature representation.
  • Step 33233 Combine and match the final word vector features corresponding to the same word vector feature representation to obtain a word vector feature set.
  • Step 3324 Call the preset first activation function to process the word vector feature set, and identify the primary attribute data corresponding to the text segment data according to the preset attribute classification rules.
  • Step 333 According to the primary attribute data, text segment data and entity pointing data, attribute fusion and segment aggregation with the same attribute are performed in sequence to generate segment attribute elements.
  • Step 34 Construct entity nodes based on entity information elements, establish associations between entities based on entity relationship elements, store segment attribute elements in entity nodes according to the association between segments and entities, and generate a feedback data map.
  • the above-mentioned step 33231 may be preferably configured to perform: convolution, activation, convolution, and activation on each word vector in the word vector feature representation, thereby obtaining the first-order convolution word vector.
  • the above-mentioned step 33232 may be preferably configured to perform: convolution, activation, convolution, and activation on the intermediate word vector features, thereby obtaining the second-order convolution word vector.
  • the convolution kernel used in the above convolution step is preferably the same preset convolution kernel, and the activation function used in the above activation may also be preferably the same second activation function.
  • the second activation function is a Relu activation function to take advantage of the fact that its positive input does not have a saturated gradient problem, and its pure linear relationship is calculated and the activation speed is fast.
  • the pooling layer may be configured to perform max pooling.
  • the abstract representation in English can be: word vector feature representation Word Embedding sequentially performs ConvD_1 convolution, Relu_1 activation, Conv1D_2 convolution, Relu_2 activation, MaxPooling1D_1 pooling, ConvD_3 convolution, Relu_3 activation, Conv1D_4 convolution, Relu_4 activation, MaxPooling1D_2 pooling .
  • the final word vector features can be combined and matched to obtain a word vector feature set corresponding to the text segment data.
  • the number of convolution filters may be 256, and the size of the convolution kernel may be 3.
  • a Dropout layer can also be set up to randomly delete some neurons to prevent overshooting. fitting.
  • a fully connected layer can also be set between the output of the word vector feature set and the activation of the first activation function, with a corresponding length of 128, used to combine local features to output global features.
  • a step of length modification of the word vector feature representation may also be included to adapt to the input requirements of the attribute classification convolution model. Specifically, for word vector feature representations whose length is greater than the length standard value of the attribute classification convolution model, a truncation operation can be performed on them; for word vector feature representations whose length is less than the length standard value, a completion operation can be performed on them, Preferably 0 is added. Preferably, the standard value of the length is 32.
  • the preferred implementation finally presented in this specific example may provide technical solutions that simultaneously include the above three levels as shown in Figures 1, 2, 5 and 6. At this time, this specific example simultaneously has the beneficial effects of the above three levels, and cooperates with each other to produce other technical effects, which will not be described again here.
  • the present invention provides a third embodiment based on the above-mentioned implementation, by configuring pre-training steps and tasks before the bi-directional feature representation model, thereby preferably configuring the bi-directional feature representation model as a pre-training model, thus saving model operation time. time consumption, improve the accuracy of feature extraction and avoid dependence on forward moments.
  • the feedback data map generation method may specifically include the following steps.
  • Step 31 Traverse all original corpus in the original information database and generate basic catalog data.
  • Step 32 Extract and form entity information elements and entity relationship elements based on the basic directory data.
  • Step 331 Search the original information database according to the basic directory data to obtain multiple sets of text to be processed corresponding to different basic directory data.
  • Step 51 Receive the pre-training data set.
  • Step 52 Enable the bidirectional feature representation model, execute the mask language model task and the next sentence prediction task in sequence, perform iterative traversal prediction and verification on the data in the pre-training data set, and obtain the standard model parameter set.
  • Step 53 Load the standard model parameter set into the bidirectional feature representation model.
  • Step 3321 Traverse the text to be processed, split it according to the preset segmentation rules, and obtain text segment data.
  • Step 3323 Input the word vector feature representation into the preset attribute classification convolution model to obtain a word vector feature set corresponding to the word vector feature representation.
  • Step 3324 Call the preset first activation function to process the word vector feature set, and identify the primary attribute data corresponding to the text segment data according to the preset attribute classification rules.
  • Step 333 According to the primary attribute data, text segment data and entity pointing data, attribute fusion and segment aggregation with the same attribute are performed in sequence to generate segment attribute elements.
  • Step 34 Construct entity nodes based on entity information elements, establish associations between entities based on entity relationship elements, store segment attribute elements in entity nodes according to the association between segments and entities, and generate a feedback data map.
  • the mask language model task represents a part of the words in the input data group in the random occlusion pre-training data set, so that the bidirectional encoder can predict and check the occluded words.
  • the next sentence prediction task represents the random extraction of two input data groups, and the bidirectional encoder determines whether they are adjacent in the pre-training data set. In this way, after iterative training, the bidirectional encoder has stronger prediction ability between different text segment data and between different words in the text segment data, thereby making the vectorization process more accurate.
  • steps 51 to 53 are not necessarily set between step 331 and step 3321. They can be set at any position before step 3322 and its derivatives 3322'. Just complete the pre-training before step.
  • the bidirectional feature representation model can preferably be a Bert model, which can solve the problem of other pre-training models overly relying on forward input and prevent the long operation time caused by low number of network layers.
  • the emergence of disadvantages such as prioritizing extraction of features can also avoid the decrease in accuracy that may occur when other neural network models perform text vectorization.
  • the bidirectional feature representation model is configured as a pre-trained model such as the Bert model, the pre-trained model can be used directly, or the pre-training process as shown in Figure 7 can be performed. Trained on the pre-training data set.
  • the pre-training data set can be a general text data set, or can be re-established based on the original information database (refrigerator instructions) or other text data in a specific field.
  • the original information database may contain an inherent directory structure information, which represents the user's preset classification tendency for the original corpus. Therefore, the directory structure information can be extracted to establish entity information elements and entity relationship elements. However, in another case, the directory structure information does not exist in the original information database, or the directory structure information is too broad to be extracted in a more detailed manner, which will affect the overall function of the feedback data map.
  • the present invention further provides a feedback data map generation method as shown in Figure 1 and Figure 8, which can be mounted on any of the above refrigerators, question and answer equipment and/or
  • the feedback data map generation device can also be installed in any other device, equipment or system mentioned above.
  • the method for generating a feedback data map may specifically include the following steps.
  • Step 313 Based on the relative positions of the structural corpus information and the directory structure information in the original information database, the directory structure information and the structural corpus information are sorted and integrated to obtain basic directory data.
  • Step 33 According to the basic directory data and the original information database, attribute fusion and segment aggregation with the same attribute are sequentially performed to generate multiple sets of segment attribute elements corresponding to different text segment data.
  • Step 34 Construct entity nodes based on entity information elements, establish associations between entities based on entity relationship elements, store segment attribute elements in entity nodes according to the association between segments and entities, and generate a feedback data map.
  • entities can be extracted not only by relying on the inherent directory structure information in the original information base, but also by autonomously identifying other structural corpus information that can serve as entities in the original information base, thereby supplementing the directory structure information, or relying on itself Form a set of basic directory data. Based on this, you can spontaneously understand the data in the original information database that meets the standard format information requirements, improving the pertinence of entity extraction. Since the original corpus that meets the standard format information requirements usually records more detailed and lower-level content, the extraction can The entities are more accurate, and the subsequent feedback data will be more directional.
  • the standard format information may be bold mark information, background mark information, italic mark information, etc.
  • the directory structure information may be extracted from the outline part in *.doc, *.docx format files, or It can be obtained by obtaining the preset outline style and traversing and searching based on the style.
  • Step 31 Traverse all original corpus in the original information database and generate basic catalog data.
  • Step 321 Iterate and extract and sort the basic directory data as entities, and execute the corresponding generated entity serial number data and basic directory data. Match to form entity information elements.
  • Step 322 Iterate and determine the external association between pairs of basic directory data as entities based on the hierarchical relationship between the basic directory data, and match and form entity relationship elements based on the external association and the corresponding two pieces of basic directory data. .
  • Step 33 According to the basic directory data and the original information database, attribute fusion and segment aggregation with the same attribute are sequentially performed to generate multiple sets of segment attribute elements corresponding to different text segment data.
  • the entity serial number data is used to represent content differences between entities, and to represent the association between entities and the text segment data.
  • steps 321 and 322 are not necessarily set in the step 32 at the same time.
  • those skilled in the art can choose to implement one of them and adopt other solutions to form the other one of the entity information element and the entity relationship element.
  • the entity serial number data may be in the same or at least related form to the entity pointing data. In this way, the entity pointing data can clearly lock a single entity to establish an association relationship.
  • the entity serial number data does not necessarily represent the hierarchical relationship between the basic directory data.
  • the directory structure data includes ⁇ serial number 1, entity 1>, ⁇ serial number 1.1, entity 2>, and the structural corpus information includes ⁇ serial number 1.1.1, entity 3> that belongs to entity 2.
  • the above three They jointly constitute the basic directory data, and the decimal digits of the serial numbers can represent the hierarchical relationship between the basic directory data.
  • ⁇ serial number 1, entity 1>, ⁇ serial number 2, entity 2>, ⁇ serial number 3, entity 3> can be generated correspondingly. It can also establish the entity itself, the relationship between entities, and the relationship between entities and segments. The technical effect of the relationship between the two, and save computational steps.
  • the entity pointer data of the segment attribute element associated with any of the above entities can be consistent with the entity serial number data of the corresponding entity.
  • the entity serial number data of the corresponding entity can be consistent with the entity serial number data of the corresponding entity.
  • it can It has the form of ⁇ serial number 3, segment attribute data, text segment data>.
  • entity relationship elements For the extraction of entity relationship elements, refer to the serial number part of the basic directory data ⁇ serial number 1, entity 1>, ⁇ serial number 1.1, entity 2>, ⁇ serial number 1.1.1, entity 3>. It can be seen that they have at least the following external relationships: Connotation: Entity 1 contains entity 2, entity 2 contains entity 3. Based on this, the entity relationship elements of ⁇ entity 1, contains, entity 2> and ⁇ entity 2, contains, entity 3> can be established, and when necessary, the entity of ⁇ entity 1, contains, entity 3> can also be established Relationship elements.
  • this further implementation may include the technical solutions at the above two levels at the same time.
  • this further embodiment has the beneficial effects of the above two aspects at the same time, and cooperates with each other to produce other technical effects, which will not be described again here.
  • step 311 the directory structure information in the original information database is analyzed according to it.
  • the following steps may be further included.
  • Step 3111 Locate the directory data set in the original information database.
  • Step 3112 Extract the directory title information and directory level serial number in the directory data set to form directory structure information, and sort the directory structure information according to the directory level serial number.
  • the method of locating the catalog data set may be to simply search for the word "catalogue", or it may be to identify the data containing the outline catalog format in the original information database, and collect the pages containing the data in the outline catalog format as the catalog data set.
  • the present invention provides an embodiment based on yet another embodiment described above.
  • the feedback data map generation method may specifically include the following steps.
  • Step 311 Analyze and obtain the directory structure information in the original information database.
  • Step 312 Iteratively identify multiple sets of original format information corresponding to different original corpus. When the original format information matches the preset standard format information, extract the original corpus corresponding to the original format information as structural corpus information.
  • Step 3131 Iteratively determine the affiliation between the structural corpus information and all directory structure information, and obtain the directory structure information located at the closest level to the structural corpus information as the reference structure information.
  • Step 3132 Determine the directory level serial number of the structural corpus information based on the directory level serial number in the reference structural information and the distribution of other adjacent structural corpus information.
  • Step 3133 Sort and integrate the directory structure information and structural corpus information according to the directory level serial number to obtain basic directory data.
  • Step 32 Extract and form entity information elements and entity relationship elements based on the basic directory data.
  • Step 33 According to the basic directory data and the original information database, attribute fusion and segment aggregation with the same attribute are sequentially performed to generate multiple sets of segment attribute elements corresponding to different text segment data.
  • Step 34 Construct entity nodes based on entity information elements, establish associations between entities based on entity relationship elements, store segment attribute elements in entity nodes according to the association between segments and entities, and generate a feedback data map.
  • the directory structure information includes corresponding directory title information and directory level serial number.
  • the subordination relationship between the structural corpus information and the directory structure information can be inferred through the adjacent relationship between the directory structure information and the structured corpus information, and based on the directory level sequence number of the directory structure information one layer above the structured corpus information (for example, entity 2 The serial number 1.1), generate the directory level serial number of the structural corpus information (for example, the serial number 1.1.1 of entity 3), and match the directory level serial number with the corresponding directory structure information and structural corpus information to facilitate subsequent Extract relationships (such as inclusion relationships) between basic directory data (i.e. entities).
  • the directory structure information includes first structure information and second structure information that are set successively, and the first structure information It includes first title information and a first level serial number, and the second structure information includes second title information and a second level serial number.
  • step 3131 may further include:
  • Step 31310 Link to the actual location pointed to by the first title information in the original information database, traverse downward and iteratively identify multiple sets of original format information corresponding to different original corpora, and extract the corresponding original corpora as structural corpus information and store them respectively. It is at least a set of first corpus information until the second structural information is recognized.
  • step 3132 may further include:
  • Step 31320 Based on the first-level serial number and the internal arrangement order of the first corpus information, generate at least one set of first-level serial numbers corresponding to at least one set of first corpus information, and compare the first-level serial number with the corresponding third-level serial number. When a piece of corpus information is matched, the first level sequence number is used as the directory level sequence number corresponding to the first corpus information.
  • the corresponding relationship between the directory structure information and other locations in the original information database and the original corpus can be easily established through inherent links, and the directory level sequence number of the structured corpus information can be generated accordingly.
  • the entire first corpus information is subordinate to the first structural information, and the first corpus information includes a plurality of original corpus arranged one after another. If the first level serial number is 2.3, then multiple original corpora in the first corpus information may have 2.3.1, 2.3.2, 2.3.3, etc. as their directory level serial numbers in sequence. It can be seen that this specific example mainly uses downward traversal and real-time generation to obtain the directory level serial number of the structural corpus information.
  • the step 312 may further include:
  • Step 3120 Iteratively traverse the parts of the original information database except the directory structure information, extract the original corpus that meets the conditions, and obtain the first corpus information.
  • step 3131 may further include:
  • Step 31310' search forward according to the first corpus information, obtain the first-appearing directory structure information as the reference structure information, and count the number of other structural corpus information arranged between the first corpus information and the reference structure information, and obtain the previous The number of corpus.
  • step 3132 may further include:
  • Step 31320' Generate a first-level serial number corresponding to the first corpus information based on the directory level serial number of the reference structure information and the number of forward corpus information, and match the first-level serial number with the first corpus information to obtain the first corpus information.
  • the primary serial number is used as the directory level serial number corresponding to the first corpus information.
  • This another specific example can be applied to the situation where the directory structure data cannot be linked to other locations in the original information database. After first querying the structural corpus information that meets the format conditions, search forward again to obtain the closest adjacent and belonging to it.
  • the directory structure data of the upper level is used to generate the directory level serial number of the structural corpus information based on the directory level serial number of the reference structure information.
  • the above two specific examples are not necessarily mutually exclusive.
  • it is first determined whether there is a link in the directory structure information, and then one of the two specific examples is selectively used for processing.
  • the above content provides different implementation modes, examples and specific examples of the present invention.
  • Those skilled in the art can understand that the various technical solutions formed by discussing them at different levels are not necessarily separated. mutually exclusive, those skilled in the art can certainly combine two or more of the above multiple technical solutions to form a more optimized technical solution.
  • the optimal technical solution provided by the present invention is to implement all the steps involved in the above technical solution at the same time.
  • the feedback data map generation method establishes entity information elements and entity relationship elements by extracting basic directory data, can fully utilize the existing structural relationships of the original information database to construct the data map, and improves the efficiency of data map generation.
  • Through attribute fusion and segment aggregation with the same attribute not only can we avoid poor consistency of contextual attributes, but we can also establish the correlation between entities and all other related data in the database during the graph generation stage, and further improve the graph on a segment basis. level of granularity, so that the retrieval phase can quickly and accurately lock relevant information, thus achieving the technical effect of accurate content and high matching of retrieval results, greatly improving retrieval speed and retrieval accuracy.

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)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明揭示了一种回馈数据图谱生成方法及冰箱,其中,方法包括:遍历原始信息库中所有原始语料,生成基础目录数据;根据基础目录数据,抽取形成实体信息元素以及实体关系元素;根据基础目录数据和原始信息库,依次执行属性融合以及同属性句段聚合,生成对应于不同文本句段数据的多组句段属性元素;根据实体信息元素构建实体节点,根据实体关系元素建立实体间的关联关系,将句段属性元素按照句段与实体间的关联关系,对应存入所述实体节点中,生成回馈数据图谱。本发明提供的方法,生成效率高,一致性更好,粒度级更细。

Description

回馈数据图谱生成方法及冰箱
本申请要求了申请日为2022年06月22日,申请号为202210713627.6,发明名称为“回馈数据图谱生成方法、生成设备、问答设备及冰箱”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及信息技术领域,尤其涉及一种回馈数据图谱生成方法及冰箱。
背景技术
现如今,搭载自然语言处理系统以便于进行信息检索,已经成为人们工作和生活中不可或缺的一部分,当前的检索引擎主要通过对输入的语句进行关键词拆分,对既有的数据库进行遍历检索,并按照关键词的重复度进行降序排列,以方便人们获取想要得到的信息。然而,由于数据库内的数据排列较为零散,每次更换检索关键词都需要对整个数据库进行遍历,检索效果差,且回馈数据生成的速度缓慢。
现有技术中还提供一种对数据库建立知识图谱,将数据库中较为核心的内容提炼为实体,从而建立实体节点以及实体之间的关联关系,以使用户输入关键词后,可以根据关键词与实体之间的相似度进行检索,如此加快检索速度。但此种技术方案仍然存在一些缺陷:(1)更多地关注与实体本身及实体之间的关系,轻视了实体与数据库中其他内容之间的关联关系,导致检索抽取时输出的内容纷繁复杂,且与输入检索关键词的匹配度不高;(2)抽取实体及相关数据的过程中,在相关数据分布于数据库中多个位置时,仍然需要对数据库进行遍历才能得到完整的相关数据,对提升检索速度的贡献较小;(3)即使建立了实体与相关数据的关联性,现有技术中相关数据的划分较为大略,通常是以大量的数据作为一组相关数据,数据图谱的粒度级较大,导致检索精准度较低。
发明内容
本发明的目的之一在于提供一种回馈数据图谱生成方法,以解决现有技术中生成方法所搭建的图谱,检索结果的内容复杂、匹配度低,提高检索速度的程度有限,以及粒度级较粗所导致的检索精准度低的技术问题。
本发明的目的之一在于提供一种回馈数据图谱生成设备。
本发明的目的之一在于提供一种问答设备。
本发明的目的之一在于提供一种冰箱。
为实现上述发明目的之一,本发明一实施方式提供一种回馈数据图谱生成方法,包括:遍历原始信息库中所有原始语料,生成基础目录数据;根据所述基础目录数据,抽取形成实体信息元素以及实体关系元素;根据所述基础目录数据和所述原始信息库,依次执行属性融合以及同属性句段聚合,生成对应于不同文本句段数据的多组句段属性元素;其中,所述文本句段数据在所述原始语料中包含有多组;根据所述实体信息元素构建实体节点,根据所述实体关系元素建立实体间的关联关系,将所述句段属性元素按照句段与实体间的关联关系,对应存入所述实体节点中,生成回馈数据图谱。
为实现上述发明目的之一,本发明一实施方式提供一种回馈数据图谱生成设备,包括:目录生成模块,用于遍历原始信息库中所有原始语料,生成基础目录数据;基本元素抽取模块,用于根据所述基础目录数据,抽取形成实体信息元素以及实体关系元素;属性元素分析模块,用于根据所述基础目录数据和所述原始信息库,依次执行属性融合以及同属性句段聚合,生成对应于不同文本句段数据的多组句段属性元素;其中,所述文本句段数据在所述原始语料中包含有多组;图谱构建模块,用于根据所述实体信息元素构建实体节点,根据所述实体关系元素建立实体间的关联关系,将所述句段属性元素按照句段与实体间的关联关系,对应存入所述实体节点中,生成回馈数据图谱。
为实现上述发明目的之一,本发明一实施方式提供一种问答设备,包括:存储器、处理器,所述问答设备还包括:存储在所述存储器上并可在所述处理器上运行的回馈数据图谱生成程序,所述回馈数据图谱生成程序被所述处理器执行时,实现上述任一种技术方案所述的回馈数据图谱生成方法的步骤,和/或存储在所述存储器上,根据上述任一种技术方案所述的回馈数据图谱生成方法生成的回馈数据图谱。
为实现上述发明目的之一,本发明一实施方式提供一种冰箱,包括不同温度区域的储存间室,以及用于开闭储存间室的门体,所述冰箱还包括上述技术方案所述的问答设备。
与现有技术相比,本发明提供的回馈数据图谱生成方法,通过抽取基础目录数据建立实体信息元素和实体关系元素,能够充分利用原始信息库既有的结构关系进行数据图谱的构建,提升数据图谱生成的效率;通过属性融合及同属性句段聚合,不仅能够避免上下文属性一致性差,还能在图谱生成阶段就建立好实体与数据库中其他所有相关数据的关联关系,并以句段为单位进一步提升了图谱的粒度级,以使检索阶段能够快速且准确地锁定相关信息,如此实现了检索结果内容精准、匹配度高,大幅提高检索速度以及检索精准度的技术效果。
附图说明
图1是本发明一实施方式中回馈数据图谱生成方法的步骤示意图。
图2是本发明另一实施方式中回馈数据图谱生成方法的部分步骤示意图。
图3是本发明另一实施方式中回馈数据图谱生成方法的第一实施例的部分步骤示意图。
图4是本发明另一实施方式中回馈数据图谱生成方法的第一实施例的一个具体示例的部分步骤示意图。
图5是本发明另一实施方式中回馈数据图谱生成方法的第二实施例的部分步骤示意图。
图6是本发明另一实施方式中回馈数据图谱生成方法的第二实施例的一个具体示例的部分步骤示意图。
图7是本发明另一实施方式中回馈数据图谱生成方法的第三实施例的部分步骤示意图。
图8是本发明再一实施方式中回馈数据图谱生成方法的部分步骤示意图。
图9是本发明再一实施方式中回馈数据图谱生成方法一实施例的一个具体示例的部分步骤示意图。
图10是本发明再一实施方式中回馈数据图谱生成方法一实施例的另一个具体示例的部分步骤示意图。
具体实施方式
以下将结合附图所示的具体实施方式对本发明进行详细描述。但这些实施方式并不限制本发明,本领域的普通技术人员根据这些实施方式所做出的结构、方法、或功能上的变换均包含在本发明的保护范围内。
需要说明的是,术语“包括”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者还包括为这种过程、方法、物品或者设备所固有的要素。此外,术语“第一”、“第二”、“第三”等仅用于描述目的,而不能理解为指示或暗示相对重要性。
随着技术的发展,在数据分析和人机交互层面上,特别是在NLP(Natural Language Processing,自然语言处理)这一分支下,人们愈发不满足于现有的检索系统,在输入关键词后才进行整个数据库范围的遍历检索,所导致的检索效率低下、输出内容冗杂而碎片化,以及算力要求高的现状,从而,进行着对检索对应的回馈数据建立知识图谱的拓展研究。目标在于:当用户输入检索关键词或问题语料时,能够从知识图谱中按照脉络快速查询得到对应的检索结果或答案语料,据此形成对用户的回馈。如此,能够提升检索效率、增强对数据内容的锁定能力,便于用户快速得到结果或进行二次检索,以大幅提升交互体验以及生产效率。
本发明在上述技术基础下,进一步根据原始信息库中的目录数据抽取实体及实体间的关系,在根据目录数据和原始信息库所包含的原始语料执行属性融合和句段融合,以使上下文的属性判断统一,且调整归属于同一属性的多种句段的位置和关联关系,从而建立粒度级更细、关联关系维度更多,且更为准确的回馈数据图谱。本领域技术人员得以用此回馈数据图谱,结合自然语言处理的分析逻辑,共同构建问答反馈系统或检索系统。如此,形成了一种性能优异、输出结果具有更细粒度的回馈数据图谱生成方法、生成设备、问答设备及冰箱。
本发明提供的下述回馈数据图谱生成方法、生成设备和问答设备,可以被具体设置于一种或多种领域下,从而赋予该领域的装置,以知识图谱构建相关的功能。在一种场景下,该领域可以是家用电器领域、移动设备领域或互联网领域,并分别可以是:应用于空调、洗衣机或热水器等装置中,或应用于移动电话、个人电脑、手表、手环或耳机等装置中,或应用于asp、jsp、php等动态页面中、htm、html等静态页面中、基于Windows、Linux、iOS平台的应用软件中。从而,赋予该领域装置或其他组分以本发明具有的技术效果。
本发明一实施方式中,具体提供一种冰箱,包括不同温度的存储间室,以及用于开闭存储间室的门体,用户可以通过开闭所述门体,向所述存储间室内存取物品,来提供物品以冷藏、冷冻或变温的存储环境。进一步地,所述冰箱还包括一种问答设备,从而实现对用户输入的问句或检索关键词进行接收,根据预设的回馈数据图谱,或根据预设的生成程序建立回馈数据图谱后,再根据该回馈数据图谱,生成对应问句的答案或检索结果而回馈至用户侧。所述问答设备设置于所述冰箱中。基于其功能配置,所述冰箱可以进一步实现对用户操作冰箱的指导、对冰箱内储藏物情况的分析反馈、对冰箱自身功能的自检与反馈、对冰箱与服务器的通信状况的反馈,以及对其他与冰箱相关的周边问题或检索的回馈。
例如,在一种实施方式中,可以是用户提出对智能冰箱操作的问题后,诸如提出如何设置感应自动开门、如何设置冰箱自动闭门、如何设置冰箱冷藏间室和冷冻间室温度等问题后,所述冰箱调用该问答设备,根据基于“操作指导说明”所建立的回馈数据图谱进行检索分析,输出检索结果或答案语料以形成回馈。在另一种实施方式中,也可以是用户提出关于冰箱内部储存物的问题后,诸如提出基于现有食材能做出何种菜品、要做出某种菜品还需要购买何种食材等问题后,所述冰箱调用该问答设备,根据回馈数据图谱进行检索分析,或结合对服务器上相关数据库的访问爬取后,根据该相关数据库和回馈数据图谱进行检索分析,从而输出检索结果或答案语料以形成回馈。
所述问答设备与所述冰箱在结构层面上的配合,可以是所述问答设备设置于所述冰箱内部任何一个能够接收供电、与用户进行交互的位置,并进一步地,可以设置于所述冰箱内部任何一个不会过分受到冰箱内部制冷系统影响,和/或能够与服务器进行通讯的位置。在所述问答设备被配置为具有诸如显示屏、音频采集设备和/或音频输出设备等输入输出设备时,或所述问答设备与上述输入输出设备连接时,至少上述输入输出设备可以设置于所述冰箱靠近 用户一侧,上述问答设备可以至少设置于靠近上述输入输出设备一侧,从而简化接线。
在一种优选的实施方式中,所述问答设备包括触摸显示屏。所述触摸显示屏被具体嵌设于所述门体靠近用户一侧,用户可以向所述触摸显示屏输入检索关键词或问句数据,所述问答设备对所述检索关键词或所述问句数据进行处理后,在回馈数据图谱上检索匹配生成对应的检索结果或答案语料,并将其显示于所述触摸显示屏上。当然,在其他实施方式中,接收所述检索关键词和所述问句数据的方式,可以具体为或包括:音频采集设备接收语音形式的数据,并交由所述问答设备中其他部分进行语音识别。输出所述检索结果或所述答案语料的方式可以具体为或包括:音频输出设备以语音形式进行回馈输出。
为了适应更多应用场景和其他领域,本发明还提供一种问答设备,可以设置于上述冰箱内,也可以设置于前述其他装置,或本文未提及但本领域技术人员能够想到的其他领域装置中,从而实现对应的技术效果。当然,本发明并不排斥将诸如所述冰箱这一整体,统称为一种问答设备,换言之,问答设备除了能够实现回馈数据图谱生成功能和/或调用回馈数据图谱进行问答的功能以外,还可以具有其他功能配置。
具体地,问答设备包括存储器、处理器,基于此,问答设备利用处理器执行存储器中的程序,并调用存储器中存储的相关数据,实现响应用户问句数据或检索关键词输入,对应输出答句语料或检索结果。
其中,存储器可以包括RAM(Random Access Memory,随机存取存储器),也可以包括NVM(Non-Volatile Memory,非易失性存储器),例如至少一个磁盘存储器。可选地,存储器还可以是至少一个远离前述处理器设置的存储装置。
优选地,存储器可以为或包括一种或多种计算机可读存储介质,所述计算机可读存储介质,可以是计算机能够存取的任何可用介质,所述可用介质可以是例如软盘、硬盘、磁带等的磁性介质,或例如DVD(Digital Video Disc,高密度数字视频光盘)等的光介质,或例如SSD(Solid State Disk,固态硬盘)等的半导体介质。
处理器可以是通用处理器,包括CPU(Central Processing Unit,中央处理器)、NP(Network Processor,网络处理器)等,还可以是DSP(Digital Signal Processing,数字信号处理器)、ASIC(Application Specific Integrated Circuit,专用集成电路)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。
本发明提供的问答设备还可以包括通信接口和通信总线。处理器、通信接口、存储器通过通信总线完成相互间的通信。其中,通信接口用于上述问答设备与其他设备之间的通信。通信总线可以是PCI(Peripheral Component Interconnect,外设部件互连标准)总线或EISA(Extended Industry Standard Architecture,扩展工业标准结构)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。
在一种实施方式中,问答设备还包括存储在存储器上,并可在处理器上运行的回馈数据图谱生成程序,所述回馈数据图谱生成程序被处理器执行时,实现一种回馈数据图谱生成方法,从而实现本发明的技术效果。进一步地,生成的回馈数据图谱可以被存储于存储器中,从而处理器可以执行存储器中的问答检索程序,利用存储器中的回馈数据图谱实现问答功能。
在另一种实施方式中,问答设备还包括存储在存储器上,根据一种回馈数据图谱方法生成的回馈数据图谱,如此,处理器同样可以执行存储器中的问答检索程序,利用存储器中已经存在的回馈数据图谱实现问答功能。应当注意地,此处“已经存在的”,包含“预设的”和“根据前置步骤生成的”两层含义,后者对应的实施例提供的技术方案则可以理解为是两种实施方式的结合,也即利用前一种实施方式执行程序生成回馈数据图谱,而后利用后一种实施方式直接实现问答功能。
上述问答功能的实现方案,可以采用本领域的任何现有技术实现,也可以具体设置为:分析问句数据和检索关键词句的内容;执行分词、词性解析等预处理步骤后进行向量化;将向量化后的输入数据与回馈数据图谱中的数据进行相似度比对(可以是先与其中的实体比对后再与实体对应的内容比对,也可以仅与其中的实体比对),检索得到最为相似的数据后,提取该数据对应的答案语料或检索结果(可以是提取与实体对应的下属数据内容,也可以是提取实体本身/下属数据内容所对应的其他数据内容),并进一步反馈给用户。
本发明一实施方式进一步提供一种回馈数据图谱生成设备,所述回馈数据图谱生成设备包括目录生成模块、基本元素抽取模块、属性元素分析模块和图谱构建模块。
其中,目录生成模块用于遍历原始信息库中所有原始语料,生成基础目录数据。基本元素抽取模块用于根据所述基础目录数据,抽取形成实体信息元素以及实体关系元素。属性元素分析模块用于根据所述基础目录数据和所述原始信息库,依次执行属性融合以及同属性句段聚合,生成对应于不同文本句段数据的多组句段属性元素。其中,所述文本句段数据在所述原始语料中包含有多组。图谱构建模块用于根据所述实体信息元素构建实体节点,根据所述实体关系元素建立实体间的关联关系,将所述句段属性元素按照句段与实体间的关联关系,对应存入所述实体节点中,生成回馈数据图谱。
当然,上述问答系统并不局限于仅具有上述功能模块,也并不限定上述功能模块仅具有上述功能配置。本领域 技术人员在本发明所提供的技术方案的启示下,可以想到添附具有其他功能的功能模块,也可以想到将其他功能配置添加于上述已有的功能模块中,来实现对所述问答系统功能的拓展。同时,值得强调地,上述功能模块的描述并不代表对其物理结构的限定,关于以独立模块形式进行描述的部分,其物理结构层面可以是由多个芯片或模块组成的,多者相互配合共同实现相关技术效果和功能步骤;关于以多个模块形式进行描述的部分,其物理结构层面也可以设置为统一的整体,例如统一命名为主控模块的MCU(Microcontroller Unit,微控制单元)、CPU(Central Processing Unit,中央处理器)等的情况,从而在该整体内部的不同功能分区中,执行相关功能步骤并实现对应的效果。
在一种优选的实施方式中,目录生成模块还可以包括目录提取模块、结构分析模块和整合排布模块。其中,所述目录提取模块,用于分析得到所述原始信息库中的目录结构信息。所述结构分析模块,用于迭代识别不同原始语料对应的多组原始格式信息;当所述原始格式信息匹配于预设的标准格式信息时,提取该原始格式信息对应的原始语料作为结构语料信息。所述整合排布模块,用于根据所述结构语料信息和所述目录结构信息在所述原始信息库中的相对位置,对所述目录结构信息和所述结构语料信息进行排序整合,得到所述基础目录数据。
所述基本元素抽取模块还可以进一步包括实体元素抽取模块和关系元素抽取模块。其中,所述实体元素抽取模块,用于迭代并以所述基础目录数据作为实体进行抽取和排序,将对应生成的实体序号数据和基础目录数据执行匹配,形成所述实体信息元素。所述关系元素抽取模块,用于迭代并根据所述基础目录数据之间的层级关系,确定作为实体的基础目录数据两两之间的外部关联关系,并根据所述外部关联关系以及对应的两项基础目录数据,匹配形成所述实体关系元素。
所述属性元素抽取模块23还可以进一步包括文本检索模块、属性识别模块和融合聚合模块。其中,所述文本检索模块,用于根据所述基础目录数据在所述原始信息库中检索,得到对应于不同基础目录数据的多组待处理文本。所述属性识别模块,用于根据所述待处理文本,依次执行双向特征表示以及属性分类识别,得到对应于不同文本句段数据的多组初级属性数据。所述融合聚合模块,用于根据所述初级属性数据、所述文本句段数据以及实体指向数据,依次执行属性融合和同属性句段聚合,生成所述句段属性元素。
在一种优选的实施方式中,所述回馈数据图谱生成设备还可以包括一种预训练模块,可以是独立设置的,也可以是设置于上述任一种模块、模型或神经网络之中的。所述预训练模块具体可以包括数据爬取模块、任务训练模块以及模型设置模块。其中,所述数据爬取模块,用于接收预训练数据集。所述任务训练模块,用于使能所述双向特征表示模型,依次执行掩码语言模型任务以及下句预测任务,对所述预训练数据集中的数据进行迭代遍历预测和验证,得到标准模型参数组。所述模型设置模块,用于将所述标准模型参数组搭载于所述双向特征表示模型。
本发明在一种实施方式中,进一步提供一种如图1所示的回馈数据图谱生成方法,可以搭载于上述任一种冰箱、问答设备和/或回馈数据图谱生成设备中,也可以搭载于上述任一种其他装置、设备或系统中。在该实施方式中,所述回馈数据图谱生成方法可以具体包括下述步骤。
步骤31,遍历原始信息库中所有原始语料,生成基础目录数据。
步骤32,根据基础目录数据,抽取形成实体信息元素以及实体关系元素。
步骤33,根据基础目录数据和原始信息库,依次执行属性融合以及同属性句段聚合,生成对应于不同文本句段数据的多组句段属性元素。
步骤34,根据实体信息元素构建实体节点,根据实体关系元素建立实体间的关联关系,将句段属性元素按照句段与实体间的关联关系,对应存入实体节点中,生成回馈数据图谱。
其中,所述文本句段数据在所述原始语料中包含有多组。
如此,可以首先根据原始信息库抽取得到既有的基础目录数据后,建立实体信息元素和实体关系元素等基本元素,而后结合基础目录数据和原始信息库,共同遍历与基础目录数据相对应的原始语料,并依次进行属性融合和同属性句段聚合,从而生成对应于每个基础目录数据的多组文本句段数据,以及与每组文本句段数据相对应的句段属性元素,最终将这些句段属性元素,根据句段与实体间的关联关系,也即文本句段数据与基础目录数据之间的关联关系,建立生成回馈数据图谱。从而,用户可以据此进行快速高效的信息检索。
具体地,上述原始信息库可以指代,据以生成回馈数据图谱的任何一种数据库、数据文本或数据集合,本发明并不限制其形式,可以根据实际应用场景进行灵活变换。在一种实施方式中,回馈数据图谱生成方法被设置于冰箱等制冷装置内,从而,上述原始信息库可以是冰箱等制冷装置的说明书全文,或说明书中诸如“语音助手”等的部分,原始语料指代该说明书内的句段描述,该说明书也是应用后续步骤建立实体信息元素、实体关系元素以及句段属性元素的基础。
在生成原始信息库之前,本发明并不限制其不具有或只能具有某种预处理步骤,换言之,上述原始信息库的构建过程同样可以根据本领域技术人员的需要实施,可以是直接爬取既有的数据库,可以是根据采集到的信息实时建立的数据库。较为特殊地,在所述原始信息库是冰箱说明书的实施方式中,步骤51之前还可以包括:识别说明书 文本格式,将所述说明书转化为预设的标准格式;根据格式转化后的说明书,建立所述原始信息库。在一种实施例中,说明书文本原始的格式可能是*.pdf格式或其他图形格式,预设的标准格式可以是*.doc、*.docx等可编辑的文本格式,转化的过程可以是单纯的格式整理,也可以是采用模板匹配法或几何特征抽取法进行文字识别,具体可以是采用OCR(Optical Character Recognition,光学字符识别)技术进行文字识别。
此外,上述实体信息元素、实体关系元素以及句段属性元素,可以具体配置为包含两项或三项数据的数据组形式,在进行最终的图谱构建之前,上述数据组可以具体地被存储于CSV(Comma-Separated Values,逗号分隔值)格式的文件中进行保存,基于此,上述三种元素的具体形式可以是逗号分隔值的形式。回馈数据图谱的具体建立方法,可以通过将实体信息元素导入图数据库引擎中,从而建立图形化的数据库,在一种实施方式中,所述图数据库引擎优选为Neo4j图形数据库,具有兼顾轻量化和高性能的特点,当然,也可以采用JanusGraph、HugeGraph、Dgraph等,分别来适应较高读写性能要求或较复杂计算性能要求等场景。
步骤33中描述了句段属性元素的生成步骤,利用基础目录数据对原始数据库中的数据进行识别分类,并进一步根据分类结果进行属性融合和同属性句段的聚合,表达了递进设置的两步操作。在一些实施方式中,可以通过文本聚类算法实现上述过程,例如可以是K均值算法等基于划分的聚类算法、变色龙算法等基于层次的聚类算法、DBSCAN等基于密度的聚类算法、CLIQUE等基于网格的聚类算法、高斯混合模型等基于模型的聚类算法,或一些基于模糊集合的聚类算法。
基于此,本发明在基于上述实施方式的另一实施方式中,进一步提供一种如图1和图2所示的回馈数据图谱生成方法,可以搭载于上述任一种冰箱、问答设备和/或回馈数据图谱生成设备中,也可以搭载于上述任一种其他装置、设备或系统中。在该另一实施方式中,所述回馈数据图谱生成方法可以具体包括下述步骤。
步骤31,遍历原始信息库中所有原始语料,生成基础目录数据。
步骤32,根据基础目录数据,抽取形成实体信息元素以及实体关系元素。
步骤331,根据基础目录数据在原始信息库中检索,得到对应于不同基础目录数据的多组待处理文本。
步骤332,根据待处理文本,依次执行双向特征表示以及属性分类识别,得到对应于不同文本句段数据的多组初级属性数据。
步骤333,根据初级属性数据、文本句段数据以及实体指向数据,依次执行属性融合和同属性句段聚合,生成句段属性元素。
步骤34,根据实体信息元素构建实体节点,根据实体关系元素建立实体间的关联关系,将句段属性元素按照句段与实体间的关联关系,对应存入实体节点中,生成回馈数据图谱。
其中,所述实体指向数据表征所述文本句段数据与所述实体间的关联关系。
如此,通过先行锁定待处理文本,而后先行利用模型得到初步分类结果,再对所有结果进行修改和句段聚合,从而确定最终的属性分类结果。相比于其他现有技术而言,基础目录数据与待处理文本关系建立更为快捷迅速,保障了后续实体和句段之间关系的建立;以双向特征表示作为向量化的手段再进行属性分类识别,能够保留待处理文本的上下文关系,以更完整的数据来生成向量并识别得到初级属性数据;利用实体指向数据对初级属性数据进行二次处理,保持上下文属性判断的一致性,避免属性类似的句段被过于细致的区分开,并避免与实体匹配的句段数据量大导致图谱粒度级过粗,建立粒度级更细的、以句段为单位与实体进行匹配关联的图谱。
单条基础目录数据之下,包含至少一组文本段落,以该文本段落作为所述待处理文本,在对原始信息库中的所有原始语料的遍历过程中,根据位置天然地形成若干待处理文本与基础目录数据之间的对应关系。单条基础目录数据可能与多组待处理文本对应,也可能与一组待处理文本相对应,如此,形成第一次对原始语料的拆分和对应关系的建立。而后,待处理文本中包括至少一组文本句段,从而以文本句段为单位进行双向特征表示和属性分类识别,得到对应于每组待处理文本的一组或多组文本句段数据,以及对应于每组文本句段数据的初级属性数据,由此可以建立文本句段数据与基础目录数据的对应关系,形成第二次对原始语料的拆分和对应关系的建立。前述过程旨在根据原始信息库固有的位置和数据形式进行分析,得到文本句段数据和相对应的初级属性数据后,可以对文本句段数据以初级属性数据为核心进行处理,形成对原始信息库的重组,建立脉络更为清晰的回馈数据图谱。
可以理解地,所述实体指向数据的生成,可以是在根据待处理文本生成对应文本句段数据对应的初级属性过程中,基于基础目录数据、待处理文本和文本句段数据三者之间的关系而附随地产生的。当然,在其他实施方式中,也可以是在该步骤之前产生的,本发明并不限制其具体的步骤安排。
根据原始信息库提取对应基础目录数据的待处理文本,可以是利用基础目录数据对原始信息库中文本/数据进行分割,分别对应提取多组待处理文本来建立其与基础目录数据的对应关系,但为了减少单次的输入数据量,当然也可以采用遍历判断的方式实现。从而,作为优选地,上述步骤331还可以进一步包括下述步骤。
步骤3311,在原始信息库中,检索当前基础目录数据和下一基础目录数据之间的原始语料,得到对应当前基础 目录数据的待处理文本。
步骤3312,迭代生成分别对应所有基础目录数据的多组待处理文本。
如此,可以在预设数据窗口的滑动下,动态形成对应于每个基础目录数据的待处理文本,减少了单次输入模型的数据量,并保证迭代一次即可完成所有待处理文本的提取。
在本实施方式中,属性融合旨在让所有文本句段数据对应的初级属性数据能够被统一,防止具有过于细微差别的属性数据被过分地区分开,从而导致对检索效率提升的贡献低。这种问题通常会出现在初级属性数据中包含两个同义词的属性数据的情况下,例如当对应两组文本句段数据的初级属性数据分别为“清洁”和“清洗”时,两种初级属性数据的区分并不能够为检索结果或答案语料的生成有过多有益影响,此时,则可以在区分误差允许的情况下,将两种初级属性数据合并为一种。上述融合过程的基准,可以是根据预设的同义词库查找得到,也可以是对输出结果进行误差计算训练得到。
同时,同属性句段聚合旨在让所有归属于相同或相似属性数据的文本句段能够被聚合,在实现属性融合的基础上,能够进一步对所有文本句段数据的结构进行整理,建立更好的对应关系以方便检索。上述同属性句段聚合的过程,可以是通过为文本句段数据或其关联数据添加标记的方式实现。
本发明应对上述内容,提供一种包含于步骤333之内的较优方案,该较优方案可以具体包括下述步骤。
步骤3331,根据初级属性数据之间的相似度,对初级属性数据执行属性融合,重新确定对应于不同文本句段数据的多组句段属性数据,并根据句段属性数据,对句段属性数据相同的多组文本句段数据执行同属性句段聚合,重新确定对应于不同文本句段数据的多组实体指向数据。
步骤3332,根据实体指向数据、句段属性数据以及文本句段数据,生成句段属性元素。
如此,通过相似度确定是否需要融合以及需要融合的初级属性数据的对象,通过修改初级属性数据的方式实现属性融合,再通过重新确定后的属性数据,重新确定实体指向数据改变句段与实体之间的关联关系,使具有相同属性的句段能够被设定为指向与该属性相关的实体。在句段属性元素以数据组或逗号分割值的形式被构建时,其包含句段聚合后重新确定的实体指向数据、属性融合后重新确定的句段属性数据,以及拆分成以句子为单位的文本句段数据,如此建立更为精巧的图谱结构。
较优地,本发明提供基于上述实施方式的第一实施例,通过计算向量间的相似度决定是否进行属性融合,并进一步根据相似度以及文本句段数据与实体间的关联关系现状,重新建立文本句段数据与实体间优化后的关联关系,从而实现同属性句段的聚合。在该第一实施例中,如图1至图3所示,所述回馈数据图谱生成方法具体可以包括下述步骤。
步骤31,遍历原始信息库中所有原始语料,生成基础目录数据。
步骤32,根据基础目录数据,抽取形成实体信息元素以及实体关系元素。
步骤331,根据基础目录数据在原始信息库中检索,得到对应于不同基础目录数据的多组待处理文本。
步骤332,根据待处理文本,依次执行双向特征表示以及属性分类识别,得到对应于不同文本句段数据的多组初级属性数据。
步骤33311,对所有句段属性数据进行向量化,计算得到的句段属性向量中两两之间的属性相似度值。
步骤33312,依次根据属性相似度值、实体指向数据、句段属性数据的数据量、文本句段数据的数据量,以及文本句段数据在待处理文本中的句段位置信息,依次重新确定句段属性数据以及实体指向数据。
步骤3332,根据实体指向数据、句段属性数据以及文本句段数据,生成句段属性元素。
步骤34,根据实体信息元素构建实体节点,根据实体关系元素建立实体间的关联关系,将句段属性元素按照句段与实体间的关联关系,对应存入实体节点中,生成回馈数据图谱。
如此,利用向量化后的数据进行相似度计算,相比于诸如利用独热编码形成的TF-IDF(Term Frequency–Inverse Document Frequency,词频-逆文本频率指数)向量或Simhash敏感哈希算法而言,能够兼顾运算速度和区分能力。当然,本发明并不排斥其他实施方式中利用上述其他算法实现句段间相似度的量化计算。所述句段属性向量,可以是相互独立的词向量,也可以是多个词向量共同组成的句段向量。两两之间相似度值的度量标准,可以采用最小编辑距离、欧氏距离(Euclidean Distance)、杰卡德相似度(Jaccard Similarity Coefficient)、海明距离(Hamming distance)或分类器等建立。
在本实施方式中,优选地,利用向量间的余弦相似度作为上述相似度值的度量标准,也即计算向量两两之间的余弦相似度,作为所述属性相似度值。具体地,可以以两向量之间的点乘结果作为被除数,并以两向量的模的乘积作为除数,计算得到所述余弦相似度作为所述属性相似度值。
步骤33312中,依次根据上述五项信息或数据来重新确定句段属性数据或实体指向数据,旨在综合考虑上述五项信息或数据所表征的相似程度、关联关系、不同数据的数据量大小以及位置情况,来对实体和文本句段数据的关 联关系进行重排。基于此,任何确定相似度是否满足条件、确定是否需要修改关联关系以及如何修改关联关系的方式,均可以替换地引用于该实施例中,例如可以是模型训练、最优化收敛、分阶段设定阈值,并可以是建立索引、遍历提取、添加标签或指针等。
本发明应对上述内容,提供一种包含于步骤33312之内的较优方案,该较优方案可以具体包括下述步骤。
步骤41,若第一属性向量与第二属性向量之间的属性相似度值满足预设的融合相似度值,则判定第一属性数据和第二属性数据具有相同的内涵。
步骤42,根据第一属性数据和第二属性数据分别对应的实体指向数据、句段属性数据的数据量、文本句段数据的数据量,以及句段位置信息,依次重新确定第一属性数据和第一指向数据,以及第二属性数据和第二指向数据。
其中,所述句段属性向量包括第一属性向量和第二属性向量,所述句段属性数据包括分别对应于所述第一属性向量和所述第二属性向量的第一属性数据和第二属性数据,所述实体指向数据包括分别对应于所述第一属性数据和所述第二属性数据的第一指向数据和第二指向数据。
具体地,所述属性相似度值为所述第一属性向量与所述第二属性向量的余弦相似度值,所述预设的融合相似度值为0.8。如此,可以清晰准确地判断两句段属性数据实质上是否是相同的,防止文本句段数据被过分分割为多种,导致回馈数据图谱中关联关系复杂而零散,影响答案语料生成和信息检索的速度。
较优地,本发明提供基于上述第一实施例的一个具体示例,在判断内涵相同时,可以进一步根据句段属性数据本身的特性,对不同的句段属性数据进行融合,实现属性数据的融合,提升回馈数据图谱的规整度。在该具体示例中,如图1至图4所示,所述回馈数据图谱生成方法具体可以包括下述步骤。
步骤31,遍历原始信息库中所有原始语料,生成基础目录数据。
步骤32,根据基础目录数据,抽取形成实体信息元素以及实体关系元素。
步骤331,根据基础目录数据在原始信息库中检索,得到对应于不同基础目录数据的多组待处理文本。
步骤332,根据待处理文本,依次执行双向特征表示以及属性分类识别,得到对应于不同文本句段数据的多组初级属性数据。
步骤33311,对所有句段属性数据进行向量化,计算得到的句段属性向量中两两之间的属性相似度值。
步骤41,若第一属性向量与第二属性向量之间的属性相似度值满足预设的融合相似度值,则判定第一属性数据和第二属性数据具有相同的内涵。
步骤42,根据第一属性数据和第二属性数据分别对应的实体指向数据、句段属性数据的数据量、文本句段数据的数据量,以及句段位置信息,依次重新确定第一属性数据和第一指向数据,以及第二属性数据和第二指向数据。
其中,步骤42具体包括:步骤420,比较第一属性数据的数据量大小和第二属性数据的数据量大小,将第一属性数据和第二属性数据设定为数据量较小的句段属性数据。
步骤3332,根据实体指向数据、句段属性数据以及文本句段数据,生成句段属性元素。
步骤34,根据实体信息元素构建实体节点,根据实体关系元素建立实体间的关联关系,将句段属性元素按照句段与实体间的关联关系,对应存入实体节点中,生成回馈数据图谱。
如此,可以将句段属性数据进行语言上的精简,保证句段属性数据能够清楚简洁地描述当前句段文本数据的归属类别。
所述对于句段属性数据的数据量大小的判断,优选为判断该句段属性数据的长度。当然,在其他实施方式中,上述句段属性数据也可以被定义为数据长度和数据维度的复合,同样能够实现本发明预期的、提升检索和回馈速度的效果。
作为另一具体示例,或作为上述具体示例的进一步改进,可以以判断实体指向数据指向的实体是否相同、文本句段数据的数据量大小是否相同作为先决条件,进一步比较文本句段数据的数据量和实体指向数据的值,实现同属性文本句段数据的融合。具体地,在上述步骤33311和步骤3332之间,还可以包括下述步骤。
步骤41,若第一属性向量与第二属性向量之间的属性相似度值满足预设的融合相似度值,则判定第一属性数据和第二属性数据具有相同的内涵。
步骤420,比较第一属性数据的数据量大小和第二属性数据的数据量大小,将第一属性数据和第二属性数据设定为数据量较小的句段属性数据。
步骤421,判断第一指向数据和第二指向数据是否指向同一实体。
若否,则跳转步骤422,判断第一句段数据的数据量大小和第二句段数据的数据量大小是否相同。
若不同,则进一步跳转步骤4221,将第一指向数据和第二指向数据修改为该数据量较大的文本句段数据所对应的实体指向数据。
其中,所述文本句段数据包括分别对应于所述第一属性数据和所述第二属性数据的第一句段数据和第二句段数 据。
如此,在第一属性向量和第二属性向量虽有差异但实质相同,两者分别对应的实体指向数据指向不同实体,且两者分别对应的文本句段数据归属于不同的基础目录数据之下时,进一步调整第一指向数据和第二指向数据为文本句段数据的数据量较大的一组实体指向数据,实现根据文本句段数据的数据量执行同属性融合的技术效果。
需要强调地,一方面,步骤420相对于步骤42中其他细化步骤的位置,可以是在其他细化步骤之前,也可以是在其他细化步骤之后或之间进行。另一方面,本发明上述步骤还暗含着“当判断第一指向数据和第二指向数据指向同一实体时,仅执行步骤420而不修改其他数据”的含义,此点应当为本领域技术人员所理解。
作为上述具体示例的进一步改进,在判断第一指向数据与第二指向数据并非指向同一实体,且判断第一句段数据的数据量大小与第二句段数据的数据量大小相同时,并不必然不输出结果或报错,当然可以进一步依据句段位置信息来重新确定第一属性数据、第二属性数据、第一指向数据和第二指向数据。具体地,在上述步骤33311和步骤3332之间,还可以包括下述步骤。
步骤41,若第一属性向量与第二属性向量之间的属性相似度值满足预设的融合相似度值,则判定第一属性数据和第二属性数据具有相同的内涵。
步骤420,比较第一属性数据的数据量大小和第二属性数据的数据量大小,将第一属性数据和第二属性数据设定为数据量较小的句段属性数据。
步骤421,判断第一指向数据和第二指向数据是否指向同一实体。
若否,则跳转步骤422,判断第一句段数据的数据量大小和第二句段数据的数据量大小是否相同。
若相同,则进一步跳转步骤4222,将第一指向数据和第二指向数据修改为该值较小的实体指向数据。
其中,实体指向数据不仅用于表征句段与实体之间的关联关系,还可以表征实体之间的关联关系,例如在一种实施方式中,实体根据基础目录数据在原始信息库中的位置先后顺序具有1,2,3……的数字标记,实体指向数据可以复用该顺序标记,并记载于句段属性元素中作为实体指向数据,表征当前句段属于该实体,并形成句段位置顺序上的区分。当然,本发明并不局限于此种复用的实施方式,实体指向数据可以具有指针等多种形式,其值上天然存在着差别,自然可以根据其值大小反映其所指向的实体位置,以及其自身在原始信息库中的位置。
如此,在第一属性向量和第二属性向量虽有差异但实质相同,两者分别对应的实体指向数据指向不同实体,两者分别对应的文本句段数据归属于不同的基础目录数据之下,且该文本句段数据的数据量也相同时,进一步对实体指向数据值的大小进行判断,充分考虑文本句段数据在原始信息库中的先后位置,据此重新确定实体指向数据。
本优选实施例中,通过实体指向数据的值的大小来表征文本句段数据位于原始信息库中的位置。当然,在其他实施方式中,也可以通过在遍历过程中生成其他顺序标签或时间标签的方式实现位置的标记,并利用该标记进行位置先后的判断。同样需要强调的,虽然上文中进行属性融合和同属性句段聚合的基准都是实体指向数据的值的大小,但是在其他实施方式中,不排除存在将上述量过程所依据的基准配置为不同的技术方案。
在本实施方式的步骤332中,双向特征表示旨在保留待处理文本的上下文关系,属性分类识别旨在对待处理文本中不同文本句段数据赋予不同的初级属性数据进行类别判断,本领域技术人员可以采用双向循环神经网络(Bi-RNN,Bi-directional Recurrent Neural Network),特别是双向长短期记忆神经网络(Bi-LSTM,Bi-directional Long Short-Term Memory)来实现上下文关系的特征表示,并可以使用有监督学习(Supervised Learning)、无监督学习(Unsupervised Learning)、半监督学习(Semi-supervised Learning)、小样本学习(Few-shot Learning)、零样本学习(Zero-shot Learning)、增量学习(Incremental Learning)、元学习(Meta-learning)等模型进行初级属性数据的识别和分类。
较优地,本发明提供基于上述实施方式的第二实施例,通过调用双向特征表示模型和属性分类卷积模型进行处理,实现对文本句段数据赋予不同的初级属性数据的效果,利用简单的模型架构实现准确的属性判断和分类识别。在该第二实施例中,如图1、图2和图5所示,所述回馈数据图谱生成方法具体可以包括下述步骤。
步骤31,遍历原始信息库中所有原始语料,生成基础目录数据。
步骤32,根据基础目录数据,抽取形成实体信息元素以及实体关系元素。
步骤331,根据基础目录数据在原始信息库中检索,得到对应于不同基础目录数据的多组待处理文本。
步骤3321,遍历待处理文本,根据预设的分句规则进行拆分,得到文本句段数据。
步骤3322,将文本句段数据依次输入至预设的双向特征表示模型中,依次执行向量化表示、向量编码以及融合运算,得到分别对应文本句段数据的词向量特征表示。
步骤3323,将词向量特征表示输入预设的属性分类卷积模型中,得到对应词向量特征表示的词向量特征集合。
步骤3324,调用预设的第一激活函数处理词向量特征集合,并根据预设的属性分类规则识别得到对应文本句段数据的初级属性数据。
步骤333,根据初级属性数据、文本句段数据以及实体指向数据,依次执行属性融合和同属性句段聚合,生成句段属性元素。
步骤34,根据实体信息元素构建实体节点,根据实体关系元素建立实体间的关联关系,将句段属性元素按照句段与实体间的关联关系,对应存入实体节点中,生成回馈数据图谱。
如此,可以更为高效地处理待处理文本的特征,对应生成细小的、以词向量为单位的词向量特征表示,并以此为基础进行卷积处理放大特征,并经过激活函数进行分类概率预测,从而得到特征判断更为准确的初级属性数据,以便后续进行融合和聚合。
当然,上述双向特征表示模型以及上述属性分类卷积模型,并不必然代表神经网络模型的整体,还可以是用于指代某个神经网络模型中用于实现特征标识和卷积的部分,例如特征提取层和卷积层。当然,本发明也可以优选地将双向特征表示模型配置为由一些诸如由ELMo(Embedding from Language Models)、NNLM(Neural Network Language Model,神经网络语言模型),甚至RNN、LSTM形成的预训练语言模型构成。
关于步骤3321至步骤3324中所涉数据之间的关系,词向量特征表示是由对应于文本句段数据中所有单词的词向量组成的、表征文本句段数据词向量内容的数据;词向量特征集合是对数据量较大的词向量特征表示进行压缩和特征放大后得到的、同样对应于文本句段数据中每个单词特征的集合的数据;初级属性数据,即是对词向量特征集合进行词向量特征判断后,总结最终概率输出得到的、能够表征文本句段数据与规定属性之间对应关系的数据。具体地,所述第一激活函数优选为softmax激活函数,用于输出属性分类预测的概率值,便于进行精细化的排序和最终判断。
较优地,本发明提供基于上述第二实施例的一个具体示例,在该具体示例的一方面,可以通过对分句符号的识别,来对大段的待处理文本进行第一次拆分,从而适应后续模型的输入要求,并与后续对于词的拆分一起,共同构成二次递进的拆分方式,便于最终输出的整理。基于此,上述步骤3321可以进一步优化为:
步骤3321’,遍历待处理文本中的所有数据,当识别得到预设的分句符号时,提取当前分句符号至前一分句符号之间的数据作为一组文本句段数据,迭代得到所有文本句段数据。
当然,上述技术方案还可以是提取当前分句符号至下一分句符号之间的数据作为一组文本句段数据。可见,任何一种提取相邻两个分句符号之间的部分作为一组文本句段数据的实施方式均可以替换地应用于本申请中。
上述分句符号可以是任何表征句子已经结束的符号,对于中文或英文而言,可以是句号、问号、感叹号等,在需要进行更为精细化的拆分时,还可以包含分号。对于其他语言,还可以是在识别待处理文本对应的语言后,调用对应的分句符号数据包进行自适应处理。
相对应且较优地,在该具体示例的另一方面,通过文本句段数据进行标记并分别送入多个嵌入层以生成多个层面的向量表示,根据多种特征表示生成输入向量后再送入双向编码器中进行运算,对得到的编码向量进行融合,如此可以得到能够同时表征位置、分段关系、字节本身,且添加有双向注意力权重的词向量特征表示,从而涵盖文本单词更多维度下的内容,防止文本处理和向量化过程中导致的特征损失。该具体示例在所述步骤3322层面上提供的回馈数据图谱生成方法,如图1、图2、图5和图6所示,可以具体包括下述步骤。
步骤31,遍历原始信息库中所有原始语料,生成基础目录数据。
步骤32,根据基础目录数据,抽取形成实体信息元素以及实体关系元素。
步骤331,根据基础目录数据在原始信息库中检索,得到对应于不同基础目录数据的多组待处理文本。
步骤3321,遍历待处理文本,根据预设的分句规则进行拆分,得到文本句段数据。
步骤33221,按照预设分隔规则,对文本句段数据添加句首向量标记和句间向量标记,得到标记句段数据。
步骤33222,将标记句段数据中的所有单词,分别输入位置嵌入层、分割嵌入层和和字嵌入层,得到分别对应于每个单词的位置向量表示、分割向量表示和字向量表示,并对位置向量表示、分割向量表示和字向量表示进行融合运算,得到对应于每个单词的单词输入向量
步骤33223,将单词输入向量分别输入至双向编码器中,依次执行双向自注意力分配、残差连接、层标准化以及线性转换,得到对应于每个单词的单词编码向量。
步骤33224,将对应于同一标记句段数据的单词编码向量依次进行连接运算,得到对应文本句段数据的词向量特征表示。
步骤3323,将词向量特征表示输入预设的属性分类卷积模型中,得到对应词向量特征表示的词向量特征集合。
步骤3324,调用预设的第一激活函数处理词向量特征集合,并根据预设的属性分类规则识别得到对应文本句段数据的初级属性数据。
步骤333,根据初级属性数据、文本句段数据以及实体指向数据,依次执行属性融合和同属性句段聚合,生成句段属性元素。
步骤34,根据实体信息元素构建实体节点,根据实体关系元素建立实体间的关联关系,将句段属性元素按照句段与实体间的关联关系,对应存入实体节点中,生成回馈数据图谱。
具体地,上述分隔规则可以与步骤3321’中的分句方法配置为一致或类似,也即步骤33221也可以是,在所述文本句段数据的首个数据之前添加所述句首向量标记,遍历文本句段数据中的所有数据,当识别得到预设的分隔符号时,提取当前分隔符号至前一分隔符号或所述首个数据之间的数据作为一组数据,并在所述当前分隔符号处添加所述句间向量标记;迭代直至所述文本句段数据中所有单词均完成识别。如此,可以将文本句段数据拆分数据量更小的短句,适应各种模型的输入限制。当然,上述拆分还可以是基于构词法、词性等标准实现的,本发明在此不进行穷举。
其中,所述位置向量表示表征不同单词在所述标记句段数据中的位置差异,所述分割向量表示表征所述标记句段数据中不同部分之间的内容差异,所述字向量表示表征对应于不同单词的多个预设维度的向量。所述位置嵌入层、分割嵌入层和字嵌入层优选具有同一预设的维度标准,因此输出的位置向量表示、分割向量表示和字向量表示,除了对应包含上述不同特征信息以外,还会将标记句段数据转换为维度均一的向量表示,以便后续编码和特征提取。
定义文本句段数据为x,所述句首向量标记为[CLS],所述句间向量标记为[SEP],则所述标记句段数据xmodel可以至少被描述为:xmodel={[CLS],x,[SEP]}。
定义对应于所述文本句段数据x中某个单词x(i)的位置向量表示为x(i)position_embedding、分割向量表示为x(i)segment_embedding、字向量表示为x(i)token_embedding,则对应于该单词x(i)的单词输入向量x(i)token可以至少被描述为:
x(i)token=x(i)position_embedding+x(i)segment_embedding+x(i)token_embedding
所述双向自注意力分配,用于根据不同的语义场景形成不同方式的向量融合。如此,在对文本句段数据中所有单词输入向量进行遍历时,能够充分体现全文整体的关系,为上下文不同情况分配不同的权重和注意力,以从上下文维度增强特征表示。
所述残差连接,用于将进行双向自注意力分配前后的单词输入向量相加作为输出,从而能够避免重构整个输出的窘境,使得模型训练时直接反传到单词输入向量一层,从而简化模型的训练过程。
所述层标准化,用于以残差连接处理的输出作为输入,并对神经网络隐藏层的输出做0均值1方差的标准化,归一化为标准正态分布,从而加快训练速度和收敛速度。所述线性转换,用于对输入的数据重复做两次线性变换,保持线性变换后的向量长度与原向量一致的基础上,增强特征的表达能力,从而得到所述单词编码向量。在一种实施方式中,所述位置嵌入层、所述分割嵌入层和和所述字嵌入层为词向量设定了统一的维度d,定义文本句段数据的长度为L,单词编码向量为xi,其中i=1,2,3,...,L,则所述词向量特征表示S可以至少满足:
S=RL*d
其中,表示连接运算,可以是简单的拼接,也可以是进行运算后简历其他关联关系,以生成序列形式的词向量特征表示。所述维度d优选取768维,当然也可以根据模型的具体情况进行调整。
相对应且较优地,在该具体示例的再一方面,通过对词向量进行多次重复卷积,并在多次重复卷积中加入激活,再在每次激活之后进行池化,如此重复多次进行特征强化和词向量维度的精炼,最终得到特征精炼度高且整体维度较低的词向量特征集合,以构成对上述第二实施例中步骤3323的改进。该具体示例在所述步骤3323层面上提供的回馈数据图谱生成方法,如图1、图2、图5和图6所示,可以具体包括下述步骤。
步骤31,遍历原始信息库中所有原始语料,生成基础目录数据。
步骤32,根据基础目录数据,抽取形成实体信息元素以及实体关系元素。
步骤331,根据基础目录数据在原始信息库中检索,得到对应于不同基础目录数据的多组待处理文本。
步骤3321,遍历待处理文本,根据预设的分句规则进行拆分,得到文本句段数据。
步骤3322,将文本句段数据依次输入至预设的双向特征表示模型中,依次执行向量化表示、向量编码以及融合运算,得到分别对应文本句段数据的词向量特征表示。
步骤33231,按照预设尺寸的卷积核、调用预设的第二激活函数,对词向量特征表示中的每个词向量重复执行两次卷积和激活,并对得到的一阶卷积词向量进行池化,得到对应词向量特征表示的多组中间词向量特征。
步骤33232,按照预设尺寸的卷积核、调用预设的第二激活函数,对中间词向量特征分别重复执行两次卷积和激活,并对得到的二阶卷积词向量进行池化,得到对应词向量特征表示的多组最终词向量特征。
步骤33233,将对应于同一词向量特征表示的最终词向量特征进行组合匹配,得到词向量特征集合。
步骤3324,调用预设的第一激活函数处理词向量特征集合,并根据预设的属性分类规则识别得到对应文本句段数据的初级属性数据。
步骤333,根据初级属性数据、文本句段数据以及实体指向数据,依次执行属性融合和同属性句段聚合,生成句段属性元素。
步骤34,根据实体信息元素构建实体节点,根据实体关系元素建立实体间的关联关系,将句段属性元素按照句段与实体间的关联关系,对应存入实体节点中,生成回馈数据图谱。
具体地,上述步骤33231可以优选配置为,对词向量特征表示中每个词向量执行:卷积、激活、卷积、激活,从而得到所述一阶卷积词向量。上述步骤33232可以优选配置为,对中间词向量特征执行:卷积、激活、卷积、激活,从而得到所述二阶卷积词向量。上述卷积步骤采用的卷积核优选为同一个预设的卷积核,且上述激活采用的激活函数也可以优选为同一个第二激活函数。在一种实施方式中,所述第二激活函数为Relu激活函数,以利用其正输入不存在饱和梯度问题,以及纯线性关系计算,激活速度快的优势。所述池化层可以配置为执行最大池化。抽象为英文表示可以是:词向量特征表示Word Embedding依次进行ConvD_1卷积、Relu_1激活、Conv1D_2卷积、Relu_2激活、MaxPooling1D_1池化、ConvD_3卷积、Relu_3激活、Conv1D_4卷积、Relu_4激活、MaxPooling1D_2池化。
进一步地,定义所述卷积核的尺寸为m,卷积滤波器为w∈Rmd,偏置向量为b,则所述最终词向量特征ci可以至少满足:ci=f(w*xi:i+m-1+b)。
基于此,可以对最终词向量特征进行组合匹配,得到对应于文本句段数据的词向量特征集合。定义所述词向量特征集合为C,则其可以至少满足:C={c1,c2,...,cL-m+1}。
优选地,卷积滤波器的数量可以是256个,卷积核的尺寸可以是3。此外,在将词向量特征集合送入步骤3324进行第一激活函数激活之前,为了适应于数据量以及神经元个数较为庞大的情况,还可以设置有Dropout层,随机删除一些神经元来防止过拟合。此外,词向量特征集合输出与第一激活函数激活之间,还可以设置有全连接层,长度对应为128,用于将局部特征进行结合,从而输出全局特征。
在一种优选的实施方式中,所述步骤33231之前,还可以包括对词向量特征表示进行长度修正的步骤,从而适应属性分类卷积模型的输入要求。具体地,对于长度大于属性分类卷积模型的长度标准值的词向量特征表示,可以对其进行截断操作;对于长度小于所述长度标准值的词向量特征表示,可以对其进行补全操作,优选为补0。优选地,所述长度标准值为32。
当然,该具体示例最终呈现的较优实施方式,可以是提供如图1、图2、图5和图6中全部所示的、同时包含有上述三个层面的技术方案的。此时,该具体示例即同时具有上述三个层面分别具有的有益效果,并相互配合产生其他技术效果,此处不再赘述。
较优地,本发明提供基于上述实施方式的第三实施例,通过在双向特征表示模型之前配置预训练步骤及任务,从而优选地将双向特征表示模型配置为预训练模型,如此节省模型运算的时间耗费、提升特征提取的准确性并避免前向时刻的依赖性。在该第三实施例中,如图1、图2和图7所示,所述回馈数据图谱生成方法具体可以包括下述步骤。
步骤31,遍历原始信息库中所有原始语料,生成基础目录数据。
步骤32,根据基础目录数据,抽取形成实体信息元素以及实体关系元素。
步骤331,根据基础目录数据在原始信息库中检索,得到对应于不同基础目录数据的多组待处理文本。
步骤51,接收预训练数据集。
步骤52,使能双向特征表示模型,依次执行掩码语言模型任务以及下句预测任务,对预训练数据集中的数据进行迭代遍历预测和验证,得到标准模型参数组。
步骤53,将标准模型参数组搭载于双向特征表示模型。
步骤3321,遍历待处理文本,根据预设的分句规则进行拆分,得到文本句段数据。
步骤3322’,将文本句段数据依次输入至训练好的双向特征表示模型中,依次执行向量化表示、向量编码以及 融合运算,得到分别对应文本句段数据的词向量特征表示。
步骤3323,将词向量特征表示输入预设的属性分类卷积模型中,得到对应词向量特征表示的词向量特征集合。
步骤3324,调用预设的第一激活函数处理词向量特征集合,并根据预设的属性分类规则识别得到对应文本句段数据的初级属性数据。
步骤333,根据初级属性数据、文本句段数据以及实体指向数据,依次执行属性融合和同属性句段聚合,生成句段属性元素。
步骤34,根据实体信息元素构建实体节点,根据实体关系元素建立实体间的关联关系,将句段属性元素按照句段与实体间的关联关系,对应存入实体节点中,生成回馈数据图谱。
其中,所述掩码语言模型任务,表征随机遮挡预训练数据集中,一段输入数据组中的部分单词,使所述双向编码器对该被遮挡的单词进行预测和检验。所述下句预测任务,表征随机提取两段输入数据组,是双向编码器判断其是否在预训练数据集中是相邻的。如此,经过迭代训练,使双向编码器在不同文本句段数据之间和文本句段数据中不同单词之间具有更强的预测能力,从而使得向量化的过程更为准确。
当然,上述步骤51至步骤53并不必然设置于步骤331和步骤3321之间,其可以被设置于步骤3322及其衍生步骤3322’等以前的任何位置,只需要满足在执行步骤3322及其衍生步骤之前完成预训练即可。
结合该第三实施例与前述具体示例,所述双向特征表示模型可以优选为Bert模型,能够解决其他预训练模型过分依赖于前向输入的问题,防止网络层数低导致的运算时间拉长、提取特征优先等弊端的出现,也能够避免其他神经网络模型执行文本向量化时可能导致的准确率降低的情况。此外,双向特征表示模型在配置为诸如Bert模型的预训练模型时,该与训练模型可以是已经预训练好的模型直接使用,也可以是执行如图7所示的预训练过程,按照特定的预训练数据集训练得到。所述预训练数据集,可以采用通用的文本数据集,也可以是根据所述原始信息库(冰箱说明书)或特定领域其他文本数据重新建立得到。
在一种情况下,所述原始信息库可能包含一种固有的目录结构信息,其表征着用户预先设定好的、对原始语料的分类倾向。从而,可以通过对该目录结构信息进行抽取,从而建立实体信息元素和实体关系元素。但在另一种情况下,原始信息库中不存在目录结构信息,或目录结构信息概括较为宽泛,无法进行更为细致的实体抽取,会影响回馈数据图谱整体的功能。
基于此,本发明在基于上述实施方式的再一实施方式中,进一步提供一种如图1和图8所示的回馈数据图谱生成方法,可以搭载于上述任一种冰箱、问答设备和/或回馈数据图谱生成设备中,也可以搭载于上述任一种其他装置、设备或系统中。在该再一实施方式关于所述步骤31的改进层面,所述回馈数据图谱生成方法可以具体包括下述步骤。
步骤311,分析得到原始信息库中的目录结构信息。
步骤312,迭代识别不同原始语料对应的多组原始格式信息,当原始格式信息匹配于预设的标准格式信息时,提取该原始格式信息对应的原始语料作为结构语料信息。
步骤313,根据结构语料信息和目录结构信息在原始信息库中的相对位置,对目录结构信息和结构语料信息进行排序整合,得到基础目录数据。
步骤32,根据基础目录数据,抽取形成实体信息元素以及实体关系元素。
步骤33,根据基础目录数据和原始信息库,依次执行属性融合以及同属性句段聚合,生成对应于不同文本句段数据的多组句段属性元素。
步骤34,根据实体信息元素构建实体节点,根据实体关系元素建立实体间的关联关系,将句段属性元素按照句段与实体间的关联关系,对应存入实体节点中,生成回馈数据图谱。
如此,可以不仅仅依靠原始信息库中固有的目录结构信息进行实体的提取,还能够自主地识别原始信息库中其他能够作为实体的结构语料信息,从而补充所述目录结构信息,或依靠其本身形成一套基础目录数据。基于此,可以自发地理解原始信息库中符合标准格式信息要求的数据,提升实体提取的针对性,由于符合标准格式信息要求的原始语料通常记载有更为详细的、下位的内容,因此提取得到的实体更为准确,后续回馈数据产生的指向性也会更强。
所述标准格式信息可以是加粗标记信息,也可以是底色标记信息、斜体标记信息等,所述目录结构信息可以是从*.doc、*.docx格式文件中的大纲部分提取得到,也可以是获取预设的大纲样式,并根据样式进行遍历查找得到。
相对应且较优地,在该再一实施方式关于所述步骤32的改进层面,所述回馈数据图谱生成方法可以具体包括下述步骤。
步骤31,遍历原始信息库中所有原始语料,生成基础目录数据。
步骤321,迭代并以基础目录数据作为实体进行抽取和排序,将对应生成的实体序号数据和基础目录数据执行 匹配,形成实体信息元素。
步骤322,迭代并根据基础目录数据之间的层级关系,确定作为实体的基础目录数据两两之间的外部关联关系,并根据外部关联关系以及对应的两项基础目录数据,匹配形成实体关系元素。
步骤33,根据基础目录数据和原始信息库,依次执行属性融合以及同属性句段聚合,生成对应于不同文本句段数据的多组句段属性元素。
步骤34,根据实体信息元素构建实体节点,根据实体关系元素建立实体间的关联关系,将句段属性元素按照句段与实体间的关联关系,对应存入实体节点中,生成回馈数据图谱。
其中,所述实体序号数据用于表征实体之间的内容差异,以及用于表征实体与所述文本句段数据的关联关系。
当然,上述步骤321和步骤322并不必然同时设置于所述步骤32中,本领域技术人员当然可以选择其一实施,并采用其他方案形成实体信息元素和实体关系元素的其中另一。
实体序号数据可以与所述实体指向数据具有相同或至少相关联的形式,如此,实体指向数据能够清楚地锁定单个实体来建立关联关系。但,所述实体序号数据并不一定表征所述基础目录数据之间的层级关系。例如,在一种实施方式中,目录结构数据包括<序号1,实体1>、<序号1.1,实体2>,结构语料信息包括从属于实体2的<序号1.1.1,实体3>,上述三者共同构成所述基础目录数据,并且其中序号的小数位能够表征基础目录数据之间的层级关系。经过抽取和排序后,可以对应生成<序号1,实体1>、<序号2,实体2>、<序号3,实体3>,同样能够实现建立实体本身、实体之间关系、实体与句段之间关系的技术效果,并且节省运算步骤。
与此相对应地,关联于上述任一实体的句段属性元素,其中的实体指向数据可以与对应实体的实体序号数据一致,以关联于上述实体3的某一句段属性元素为例,其可以具有<序号3,句段属性数据,文本句段数据>的形式。
对于实体关系元素的抽取,参考基础目录数据<序号1,实体1>、<序号1.1,实体2>、<序号1.1.1,实体3>的序号部分,可见其至少具有下述外部关联关系的内涵:实体1包含实体2,实体2包含实体3。基于此,可以建立<实体1,包含,实体2>、<实体2,包含,实体3>的所述实体关系元素,并在必要时,也可以建立<实体1,包含,实体3>的实体关系元素。
当然,该再一实施方式可以是同时包含有上述两个层面的技术方案的。此时,该再一实施方式即同时具有上述两个层面分别具有的有益效果,并相互配合产生其他技术效果,此处不再赘述。
步骤311中根据原始信息库分析其中的目录结构信息,作为优选地,可以进一步包括下述步骤。
步骤3111,定位原始信息库中的目录数据集合。
步骤3112,提取目录数据集合中的目录标题信息和目录层级序号,组成目录结构信息,并按照目录层级序号对目录结构信息排序。
定位目录数据集合的方式,可以是简单的检索“目录”二字进行,也可以是识别原始信息库中包含大纲目录格式的数据,以集中包含大纲目录格式数据的页面作为所述目录数据集合。
较优地,本发明提供基于上述再一实施方式的一个实施例。在该实施例中,如图1、图8,以及图9或图10所示,所述回馈数据图谱生成方法具体可以包括下述步骤。
步骤311,分析得到原始信息库中的目录结构信息。
步骤312,迭代识别不同原始语料对应的多组原始格式信息,当原始格式信息匹配于预设的标准格式信息时,提取该原始格式信息对应的原始语料作为结构语料信息。
步骤3131,迭代判断结构语料信息与所有目录结构信息之间的从属关系,得到位于结构语料信息最接近上一层级的目录结构信息,作为参考结构信息。
步骤3132,根据参考结构信息中的目录层级序号,以及相邻的其他结构语料信息分布情况,确定结构语料信息的目录层级序号。
步骤3133,按照目录层级序号对目录结构信息和结构语料信息进行排序整合,得到基础目录数据。
步骤32,根据基础目录数据,抽取形成实体信息元素以及实体关系元素。
步骤33,根据基础目录数据和原始信息库,依次执行属性融合以及同属性句段聚合,生成对应于不同文本句段数据的多组句段属性元素。
步骤34,根据实体信息元素构建实体节点,根据实体关系元素建立实体间的关联关系,将句段属性元素按照句段与实体间的关联关系,对应存入实体节点中,生成回馈数据图谱。
其中,所述目录结构信息包括相互对应的目录标题信息和目录层级序号。
如此,可以通过目录结构信息与结构语料信息的相邻关系,推断结构语料信息与目录结构信息之间的从属关系,并根据结构语料信息上一层的目录结构信息的目录层级序号(例如实体2的序号1.1),生成结构语料信息的目录层级序号(例如实体3的序号1.1.1),并将目录层级序号与对应的目录结构信息、结构语料信息进行匹配,便于后续 抽取基础目录数据(即实体)间的关系(例如包含关系)。
优选地,在该实施例的一个具体示例中,如图1、图8和图9所示,所述目录结构信息包括先后设置的第一结构信息和第二结构信息,所述第一结构信息包括第一标题信息和第一层级序号,所述第二结构信息包括第二标题信息和第二层级序号。基于此,所述步骤3131还可以进一步包括:
步骤31310,链接到原始信息库中第一标题信息所指向的实际位置,向下遍历并迭代识别不同原始语料对应的多组原始格式信息,对应提取符合条件的原始语料作为结构语料信息,分别存储为至少一组第一语料信息,直至识别到第二结构信息。
与此相配合地,所述步骤3132还可以进一步包括:
步骤31320,根据第一层级序号,按照第一语料信息的内部排列顺序,生成对应于至少一组第一语料信息的至少一组第一次级序号,并将第一次级序号与对应的第一语料信息形成匹配,以第一次级序号作为对应第一语料信息的目录层级序号。
如此,可以通过固有的链接,方便的建立目录结构信息与原始信息库中其他位置及原始语料的对应关系,并据此生成结构语料信息的目录层级序号。
具体而言,第一语料信息整体从属于第一结构信息,第一语料信息包含多个先后排列的原始语料。若第一层级序号为2.3,则第一语料信息中多个原始语料可以依次具有2.3.1、2.3.2、2.3.3等作为其目录层级序号。可见,本具体示例主要利用向下遍历并实时生成的方式,得到结构语料信息的目录层级序号。
优选地,在该实施例的另一个具体示例中,如图1、图8和图10所示,所述步骤312可以进一步包括:
步骤3120,迭代遍历原始信息库中除目录结构信息以外的部分,提取符合条件的原始语料,得到第一语料信息。
与此相配合地,所述步骤3131还可以进一步包括:
步骤31310’,根据第一语料信息向前检索,得到首次出现的目录结构信息作为参考结构信息,并统计排列于第一语料信息和参考结构信息之间的其他结构语料信息的个数,得到前向语料数量。
与此相配合地,所述步骤3132还可以进一步包括:
步骤31320’,根据参考结构信息的目录层级序号,以及前向语料数量,生成对应于第一语料信息的第一次级序号,并将第一次级序号与第一语料信息形成匹配,以第一次级序号作为对应第一语料信息的目录层级序号。
该另一具体示例,可以适用于目录结构数据无法链接到原始信息库中其他位置的情况,优先查询符合格式条件的结构语料信息后,再次前向查找得到与之相邻最近的、且属于其上一层级的目录结构数据,从而根据该参考结构信息的目录层级序号,进行结构语料信息的目录层级序号的生成。
当然,上述两种具体示例并不必然相互排斥,在本发明中,优选地,可以先行判断目录结构信息是否存在链接,而后选择性采用两种具体示例之一进行处理。
作为补充地,上述内容提供了关于本发明的不同实施方式、实施例以及具体示例,本领域技术人员可以理解的,不同层次分别进行论述而形成的多种技术方案之间,并不必然割裂而相互排斥地设置,本领域技术人员当然可以结合上述多种技术方案中的两种或更多形成更优化的技术方案。同时,可以理解地,本发明提供的最优技术方案在于,同时实施上述技术方案中涉及步骤的全部。
综上,本发明提供的回馈数据图谱生成方法,通过抽取基础目录数据建立实体信息元素和实体关系元素,能够充分利用原始信息库既有的结构关系进行数据图谱的构建,提升数据图谱生成的效率;通过属性融合及同属性句段聚合,不仅能够避免上下文属性一致性差,还能在图谱生成阶段就建立好实体与数据库中其他所有相关数据的关联关系,并以句段为单位进一步提升了图谱的粒度级,以使检索阶段能够快速且准确地锁定相关信息,如此实现了检索结果内容精准、匹配度高,大幅提高检索速度以及检索精准度的技术效果。
应当理解,虽然本说明书按照实施方式加以描述,但并非每个实施方式仅包含一个独立的技术方案,说明书的这种叙述方式仅仅是为清楚起见,本领域技术人员应当将说明书作为一个整体,各实施方式中的技术方案也可以经适当组合,形成本领域技术人员可以理解的其他实施方式。
上文所列出的一系列的详细说明仅仅是针对本发明的可行性实施方式的具体说明,它们并非用以限制本发明的保护范围,凡未脱离本发明技艺精神所作的等效实施方式或变更均应包含在本发明的保护范围之内。

Claims (15)

  1. 一种回馈数据图谱生成方法,其特征在于,包括:
    遍历原始信息库中所有原始语料,生成基础目录数据;
    根据所述基础目录数据,抽取形成实体信息元素以及实体关系元素;
    根据所述基础目录数据和所述原始信息库,依次执行属性融合以及同属性句段聚合,生成对应于不同文本句段数据的多组句段属性元素;其中,所述文本句段数据在所述原始语料中包含有多组;
    根据所述实体信息元素构建实体节点,根据所述实体关系元素建立实体间的关联关系,将所述句段属性元素按照句段与实体间的关联关系,对应存入所述实体节点中,生成回馈数据图谱。
  2. 根据权利要求1所述的回馈数据图谱生成方法,其特征在于,所述“根据所述基础目录数据和所述原始信息库,依次执行属性融合以及同属性句段聚合,生成对应于不同文本句段数据的多组句段属性元素”具体包括:
    根据所述基础目录数据在所述原始信息库中检索,得到对应于不同基础目录数据的多组待处理文本;
    根据所述待处理文本,依次执行双向特征表示以及属性分类识别,得到对应于不同文本句段数据的多组初级属性数据;
    根据所述初级属性数据、所述文本句段数据以及实体指向数据,依次执行属性融合和同属性句段聚合,生成所述句段属性元素;其中,所述实体指向数据表征所述文本句段数据与所述实体间的关联关系。
  3. 根据权利要求2所述的回馈数据图谱生成方法,其特征在于,所述“根据所述初级属性数据、所述文本句段数据以及实体指向数据,依次执行属性融合和同属性句段聚合,生成所述句段属性元素”具体包括:
    根据所述初级属性数据之间的相似度,对所述初级属性数据执行属性融合,重新确定对应于不同文本句段数据的多组句段属性数据,并根据所述句段属性数据,对句段属性数据相同的多组文本句段数据执行同属性句段聚合,重新确定对应于不同文本句段数据的多组实体指向数据;
    根据所述实体指向数据、所述句段属性数据以及所述文本句段数据,生成所述句段属性元素;
    所述“根据所述初级属性数据之间的相似度,对所述初级属性数据执行属性融合,重新确定对应于不同文本句段数据的多组句段属性数据,并根据所述句段属性数据,对句段属性数据相同的多组文本句段数据执行同属性句段聚合,重新确定对应于不同文本句段数据的多组实体指向数据”具体包括:
    对所有句段属性数据进行向量化,计算得到的句段属性向量中两两之间的属性相似度值;
    依次根据所述属性相似度值、所述实体指向数据、所述句段属性数据的数据量、所述文本句段数据的数据量,以及所述文本句段数据在所述待处理文本中的句段位置信息,依次重新确定所述句段属性数据以及所述实体指向数据;
    所述句段属性向量包括第一属性向量和第二属性向量,所述句段属性数据包括分别对应于所述第一属性向量和所述第二属性向量的第一属性数据和第二属性数据,所述实体指向数据包括分别对应于所述第一属性数据和所述第二属性数据的第一指向数据和第二指向数据;所述“依次根据所述属性相似度值、所述实体指向数据、所述句段属性数据的数据量、所述文本句段数据的数据量,以及所述文本句段数据在所述待处理文本中的句段位置信息,依次重新确定所述句段属性数据以及所述实体指向数据”具体包括:
    若所述第一属性向量与所述第二属性向量之间的属性相似度值满足预设的融合相似度值,则判定所述第一属性数据和所述第二属性数据具有相同的内涵;
    根据所述第一属性数据和所述第二属性数据分别对应的实体指向数据、所述句段属性数据的数据量、所述文本句段数据的数据量,以及所述句段位置信息,依次重新确定第一属性数据和第一指向数据,以及第二属性数据和第二指向数据;
    所述“根据所述第一属性数据和所述第二属性数据分别对应的实体指向数据、所述句段属性数据的数据量、所述文本句段数据的数据量,以及所述句段位置信息,依次重新确定第一属性数据和第一指向数据,以及第二属性数据和第二指向数据”具体包括:
    比较所述第一属性数据的数据量大小和所述第二属性数据的数据量大小,将所述第一属性数据和所述第二属性数据设定为数据量较小的句段属性数据。
  4. 根据权利要求2所述的回馈数据图谱生成方法,其特征在于,所述“根据所述初级属性数据、所述文本句段数据以及实体指向数据,依次执行属性融合和同属性句段聚合,生成所述句段属性元素”具体包括:
    根据所述初级属性数据之间的相似度,对所述初级属性数据执行属性融合,重新确定对应于不同文本句段数据的多组句段属性数据,并根据所述句段属性数据,对句段属性数据相同的多组文本句段数据执行同属性句段聚合,重新确定对应于不同文本句段数据的多组实体指向数据;
    根据所述实体指向数据、所述句段属性数据以及所述文本句段数据,生成所述句段属性元素;
    所述“根据所述初级属性数据之间的相似度,对所述初级属性数据执行属性融合,重新确定对应于不同文本句段数据的多组句段属性数据,并根据所述句段属性数据,对句段属性数据相同的多组文本句段数据执行同属性句段聚合,重新确定对应于不同文本句段数据的多组实体指向数据”具体包括:
    对所有句段属性数据进行向量化,计算得到的句段属性向量中两两之间的属性相似度值;
    依次根据所述属性相似度值、所述实体指向数据、所述句段属性数据的数据量、所述文本句段数据的数据量,以及所述文本句段数据在所述待处理文本中的句段位置信息,依次重新确定所述句段属性数据以及所述实体指向数据;
    所述句段属性向量包括第一属性向量和第二属性向量,所述句段属性数据包括分别对应于所述第一属性向量和所述第二属性向量的第一属性数据和第二属性数据,所述实体指向数据包括分别对应于所述第一属性数据和所述第二属性数据的第一指向数据和第二指向数据;所述“依次根据所述属性相似度值、所述实体指向数据、所述句段属性数据的数据量、所述文本句段数据的数据量,以及所述文本句段数据在所述待处理文本中的句段位置信息,依次重新确定所述句段属性数据以及所述实体指向数据”具体包括:
    若所述第一属性向量与所述第二属性向量之间的属性相似度值满足预设的融合相似度值,则判定所述第一属性数据和所述第二属性数据具有相同的内涵;
    根据所述第一属性数据和所述第二属性数据分别对应的实体指向数据、所述句段属性数据的数据量、所述文本句段数据的数据量,以及所述句段位置信息,依次重新确定第一属性数据和第一指向数据,以及第二属性数据和第二指向数据;
    所述文本句段数据包括分别对应于所述第一属性数据和所述第二属性数据的第一句段数据和第二句段数据;所述“根据所述第一属性数据和所述第二属性数据分别对应的实体指向数据、所述句段属性数据的数据量、所述文本句段数据的数据量,以及所述句段位置信息,依次重新确定第一属性数据和第一指向数据,以及第二属性数据和第二指向数据”具体包括:
    判断所述第一指向数据和所述第二指向数据是否指向同一实体;
    若否,则判断所述第一句段数据的数据量大小和所述第二句段数据的数据量大小是否相同;
    若不同,则将所述第一指向数据和所述第二指向数据修改为该数据量较大的文本句段数据所对应的实体指向数据;
    在所述“判断所述第一句段数据的数据量大小和所述第二句段数据的数据量大小是否相同”之后,所述方法还包括:
    若相同,则将所述第一指向数据和所述第二指向数据修改为该值较小的实体指向数据。
  5. 根据权利要求2所述的回馈数据图谱生成方法,其特征在于,所述“根据所述待处理文本,依次执行双向特征表示以及属性分类识别,得到对应于不同文本句段数据的多组初级属性数据”具体包括:
    遍历所述待处理文本,根据预设的分句规则进行拆分,得到所述文本句段数据;
    将所述文本句段数据依次输入至预设的双向特征表示模型中,依次执行向量化表示、向量编码以及融合运算,得到分别对应所述文本句段数据的词向量特征表示;
    将所述词向量特征表示输入预设的属性分类卷积模型中,得到对应所述词向量特征表示的词向量特征集合;
    调用预设的第一激活函数处理所述词向量特征集合,并根据预设的属性分类规则识别得到对应所述文本句段数据的初级属性数据;
    所述“将所述词向量特征表示输入预设的属性分类卷积模型中,得到对应所述词向量特征表示的词向量特征集合”具体包括:
    按照预设尺寸的卷积核、调用预设的第二激活函数,对所述词向量特征表示中的每个词向量重复执行两次卷积和激活,并对得到的一阶卷积词向量进行池化,得到对应所述词向量特征表示的多组中间词向量特征;
    按照预设尺寸的卷积核、调用预设的第二激活函数,对所述中间词向量特征分别重复执行两次卷积和激活,并对得到的二阶卷积词向量进行池化,得到对应所述词向量特征表示的多组最终词向量特征;
    将对应于同一所述词向量特征表示的最终词向量特征进行组合匹配,得到所述词向量特征集合。
  6. 根据权利要求2所述的回馈数据图谱生成方法,其特征在于,所述“根据所述待处理文本,依次执行双向特征表示以及属性分类识别,得到对应于不同文本句段数据的多组初级属性数据”具体包括:
    遍历所述待处理文本,根据预设的分句规则进行拆分,得到所述文本句段数据;
    将所述文本句段数据依次输入至预设的双向特征表示模型中,依次执行向量化表示、向量编码以及融合运算,得到分别对应所述文本句段数据的词向量特征表示;
    将所述词向量特征表示输入预设的属性分类卷积模型中,得到对应所述词向量特征表示的词向量特征集合;
    调用预设的第一激活函数处理所述词向量特征集合,并根据预设的属性分类规则识别得到对应所述文本句段数据的初级属性数据;
    所述“将所述文本句段数据依次输入至预设的双向特征表示模型中,依次执行向量化表示、向量编码以及融合运算,得到分别对应所述文本句段数据的词向量特征表示”具体包括:
    按照预设分隔规则,对所述文本句段数据添加句首向量标记和句间向量标记,得到标记句段数据;
    将所述标记句段数据中的所有单词,分别输入位置嵌入层、分割嵌入层和和字嵌入层,得到分别对应于每个单词的位置向量表示、分割向量表示和字向量表示,并对所述位置向量表示、所述分割向量表示和所述字向量表示进行融合运算,得到对应于每个单词的单词输入向量;
    将所述单词输入向量分别输入至双向编码器中,依次执行双向自注意力分配、残差连接、层标准化以及线性转换,得到对应于每个单词的单词编码向量;
    将对应于同一标记句段数据的单词编码向量依次进行连接运算,得到对应所述文本句段数据的词向量特征表示;
    其中,所述位置向量表示表征不同单词在所述标记句段数据中的位置差异,所述分割向量表示表征所述标记句段数据中不同部分之间的内容差异,所述字向量表示表征对应于不同单词的多个预设维度的向量。
  7. 根据权利要求2所述的回馈数据图谱生成方法,其特征在于,所述“根据所述待处理文本,依次执行双向特征表示以及属性分类识别,得到对应于不同文本句段数据的多组初级属性数据”具体包括:
    遍历所述待处理文本,根据预设的分句规则进行拆分,得到所述文本句段数据;
    将所述文本句段数据依次输入至预设的双向特征表示模型中,依次执行向量化表示、向量编码以及融合运算,得到分别对应所述文本句段数据的词向量特征表示;
    将所述词向量特征表示输入预设的属性分类卷积模型中,得到对应所述词向量特征表示的词向量特征集合;
    调用预设的第一激活函数处理所述词向量特征集合,并根据预设的属性分类规则识别得到对应所述文本句段数据的初级属性数据;
    所述“将所述文本句段数据依次输入至预设的双向特征表示模型中,依次执行向量化表示、向量编码以及融合运算,得到分别对应所述文本句段数据的词向量特征表示”具体包括:
    按照预设分隔规则,对所述文本句段数据添加句首向量标记和句间向量标记,得到标记句段数据;
    将所述标记句段数据中的所有单词,分别输入位置嵌入层、分割嵌入层和和字嵌入层,得到分别对应于每个单词的位置向量表示、分割向量表示和字向量表示,并对所述位置向量表示、所述分割向量表示和所述字向量表示进行融合运算,得到对应于每个单词的单词输入向量;
    将所述单词输入向量分别输入至双向编码器中,依次执行双向自注意力分配、残差连接、层标准化以及线性转换,得到对应于每个单词的单词编码向量;
    将对应于同一标记句段数据的单词编码向量依次进行连接运算,得到对应所述文本句段数据的词向量特征表示;
    所述“按照预设分隔规则,对所述文本句段数据添加句首向量标记和句间向量标记,得到标记句段数据”具体包括:
    在所述文本句段数据中首个单词之前添加句首向量标记后,对所述文本句段数据的内容进行遍历,当识别得到预设的分隔符号时,将所述分隔符号处添加所述句间向量标记,迭代直至所述文本句段数据中所有单词均完成识别。
  8. 根据权利要求2所述的回馈数据图谱生成方法,其特征在于,所述“根据所述待处理文本,依次执行双向特征表示以及属性分类识别,得到对应于不同文本句段数据的多组初级属性数据”具体包括:
    遍历所述待处理文本,根据预设的分句规则进行拆分,得到所述文本句段数据;
    将所述文本句段数据依次输入至预设的双向特征表示模型中,依次执行向量化表示、向量编码以及融合运算,得到分别对应所述文本句段数据的词向量特征表示;
    将所述词向量特征表示输入预设的属性分类卷积模型中,得到对应所述词向量特征表示的词向量特征集合;
    调用预设的第一激活函数处理所述词向量特征集合,并根据预设的属性分类规则识别得到对应所述文本句段数据的初级属性数据;
    在所述“根据所述基础目录数据在所述原始信息库中检索,得到对应于不同基础目录数据的多组待处理文本”之后,所述方法还包括:
    接收预训练数据集;
    使能所述双向特征表示模型,依次执行掩码语言模型任务以及下句预测任务,对所述预训练数据集中的数据进行迭代遍历预测和验证,得到标准模型参数组;
    将所述标准模型参数组搭载于所述双向特征表示模型;
    所述“将所述文本句段数据依次输入至预设的双向特征表示模型中,依次执行向量化表示、向量编码以及融合运算,得到分别对应所述文本句段数据的词向量特征表示”具体包括:
    将所述文本句段数据依次输入至训练好的双向特征表示模型中,依次执行向量化表示、向量编码以及融合运算,得到分别对应所述文本句段数据的词向量特征表示。
  9. 根据权利要求2所述的回馈数据图谱生成方法,其特征在于,所述“根据所述待处理文本,依次执行双向特征表示以及属性分类识别,得到对应于不同文本句段数据的多组初级属性数据”具体包括:
    遍历所述待处理文本,根据预设的分句规则进行拆分,得到所述文本句段数据;
    将所述文本句段数据依次输入至预设的双向特征表示模型中,依次执行向量化表示、向量编码以及融合运算,得到分别对应所述文本句段数据的词向量特征表示;
    将所述词向量特征表示输入预设的属性分类卷积模型中,得到对应所述词向量特征表示的词向量特征集合;
    调用预设的第一激活函数处理所述词向量特征集合,并根据预设的属性分类规则识别得到对应所述文本句段数据的初级属性数据;
    所述“遍历所述待处理文本,根据预设的分句规则进行拆分,得到所述文本句段数据”具体包括:
    遍历所述待处理文本中的所有数据,当识别得到预设的分句符号时,提取当前分句符号至前一分句符号之间的数据作为一组文本句段数据,迭代得到所有文本句段数据;且/或,
    所述“根据所述基础目录数据在所述原始信息库中检索,得到对应于不同基础目录数据的多组待处理文本”具体包括:
    在所述原始信息库中,检索当前基础目录数据和下一基础目录数据之间的原始语料,得到对应所述当前基础目录数据的待处理文本;
    迭代生成分别对应所有所述基础目录数据的多组待处理文本。
  10. 根据权利要求1所述的回馈数据图谱生成方法,其特征在于,所述“根据所述基础目录数据,抽取形成实体信息元素以及实体关系元素”具体包括:
    迭代并以所述基础目录数据作为实体进行抽取和排序,将对应生成的实体序号数据和基础目录数据执行匹配,形成所述实体信息元素;其中,所述实体序号数据用于表征实体之间的内容差异,以及用于表征实体与所述文本句段数据的关联关系;且/或,
    所述“根据所述基础目录数据,抽取形成实体信息元素以及实体关系元素”具体包括:
    迭代并根据所述基础目录数据之间的层级关系,确定作为实体的基础目录数据两两之间的外部关联关系,并根据所述外部关联关系以及对应的两项基础目录数据,匹配形成所述实体关系元素。
  11. 根据权利要求1所述的回馈数据图谱生成方法,其特征在于,所述“遍历原始信息库中所有原始语料,生成基础目录数据”具体包括:
    分析得到所述原始信息库中的目录结构信息;
    迭代识别不同原始语料对应的多组原始格式信息,当所述原始格式信息匹配于预设的标准格式信息时,提取该原始格式信息对应的原始语料作为结构语料信息;
    根据所述结构语料信息和所述目录结构信息在所述原始信息库中的相对位置,对所述目录结构信息和所述结构语料信息进行排序整合,得到所述基础目录数据。
  12. 根据权利要求11所述的回馈数据图谱生成方法,其特征在于,所述目录结构信息包括相互对应的目录标题信息和目录层级序号;所述“根据所述结构语料信息和所述目录结构信息在所述原始信息库中的相对位置,对所述目录结构信息和所述结构语料信息进行排序整合,得到所述基础目录数据”具体包括:
    迭代判断所述结构语料信息与所有目录结构信息之间的从属关系,得到位于所述结构语料信息最接近上一层级的目录结构信息,作为参考结构信息;
    根据所述参考结构信息中的目录层级序号,以及相邻的其他结构语料信息分布情况,确定所述结构语料信息的目录层级序号;
    按照所述目录层级序号对所述目录结构信息和所述结构语料信息进行排序整合,得到所述基础目录数据;
    所述目录结构信息包括先后设置的第一结构信息和第二结构信息,所述第一结构信息包括第一标题信息和第一层级序号,所述第二结构信息包括第二标题信息和第二层级序号;所述“迭代判断所述结构语料信息与所有目录结构信息之间的从属关系,得到位于所述结构语料信息最接近上一层级的目录结构信息,作为参考结构信息”具体包括:
    链接到所述原始信息库中所述第一标题信息所指向的实际位置,向下遍历并迭代识别不同原始语料对应的多组原始格式信息,对应提取符合条件的原始语料作为结构语料信息,分别存储为至少一组第一语料信息,直至识别到 所述第二结构信息;
    所述“根据所述参考结构信息中的目录层级序号,以及相邻的其他结构语料信息分布情况,确定所述结构语料信息的目录层级序号”具体包括:
    根据所述第一层级序号,按照所述第一语料信息的内部排列顺序,生成对应于至少一组第一语料信息的至少一组第一次级序号,并将所述第一次级序号与对应的所述第一语料信息形成匹配,以所述第一次级序号作为对应所述第一语料信息的所述目录层级序号。
  13. 根据权利要求11所述的回馈数据图谱生成方法,其特征在于,所述目录结构信息包括相互对应的目录标题信息和目录层级序号;所述“根据所述结构语料信息和所述目录结构信息在所述原始信息库中的相对位置,对所述目录结构信息和所述结构语料信息进行排序整合,得到所述基础目录数据”具体包括:
    迭代判断所述结构语料信息与所有目录结构信息之间的从属关系,得到位于所述结构语料信息最接近上一层级的目录结构信息,作为参考结构信息;
    根据所述参考结构信息中的目录层级序号,以及相邻的其他结构语料信息分布情况,确定所述结构语料信息的目录层级序号;
    按照所述目录层级序号对所述目录结构信息和所述结构语料信息进行排序整合,得到所述基础目录数据;
    所述“迭代识别不同原始语料对应的多组原始格式信息,当所述原始格式信息匹配于预设的标准格式信息时,提取该原始格式信息对应的原始语料作为结构语料信息”具体包括:
    迭代遍历所述原始信息库中除所述目录结构信息以外的部分,提取符合条件的原始语料,得到第一语料信息;
    所述“迭代判断所述结构语料信息与所有目录结构信息之间的从属关系,得到位于所述结构语料信息最接近上一层级的目录结构信息,作为参考结构信息”具体包括:
    根据所述第一语料信息向前检索,得到首次出现的目录结构信息作为参考结构信息,并统计排列于所述第一语料信息和所述参考结构信息之间的其他结构语料信息的个数,得到前向语料数量;
    所述“根据所述参考结构信息中的目录层级序号,以及相邻的其他结构语料信息分布情况,确定所述结构语料信息的目录层级序号”具体包括:
    根据所述参考结构信息的所述目录层级序号,以及所述前向语料数量,生成对应于所述第一语料信息的第一次级序号,并将所述第一次级序号与所述第一语料信息形成匹配,以所述第一次级序号作为对应所述第一语料信息的所述目录层级序号。
  14. 根据权利要求11所述的回馈数据图谱生成方法,其特征在于,所述“分析得到所述原始信息库中的目录结构信息”具体包括:
    定位所述原始信息库中的目录数据集合;
    提取所述目录数据集合中的目录标题信息和目录层级序号,组成所述目录结构信息,并按照所述目录层级序号对所述目录结构信息排序。
  15. 一种冰箱,包括不同温度区域的储存间室,以及用于开闭储存间室的门体,其特征在于,所述冰箱还包括一种问答设备;所述问答设备包括存储器、处理器;所述问答设备还包括:
    存储在所述存储器上并可在所述处理器上运行的回馈数据图谱生成程序,所述回馈数据图谱生成程序被所述处理器执行时,实现如权利要求1-14中任一项所述的回馈数据图谱生成方法的步骤,和/或
    存储在所述存储器上,根据权利要求1-14中任一项所述的回馈数据图谱生成方法生成的回馈数据图谱。
PCT/CN2023/101636 2022-06-22 2023-06-21 回馈数据图谱生成方法及冰箱 WO2023246849A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210713627.6 2022-06-22
CN202210713627.6A CN115129890A (zh) 2022-06-22 2022-06-22 回馈数据图谱生成方法、生成设备、问答设备及冰箱

Publications (1)

Publication Number Publication Date
WO2023246849A1 true WO2023246849A1 (zh) 2023-12-28

Family

ID=83380495

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/101636 WO2023246849A1 (zh) 2022-06-22 2023-06-21 回馈数据图谱生成方法及冰箱

Country Status (2)

Country Link
CN (1) CN115129890A (zh)
WO (1) WO2023246849A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115129890A (zh) * 2022-06-22 2022-09-30 青岛海尔电冰箱有限公司 回馈数据图谱生成方法、生成设备、问答设备及冰箱

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729402A (zh) * 2013-11-22 2014-04-16 浙江大学 一种基于图书目录的知识图谱的构建方法
CN110941612A (zh) * 2019-11-19 2020-03-31 上海交通大学 基于关联数据的自治数据湖构建系统及方法
WO2022022045A1 (zh) * 2020-07-27 2022-02-03 平安科技(深圳)有限公司 基于知识图谱的文本比对方法、装置、设备及存储介质
CN114580638A (zh) * 2022-02-14 2022-06-03 中国人民解放军战略支援部队信息工程大学 基于文本图增强的知识图谱表示学习方法及系统
CN115129890A (zh) * 2022-06-22 2022-09-30 青岛海尔电冰箱有限公司 回馈数据图谱生成方法、生成设备、问答设备及冰箱

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729402A (zh) * 2013-11-22 2014-04-16 浙江大学 一种基于图书目录的知识图谱的构建方法
CN110941612A (zh) * 2019-11-19 2020-03-31 上海交通大学 基于关联数据的自治数据湖构建系统及方法
WO2022022045A1 (zh) * 2020-07-27 2022-02-03 平安科技(深圳)有限公司 基于知识图谱的文本比对方法、装置、设备及存储介质
CN114580638A (zh) * 2022-02-14 2022-06-03 中国人民解放军战略支援部队信息工程大学 基于文本图增强的知识图谱表示学习方法及系统
CN115129890A (zh) * 2022-06-22 2022-09-30 青岛海尔电冰箱有限公司 回馈数据图谱生成方法、生成设备、问答设备及冰箱

Also Published As

Publication number Publication date
CN115129890A (zh) 2022-09-30

Similar Documents

Publication Publication Date Title
CN112507715B (zh) 确定实体之间关联关系的方法、装置、设备和存储介质
CN107066553B (zh) 一种基于卷积神经网络与随机森林的短文本分类方法
WO2022116537A1 (zh) 一种资讯推荐方法、装置、电子设备和存储介质
RU2628431C1 (ru) Подбор параметров текстового классификатора на основе семантических признаков
RU2628436C1 (ru) Классификация текстов на естественном языке на основе семантических признаков
WO2023065211A1 (zh) 一种信息获取方法以及装置
WO2021068683A1 (zh) 正则表达式生成方法、装置、服务器及计算机可读存储介质
CN107844533A (zh) 一种智能问答系统及分析方法
CN107688870B (zh) 一种基于文本流输入的深度神经网络的分层因素可视化分析方法及装置
WO2020232898A1 (zh) 文本分类方法、装置、电子设备及计算机非易失性可读存储介质
CN116501875B (zh) 一种基于自然语言和知识图谱的文档处理方法和系统
WO2023246849A1 (zh) 回馈数据图谱生成方法及冰箱
JP2018005690A (ja) 情報処理装置及びプログラム
CN115374781A (zh) 文本数据信息挖掘方法、装置、设备
CN114997288A (zh) 一种设计资源关联方法
CN115795030A (zh) 文本分类方法、装置、计算机设备和存储介质
CN116975271A (zh) 文本相关性的确定方法、装置、计算机设备和存储介质
CN115730597A (zh) 多级语义意图识别方法及其相关设备
CN115248839A (zh) 一种基于知识体系的长文本检索方法以及装置
CN115130601A (zh) 基于多维特征融合的二阶段学术数据网页分类方法及系统
CN114491079A (zh) 知识图谱构建和查询方法、装置、设备和介质
CN111061876A (zh) 事件舆情数据分析方法及装置
CN112925912B (zh) 文本处理方法、同义文本召回方法及装置
RU2681356C1 (ru) Обучение классификаторов, используемых для извлечения информации из текстов на естественном языке
CN114265936A (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: 23826494

Country of ref document: EP

Kind code of ref document: A1