A content filtering method and system based on character portraits and a storage medium
By employing a two-tier architecture where the client and server work together, and utilizing a character portrait library for intelligent filtering, the problem of existing filtering schemes failing to understand context is solved. This achieves more accurate content filtering and load balancing, improving user experience and system efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FUJIAN TQ ONLINE INTERACTIVE INC
- Filing Date
- 2026-02-10
- Publication Date
- 2026-06-05
AI Technical Summary
In chat scenarios of online games and social platforms, existing filtering solutions cannot understand the context, leading to false blocking or missed filtering. Furthermore, the uneven load between the client and server affects user experience and community governance.
A two-level collaborative filtering architecture based on character portraits is adopted. The client builds a first character portrait library for initial filtering, and the server generates a second character portrait library through machine learning for in-depth analysis, combining character characteristics and dialogue context for content filtering.
It enables contextual awareness and scenario-based analysis of chat content, improving the accuracy and flexibility of filtering, and achieving intelligent allocation and dynamic balancing of system load, thereby enhancing user experience and system efficiency.
Smart Images

Figure CN122153044A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer information processing and artificial intelligence technology, and in particular to a content filtering method, system and storage medium based on character portraits. Background Technology
[0002] In public chat scenarios of online games and various online social platforms, content filtering technology is typically used to control user speech in order to maintain a healthy communication environment. Current mainstream technical solutions are mainly divided into client-side filtering, server-side filtering, and hybrid filtering modes. Client-side filtering distributes a sensitive word database to the user's terminal for local regular expression or wildcard matching. While this can alleviate server pressure, it carries the risk of being modified or deleted by users, rendering it ineffective, and it cannot intelligently judge based on context. Server-side filtering centrally processes all messages on the server side. While ensuring policy consistency, it introduces performance burdens and latency issues under high concurrency. Hybrid modes attempt to distribute filtering tasks between the client and server, but they still fall under the limitation of static keyword matching. They cannot dynamically and accurately judge based on the speaker's identity, dialogue context, and surrounding text, easily leading to false blocking or missed filtering, affecting user experience and community atmosphere. Therefore, there is an urgent need for an intelligent content filtering method that can understand context, achieve client-server load balancing, and possess adaptive capabilities. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a content filtering method, system and storage medium based on character portrait, which can intelligently filter content by combining the speaker's character attributes and the context of the dialogue, and solve the problems of rigid filtering rules, inability to understand context and unbalanced load between client and server in the existing technology.
[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A content filtering method based on character portraits includes: The client creates a first-level character portrait library for each user role and sends the first-level character portrait library to the server; The server learns from the received first-character portrait databases and generates second-character portrait databases for each character. When the client receives dialogue information sent by a user role, it determines whether the user role matches the first role portrait library. If so, the first role portrait library is used to filter the content of the dialogue information. Otherwise, the client sends the dialogue information to the server, which matches the corresponding second role portrait library based on the user's role and uses the second role portrait library to filter the dialogue information.
[0005] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is: a content filtering system based on character portraits, including a client and a server; The client is used to create a first character portrait database for user roles and send the first character portrait database to the server; The server is used to learn from the received first character portrait databases and generate second character portrait databases for each character. The client is also used to determine whether the user role matches the first role portrait library when it receives dialogue information sent by the user role. If so, the client uses the first role portrait library to filter the content of the dialogue information; otherwise, the client sends the dialogue information to the server, and the server matches the corresponding second role portrait library according to the user role and uses the second role portrait library to filter the content of the dialogue information.
[0006] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is: a computer-readable storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the various steps of the method described above.
[0007] The beneficial effects of this invention are as follows: It adopts a two-tier architecture where the client and server work together. The client performs initial filtering based on local character portraits, effectively reducing server load. The server continuously learns and updates the character portrait library through machine learning, forming a more accurate filtering model. By constructing an intelligent filtering mechanism based on character portraits, contextual awareness and scenario-based analysis of chat content are achieved. This design allows the filtering process to consider not only the sensitive words themselves but also the speaker's role characteristics and the dialogue context for dynamic judgment, significantly improving the accuracy and flexibility of filtering, while also achieving intelligent allocation and dynamic balancing of system load. Attached Figure Description
[0008] Figure 1 This is a flowchart of a content filtering method based on character portrait according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating the interaction between the client and server in an embodiment of the present invention. Figure 3 This is a flowchart illustrating the server updating the second character portrait library according to an embodiment of the present invention; Figure 4 This is a flowchart illustrating client-side content filtering in an embodiment of the present invention; Figure 5 This is a detailed flowchart of a content filtering system based on character portrait according to an embodiment of the present invention; Figure 6 This is a schematic diagram of a content filtering system based on character portrait according to an embodiment of the present invention; Label Explanation: 1. A content filtering system based on character portraits; 2. Client; 3. Server. Detailed Implementation
[0009] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0010] Before detailing the embodiments of this application, some related concepts will first be explained: Character Portrait Library: A data model used to describe and define user character characteristics, including character type, personality traits, background information, common scenarios, and typical language patterns in specific scenarios.
[0011] Contextual association rules: Filtering rules based on the character portrait library and scene definition, used to determine whether words are appropriate in a specific context.
[0012] In existing technologies, chat rooms on online games and social platforms are typical application scenarios for content filtering. In these scenarios, users have diverse identities, conversation topics vary widely, and malicious speech constantly evolves. Traditional filtering schemes based on fixed sensitive word lists struggle to handle complex contexts, often resulting in problems such as: blocking the word "dog" in friendly conversations about pets; failing to identify malicious speech that has been distorted; and concentrating system load on the server side, leading to performance bottlenecks. These issues severely impact user experience and community governance. Therefore, a filtering scheme that can understand context and intelligently allocate computing resources is needed.
[0013] To at least solve the above problems, please refer to Figure 1 This invention provides a content filtering method based on character portraits, including: S1. The client creates a first character portrait library for the user character and sends the first character portrait library to the server; S2. The server learns from the received first character portrait databases and generates second character portrait databases for each character. S3. When the client receives dialogue information sent by the user role, it determines whether the user role matches the first role portrait library. If so, the first role portrait library is used to filter the content of the dialogue information. S4. Otherwise, the client sends the dialogue information to the server, and the server matches the corresponding second role portrait library according to the user role, and uses the second role portrait library to filter the content of the dialogue information.
[0014] As described above, the beneficial effects of this invention are as follows: the client performs initial filtering based on local character portraits, effectively reducing server load; the server continuously optimizes the content filtering model through machine learning, improving overall filtering accuracy. This solution achieves intelligent processing of chat content by introducing the concept of character portraits and a two-level collaborative filtering architecture. This design solves the problems of insufficient contextual understanding and unbalanced load in traditional solutions.
[0015] Combination Figure 2 Furthermore, in step S1, the client establishes a first character portrait library for the user character, including: Generate role feature data for the user roles of the client, and extract role type, role personality traits, and role background from the role feature data; By combining the character's usage scenarios and interaction requirements, we can determine the appropriate usage scenarios for the character. Pre-defined context association rules, which include the dialogue logic and expression norms of roles in different usage scenarios; By combining the character type, character personality traits, character background, suitable usage scenario, and context association rules, a first character portrait library is generated.
[0016] As described above, the establishment of the first character portrait library is based on multi-dimensional feature analysis of user roles, including not only static identity identifiers but also dynamic personality traits and contextual rules. This enables the client to perform preliminary contextual understanding of chat content. For example, when building a portrait library for characters tagged as "pet lovers" or "gentle personalities," it pre-sets rules that words like "dog" and "cat" are normal vocabulary in pet communication scenarios, achieving more accurate content filtering.
[0017] Combination Figure 3 Furthermore, step S2 includes: The server generates a core information database for each character based on the received first character portrait database. Extract feature vectors from the core information database, construct training samples based on the feature vectors, add whether the training samples are masked or not, and use machine learning algorithms to learn from the training samples to obtain a learning model; The learning model is mapped to a second character portrait library corresponding to the character.
[0018] As described above, the server uses machine learning to combine a large number of character portraits uploaded by clients with historical chat content data to train an intelligent model that can identify the complex relationship between character characteristics and illegal content, in order to generate a more accurate second character portrait library.
[0019] Combination Figure 3Furthermore, a second character portrait library for each character is obtained, which also includes: Configure a context filtering sub-library associated with the character for the second character portrait library. The context filtering sub-library contains context filtering rules for the corresponding adapted use scenario.
[0020] As described above, the context filtering sub-library is designed to achieve scenario-based segmentation of filtering rules. For the same character's statements in different applicable scenarios, the system can apply different levels of filtering strictness and rule sets. For example, more internal banter is allowed in the guild channel, while a more stringent filtering standard is adopted in the world channel, thereby improving the flexibility of content filtering and user experience.
[0021] Combination Figure 3 Furthermore, a second character portrait library for each character is obtained, which also includes: Check if there is any conflicting content related to the current character in the second character portrait library for each character. If so, update the second character portrait library according to the blocking rules for the conflicting content.
[0022] As described above, the system possesses self-detection and optimization capabilities, and can identify and resolve conflicts between different rules. For example, if a character's "dog lover" tag has the highest weight as the first tag and "dislikes dogs" has the second weight, then in the character's statements, if dog-related content is detected, it will be filtered according to the first tag weight rule. If dog-unrelated content is detected, the first tag weight rule filtering will not take effect, and content filtering will be performed according to the second tag weight rule.
[0023] Combination Figure 4 Furthermore, in step S3, the dialogue information is filtered using the first character portrait library, including: The dialogue information is segmented to obtain the words to be filtered; The words to be filtered are matched with the context association rules in the first character portrait library. If a match is found, the dialogue information is not filtered. If there is no match, the words to be filtered in the dialogue information are filtered out.
[0024] As described above, the client-side filtering process combines rule matching with contextual analysis. When a user's message contains sensitive words, the client first checks the match between the current chat context and the user's profile. Filtering is only performed if the context does not match or the user's characteristics do not support the term. This mechanism effectively avoids the problem of indiscriminate blocking found in traditional solutions, thus improving the user experience.
[0025] Combination Figure 5 Furthermore, step S4 includes: The dialogue information is segmented to obtain the words to be filtered; If the server successfully matches the corresponding second role portrait library based on the user role, it will match the word to be filtered with the context filtering sub-library of the second role portrait library. If a match is found, the dialogue information will not be filtered. If there is no match, the words to be filtered in the dialogue information are filtered out.
[0026] As described above, the server-side filtering mechanism employs intelligent judgment based on machine learning models. When the client cannot handle the situation or requires more precise judgment, the server uses a pre-trained second-person portrait library for in-depth analysis, combining multi-dimensional information such as character characteristics, dialogue history, and scene environment to make a more accurate content security assessment.
[0027] Furthermore, step S4 also includes: If the server fails to match the corresponding second role portrait library based on the user role, it will create a corresponding second role portrait library for the user role and use the dialogue information to learn and update the second role portrait library.
[0028] As described above, this mechanism ensures the system's integrity and scalability. For newly emerging character types or characters that have not been fully learned, the system can automatically create an initial character portrait library and continuously optimize its filtering strategy through learning. This adaptive capability enables the system to handle various unknown situations and always maintain accurate and effective filtering results.
[0029] Please refer to Figure 6 Another embodiment of the present invention provides a content filtering system based on character portraits, including a client and a server; The client is used to create a first character portrait database for user roles and send the first character portrait database to the server; The server is used to learn from the received first character portrait databases and generate second character portrait databases for each character. The client is also used to determine whether the user role matches the first role portrait library when it receives dialogue information sent by the user role. If so, the client uses the first role portrait library to filter the content of the dialogue information; otherwise, the client sends the dialogue information to the server, and the server matches the corresponding second role portrait library according to the user role and uses the second role portrait library to filter the content of the dialogue information.
[0030] Another embodiment of the present invention: a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the various steps of the above-described content filtering method based on character portrait.
[0031] The content filtering method, system, and storage medium based on character portrait described above are applicable to various real-time communication scenarios requiring content security management, such as online games, social platforms, forums, and online education. The following detailed implementation methods illustrate these methods: Please refer to Figure 1 One embodiment of the present invention is as follows: A content filtering method based on character portraits includes: S1. The client establishes a first-level character portrait library for the user role and sends the first-level character portrait library to the server, including: S11. Generate role feature data for the user role of the client, and extract role type, role personality traits, and role background from the role feature data; Specifically, in a multiplayer online role-playing game, the client creates a first character portrait library for a new user character "User A".
[0032] Through in-system behavior tracking, recent data for "User A" was collected: Chat logs showed frequently used words including "my dog," "walking the dog," and "dog food." The user completed 15 pet-related tasks, far exceeding the average user's 3. The user community they joined was the "Dog Lovers Alliance."
[0033] Based on their behavioral patterns, the role type was extracted as "pet lover", with the specific sub-tag being "dog lover".
[0034] Analyzing 300 of User A's historical posts, 85% were neutral or positive in tone, with frequent use of words like "cute" and "smart" to describe pets. During arguments with other users (twice in total), the user's language was relatively restrained, with no abusive language used. Overall, the user's personality is determined to be "gentle and friendly."
[0035] Analysis of its activity patterns revealed that its main settings were "Pet Paradise" and "Pet Discussion Forum on Public Channels"; its affiliated group, "Cute Pet Home," primarily focused on pet communication.
[0036] S12. Based on the character's usage scenarios and interaction requirements, obtain the character's suitable usage scenarios; Specifically, based on data analysis, it was determined that User A's main suitable scenarios are "pet topic discussions", "pet parenting exchanges", and "pet community interactions".
[0037] S13. Preset context association rules, which include the dialogue logic and expression norms of the role in different usage scenarios; Specifically, in the context of the "pet lover" tag and its applicable scenarios, the default context association rules are as follows: Rule 1: In the context of "pet topic discussion", words such as "dog", "canine", and "rabies" should not trigger filtering of animal-related or disease / health keywords.
[0038] Rule 2: When the sentence structure is “(an animal) got (a disease)”, if the subject is an animal, it is considered a normal descriptive sentence.
[0039] Rule 3: Associate animal behavior terms such as "wagging its tail" with derogatory human behavior terms such as "flattery" or "fawning." If used to describe humans, the tone of the language must be considered.
[0040] S14. By combining the character type, the character personality traits, the character background, the suitable usage scenario, and the context association rules, a first character portrait library is generated.
[0041] Specifically, the above-mentioned character types (pet lovers / dog lovers), character personality traits (gentle and friendly), character background (scene: pet park / pet discussion forum; group: cute pet home), suitable usage scenarios (pet related), and preset context association rules are integrated to generate a structured first character portrait library, which is then uploaded to the server.
[0042] S2. The server learns from the received first-character portrait databases and generates second-character portrait databases for each character, including: S21. The server generates a core information database for each character based on the received first character portrait database. Specifically, the server receives the first character portrait database and related chat data of "User A" and tens of thousands of "pet lover" type users across the server.
[0043] Generate a core information database for roles like "User A", which includes their role type code, personality vector (gentle label with a weight of 0.5, friendly label with a weight of 0.5), and background vector (pet scene label with a weight of 1).
[0044] S22. Extract the feature vector of the core information database, construct training samples based on the feature vector, add a label for whether the training samples are blocked or not, and use a machine learning algorithm to learn the training samples to obtain a learning model. Specifically, a large sample was selected from the historical chat data of the "dog lover" persona, such as: Sample A (notation: not masked): "My dog went to get his rabies vaccine yesterday." — Based on the character type and scenario, this is judged to be normal.
[0045] Sample B (marked: censored): "You bite people like a mad dog." — Even if the speaker might be a dog lover, this is an insult in this context.
[0046] The core information feature vectors of the characters and the feature vectors of the chat text were extracted from the samples, concatenated, and then input into a machine learning model for training. The model learned that for the "dog lover" character, the probability of violation is extremely low when the chat content contains "rabies" and the context is strongly related to "pet medical care"; however, the probability of violation is extremely high when it contains "mad dog" and is used to describe other users.
[0047] S23. Mapping the learning model to a second character portrait library corresponding to the character, including: S231. Configure a context filtering sub-library associated with the character for the second character portrait library. The context filtering sub-library contains context filtering rules for the corresponding adapted use scenario. S232. Detect whether there is conflicting content related to the current character in the second character portrait library of each character. If so, update the second character portrait library according to the blocking rules of the conflicting content.
[0048] In this embodiment, the context filtering rules are formulated based on the tag weights in the second character portrait library and the corresponding adapted usage scenarios, including: if a content conflict occurs, the content is filtered according to the tag weight priority order corresponding to the content; if the content conflict is filtered by a high-priority rule, other low-priority filtering rules will not be activated.
[0049] Specifically, the trained model's parameters and discrimination rules for roles like "User A" are instantiated into a specific second-person portrait library. This library contains a core prediction model and a series of rules generated based on the model's decision thresholds.
[0050] Associate a contextual filtering sub-library with the second persona library for "User A". This sub-library specifies that under the "pet lover" tag and in the "pet topic discussion" scenario, the word "rabies" will not be blocked when it co-occurs with words such as "vaccine", "treatment", and "prevention"; however, it will be blocked when the word "mad dog" co-occurs with personal pronouns such as "you", "he", and "someone", and the sentence has a negative emotional tone.
[0051] The server periodically performs conflict detection. For example, if it detects that "User A" posted in a public channel, "That person who litters has no manners, like a stray dog," the system detects that this statement (comparing a person to a dog for derogatory purposes) conflicts with the "dog lover" and "mild" and "friendly" tags in its character profile database. Based on conflict resolution rules (recent behavior may reflect true inclinations), the system updates its secondary character profile database, lowers the weight of its "dog lover," "mild," and "friendly" tags, and adds an exception note to the "dog lover" tag: "May use dogs as a negative metaphor." Simultaneously, the system will more strictly check for similar metaphors in future posts.
[0052] S3. When the client receives dialogue information sent by a user role, it determines whether the user role matches the first role portrait database. If so, it uses the first role portrait database to filter the content of the dialogue information, including: S31. Segment the dialogue information to obtain words to be filtered; S32. Match the word to be filtered with the context association rules in the first character portrait library. If they match, do not filter the dialogue information; if they do not match, filter the word to be filtered in the dialogue information.
[0053] Specifically, user "User A" posted a chat message in the "Pet Topic Discussion" section: "Help! My dog's ears are drooping and he seems lethargic. Could it be canine distemper?" The client identifies the current user role as "User A," queries the locally stored first-person portrait database, confirms the existence of data for this role, and a successful match is achieved. Next, User A's chat content is segmented into words, resulting in ["help", "my home", "dog", "ears", "drooping", "listless", "could it be", "yes", "got it", "canine distemper"]. "Canine distemper" is identified as the word to be filtered.
[0054] The client identifies the current scenario as a "pet discussion" based on the chat channel information. It then queries the first character's portrait database for the pre-defined contextual association rules for that character and pet scenario: Rule 1 stipulates that disease-related words should not trigger blocking in the "pet discussion" scenario; Rule 2 stipulates that when the sentence structure is "(animal) has (disease)" and the subject is an animal, it is considered a normal description. The subject is "my dog" (animal), and the structure is "...has canine distemper?", which conforms to Rule 2.
[0055] Since a valid context association rule was matched, "canine distemper" is not filtered in this conversation message. The client sends the full message to the user.
[0056] S4. Otherwise, the client sends the conversation information to the server. The server matches the corresponding second role portrait library according to the user role, and uses the second role portrait library to filter the content of the conversation information, including: S41. Segment the conversation information to obtain the words to be filtered; If the server successfully matches the corresponding second role portrait library according to the user role, then match the word to be filtered with the context filtering sub-library of the second role portrait library. If there is a match, do not filter the conversation information; If there is no match, filter the word to be filtered in the conversation information.
[0057] S42. If the server fails to successfully match the corresponding second role portrait library according to the user role, create a corresponding second role portrait library for the user role, and use the conversation information to learn and update the second role portrait library.
[0058] Specifically, assume that a newly registered user role "User B" makes a first speech in the public channel: "Are you sick? Talking nonsense here." The client does not have the first role portrait library of "User B" locally, and the matching fails. So the client sends the original conversation information to the server. The server queries according to the user ID "User B" and fails to find its existing second role portrait library. The server creates an initial second role portrait library for this user role and immediately uses the currently received conversation information as the first training sample to learn and update it. The learning process identifies that "being sick" belongs to the highly sensitive words in the disease and health shielding library, and in the current public channel scenario, there is no context indicating that this is a medical discussion. Combining the strong tone of interrogation and accusation in the statement, it is determined as a malicious attack. According to this conversation information, add the major label "non-compliant speech" for User B, where the sub-label is "malicious attack" and the current weight is 1.
[0059] The client segments the conversation information to obtain the word to be filtered "being sick". In the newly created and updated second role portrait library after this learning, the rule of its context filtering sub-library for a new user using the word "being sick" in the public channel is: block without reasonable context. Since no allowed context rule is matched, filter the "being sick" in this conversation information, and process the message as "Are you ? Talking nonsense here." and then broadcast it.
[0060] Suppose user "User A" later comments during an argument with another user in a public channel: "You're just like a dog wagging its tail, pretending to know everything." The client might allow this because its rules don't cover such complex metaphors or its version isn't up-to-date, and send the message to the user. The server, however, successfully matches the user's ID to its learned and optimized second-person profile database.
[0061] The server segments the dialogue information into words, obtaining the words to be filtered: "wagging tail" and "dog". It then queries the context filtering sub-base of the "public channel" scene in the second-person character portrait database. The sub-base rules (generated by the learning model) indicate that the combination of "wagging tail" and "dog" to describe other users is highly likely to anthropomorphize and belittle them. This statement (using a dog as a negative metaphor) matches the exception note "may use a dog as a negative metaphor" in the recent update record of its second-person character portrait database, but it still conflicts with its core "dog lover" tag and adjusted personality trait tags. This conflict will be recorded for subsequent model fine-tuning.
[0062] Since a clear negative metaphor rule was matched in the sub-database, and the current scenario is a public channel prone to arguments, "wagging tail" and "dog" were filtered out, and the result was processed as "Your pretentious manner is just like a..." "Then broadcast."
[0063] In another embodiment, the server periodically distributes an optimized subset of rules from the second character portrait library that can be applied to the client (i.e., the updated first character portrait library) to each client. Specifically, the server periodically optimizes the subset of tag weight rules in the second character portrait library, updates the corresponding tag weights in the second character portrait library, and distributes the updates to the clients simultaneously.
[0064] For example, after the event described in the above embodiment occurs, the server may add a new rule to its first persona library: "When 'User A' uses 'dog' to describe other users in a non-pet discussion area, block them." After the client receives the update, subsequent attempts by that user to send similar comments on the client will be directly blocked locally, thereby further reducing server load and achieving more real-time content protection.
[0065] In summary, this embodiment provides an intelligent content filtering scheme based on character portraits. By constructing a two-level filtering architecture that coordinates client and server, the client establishes a first character portrait library containing character types, personality traits, and scene rules for initial filtering; the server then generates a more accurate second character portrait library through machine learning for in-depth analysis. This method not only considers the sensitive words themselves but also dynamically judges based on the speaker's character characteristics and the dialogue context, effectively solving the problems of rigid filtering and inability to understand context in traditional solutions. Simultaneously, load balancing optimizes system performance, achieving a balance between filtering accuracy, scene adaptability, and system efficiency.
[0066] Please refer to Figure 6 Another embodiment of the present invention is: a content filtering system 1 based on character portrait, including a client 2 and a server 3; The client is used to create a first character portrait database for user roles and send the first character portrait database to the server; The server is used to learn from the received first character portrait databases and generate second character portrait databases for each character. The client is also used to determine whether the user role matches the first role portrait library when it receives dialogue information sent by the user role. If so, the client uses the first role portrait library to filter the content of the dialogue information; otherwise, the client sends the dialogue information to the server, and the server matches the corresponding second role portrait library according to the user role and uses the second role portrait library to filter the content of the dialogue information.
[0067] In another embodiment, a computer-readable storage medium is provided having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the steps of the above-described content filtering method based on character portrait.
[0068] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A content filtering method based on character portraits, characterized in that, include: The client creates a first-level character portrait library for each user role and sends the first-level character portrait library to the server; The server learns from the received first-character portrait databases and generates second-character portrait databases for each character. When the client receives dialogue information sent by a user role, it determines whether the user role matches the first role portrait library. If so, the first role portrait library is used to filter the content of the dialogue information. Otherwise, the client sends the dialogue information to the server, which matches the corresponding second role portrait library based on the user's role and uses the second role portrait library to filter the dialogue information.
2. The method according to claim 1, characterized in that, The client establishes a primary character portrait library for each user role, including: Generate role feature data for the user roles of the client, and extract role type, role personality traits, and role background from the role feature data; By combining the character's usage scenarios and interaction requirements, we can determine the appropriate usage scenarios for the character. Pre-defined context association rules, which include the dialogue logic and expression norms of roles in different usage scenarios; By combining the character type, character personality traits, character background, suitable usage scenario, and context association rules, a first character portrait library is generated.
3. The method according to claim 2, characterized in that, The server learns from the received first-character portrait databases and generates second-character portrait databases for each character, including: The server generates a core information database for each character based on the received first character portrait database. Extract feature vectors from the core information database, construct training samples based on the feature vectors, add whether the training samples are masked or not, and use machine learning algorithms to learn from the training samples to obtain a learning model; The learning model is mapped to a second character portrait library corresponding to the character.
4. The method according to claim 3, characterized in that, The second character portrait library for each character is obtained, and also includes: Configure a context filtering sub-library associated with the character for the second character portrait library. The context filtering sub-library contains context filtering rules for the corresponding adapted use scenario.
5. The method according to claim 3, characterized in that, The second character portrait library for each character is obtained, and also includes: Check if there is any conflicting content related to the current character in the second character portrait library for each character. If so, update the second character portrait library according to the blocking rules for the conflicting content.
6. The method according to claim 2, characterized in that, The dialogue information is filtered using a first character portrait library, including: The dialogue information is segmented to obtain the words to be filtered; The words to be filtered are matched with the context association rules in the first character portrait library. If a match is found, the dialogue information is not filtered. If there is no match, the words to be filtered in the dialogue information are filtered out.
7. The method according to claim 4, characterized in that, The client sends the dialogue information to the server. The server matches the corresponding second-role portrait library based on the user's role and uses the second-role portrait library to filter the dialogue information, including: The dialogue information is segmented to obtain the words to be filtered; If the server successfully matches the corresponding second role portrait library based on the user role, it will match the word to be filtered with the context filtering sub-library of the second role portrait library. If a match is found, the dialogue information will not be filtered. If there is no match, the words to be filtered in the dialogue information are filtered out.
8. The method according to claim 7, characterized in that, Also includes: If the server fails to match the corresponding second role portrait library based on the user role, it will create a corresponding second role portrait library for the user role and use the dialogue information to learn and update the second role portrait library.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.
10. A content filtering system based on character portraits, characterized in that, Includes both client and server; The client is used to create a first character portrait database for user roles and send the first character portrait database to the server; The server is used to learn from the received first character portrait databases and generate second character portrait databases for each character. The client is also used to determine whether the user role matches the first role portrait library when it receives dialogue information sent by the user role. If so, the client uses the first role portrait library to filter the content of the dialogue information; otherwise, the client sends the dialogue information to the server, and the server matches the corresponding second role portrait library according to the user role and uses the second role portrait library to filter the content of the dialogue information.