A target group determination method, system, device and storage medium
By automatically identifying and generating bitmap scripts using a natural language processing model, the errors caused by manually inputting label information and logical relationships in existing technologies are solved, enabling efficient and accurate screening of target customer groups.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- E SURFING VISION TECHNOLOGY CO LTD
- Filing Date
- 2023-10-16
- Publication Date
- 2026-08-04
AI Technical Summary
In existing technologies, when filtering target customer groups using bitmaps, operators need to manually input tag information and logical relationships, which is prone to errors and complex, resulting in low accuracy and a high barrier to entry.
The system uses a natural language processing model to automatically identify tag information and logical relationships, generate relation triples, and convert them into binary trees and bitmap scripts. The target group is then extracted through a bitmap computing engine, reducing manual intervention.
It improves the accuracy of target group identification, reduces the reliance on operator skills, and enhances the efficiency and user experience of customer group selection.
Smart Images

Figure CN117421390B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of big data technology, and in particular to a method, system, device and storage medium for identifying target groups. Background Technology
[0002] With the development of big data technology, enterprises need to build data tags for customer data to better understand their needs, track changes in different customer segments, accurately target new customers, and provide comprehensive customer service to prevent customer churn. During the usage phase, combining multi-dimensional tags allows for the rapid selection of segmented target customer groups. Therefore, building customer tags is one of the most effective methods for precision marketing in the big data era. The rapid and effective selection of customer groups is of great significance for improving the efficiency of precision marketing and achieving cost reduction and efficiency improvement for enterprises.
[0003] The efficient support of computer hardware, parallel processing capabilities, hardware optimization, and the data types targeted by bitwise operations all contribute to the ability of computers to perform bitwise operations with high efficiency. Furthermore, the high storage efficiency and ease of processing and editing of bitmaps have made them a mainstream method for target customer segmentation. However, in related technologies, when using bitmaps to segment target groups, the operator needs to accurately provide the tag information of the target group and the logical relationships between the tags. This process requires the operator to have certain relevant basic knowledge; moreover, it requires manual screening of the tag information, which is prone to errors and leads to low accuracy in tag screening. Summary of the Invention
[0004] The purpose of this invention is to at least partially solve one of the technical problems existing in the prior art.
[0005] Therefore, the purpose of this invention is to provide an efficient method, system, apparatus, and storage medium for identifying target groups.
[0006] To achieve the above-mentioned technical objectives, the technical solutions adopted in the embodiments of the present invention include:
[0007] On one hand, embodiments of the present invention provide a method for determining a target group, comprising the following steps:
[0008] This invention discloses a method for determining a target group, comprising: acquiring first text; the first text including tag information of the target group and logical relationship information between tags; processing the first text using a natural language model to obtain relation triples; the natural language model being used to uniformly represent and interact with entities and relationships involved in the first text, the natural language model performing predictive learning through indicator functions, the indicator functions including a first function for subject entities and object entities, and a second function for object entities and subject entities; converting the relation triples into a binary tree, and generating bitmap script statements based on the binary tree; and extracting a group list from the bitmap script statements using a bitmap computing engine to obtain the target group. This invention obtains relation triples from the first text provided by the operator by processing it; it eliminates the need for the operator to select tags or determine the logical relationships between tags. This invention helps alleviate the dependence of tag determination on operator skills. Furthermore, by establishing a first function and a second function in the natural language model to distinguish the relative relationships between subject entities and object entities, this invention improves the accuracy of the natural language model output, thereby improving the accuracy of target group determination.
[0009] In addition, the target group determination method according to the above embodiments of the present invention may also have the following additional technical features:
[0010] Furthermore, in the target group determination method of this embodiment of the invention, the step of processing the first text through a natural language model to obtain relation triples includes:
[0011] The first text, logical triples, and sub-logical triples are concatenated to obtain the input sequence; the logical triples are used to represent the logical relationship between the main entity, the object entity, and the relation; the sub-logical triples include the first logical relationship between the main entity and the object entity, the second logical relationship between the object entity and the main entity, the third logical relationship between the entity and the relation, and the fourth logical relationship between the relation and the entity.
[0012] The input sequence is processed by a natural language model to learn representations, resulting in a representation matrix; each position in the representation matrix is used to represent a defined relation.
[0013] Based on the representation matrix, an indicator function is determined; and based on the indicator function, a result prediction is performed to obtain a relation triplet.
[0014] Furthermore, in one embodiment of the present invention, the natural language model includes a BERT model, and the method further includes:
[0015] The interaction table is obtained by adding the Q matrix and K matrix of the last layer in the BERT model.
[0016] The interaction table is processed by an activation function to obtain relation triples;
[0017] The relation triplet is optimized by using an optimization function to obtain the optimized relation triplet.
[0018] Furthermore, in one embodiment of the present invention, the method further includes the following steps:
[0019] Perform subject-object recognition processing on the first text to obtain entities and relationships;
[0020] The entities involved in the first text are validated using a greedy algorithm based on regular expressions. If the validation result is unsuccessful, the first text is corrected to obtain the corrected first text.
[0021] Furthermore, in one embodiment of the present invention, the step of converting the relation triplet into a binary tree includes:
[0022] Traverse each triplet in the relation triplet and generate the corresponding partial binary tree;
[0023] Insert the partial binary tree into the existing binary tree to obtain the transformed binary tree.
[0024] Furthermore, in one embodiment of the present invention, generating a corresponding partial binary tree for each triple in the traversal relation triplet includes:
[0025] Iterate through the relation triples and obtain the first triple;
[0026] Use the relation in the first triplet as the root node of the partial binary tree;
[0027] If the first main entity of the first triplet is not empty, the first main entity is taken as the left child node of the root node;
[0028] Alternatively, if the first object entity of the first triplet is not empty, the first object entity is used as the right child node of the root node to generate a partial binary tree.
[0029] Furthermore, in one embodiment of the present invention, the method further includes:
[0030] Establish a group tag architecture, which includes a tag data layer, a bit layer, and a tag query application layer;
[0031] The tag data layer is used to store tag information of the group, the bit layer is used to build a bitmap based on the tag information, and the tag query application layer is used to query the target group based on the first text.
[0032] On the other hand, embodiments of the present invention propose a target group determination system, comprising:
[0033] The first module is used to acquire the first text; the first text includes the tag information of the target group and the logical relationship information between the tags;
[0034] The second module is used to process the first text through a natural language model to obtain relation triples; the natural language model is used to uniformly represent and interact with the entities and relations involved in the first text, and the natural language model performs prediction learning through indicator functions, the indicator functions including a first function for the main entity and the object entity, and a second function for the object entity and the main entity;
[0035] The third module is used to convert the relation triples into a binary tree and generate bitmap script statements based on the binary tree;
[0036] The fourth module is used to extract the target group from the bitmap script statements through the bitmap calculation engine.
[0037] On the other hand, embodiments of the present invention provide a target group identification device, comprising:
[0038] At least one processor;
[0039] At least one memory for storing at least one program;
[0040] When the at least one program is executed by the at least one processor, the at least one processor implements the target group determination method described above.
[0041] On the other hand, embodiments of the present invention provide a storage medium storing a processor-executable program, which, when executed by a processor, is used to implement the above-described target group determination method.
[0042] The target group determination method provided by this invention includes the following steps: obtaining a first text; the first text includes tag information of the target group and logical relationship information between tags; processing the first text through a natural language model to obtain relation triples; the natural language model is used to uniformly represent and interact with the entities and relationships involved in the first text, and the natural language model performs prediction learning through indicator functions, the indicator functions including a first function for the main entity and the object entity, and a second function for the object entity and the main entity; converting the relation triples into a binary tree, and generating bitmap script statements based on the binary tree; and extracting a group list from the bitmap script statements through a bitmap computing engine to obtain the target group. This invention obtains relation triples in the first text by processing the first text provided by the operator; it does not require the operator to select tags or determine the logical relationships between tags. This invention helps to alleviate the dependence of tag determination on operator skills. Simultaneously, this invention improves the accuracy of the natural language model output by establishing a first function and a second function in the natural language model to distinguish the relative relationships between the main entity and the object entity, thereby improving the accuracy of target group determination. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following description is provided with accompanying drawings of the relevant technical solutions in the embodiments of the present invention or the prior art. It should be understood that the accompanying drawings described below are only for the purpose of clearly illustrating some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0044] Figure 1 A flowchart illustrating an embodiment of the target group determination method provided by the present invention;
[0045] Figure 2 A schematic diagram of one embodiment of the group tagging architecture provided by the present invention;
[0046] Figure 3 A flowchart illustrating an embodiment of the customer group determination method based on a bitmap computing engine provided by the present invention;
[0047] Figure 4 A schematic diagram of the structure of an embodiment of the client group bitmap storage based on a bitmap computing engine provided by the present invention;
[0048] Figure 5 A flowchart illustrating one embodiment of the bitmap computing engine-based customer selection provided by the present invention;
[0049] Figure 6A schematic diagram of a structural embodiment of a binary tree provided by the present invention;
[0050] Figure 7 A schematic diagram of the structure of one embodiment of the multi-label binary tree provided by the present invention;
[0051] Figure 8 A flowchart illustrating one embodiment of the natural language model processing procedure provided by the present invention;
[0052] Figure 9 This is a flowchart comparing an embodiment of the present application with an embodiment of related technologies provided by the present invention;
[0053] Figure 10 A flowchart illustrating another embodiment of the target group determination method provided by the present invention;
[0054] Figure 11 A schematic diagram of the structure of one embodiment of the target group determination system provided by the present invention;
[0055] Figure 12 This is a schematic diagram of one embodiment of the target group determination device provided by the present invention. Detailed Implementation
[0056] The embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention. The step numbers in the following embodiments are set only for ease of explanation, and there is no limitation on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0057] First, the terms used in the embodiments of this application will be explained:
[0058] Bitmap Calculation Engine: BitMap is a computation engine specifically designed for processing bitmaps. It provides a series of functions and algorithms for various operations and calculations on bitmaps. Some common bitmap functions include bitmap-body conversion, bitmap logical operations, bitmap value addition, modification, and deletion. Common bitmap calculation engines include ClickHouse, PolarDB, PostgreSQL, and Redis. In this embodiment of the invention, ClickHouse is used as the BitMap calculation engine. However, it should be noted that those skilled in the art can choose a bitmap calculation engine according to actual needs, and not just use ClickHouse as the BitMap calculation engine, but can use the calculation engine for the related technical solutions, models, etc. mentioned in this embodiment of the invention.
[0059] For example, ClickHouse features include:
[0060] Columnar storage: ClickHouse uses a columnar storage structure, which can significantly improve query performance, especially in scenarios where large amounts of data need to be retrieved quickly.
[0061] High performance: ClickHouse boasts high-performance query and insert speeds, supporting millions or even tens of millions of query and insert operations.
[0062] Scalability: ClickHouse can achieve higher performance and reliability through horizontal scaling, and can expand data storage capacity without affecting existing performance.
[0063] SQL Support: ClickHouse supports the standard SQL query language and can be integrated with existing SQL tools and applications.
[0064] Open source: ClickHouse is an open source project with high customizability and scalability, which can be customized and extended according to different application scenarios and needs.
[0065] ClickHouse is suitable for scenarios requiring the processing of large amounts of data and complex analysis, such as data warehousing, log analysis, ad serving, and the Internet of Things (IoT). Due to its high performance and scalability, ClickHouse has been widely adopted in the big data field.
[0066] With the development of technologies such as big data, enterprises need to build data tags for customer data to better understand their needs, track changes in different customer segments, accurately target new customers, and provide comprehensive customer service to prevent customer churn. During the usage phase, combining multi-dimensional tags allows for the rapid selection of segmented target customer groups. Therefore, building customer tags is one of the most effective methods for precision marketing in the big data era. The rapid and effective selection of customer groups is of great significance for improving the efficiency of precision marketing and achieving cost reduction and efficiency improvement for enterprises.
[0067] The efficient support of computer hardware, parallel processing capabilities, hardware optimization, and the data types targeted by bitwise operations all contribute to the ability of computers to perform bitwise operations with remarkable efficiency. Furthermore, the high storage efficiency and ease of processing and editing of bitmaps have made them a mainstream method for targeting specific customer groups.
[0068] In applications that select customer groups based on tags, to filter out all customer groups matching specific tag characteristics, a bitmap needs to be created for each tag's corresponding customer group. When filtering target groups, simply select the specified bitmap and perform bitwise logical operations according to the logical relationships. Common bitwise logical operations include AND, OR, NOT, XOR, XNOR, etc. When performing logical operations on bitmaps, set operations such as AND, OR, and NOT are mainly involved. Since a bitmap represents a set of customers represented by a tag, logical operations between sets can be transformed into bitwise logical operations on the bitmap, which greatly improves the performance of target group selection. The conventional way to convert finding target customer groups into logical operations between sets is through integration with the application system. The application system designs an interface where customers manually select the tag groups to be selected, then manually select the logical relationships between the tags, and finally submit. The application system then converts the logical operations into bitwise operations based on the submitted task and ultimately finds and outputs the target group. However, set operations involve some mathematical knowledge, and logical calculations require rigorous logical thinking, which can lead to errors when performed manually by the user. Furthermore, complex user interfaces increase the barrier to entry and significantly reduce the user experience. To address these issues, this invention presents an NLP model. The user only needs to input a textual description of the target group to be selected, and the model will automatically identify the tags contained within the target group and the logical relationships between them. This information is then converted into a corresponding bitmap for calculation in the background, and the target group is output after the calculation is complete.
[0069] The target group determination method and system proposed according to the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. First, the target group determination method proposed according to the embodiments of the present invention will be described with reference to the accompanying drawings.
[0070] Reference Figure 1 This invention provides a method for determining a target group. This method can be applied to a terminal, a server, or software running on either a terminal or server. The terminal can be a tablet, laptop, desktop computer, etc., but is not limited to these. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The method for determining a target group in this invention mainly includes the following steps:
[0071] S100: Obtain the first text; the first text includes the target group's tag information and the logical relationship information between the tags;
[0072] S200: The first text is processed by a natural language model to obtain relation triples; the natural language model is used to uniformly represent and interact with the entities and relations involved in the first text. The natural language model performs prediction learning through indicator functions, which include the first function of the main entity and the object entity, and the second function of the object entity and the main entity.
[0073] S300: Convert relation triples into binary trees and generate bitmap script statements based on the binary trees;
[0074] S400: Extracts the target group from the bitmap script statements using the bitmap calculation engine.
[0075] In some possible implementations, such as Figure 2 As shown, the target group determination method provided in this application embodiment can be based on Figure 2 The illustrated architecture, based on a bitmap computing engine, comprises three parts: a tag data table, a bitmap chart, and a tag query application. Based on these three parts, the system converts tags into bitmaps, which are then used to query target groups. Specifically, the structure of the tag data table is shown in Table 1, and the structure of the bitmap chart is shown in Table 2.
[0076] Fields type meaning userid Int Customer ID tag_code String Tag Encoding tag_value String Tag value period String payment terms event_time DateTime Event Time
[0077] Table 1
[0078] Fields type meaning tag_code String Tag Encoding tag_value String Tag value period String payment terms userids GroupBitmap Customer list bitmap event_time DateTime Event Time
[0079] Table 2
[0080] Based on the examples given in Tables 1 and 2, it can be seen that the tag data table stores the original data of customer tags, and the bitmap is calculated based on the tag data table. When generating the bitmap, it is only necessary to group the tag table according to the tag code, tag value, and billing period, and then aggregate and transform the customer ID to obtain the bitmap.
[0081] Understandably, bitmaps provide efficient computation for multi-dimensional label selection. A bitmap is a data structure that associates array indices with specific values. In a bitmap, each element occupies one bit. A bit of 1 indicates that the corresponding element has that specific value, while a bit of 0 indicates that it does not. Once the bitmap is constructed, bitwise logical operations between bitmaps can be used to select customer groups through multi-label combinations. Specific steps can be found... Figure 3 As shown.
[0082] For example, such as Figure 4 As shown, suppose customer group C1 all have label A, and their ID set is [0, 1, 4, 5, 13, 14], while customer group C2 all have label B, and their ID set is [1, 2, 3, 4, 13, 15]. Then customer groups C1 and C2 can be represented as B1 and B2 in a bitmap. To extract customers who satisfy both label A and label B, the following steps are required to complete the label selection:
[0083] S41: Transform the customer's requirements into a combination of tag conditions and input them;
[0084] S42: Find bitmap B1 corresponding to customer group A and bitmap B2 corresponding to customer group B;
[0085] S43: Perform calculations based on the logical relationships in the tag combination conditions to obtain the bitmap B3 of the target customer group (e.g., Figure 5 (as shown);
[0086] S44: Convert bitmap B3 into a list of customer IDs and output it. The conversion process can be viewed as... Figure 4 The reverse process in.
[0087] In this way, the storage space occupied by the tag bitmap is very small, and the tag calculation speed is also very fast.
[0088] In step S41, the complexity of inputting tag combination conditions lies in the logical representation between tags and the conversion between customer intent and tag calculation logic. Typically, a simple logical relationship can be represented by a triple: (subject, object, symbol). Here, subject represents the subject, object represents the object, and symbol represents the logical relationship between the subject and object. In the tag selection scenario, subject and object both refer to a specific tag or the result of logical operations on multiple tags. The symbol represents the logical relationship between the subject and object, and can be represented by keywords, as shown in Table 3, where A represents subject and B represents object.
[0089] symbol meaning Label meaning ∩ Intersection Simultaneously satisfying customer groups of both label A and label B ∪ Union Customer groups that meet A or B - difference set Customer groups that meet A but not B △ Symmetrical difference Customer groups that do not overlap between A and B
[0090] Table 3
[0091] Understandably, converting triples into bitmaps for computation is a relatively simple process, since triples can be represented by a simple binary tree, such as... Figure 6 This represents the AND logical relationship between label A and label B. Using a binary tree, mixed logical calculations between multiple labels can be easily described, such as... Figure 7 The logical relationship represented by is: find customers who satisfy both A and B but not C, or customers who are in D but not in E and do not overlap with F.
[0092] By representing a triple as a binary tree structure, it can be easily converted into bitmap logic calculations between ClickHouses, such as... Figure 6 Leaf nodes are labels, and non-leaf nodes are logical relationships. A simple triple can be converted into a bitmap logical relationship operation in ClickHouse, which can be represented by the following formulas (1) to (4):
[0093] subject∩object=>bitmapAnd(subject,object) (1)
[0094] subject∪object=>bitmapOr(subject,object) (2)
[0095] subject-object=>bitmapAndNot(subject,object) (3)
[0096] subjectΔobject=>bitmapAndNot(bitmapOr(subject,object),bitmapAnd(subject,object)) (4)
[0097] This embodiment of the application represents a triple as a binary tree structure, which can be easily converted into bitmap logic calculations between ClickHouse instances. After completing the conversion of the key logic, the query can be completed simply by supplementing the preceding and following statements when executing the ClickHouse SQL statement.
[0098] Therefore, it becomes crucial to convert customer requirements into triples that represent logical relationships. A common approach is to have multiple tags selected from a dropdown menu within the application system, specifying the logical relationships between the tags. The system's backend then performs the triple conversion, and finally, the triples are recursively converted into ClickHouse execution statements to complete the selection and output of the target group.
[0099] However, this method has the following three drawbacks:
[0100] (1) Manually select labels. Since multiple labels may have similar names, manual selection is prone to misselection.
[0101] (2) When specifying logical relationships for labels, due to the complexity and similarity of logical relationships, logical relationships are easy to be mistakenly selected;
[0102] (3) Customers who use this system need to have professional knowledge of set operations, and there is a certain threshold to use it.
[0103] To address this, this invention proposes a target group determination method for selecting target groups based on customer tags. Specifically, it proposes a bitmap condition generation method based on an improved NLP algorithm. There is a theoretical method for relation extraction in the industry, the core idea of which is as follows: Figure 8 As shown: In the task of extracting triples (subject, object, symbol) (Note: In the relation extraction model, for simplicity, subject is represented by s; object by o; and symbol, being a symbolic representation of relation, is represented by r), entities and relations are represented and interacted together. The extraction method still adopts the currently mainstream table-filling approach. However, during prediction, the triple learning objective is split into three types of interaction relation predictions: the relationship between entities (s, o), the relationship between an entity and a relation type (s|o, r), and the relationship between a relation type and an entity (r, s|o). Based on this, the embodiments of this application... Figure 8Building upon the existing model, this application adds a relationship prediction mechanism, categorizing relationships between entities into those between the primary and secondary entities, and those between the secondary and primary entities. By enhancing the identification of logical relationships, this embodiment improves the model's ability to recognize common logical relationship scenarios. Specifically, users only need to provide relevant descriptive information about the target group. This embodiment extracts tag information from the descriptive information using the aforementioned target group determination method, generates triples based on the tag information, and then generates a binary tree. The target group is then extracted using a bitmap computing engine.
[0104] This invention addresses the issues of manual error-prone operation and unfriendly user experience associated with tag-based target customer group selection using a BitMap calculation engine. It proposes an improved NLP logical relationship extraction algorithm and, based on this algorithm, an improved bitmap condition generation algorithm to effectively determine the target group. The algorithm automatically identifies tags within text and determines the logical relationships between tags, rapidly generating tag bitmap calculation conditions. This optimizes the user experience for customer group selection, particularly lowering the barrier to entry for tag-based target customer group selection.
[0105] Optionally, in one embodiment of the present invention, the first text is processed by a natural language model to obtain relation triples, including:
[0106] The first text, logical triples, and sub-logical triples are concatenated to obtain the input sequence. The logical triples are used to represent the logical relationships between the main entity, the object entity, and the relation. The sub-logical triples include the first logical relationship between the main entity and the object entity, the second logical relationship between the object entity and the main entity, the third logical relationship between the entity and the relation, and the fourth logical relationship between the relation and the entity.
[0107] The input sequence is processed by a natural language model to learn representations, resulting in a representation matrix; each position in the representation matrix is used to represent a defined relation.
[0108] Based on the representation matrix, the indicator function is determined; and based on the indicator function, the result is predicted to obtain the relation triplet.
[0109] In some possible implementations, refer to Figure 9 As shown, compared with the prior art, in this embodiment of the application, the model's steps for extracting relations are as follows:
[0110] S91: Concatenate text and relation categories as input sequence, the sequence can be represented as X = {x1, x2, ... x}. N The expression is represented by ,}, where N is the sequence length. The extraction task is to identify all relation triples from the text. Where L is the triplet input, sl ,r l ,o l Let e be the primary entity, relation, and object corresponding to the l-th group. The primary entity and object constitute an entity set E = {e1, e2, ..., e...} k}, where k is the number of entities; the relation set is R = {R1, R2, ..., R}. M}, where M is the number of relation types.
[0111] S92: Represent all relation types, such as " / business / company / founders", with "founders" and "is capital of" with "captial". Then, concatenate the predicted text with the core words of all relation categories to form a new sequence, which is then input into a representation model, such as the BERT model, for representation learning. A representation table matrix is formed, where each position (cell) can represent whether a relation is defined (as shown in formulas (5) and (6)). Due to the complexity and nestability of logical relations, in order to satisfy the complete recognition of logical relations, this embodiment of the invention adjusts the sequence input to: text, the final logical triplet, and each sub-logical triplet.
[0112] T = Concat(T) s ,T p (5)
[0113] H = E[T] (6)
[0114] S93: Determine if each position in the table matrix has a defined relation; if so, return 1; otherwise, return 0. This transforms the prediction task into a binary classification task involving table filling. The model decomposes the triple relation (s, r, o) into three sub-relations for representation and prediction learning, which are defined as I... e (e a ,e b Definitions of Entities and Relationships (I) r (e,r) and I r (r,e), considering the symmetry of entity relations, I e (e a ,e b ) = I e (e b ,e a As shown in formulas (7) to (9).
[0115]
[0116]
[0117]
[0118] S94: During decoding, the triples can be parsed by combining the prediction results of the table with the rules. The decoding method is to take the Q and K matrices in the last layer of the multi-head attention mechanism represented by BERT and sum them to obtain the interaction map.
[0119] S95: The final relation prediction result is obtained by adding a sigmoid function to the interaction table, see formula (10).
[0120]
[0121] S96: To improve the robustness of the results, the model employs a binary classification cross-entropy optimization function (as shown in Equation (11)), where I * This is the truth matrix of the interaction table:
[0122]
[0123] It is understandable that, when setting the indicator function, since there is a certain correspondence between the logical relationship between the subject and the object, in order to strengthen the identification of this relationship (i.e., the first and second functions in this application embodiment are used to identify and distinguish the relationship between the subject entity and the object entity. Similarly, the first and second logical relationships in this application embodiment are used to characterize the different relationships between the subject entity and the object entity), this invention adds an indicator function, I, based on the existing model. e (e b ,e a At this time, I e (e a ,e b )≠I e (e b ,e a The specific function is expressed as formula (12):
[0124]
[0125] The logical correspondence between the subject and object is shown in Table 4.
[0126] <![CDATA[I e (And a ,And b )]]> <![CDATA[I e (And b ,And a )]]> s∩o o∩s s∪o o∪s so o∧(o∪s), where ∧ represents the complement set. sΔo oΔs
[0127] Table 4
[0128] Through the model optimization described above, when customers use the tagging system to select target customer groups, they can input a text describing the tags to be selected and the logical relationships between them. This text is automatically converted into a binary tree of triples and logical operations between bitmaps, and then into ClickHouse execution statements to complete the target group selection. Ultimately, this allows customers to select target groups through text-based dialogue with the system.
[0129] Optionally, in one embodiment of the present invention, the natural language model includes a BERT model, and the method further includes:
[0130] Add the Q matrix and K matrix of the last layer in the BERT model to obtain the interaction table;
[0131] The interaction table is processed using an activation function to obtain relation triples;
[0132] The relation triples are optimized by using an optimization function to obtain the optimized relation triples.
[0133] In some possible implementations, embodiments of this application improve the prediction accuracy of the model through activation functions and optimization functions.
[0134] Optionally, in one embodiment of the present invention, the method further includes:
[0135] Perform subject-object recognition processing on the first text to obtain entities and relationships;
[0136] The entities involved in the first text are validated using a greedy algorithm based on regular expressions. If the validation result is unsuccessful, the first text is corrected to obtain the corrected first text.
[0137] In some possible implementations, after the subject and object entities are identified, a tag entity matching algorithm is added to verify the correctness of the tags entered by the customer. If errors are found in the customer's input tags, they can be automatically corrected. The matching algorithm can employ a greedy algorithm based on regular expressions. Of course, the embodiments of this application do not limit the specific implementation of the matching algorithm.
[0138] Optionally, in one embodiment of the present invention, the step of converting relation triples into a binary tree includes:
[0139] Traverse each triplet in the relation triplet and generate the corresponding partial binary tree;
[0140] Insert a portion of the binary tree into an existing binary tree to obtain the transformed binary tree.
[0141] Optionally, in one embodiment of the present invention, traversing each triplet in the relation triplet to generate a corresponding partial binary tree includes:
[0142] Iterate through the relation triples and obtain the first triple;
[0143] Use the relation in the first triplet as the root node of the partial binary tree;
[0144] If the first main entity of the first triplet is not empty, the first main entity is taken as the left child of the root node;
[0145] Alternatively, if the first object of the first triplet is not empty, the first object is used as the right child of the root node to generate a partial binary tree.
[0146] In some possible implementations, the algorithm for converting triples into binary trees can be performed as follows:
[0147] S21: Create an empty binary tree;
[0148] S22: Iterate through each triplet;
[0149] S23: For each triplet, convert it into a partial binary tree;
[0150] S231: Use the relation (symbol) as the data of the root node, and store the root node in a binary tree;
[0151] S232: If the subject is not empty, then the subject is the left child of the root node, and the left child is stored in the binary tree;
[0152] S233: If the object is not empty, then the object is made the right child of the root node and the right child is stored in the binary tree.
[0153] S24: Insert this part of the binary tree into the appropriate position in the existing binary tree;
[0154] S241: If an existing binary tree is empty, then set that part of the binary tree as the root node;
[0155] S242: If the existing binary tree is not empty, insert the part of the binary tree into the appropriate position in the existing binary tree according to certain rules (e.g., select the left or right subtree according to the properties of the binary tree);
[0156] S25: Repeat steps S22 to S24 until all triples have been processed;
[0157] S26: Return the complete binary tree.
[0158] Therefore, the embodiments of this application can implement bitmap logic conversion through a simple recursive algorithm. The steps are as follows:
[0159] S31: Starting from the root node, denote the root node as symbol. If the tree to the left of the root node contains multiple nodes, then transform all nodes to the left of the root node and jump to S34; otherwise, denote the nodes to the left as subject.
[0160] S32: Starting from the root node, if the tree to the right of the root node contains multiple nodes, then convert all nodes to the right of the root node and jump to S35; otherwise, denote the nodes to the right as objects.
[0161] S33: Converts subject, object, and symbol;
[0162] S34: Using the left child node as the root node, repeat steps S31, S32, and S33 until all nodes on the left have been transformed;
[0163] S35: Using the right child node as the root node, repeat steps S31, S32, and S33 until all nodes on the right have been transformed.
[0164] After completing the transformation of the key logic, you only need to complete the preceding and following statements when executing the SQL statement in ClickHouse to complete the query.
[0165] Optionally, in one embodiment of the present invention, the method further includes:
[0166] Establish a group tag architecture, which includes a tag data layer, a bit layer, and a tag query application layer;
[0167] The tag data layer stores the tag information of the group, and the bit layer is used to create a bitmap based on the tag information.
[0168] The tag query application layer is used to query the target group based on the first text.
[0169] In some possible implementations, refer to Figure 2 As shown, the ClickHuse-based customer tagging system consists of three parts: a tag data table (i.e., the tag data layer), a bitmap (i.e., the bitmap layer), and a tag query application (i.e., the tag query application layer). The tag data table stores customer tags; the bitmap is used to create bitmaps based on the tags, facilitating customer selection; and the tag query application interfaces with external systems, enabling users to query detailed customer tags or search for customer groups that meet specific criteria based on combinations of multiple tags.
[0170] The following detailed description uses a specific embodiment as an example to illustrate the method for determining the target group proposed in this application. (Refer to...) Figure 10 As shown, the left side illustrates the process of acquiring customer input text, recognizing NLP logical relationships, and performing bitmap calculation and conversion, while the right side illustrates the target group selection process. The technical solution of this method mainly includes the following implementation steps:
[0171] S51. Obtain the customer's input text, denoted as data;
[0172] S52. Convert the NLP model into relational triples, denoted as SOR;
[0173] S53. Convert the triplet into a logical relation binary tree, denoted as Tree;
[0174] S54. Generate the ClickHouse bitmap logic calculation statement Lang using a recursive algorithm;
[0175] S55. Assemble Lang into script statements that can be executed in ClickHouse;
[0176] S56. Calculate and extract the customer list using ClickHouse, denoted as UserList;
[0177] S57. Output UserList to complete the task.
[0178] This application improves the target group selection criteria using a natural language model, enhancing the efficiency of customer tag selection and lowering the barrier to entry. Target group selection can be completed through text-based dialogue. This application adds indicator functions between objects and entities to the original UniRel model, increasing the recognition of logical relationships and improving the model's ability to identify common logical relationship scenarios. This application adjusts the model's sequential input, inputting text, the final logical triplet, and each sub-logical triplet together, increasing the ability to extract nested logical relationships. After subject-object entity recognition, this application adds a tag entity matching algorithm to verify the correctness of the customer's input tags and automatically corrects errors, enhancing the model's error correction capabilities. This application expands the model's application scenarios by defining the model's input as a triplet.
[0179] Meanwhile, this application embodiment enhances the model's error correction capability for incorrect customer input: after the subject-object entity identification is completed, a label entity matching algorithm is added to verify whether the customer's input labels are correct, and automatically corrects errors when they are detected. This application embodiment achieves model versatility: by defining the model's input as a triple, the prediction range of the model is simplified, and the application scenarios of the model are expanded. After identifying the triple, it is converted into the corresponding logical binary tree, improving the expressive power and consistency of logical relationships. This application embodiment achieves flexible application: the method of this invention can be used as a preprocessing flow for target group selection, or it can be used independently as any logical relationship extraction task, exhibiting high versatility.
[0180] Secondly, refer to the appendix Figure 11 A target group determination system is described according to an embodiment of the present invention.
[0181] Figure 11 This is a schematic diagram of a target group determination system according to an embodiment of the present invention. The system specifically includes:
[0182] The first module 110 is used to obtain the first text; the first text includes the tag information of the target group and the logical relationship information between the tags;
[0183] The second module 120 is used to process the first text through a natural language model to obtain relation triples. The natural language model is used to uniformly represent and interact with the entities and relations involved in the first text. The natural language model performs prediction learning through indicator functions, which include the first function of the main entity and the object entity, and the second function of the object entity and the main entity.
[0184] The third module 130 is used to convert relation triples into binary trees and generate bitmap script statements based on the binary trees;
[0185] The fourth module 140 is used to extract the target group from the bitmap script statements through the bitmap calculation engine.
[0186] It is evident that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0187] Reference Figure 12 This invention provides a target group identification device, comprising:
[0188] At least one processor 210;
[0189] At least one memory 220 is used to store at least one program;
[0190] When the at least one program is executed by the at least one processor 210, the at least one processor 210 implements the target group determination method.
[0191] Similarly, the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0192] This invention also provides a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to perform the target group determination method described above.
[0193] Similarly, the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0194] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is altered and sub-operations described as part of a larger operation are executed independently.
[0195] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.
[0196] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several programs to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0197] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequential list of executable programs for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, a program execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can retrieve and execute a program from or in conjunction with such a program execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can mean any means that can contain, store, communicate, propagate, or transmit a program for use by or in conjunction with a program execution system, apparatus, or device.
[0198] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0199] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable program execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0200] In the foregoing description of this specification, references to terms such as "one embodiment," "another embodiment," or "some embodiments" indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of the present invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0201] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
[0202] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.
Claims
1. A method for determining a target group, characterized in that, Includes the following steps: Obtain the first text; the first text includes the target group's tag information and the logical relationship information between the tags; The first text is processed using a natural language model to obtain relation triples; The natural language model is used to uniformly represent and interact with the entities and relationships involved in the first text. The natural language model performs prediction learning through indicator functions, which include a first function for the main entity and the object entity, and a second function for the object entity and the main entity. The relation triples are converted into a binary tree, and bitmap script statements are generated based on the binary tree; The target group is obtained by extracting a group list from the bitmap script statements using a bitmap computing engine. The step of processing the first text using a natural language model to obtain relation triples includes: The first text, logical triples, and sub-logical triples are concatenated to obtain the input sequence; the logical triples are used to represent the logical relationship between the main entity, the object entity, and the relation; the sub-logical triples include the first logical relationship between the main entity and the object entity, the second logical relationship between the object entity and the main entity, the third logical relationship between the entity and the relation, and the fourth logical relationship between the relation and the entity. The input sequence is processed by a natural language model to learn representations, resulting in a representation matrix; each position in the representation matrix is used to represent a defined relation. Based on the representation matrix, an indicator function is determined; and based on the indicator function, a result prediction is performed to obtain relation triples. The method further includes: Establish a group tag architecture, which includes a tag data layer, a bit layer, and a tag query application layer; The tag data layer is used to store tag information of the group, the bit layer is used to build a bitmap based on the tag information, and the tag query application layer is used to query the target group based on the first text.
2. The target group determination method according to claim 1, characterized in that, The natural language model includes the BERT model, and the method further includes: The interaction table is obtained by adding the Q matrix and K matrix of the last layer in the BERT model. The interaction table is processed by an activation function to obtain relation triples; The relation triplet is optimized by using an optimization function to obtain the optimized relation triplet.
3. The target group determination method according to claim 1, characterized in that, The method further includes the following steps: Perform subject-object recognition processing on the first text to obtain entities and relationships; The entities involved in the first text are validated using a greedy algorithm based on regular expressions. If the validation result is unsuccessful, the first text is corrected to obtain the corrected first text.
4. The target group determination method according to claim 1, characterized in that, The step of converting the relation triples into a binary tree includes: Traverse each triplet in the relation triplet and generate the corresponding partial binary tree; Insert the partial binary tree into the existing binary tree to obtain the transformed binary tree.
5. The target group determination method according to claim 4, characterized in that, Each triplet in the traversal relation triplet generates a corresponding partial binary tree, including: Iterate through the relation triples and obtain the first triple; Use the relation in the first triplet as the root node of the partial binary tree; If the first main entity of the first triplet is not empty, the first main entity is taken as the left child node of the root node; Alternatively, if the first object entity of the first triplet is not empty, the first object entity is used as the right child node of the root node to generate a partial binary tree.
6. A target group identification system, characterized in that, include: The first module is used to acquire the first text; the first text includes the tag information of the target group and the logical relationship information between the tags; The second module is used to process the first text through a natural language model to obtain relation triples; The natural language model is used to uniformly represent and interact with the entities and relationships involved in the first text. The natural language model performs prediction learning through indicator functions, which include a first function for the main entity and the object entity, and a second function for the object entity and the main entity. The third module is used to convert the relation triples into a binary tree and generate bitmap script statements based on the binary tree; The fourth module is used to extract the target group from the bitmap script statements using the bitmap calculation engine. The step of processing the first text using a natural language model to obtain relation triples includes: The first text, logical triples, and sub-logical triples are concatenated to obtain the input sequence; the logical triples are used to represent the logical relationship between the main entity, the object entity, and the relation; the sub-logical triples include the first logical relationship between the main entity and the object entity, the second logical relationship between the object entity and the main entity, the third logical relationship between the entity and the relation, and the fourth logical relationship between the relation and the entity. The input sequence is processed by a natural language model to learn representations, resulting in a representation matrix; each position in the representation matrix is used to represent a defined relation. Based on the representation matrix, an indicator function is determined; and based on the indicator function, a result prediction is performed to obtain relation triples. The system is also used to perform the following steps: Establish a group tag architecture, which includes a tag data layer, a bit layer, and a tag query application layer; The tag data layer is used to store tag information of the group, the bit layer is used to build a bitmap based on the tag information, and the tag query application layer is used to query the target group based on the first text.
7. A target group identification device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the target group determination method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to implement the target group determination method as described in any one of claims 1 to 5.