Advertisement compliance knowledge question and answer method, device and equipment for foreign enterprises
By building an advertising compliance knowledge graph and combining a large language model for Q&A, the complex challenges of foreign-related enterprises in advertising compliance are solved, and efficient and accurate compliance information query and answering services are achieved.
Patent Information
- Application Number
- CN202411418083.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-02-14
AI Technical Summary
Foreign-related companies face complex legal compliance challenges in the global market expansion, especially in the field of advertising, and existing technologies are difficult to provide efficient and accurate compliance information inquiry and answering services.
Propose a Q&A method for advertising compliance knowledge for foreign-related enterprises. By obtaining advertising compliance data from global data sources, building an advertising compliance knowledge graph, and converting text data into vectors, combining large language models for Q&A to provide comprehensive, Efficient compliance information query and answering services.
It has achieved comprehensive coverage and unified management of advertising compliance knowledge worldwide, improved the speed of information retrieval and the accuracy and pertinence of Q&A, and enhanced the user experience.
Smart Images

Figure CN119441422A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of compliance information service technology, and in particular to an advertising compliance knowledge question and answer method, device and equipment for foreign-related enterprises. Background Art
[0002] In the context of the global economy's deep integration and accelerated development, the legal and compliance challenges faced by foreign-related enterprises in the global market expansion are becoming increasingly complex. However, the legal and compliance challenges faced in this process are becoming increasingly complex and multi-dimensional. Especially in the field of advertising, the compliance requirements for the definition of sensitive content, expression methods and industry-specific standards vary greatly among countries and regions, forming an intricate compliance network.
[0003] Although the traditional human review mechanism has played an important role in the past, its inherent limitations - low efficiency, large subjective judgment bias and high error rate - make it difficult to match the urgent need for efficient and accurate compliance review in the current international business environment. Although the rapid development of existing information retrieval technology, especially search engines, has opened up new paths for the rapid acquisition of compliance information, it is difficult to accurately lock and deeply analyze the required information when faced with highly specialized compliance knowledge, resulting in a significant reduction in the pertinence and practicality of the search results. The key reasons are: 1) Limited coverage of knowledge graphs: Existing compliance knowledge graphs are often concentrated in a few countries or specific industries, making it difficult to achieve comprehensive coverage worldwide, and the update and maintenance mechanism is not agile enough to reflect the latest changes in laws and regulations of various countries in real time. 2) Weak multilingual processing capabilities: In a multilingual environment, the system's processing capabilities for non-English or other minority language legal texts are insufficient, and the accuracy of translation and understanding becomes a bottleneck, affecting the accurate acquisition of cross-border compliance information. 3) Lack of multimodal information processing: Most systems can only process text information, and have almost no ability to identify compliance issues in multimedia advertising content such as images and videos, ignoring the compliance review needs of multimodal information in modern advertising. Summary of the invention
[0004] In view of this, the purpose of the present invention is to propose an advertising compliance knowledge question and answer method, device and equipment for foreign-related enterprises, aiming to solve the problem of how to provide comprehensive and efficient compliance information query and answer services to meet the compliance review needs of foreign-related enterprises for advertisements in a multilingual and cross-regional environment.
[0005] To achieve the above-mentioned purpose, the present invention provides an advertising compliance knowledge question-and-answer method for foreign-related enterprises, the method comprising:
[0006] Acquire advertising compliance data from global data sources, perform document structuring and knowledge extraction on the advertising compliance data, and build an advertising compliance knowledge graph;
[0007] Converting text data in the advertising compliance knowledge graph into vectors to obtain vector data;
[0008] Perform semantic analysis on the query question input by the user, and construct it in combination with the vector data to obtain a prompt, and input the prompt into a preset large language model to obtain a target answer;
[0009] The target answer is output based on the advertising compliance knowledge graph and is visualized using a corresponding answer query graph.
[0010] Preferably, the step of acquiring advertising compliance data from a global data source, structuring the advertising compliance data and extracting knowledge, and constructing an advertising compliance knowledge graph includes:
[0011] Preprocessing the advertising compliance data including cleaning, classification and labeling, and classifying the advertising compliance data according to different corpus categories, wherein the corpus categories include advertising industry specifications, advertising legal documents, advertising violation cases, advertising copy, product information and company information;
[0012] Constructing a corpus of the classified advertising compliance data, wherein the corpus includes a sensitive word vocabulary, a legal and regulatory document information table, a legal and regulatory content information table, a company information table, a product information table, an advertising copy table, and a violation case table;
[0013] Based on the corpus, the entities, relationships and attributes of the advertising compliance knowledge graph are defined, wherein entities include sensitive words, alternative words, laws and regulations, advertising legal documents, advertising violation cases, advertising copy, product information and company information; relationships include relevant laws and regulations, relevant advertising violation cases, and related advertising legal documents; attributes include risk level, legal link, penalty scope and language type.
[0014] Preferably, converting the text data in the advertising compliance knowledge graph into vectors to obtain vector data includes:
[0015] GraphSAGE is used to vectorize the text data in the advertising compliance knowledge graph to obtain the vector data.
[0016] Preferably, the semantic analysis of the query question input by the user and the construction in combination with the vector data to obtain the prompt include:
[0017] Performing text preprocessing, problem target element extraction, problem task element extraction and problem background element extraction on the query question to obtain problem element information including background, target and task;
[0018] Based on the question element information, a prompt template including role, background, goal, task and language type is constructed;
[0019] Searching for relevant knowledge fragments according to the question element information combined with the vector data to obtain retrieval information;
[0020] Based on the prompt template, the prompt is constructed according to the problem to be processed and the search information to obtain the prompt.
[0021] Preferably, the step of inputting the prompt into a preset large language model to obtain a target answer includes:
[0022] Inputting the prompt into a preset large language model to obtain multiple candidate answers;
[0023] The confidence of each candidate answer is determined by utilizing the advertising compliance knowledge graph, and the candidate answer with the highest confidence is used as the target answer.
[0024] Preferably, determining the confidence of each candidate answer by using the advertising compliance knowledge graph, and taking the candidate answer with the highest confidence as the target answer, includes:
[0025] Using entities and relationships of the advertising compliance knowledge graph as keywords, extracting answer entities and answer relationships in the candidate answers by keyword matching, and obtaining matching graph structure data;
[0026] Using the answer entity and the answer relationship as query keywords, querying the advertising compliance knowledge graph to obtain an answer query graph;
[0027] Based on the matching graph structure data and the answer query graph, using a preset confidence evaluation model to determine the confidence of the candidate answer;
[0028] The candidate answers are reordered according to the confidences, and the candidate answer with the highest confidence is used as the target answer.
[0029] Preferably, the text data in the advertising compliance knowledge graph is stored using a Neo4j graph database; and the vector data is stored using a Milvus vector database.
[0030] To achieve the above-mentioned purpose, the present invention further provides an advertising compliance knowledge question-and-answer device for foreign-related enterprises, the device comprising:
[0031] A graph construction unit, used to obtain advertising compliance data from global data sources, perform document structuring and knowledge extraction on the advertising compliance data, and construct an advertising compliance knowledge graph;
[0032] A vectorization unit, used to convert text data in the advertising compliance knowledge graph into vectors to obtain vector data;
[0033] The knowledge question answering unit is used to perform semantic analysis on the query question input by the user, and construct it in combination with the vector data to obtain a prompt, and input the prompt into a preset large language model to obtain a target answer;
[0034] An answer display unit is used to output the target answer based on the advertising compliance knowledge graph and to visually display it with a corresponding answer query graph.
[0035] In order to achieve the above-mentioned objectives, the present invention also proposes an advertising compliance knowledge question and answer device for foreign-related enterprises, comprising a processor, a memory, and a computer program stored in the memory, wherein the computer program is executed by the processor to implement the steps of an advertising compliance knowledge question and answer method for foreign-related enterprises as described in the above-mentioned embodiment.
[0036] In order to achieve the above-mentioned purpose, the present invention also proposes a computer-readable storage medium, on which a computer program is stored. The computer program is executed by a processor to implement the steps of an advertising compliance knowledge question and answer method for foreign-related enterprises as described in the above embodiment.
[0037] In order to achieve the above-mentioned purpose, the present invention also proposes a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of an advertising compliance knowledge question and answer method for foreign-related enterprises as described in the above embodiment.
[0038] Beneficial effects:
[0039] The above solution, by acquiring advertising compliance data from global data sources and building an advertising compliance knowledge graph, achieves comprehensive coverage and unified management of advertising compliance knowledge worldwide, helping companies quickly and accurately understand advertising compliance requirements in various countries; converting text data in the knowledge graph into vectors and combining it with a large language model for question and answer, not only improves the speed of information retrieval, but also enhances the accuracy and pertinence of questions and answers. Visualizing the answer query graph makes complex compliance information intuitive and easy to understand, enhancing the user experience.
[0040] The above scheme ensures the accuracy and completeness of advertising compliance data through detailed data preprocessing and classification, laying a solid foundation for the subsequent construction of the knowledge graph; the constructed corpus contains a variety of structured information tables, covering all aspects of advertising compliance, and provides rich data support for defining the entities, relationships and attributes of the knowledge graph, which helps to accurately understand and interpret users' query needs in the subsequent question-and-answer process.
[0041] The above scheme uses GraphSAGE's graph embedding technology to vectorize text data, which can effectively retain the structural and semantic information in the knowledge graph, improve the accuracy and usefulness of vector data, and facilitate subsequent semantic parsing and question-answering processes.
[0042] The above scheme, through in-depth semantic analysis of the query question, extracts key elements such as background, goals, and tasks, which helps to more accurately understand the user's query intention; through the constructed prompt template and the knowledge fragments combined with vector data search, the generated prompt is closer to the user's query needs, which helps the large language model generate more accurate answers.
[0043] The above solution uses a large language model to generate multiple candidate answers, and determines the confidence of the candidate answers through the advertising compliance knowledge graph, ensuring that the target answer finally selected has high accuracy and credibility. Through keyword matching and query graph construction, in-depth analysis and evaluation of candidate answers are achieved; the confidence of candidate answers is determined using a preset confidence evaluation model, ensuring the objectivity and accuracy of the evaluation process.
[0044] The above solution uses Neo4j graph database to store text data of the advertising compliance knowledge graph, giving full play to the advantages of graph database in processing complex relational data and ensuring efficient access and update of data; Milvus vector database is used to store vector data, supporting fast retrieval and similarity calculation of high-dimensional vectors, providing strong support for subsequent semantic parsing and question-answering processes. By storing text data and vector data separately, the flexibility and scalability of data management are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A flowchart of an advertising compliance knowledge question-and-answer method for foreign-related enterprises provided in accordance with an embodiment of the present invention.
[0047] Figure 2 A schematic diagram of an advertising compliance knowledge graph model layer provided for an embodiment of the present invention.
[0048] Figure 3 A schematic diagram of an advertising compliance knowledge graph provided for an embodiment of the present invention.
[0049] Figure 4 A schematic diagram of a visualization interface of an answer query graph provided by an embodiment of the present invention.
[0050] Figure 5 A schematic diagram of an attribute query interface for an answer query graph provided by an embodiment of the present invention.
[0051] Figure 6 A schematic diagram of the entity relationship reasoning interface of an answer query graph provided by an embodiment of the present invention.
[0052] Figure 7 A schematic diagram of the structure of an advertising compliance knowledge question-and-answer device for foreign-related enterprises provided in one embodiment of the present invention.
[0053] The realization of the purpose, functional features and advantages of the invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the invention claimed for protection, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0055] The content of the present invention is described in detail below with reference to embodiments.
[0056] Reference Figure 1 The figure is a flow chart of an advertising compliance knowledge question-and-answer method for foreign-related enterprises provided by an embodiment of the present invention.
[0057] In this embodiment, the method includes:
[0058] S11, obtaining advertising compliance data from global data sources, performing document structuring and knowledge extraction on the advertising compliance data, and constructing an advertising compliance knowledge graph.
[0059] Furthermore, in step S11, the advertisement compliance data from the global data source is obtained, document structuring and knowledge extraction are performed on the advertisement compliance data, and an advertisement compliance knowledge graph is constructed, including:
[0060] S11-1, pre-processing the advertising compliance data including cleaning, classification and labeling, and classifying the advertising compliance data according to different corpus categories, wherein the corpus categories include advertising industry specifications, advertising legal documents, advertising violation cases, advertising copy, product information and company information;
[0061] S11-2, constructing a corpus of the classified advertising compliance data, wherein the corpus includes a sensitive word vocabulary, a legal document information table, a legal content information table, a company information table, a product information table, an advertising copy table, and a violation case table;
[0062] S11-3, define the entities, relationships and attributes of the advertising compliance knowledge graph based on the corpus, wherein entities include sensitive words, alternative words, laws and regulations, advertising legal documents, advertising violation cases, advertising copy, product information and company information; relationships include relevant laws and regulations, relevant advertising violation cases, and related advertising legal documents; attributes include risk level, legal link, penalty scope and language type.
[0063] In this embodiment, advertising compliance data related to advertising from global data sources is collected by using the Internet. Global data sources include Amazon advertising policies, Arabic laws, Japanese advertising-related policies, WeChat public accounts, and the People's Republic of China Illegal Case Library. At the same time, advertising legal documents are derived from laws and regulations and documents of various countries, including Amazon advertising policies, Japan Consumer Affairs Agency's Scenic Product Representation Act, domestic laws and regulations, and relevant legal documents of various countries on the WIPO Lex website; advertising illegal cases are derived from the West Kool Law Library and the People's Republic of China Illegal Case Library. In addition, product information and advertising copy are derived from multiple channels such as the People's Republic of China Illegal Case Library, Japan Amazon website, domestic court document website, and product information introductions on domestic and foreign shopping websites; company information is derived from national enterprise credit information data, etc., as shown in the following table.
[0064]
[0065] The acquired raw advertising compliance data is cleaned, classified and annotated to be organized and manageable. First, the data is cleaned and preprocessed, including deduplication and missing value processing, to ensure data quality and consistency; then, the data is classified into different corpus categories through text classification and keyword recognition technology, where the corpus categories include advertising industry specifications, advertising legal documents, advertising violation cases, advertising copy, product information and company information. Further, it is defined as C = {C1, C2, C3, C4, C5, C6}, and the global data source S global After the collection, the advertising compliance data set D is obtained; the specific process can be expressed as follows:
[0066]
[0067] The Collect function represents the collection of data from the global data source S global According to the corpus category C i The process of collecting data.
[0068] Then, a corpus is constructed, which contains structured information such as sensitive word vocabulary, legal document information table, legal content information table, company information table, product information table, advertising copy table, violation case table, etc., providing rich data resources for the subsequent knowledge graph construction. That is,
[0069] D structured =Structure(D);
[0070] The Structure function represents the process of cleaning, classifying, and labeling the advertising compliance dataset D to ensure the quality and organization of the data.
[0071] By designing the model layer of the advertising compliance knowledge graph to define the entities, relationships and attributes in the knowledge graph, the structure of the entire knowledge graph is standardized and guided. The model layer designs conceptual entities such as sensitive words, alternative words, legal regulations, legal documents, illegal cases, advertising copy, product information, company information, and relationships such as related laws, related illegal cases, and legal documents, and attributes such as risk level, legal link, penalty scope, and language type. Figure 3 This model layer can clearly reflect the organizational structure and semantic relationship of foreign-related advertising compliance knowledge, which is convenient for subsequent knowledge extraction, alignment and application. schema =DesignSchema(D structured );
[0072] The DesignSchema function is responsible for defining entities, relationships, and attributes to build the schema layer G of the advertising compliance knowledge graph. schema .
[0073] Furthermore, knowledge extraction is to extract foreign-related advertising compliance knowledge by using information extraction technology from the constructed corpus and the model layer of the advertising compliance knowledge graph; that is,
[0074] G extracted =ExtractKnowledge(D structured ,G schema );
[0075] Among them, the ExtractKnowledge algorithm uses D structured Structured information and Gschema The pattern layer is used as input to extract knowledge and obtain the knowledge triple set G extracted . The ExtractKnowledge algorithm uses the PaddleNLP natural language processing tool and the UIE extraction tool. Specifically, you first need to use PaddleNLP to preprocess and analyze the corpus, including tasks such as entity recognition and relationship extraction. Use the named entity recognition model to extract entity information such as company names and product names from the text. At the same time, use the relationship extraction model to extract the association between entities, such as the relationship between products and companies, and which laws and regulations sensitive words violate. Then, use the UIE extraction tool to design and execute extraction templates for specific entities and relationships, and extract the entity information from D structured Extract specific instance information. For example, for company information, design a template to extract company name, location, enterprise size, etc.; for product information, design a template to extract product name, description, price, etc.
[0076] Through knowledge alignment, cross-language alignment of advertising compliance knowledge is achieved, mainly including multi-language sensitive word alignment, multi-language advertising text alignment, multi-language company information alignment, multi-language product information alignment, etc.; the processed advertising compliance data is stored in the graph database for subsequent query, analysis and application. That is,
[0077] G aligned =AlignKnowledge(G extracted ,AlignTypes);
[0078] Among them, G aligned Represents the aligned knowledge triple set. The AlignKnowledge algorithm is used to extract the knowledge triple set G extracted For cross-language alignment, AlignTypes is a set of alignment types, including all types that need to be aligned, such as multilingual sensitive words, advertising texts, company information, and product information. The AlignKnowledge algorithm adopts a knowledge alignment method based on multi-task learning. It uses entity alignment and attribute alignment to simultaneously learn multiple tasks, obtain multilingual knowledge semantic information, and use entity attribute alignment to enrich the multilingual semantic information of entities.
[0079] KG advertisement =Store(G aligned );
[0080] The Store function is responsible for storing the aligned knowledge triple set G aligned Store in a graph database to build an advertising compliance knowledge graph KG advertisement .
[0081] Specifically, Neo4j is a graph database management system that stores data in a graphical manner and provides powerful graph query and analysis functions. It is suitable for storing complex entity and relationship structures. Py2neo is the Python driver for Neo4j, which provides an interface for interacting with the Neo4j database, facilitating the operation and management of the graph database. Use the Py2neo library to establish a connection with the Neo4j database, and use Python code to build and manage the knowledge graph. By creating nodes and relationships, the aligned knowledge triple set G aligned Stored in a Neo4j database.
[0082] Furthermore, the processed advertising compliance data, namely entity relationship triples and entity attribute triples, are stored in the Neo4j graph database to construct the advertising compliance knowledge graph KG. advertisement ; Use Python automated scripting technology to extract entities and relationships, align knowledge, and add new knowledge triples KG based on the entity and relationship patterns of the advertising compliance knowledge graph update to the advertising compliance knowledge graph to achieve regular updates; use the knowledge graph evaluation system to calculate and evaluate the advertising compliance knowledge graph to obtain the evaluation results, where the knowledge graph evaluation system includes the number of nodes, the number of node classes, the number of relationships, the number of relationship classes, the average point strength, graph density, graph clustering coefficient, graph transitivity, minimum query time, maximum query time, average query time, number of empty nodes, empty node ratio, unique node ratio, empty attribute ratio, and longest path.
[0083] S12, converting the text data in the advertising compliance knowledge graph into vectors to obtain vector data.
[0084] Furthermore, in step S12, the text data in the advertising compliance knowledge graph is converted into vectors to obtain vector data, including:
[0085] GraphSAGE is used to vectorize the text data in the advertising compliance knowledge graph to obtain the vector data.
[0086] In this embodiment, this step is implemented based on the GraphRAG engine. The text data in the advertising compliance knowledge graph is converted into vector form. This process usually involves text preprocessing, feature extraction, and vectorization using the graph embedding technology GraphSAGE.
[0087] V = Vectorize(Q);
[0088] Among them, Vectorize() represents the graph embedding technology GraphSAGE model, V represents the feature vector extracted from the text data Q, and Q is the text data in the advertising compliance knowledge graph.
[0089] In subsequent applications, the knowledge vector most relevant to the user's query question semantics is quickly retrieved from the vectorized advertising compliance knowledge graph, and the Milvus vector database is used to store the vector data and optimize the search to obtain the search results. That is, R = Search (V, D);
[0090] Among them, the information retrieval function Search() represents the proximity hash graph index model, which implements an adaptive graph traversal strategy, balances breadth and depth, and introduces an attention mechanism to focus on the most relevant graph structure. D represents the vectorized advertising compliance knowledge graph, and R represents the set of relevant knowledge vectors returned based on the query feature vector V (that is, the retrieval result).
[0091] Scoring and sorting the search results based on scoring factors to ensure that the most relevant information is presented to the user first. Scoring factors include text similarity, graph structure similarity, node importance, and node relevance. That is, S = Sort (R);
[0092] Among them, the sorting function Sort() calculates text similarity, graph structure similarity, node importance and node relevance through vector distance and path sorting algorithm and further realizes adaptive dynamic weighted fusion to obtain the sorting result. S is the ordered result set after processing according to the scoring and sorting algorithm.
[0093] For example, Question = "The company's products are of very good quality and are a high-quality representative in the industry. Can we use "quality first in the country" or "national level" to describe the products or services?"
[0094] Through the above processing, we can obtain the feature vector V of the question and the set of knowledge vectors related to the feature vector V, R = {r 1 ,r 2 ,r 3 ,r 4 ,r 5 ……}; After the scoring and sorting algorithm, the ordered result set S of the relevant vectors is obtained = {s 1 ,s 2 ,s 3 ,s 4 ,s 5 ……}; the last first result s 1 Get the real text s through vector text mapping * = "Article 9, Chapter 2 of the Advertising Law of the People's Republic of China", that is, the most relevant knowledge graph nodes are obtained * .
[0095] According to s * The node is expanded through the subgraph to obtain its content node d = "Advertisements must not have the following conditions:
[0096] (3) Use of terms such as “national level”, “highest level”, “best”, etc.
[0097] S13, semantically analyzing the query question input by the user, and constructing it in combination with the vector data to obtain a prompt, and inputting the prompt into a preset large language model to obtain a target answer.
[0098] Furthermore, in step S13, the query question input by the user is semantically parsed and constructed in combination with the vector data to obtain a prompt, including:
[0099] S13-1, performing text preprocessing, question target element extraction, question task element extraction and question background element extraction on the query question to obtain question element information including background, target and task;
[0100] S13-2, constructing based on the question element information to obtain a prompt template including role, background, goal, task and language type;
[0101] S13-3, searching for relevant knowledge fragments according to the question element information and the vector data to obtain retrieval information;
[0102] S13-4, based on the prompt template, construct according to the problem to be processed and the search information to obtain the prompt.
[0103] Furthermore, in step S13, the prompt is input into a preset large language model to obtain a target answer, including:
[0104] S13-5, inputting the prompt into a preset large language model to obtain multiple candidate answers;
[0105] S13-6, determining the confidence of each candidate answer by utilizing the advertising compliance knowledge graph, and taking the candidate answer with the highest confidence as the target answer.
[0106] Further, in step S13-6, the confidence of each candidate answer is determined by using the advertising compliance knowledge graph, and the candidate answer with the highest confidence is used as the target answer, including:
[0107] S13-6-1, using the entities and relationships of the advertising compliance knowledge graph as keywords, extracting answer entities and answer relationships in the candidate answers by keyword matching, and obtaining matching graph structure data;
[0108] S13-6-2, using the answer entity and the answer relationship as query keywords, querying the advertising compliance knowledge graph to obtain an answer query graph;
[0109] S13-6-3, based on the matching graph structure data and the answer query graph, using a preset confidence evaluation model to determine the confidence of the candidate answer;
[0110] S13-6-4, reorder the candidate answers according to the confidence levels, and use the candidate answer with the highest confidence level as the target answer.
[0111] In this embodiment, the query question is processed, including question text preprocessing, question target element extraction, question task element extraction, and question background element extraction, to obtain question element information including background, target, and task. Specifically:
[0112] Question text preprocessing includes the use of natural language processing technology to remove stop words, convert, and segment the text of the query question; that is,
[0113] Q', L=Preprocess(Question);
[0114] Among them, Question represents the original query question text, Q' is the preprocessed question text, and L is the extracted language type.
[0115] Extraction of question target elements includes identifying the targets implied in the preprocessed query questions, including advertising policy explanation, advertising content evaluation, company information question answering, product information question answering, and others; that is, T = ExtractTargets (Q');
[0116] Where T represents the target element set of question Q'.
[0117] Extracting the task elements of the question includes determining the specific tasks and actions that the user wants to perform or the specific operations or answers that the user expects in the query question; that is, A = ExtractActions (Q');
[0118] Among them, A represents the action or task element extracted from the question Q'.
[0119] Extraction of question context elements includes determining the environment or context described by the user in the query question. That is, B, Ro = ExtractContext (Q');
[0120] Among them, B represents the background elements of question Q', and Ro is the role extracted according to the user description.
[0121] For example (continuing the above example), Question = "The company's product quality is very good and is a high-quality representative in the industry. Can we use "quality first in the country" or "national level" to describe the product or service?" After preprocessing, Q' = "The company's product quality is good and is a high-quality representative in the industry. Can we use 'quality first in the country' or 'national level' to describe the product or service?";
[0122] Input Q' into the problem target element extraction function to obtain T = {"advertising content evaluation"};
[0123] Input the preprocessed question Q' into the question task element extraction function to obtain A = {"laws and regulations", "sensitive words"};
[0124] The preprocessed question Q' is input into the question background element extraction function to obtain C = {"The company's product quality is very good and is a high-quality representative in the industry"}.
[0125] Based on the question element information, a highly targeted and accurate foreign-related advertising compliance prompt is constructed. The prompt construction includes constructing a prompt template, obtaining search information, and constructing a prompt statement. Specifically, constructing a prompt template includes integrating the advertising compliance knowledge graph to segment the precise search question and answer requirements and query the semantics of the question elements, and constructing a prompt template, which includes the role Ro, the background B, the target T, the task A, and the language type L; that is, M = Template (Q', Ro, T, A, B, L);
[0126] Wherein, M is the generated prompt template.
[0127] For example, a prompt template is constructed based on the question element information to obtain M, as shown below;
[0128] Prompt template M:
[0129] [Question] The company’s product quality is very good and is a high-quality representative in the industry. Can we use “the best quality in the country” or “national level” to describe the product or service?
[0130] [Role] AI Compliance Guard
[0131] [Background] As an AI compliance guard, I need to remind you that there are certain legal risks in using "quality first in the country" or "national level" to describe goods or services. According to Article 9 of the Advertising Law of the People's Republic of China, advertisements shall not use absolute terms such as "national level", "highest level", "best", etc. "quality first in the country" and "national level" may be regarded as absolute terms that violate the above provisions.
[0132] [Objective] Advertising content evaluation
[0133] [Task] The laws and regulations violated in the question and the sensitive words contained
[0134] [Language type] Chinese
[0135] Retrieving the retrieval information includes taking the question element information including role, background, goal, task and language type, and searching the most relevant knowledge fragments through the above-mentioned GraphRAG engine to obtain the retrieval information. That is, IC&=RetrieveInformation(Ro,T,A,B,L,D,Q');
[0136] Among them, IC represents retrieval information, and D is the vectorized dataset in the advertising compliance knowledge graph.
[0137] Constructing the prompt statement includes dynamically constructing the prompt statement based on the determined prompt statement template, combining the specific content and context of the query question with the search information. That is, P = GeneratePrompt (M, IC, Q');
[0138] Among them, P is the final generated prompt, M is the prompt template, IC is the search information, and Q' is the preprocessed question text.
[0139] After being processed by the GraphRAG engine, the search information IC = "Article 9 of Chapter 2 of the Advertising Law of the People's Republic of China states that advertisements shall not contain the following circumstances:
[0140] (3) Use of terms such as “national level”, “highest level”, “best”, etc.;”
[0141] Merge to get prompt template M:
[0142] [Question] The company’s product quality is very good and is a high-quality representative in the industry. Can we use “the best quality in the country” or “national level” to describe the product or service?
[0143] [Role] AI Compliance Guard
[0144] [Background] As an AI compliance guard, I need to remind you that there are certain legal risks in using "quality first in the country" or "national level" to describe goods or services. According to Article 9 of the Advertising Law of the People's Republic of China, advertisements shall not use absolute terms such as "national level", "highest level", "best", etc. "quality first in the country" and "national level" may be regarded as absolute terms that violate the above provisions.
[0145] [Search information] Article 9 of Chapter 2 of the Advertising Law of the People's Republic of China states that advertisements shall not contain the following circumstances:
[0146] (3) Use of terms such as “national level”, “highest level”, “best”, etc.;
[0147] [Objective] Advertising content evaluation
[0148] [Task] The laws and regulations violated in the question and the sensitive words contained
[0149] [Language type] Chinese
[0150] Specifically, the prompt template and the question are integrated to construct the prompt sentence to obtain P, as shown below;
[0151] Prompt statement P:
[0152] [Prompt] You are an AI compliance guard. Please focus on the laws and regulations violated and the sensitive words contained in the questions for all the questions below. For example, answer like this: "As an AI compliance guard, I need to remind you that there are certain legal risks in using "quality first in the country" or "national level" to describe goods or services. According to Article 9 of the Advertising Law of the People's Republic of China, advertisements shall not use absolute terms such as "national level", "highest level" and "best". "Quality first in the country" and "national level" may be regarded as absolute terms that violate the above provisions, which may cause your advertisements to be judged as illegal. Therefore, in order to ensure that your advertisements are compliant and legal, I suggest that you carefully choose the way to describe the quality of goods or services, and try to avoid using words that may pose legal risks. If you need more specific legal advice, you can consider consulting a professional legal advisor or lawyer. Based on the above content, please answer this question: The company's product quality is very good and is a high-quality representative in the industry. Can it use "quality first in the country" or "national level" to describe products or services? And evaluate the advertising content and answer in Chinese. The reference information is Article 9 of Chapter 2 of the Advertising Law of the People's Republic of China. Advertisements shall not have the following circumstances:
[0153] (3) Use of terms such as “national level”, “highest level”, “best”, etc.;
[0154] By calling the large language model to provide multiple candidate answers based on the input prompt, that is, {R i}=LLM(P); where {R i} represents the generated set of candidate answers. The multiple candidate answers obtained are verified and validated to improve the credibility of the answers. Specifically, by matching the entities involved in the candidate answers and evaluating the confidence of the candidate answers, the candidate answers are reordered by confidence and the final target answer and its corresponding answer query graph are returned to ensure the matching degree and authenticity of the target answer with the advertising compliance knowledge graph. The verification process includes knowledge graph matching, knowledge graph query, and confidence evaluation. The knowledge graph matching includes taking the entities and relationships of the advertising compliance knowledge graph as keywords, and using the keyword precise matching algorithm to extract the answer entities and answer relationships in the candidate answers to obtain the matching graph structure data G. match ;Right now,
[0155] G match =(E match ,R match )=EntityExtraction(R i ,KG advertisement );
[0156] Among them, EntityExtraction is a keyword matching function. It uses the pre-trained BERT model to convert keywords into vector space, and evaluates the similarity between keywords and entities and relationships in the advertising compliance knowledge graph by calculating cosine similarity, so as to obtain the answer entities and answer relationships in the candidate answers. match is the set of matched entities, R match is the set of matched relations, KG advertisement represents the advertising compliance knowledge graph, R i Represents a set of candidate answers.
[0157] The knowledge graph query includes querying the advertising compliance knowledge graph using answer entities and answer relationships as query keywords, and outputting the answer query graph G. search ;Right now,
[0158] G search =GraphQuery(G match );
[0159] GraphQuery represents a knowledge graph query function, which receives the input answer entity and answer relationship as query keywords, searches for relevant nodes and their connection relationships in the knowledge graph, and returns the answer query graph.
[0160] Confidence evaluation includes using the confidence evaluation model Confidence (R i ) Determine the confidence of the candidate answers, reorder the candidate answers by confidence, and output the final target answer R opt and its corresponding answer query graph Gsearch-opt The confidence assessment model uses the pre-trained BERT model as the base model and uses its pre-trained language understanding capabilities to extract text features. That is,
[0161] Confidence(R i )=α×TextMatch(R i ,G search )+β×EntityMatch(R i ,G match );
[0162] Among them, α and β are coefficients to adjust the importance of text matching and entity matching, and the TextMatch function is a measure of the candidate answer text R i and the answer query graph G search The candidate answer and the related text description in the knowledge graph are converted into vector representation using the BERT model, and then the similarity score between the two is calculated. A high score indicates that the candidate answer is highly consistent with the information in the query graph in terms of text description. The EntityMatch function focuses on evaluating the similarity between the entities mentioned in the candidate answer and the knowledge graph G. match The BERT model is used to vectorize the entities in the candidate answers and the entities in the knowledge graph. After that, the matching score is calculated by comparing the similarity between the entities. If the entity relationship structure in the candidate answer matches the compliance model layer defined in the knowledge graph, the score will be higher.
[0163] Use the above prompt sentence to input the large language model question-answering module to obtain the candidate answer set {R i}, as shown below;
[0164] [R1] As an AI compliance guard, I need to remind you that there are certain legal risks in using "quality first in the country" or "national level" to describe goods or services. According to Article 9 of the Advertising Law of the People's Republic of China, advertisements shall not use absolute terms such as "national level", "highest level", "best", etc. Therefore, using these words when describing products or services may be considered illegal. It is recommended to choose other expressions to avoid possible legal problems.
[0165] [R2] Regarding your question, using "quality first in the country" or "national level" to describe goods or services may be risky in law. The Advertising Law stipulates that absolute terms such as "best" and "national level" shall not be used in advertisements. Therefore, in order to avoid potential legal risks, it is recommended that you use more objective and cautious language to express the advantages of your products.
[0166] [R3] Please note that according to the relevant provisions of the Advertising Law of the People's Republic of China, it is not allowed to use absolute terms such as "quality first in the country" or "national level" in advertisements. Such usage may result in the advertisement being deemed illegal, so it is recommended that you avoid using such expressions in advertisements to ensure the legality of the advertising content.
[0167] [R4] When describing the quality of products or services, it is recommended not to use words such as "quality is the best in the country" or "national level" because this may violate the provisions of the Advertising Law that absolute terms cannot be used. It is recommended that you use a description that is more in line with regulations, such as emphasizing the specific features of the product and consumer reviews, to reduce legal risks.
[0168] [R5] According to the requirements of the Advertising Law, it is illegal to use words such as "national level" or "quality first in the country" in advertisements because these are absolute terms. It is recommended to use more neutral and factual descriptions instead, such as pointing out the specific advantages of the product or the specific awards it has won, and avoid using expressions that may cause legal problems.
[0169] Verify the above candidate answer set to obtain the matching graph structure data G match , as shown below;
[0170] G match 1: Quality is the best in the country, national level, highest level, best
[0171] G match 2: Quality is the best in the country, national level, best
[0172] G match 3: Quality is the best in the country, national level
[0173] G match 4: Quality is the best in the country, national level
[0174] G match 5: Quality is the best in the country, national level
[0175] After querying the knowledge graph, we get the corresponding answer query graph G search , its visual interface is as follows Figure 4 As shown;
[0176] According to the matching graph structure data G obtained above match and answer query graph G search , combined with the candidate answer set {R i}, the following results are obtained after the text matching evaluation function and the entity matching evaluation function;
[0177] Confidence(R1)=0.5×0.98+0.5×0.95=0.965
[0178] Confidence(R2)=0.5×0.95+0.5×0.90=0.925
[0179] Confidence(R3)=0.5×0.90+0.5×0.85=0.875
[0180] Confidence(R4)=0.5×0.90+0.5×0.85=0.875
[0181] Confidence(R5)=0.5×0.90+0.5×0.85=0.875
[0182] Finally, the candidate answers are sorted based on the confidence level to obtain the final target answer: FinalAnswer = R1; and the corresponding matching graph data G match 1.
[0183] S14, outputting the target answer based on the advertising compliance knowledge graph and visually displaying it with a corresponding answer query graph.
[0184] In this embodiment, by search 1, and visualize the entities and relationships in a network diagram, such as Figure 4 As shown; query graph G based on the answer clicked by the user search 1, further display the advertising compliance knowledge graph, display the attribute list of entities and relationships in the form of cards, such as language type, legal link, risk level, penalty scope, country, etc., and visualize the attribute information in the form of links and buttons, such as Figure 5 As shown; query graph G based on the answer clicked by the user search 1, further search the advertising compliance knowledge graph to display multiple related entities and relationships, such as Figure 6 shown.
[0185] Reference Figure 7 The figure is a schematic diagram of the structure of an advertising compliance knowledge question-and-answer device for foreign-related enterprises provided by an embodiment of the present invention.
[0186] In this embodiment, the device 20 includes:
[0187] A graph construction unit 21, used to obtain advertising compliance data from global data sources, perform document structuring and knowledge extraction on the advertising compliance data, and construct an advertising compliance knowledge graph;
[0188] A vectorization unit 22, used to convert text data in the advertising compliance knowledge graph into vectors to obtain vector data;
[0189] The knowledge question answering unit 23 is used to perform semantic analysis on the query question input by the user, and construct it in combination with the vector data to obtain a prompt, and input the prompt into a preset large language model to obtain a target answer;
[0190] The answer display unit 24 is used to output the target answer based on the advertising compliance knowledge graph and to visually display it with a corresponding answer query graph.
[0191] Each unit module of the device 20 can respectively execute the corresponding steps in the above method embodiment, so each unit module will not be described in detail here. Please refer to the description of the above corresponding steps for details.
[0192] The embodiment of the present invention also provides an advertising compliance knowledge question and answer device for foreign-related enterprises, the device comprising the advertising compliance knowledge question and answer device for foreign-related enterprises as described above, wherein the advertising compliance knowledge question and answer device for foreign-related enterprises can adopt Figure 7 The structure of the embodiment can be executed accordingly. Figure 1 The technical solution of the method embodiment shown has similar implementation principles and technical effects. For details, please refer to the relevant records in the above embodiments, which will not be repeated here.
[0193] The device includes: a mobile phone, a digital camera, a tablet computer, or other devices with a camera function, or a device with an image processing function, or a device with an image display function. The device may include components such as a memory, a processor, an input unit, a display unit, and a power supply.
[0194] Among them, the memory can be used to store software programs and modules, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as an image playback function, etc.), etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory may also include a memory controller to provide the processor and the input unit with access to the memory.
[0195] The input unit can be used to receive input digital or character or image information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit of this embodiment includes not only a camera, but also a touch-sensitive surface (such as a touch display) and other input devices.
[0196] The display unit can be used to display information input by the user or information provided to the user and various graphical user interfaces of the device, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit may include a display panel, and optionally, the display panel may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface may cover the display panel, and when the touch-sensitive surface detects a touch operation on or near it, it is transmitted to the processor to determine the type of touch event, and then the processor provides a corresponding visual output on the display panel according to the type of touch event.
[0197] The embodiment of the present invention further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the memory in the above embodiment; or a computer-readable storage medium that exists independently and is not installed in a device. The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement Figure 1 The advertising compliance knowledge question and answer method for foreign-related enterprises is shown. The computer-readable storage medium may be a read-only memory, a disk or an optical disk, etc.
[0198] The embodiment of the present invention also provides a computer program product, including a computer program / instruction, which is loaded and executed by a processor to implement Figure 1 A method of question and answer on advertising compliance knowledge for foreign-related enterprises is shown.
[0199] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, equipment embodiment and storage medium embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0200] Furthermore, in this document, the terms "comprises," "comprising," or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device that includes the element.
[0201] The above description shows and describes the preferred embodiments of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the invention, through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not depart from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.
Claims
1. A method for answering questions about advertising compliance knowledge for foreign-related enterprises, characterized in that: The method comprises: Acquire advertising compliance data from global data sources, perform document structuring and knowledge extraction on the advertising compliance data, and build an advertising compliance knowledge graph; Converting text data in the advertising compliance knowledge graph into vectors to obtain vector data; Perform semantic analysis on the query question input by the user, and construct it in combination with the vector data to obtain a prompt, and input the prompt into a preset large language model to obtain a target answer; The target answer is output based on the advertising compliance knowledge graph and is visualized using a corresponding answer query graph.
2. According to claim 1, a method for answering questions about advertising compliance knowledge for foreign-related enterprises is characterized in that: The step of obtaining advertising compliance data from global data sources, structuring documents and extracting knowledge from the advertising compliance data, and constructing an advertising compliance knowledge graph includes: Preprocessing the advertising compliance data including cleaning, classification and labeling, and classifying the advertising compliance data according to different corpus categories, wherein the corpus categories include advertising industry specifications, advertising legal documents, advertising violation cases, advertising copy, product information and company information; The classified advertising compliance data is used to construct a corpus, wherein the corpus includes a sensitive word vocabulary, a legal regulation document information table, a legal regulation content information table, a company information table, a product information table, an advertising copy table, and a violation case table; Based on the corpus, the entities, relationships and attributes of the advertising compliance knowledge graph are defined, wherein entities include sensitive words, alternative words, laws and regulations, advertising legal documents, advertising violation cases, advertising copy, product information and company information; relationships include relevant laws and regulations, relevant advertising violation cases, and related advertising legal documents; attributes include risk level, legal link, penalty scope and language type.
3. According to claim 1, a method for answering questions about advertising compliance knowledge for foreign-related enterprises is characterized in that: The step of converting the text data in the advertising compliance knowledge graph into vectors to obtain vector data includes: GraphSAGE is used to vectorize the text data in the advertising compliance knowledge graph to obtain the vector data.
4. According to claim 1, a method for answering questions about advertising compliance knowledge for foreign-related enterprises is characterized in that: The semantic analysis of the query question input by the user and the construction in combination with the vector data to obtain the prompt include: Performing text preprocessing, problem target element extraction, problem task element extraction and problem background element extraction on the query question to obtain problem element information including background, target and task; Based on the question element information, a prompt template including role, background, goal, task and language type is constructed; Searching for relevant knowledge fragments according to the question element information combined with the vector data to obtain retrieval information; Based on the prompt template, the prompt is constructed according to the problem to be processed and the search information to obtain the prompt.
5. According to claim 4, a method for answering questions about advertising compliance knowledge for foreign-related enterprises is characterized in that: The step of inputting the prompt into a preset large language model to obtain a target answer includes: Inputting the prompt into a preset large language model to obtain multiple candidate answers; The confidence of each candidate answer is determined by utilizing the advertising compliance knowledge graph, and the candidate answer with the highest confidence is used as the target answer.
6. According to claim 5, a method for answering questions about advertising compliance knowledge for foreign-related enterprises is characterized in that: Determining the confidence of each candidate answer by using the advertising compliance knowledge graph, and taking the candidate answer with the highest confidence as the target answer, includes: Using entities and relationships of the advertising compliance knowledge graph as keywords, extracting answer entities and answer relationships in the candidate answers by keyword matching, and obtaining matching graph structure data; Using the answer entity and the answer relationship as query keywords, querying the advertising compliance knowledge graph to obtain an answer query graph; Based on the matching graph structure data and the answer query graph, using a preset confidence evaluation model to determine the confidence of the candidate answer; The candidate answers are reordered according to the confidences, and the candidate answer with the highest confidence is used as the target answer.
7. According to claim 1, a method for answering questions about advertising compliance knowledge for foreign-related enterprises is characterized in that: The text data in the advertising compliance knowledge graph is stored using the Neo4j graph database; the vector data is stored using the Milvus vector database.
8. An advertising compliance knowledge question-and-answer device for foreign-related enterprises, characterized in that: The device comprises: A graph construction unit, used to obtain advertising compliance data from global data sources, perform document structuring and knowledge extraction on the advertising compliance data, and construct an advertising compliance knowledge graph; A vectorization unit, used to convert text data in the advertising compliance knowledge graph into vectors to obtain vector data; The knowledge question answering unit is used to perform semantic analysis on the query question input by the user, and construct it in combination with the vector data to obtain a prompt, and input the prompt into a preset large language model to obtain a target answer; An answer display unit is used to output the target answer based on the advertising compliance knowledge graph and to visually display it with a corresponding answer query graph.
9. An advertising compliance knowledge question-and-answer device for foreign-related enterprises, characterized in that: It includes a processor, a memory and a computer program stored in the memory, wherein the computer program is executed by the processor to implement the steps of an advertising compliance knowledge question-and-answer method for foreign-related enterprises as described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program / instructions, wherein the computer program / instructions are executed by a processor to implement the steps of an advertising compliance knowledge question-and-answer method for foreign-related enterprises as described in any one of claims 1 to 7.
Citation Information
Cited By
Intelligent customer service system based on natural language processing
CN120316234A
Advertisement video badness-oriented fine-grained detection method based on knowledge graph and large language model
CN120451872A
Document compliance judgment method based on violation traceability path score
CN120492607A
A document compliance determination method based on violation tracing path scoring
CN120492607B
Government affair policy question and answer method based on knowledge graph and related equipment
CN120849569A