fix: strengthen entity filtering for ad/business content
- Add marketing metadata to 'Not allowed' list in ontology prompt - Strengthen exclude_self filter instruction - Add exclude_rules support from template filter rules - Update business_ad template with more excluded types
This commit is contained in:
@@ -53,6 +53,9 @@ Therefore, **entities must be real-world subjects that can speak and interact on
|
||||
- Abstract concepts (such as "public opinion", "emotion", "trend")
|
||||
- Topics/subjects (such as "academic integrity", "education reform")
|
||||
- Viewpoints/attitudes (such as "supporters", "opponents")
|
||||
- Marketing/advertising metadata (such as "campaign name", "ad position", "ad channel", "ad format", "brand name")
|
||||
- The entity that created the uploaded content (e.g., if the data is an ad, do NOT create an entity for the advertiser/brand)
|
||||
- Non-human concepts that cannot speak or interact on social media
|
||||
|
||||
## Output Format
|
||||
|
||||
@@ -221,14 +224,21 @@ class OntologyGenerator:
|
||||
|
||||
if exclude_self:
|
||||
filter_instruction += (
|
||||
"- IMPORTANT: The uploaded data is from a business/brand/advertiser. "
|
||||
"Do NOT create entity types for the business/brand that created this content. "
|
||||
"Only create entities for the TARGET AUDIENCE, competitors, influencers, media, etc.\n"
|
||||
"- CRITICAL: The uploaded data is from a business/brand/advertiser. "
|
||||
"Do NOT create entity types for: the business itself, its brand name, campaign names, "
|
||||
"ad positions, ad channels, ad formats, or any marketing metadata. "
|
||||
"ONLY create entity types for real people/organizations who would REACT to this content: "
|
||||
"target audience segments, competitors, influencers, media outlets, consumer groups.\n"
|
||||
)
|
||||
|
||||
if exclude_types:
|
||||
filter_instruction += f"- Do NOT create entity types matching: {', '.join(exclude_types)}\n"
|
||||
|
||||
# Add custom exclude rules from template
|
||||
exclude_rules = template_filter_rules.get('exclude_rules', [])
|
||||
for rule in exclude_rules:
|
||||
filter_instruction += f"- {rule}\n"
|
||||
|
||||
if focus:
|
||||
filter_instruction += f"- Focus entity types on: {focus}\n"
|
||||
|
||||
|
||||
@@ -7,7 +7,10 @@
|
||||
"prompt_th": "จำลองปฏิกิริยาของประชาชนบนโซเชียลมีเดียหลังจาก [เหตุการณ์] ในช่วง [ระยะเวลา] ชั่วโมง",
|
||||
"prompt_en": "Simulate public reactions on social media after [event] within [timeframe] hours",
|
||||
"prompt_zh": "模拟[事件]发生后公众在社交媒体上的反应,时间范围[时间]小时",
|
||||
"placeholders": ["event", "timeframe"],
|
||||
"placeholders": [
|
||||
"event",
|
||||
"timeframe"
|
||||
],
|
||||
"entity_filter": {
|
||||
"exclude_types": [],
|
||||
"focus": "affected_parties, public, media, officials"
|
||||
@@ -20,7 +23,9 @@
|
||||
"prompt_th": "จำลองผลกระทบของนโยบาย [ชื่อนโยบาย] ต่อกลุ่มต่างๆ ในสังคม รวมถึงการโต้ตอบบนโซเชียลมีเดีย",
|
||||
"prompt_en": "Simulate the impact of [policy name] on different social groups, including social media interactions",
|
||||
"prompt_zh": "模拟[政策名称]对不同社会群体的影响,包括社交媒体互动",
|
||||
"placeholders": ["policy_name"],
|
||||
"placeholders": [
|
||||
"policy_name"
|
||||
],
|
||||
"entity_filter": {
|
||||
"exclude_types": [],
|
||||
"focus": "citizens, experts, media, government, affected_groups"
|
||||
@@ -33,11 +38,28 @@
|
||||
"prompt_th": "จำลองการแพร่กระจายและผลตอบรับของ [แคมเปญ/สินค้า] บนโซเชียลมีเดีย รวมถึงปฏิกิริยาของกลุ่มเป้าหมาย",
|
||||
"prompt_en": "Simulate the spread and reception of [campaign/product] on social media, including target audience reactions",
|
||||
"prompt_zh": "模拟[活动/产品]在社交媒体上的传播和反馈,包括目标受众的反应",
|
||||
"placeholders": ["campaign_product"],
|
||||
"placeholders": [
|
||||
"campaign_product"
|
||||
],
|
||||
"entity_filter": {
|
||||
"exclude_self": true,
|
||||
"exclude_types": ["Advertiser", "BrandOwner"],
|
||||
"focus": "target_audience, competitors, influencers, media"
|
||||
"exclude_types": [
|
||||
"Advertiser",
|
||||
"BrandOwner",
|
||||
"Campaign",
|
||||
"AdPosition",
|
||||
"AdChannel",
|
||||
"AdCreative",
|
||||
"MarketingPlan",
|
||||
"Brand"
|
||||
],
|
||||
"exclude_rules": [
|
||||
"Do NOT create entities for the business/brand that created the ad",
|
||||
"Do NOT create entities for ad metadata (campaign name, ad position, ad channel, ad format)",
|
||||
"Do NOT create entities for abstract marketing concepts",
|
||||
"ONLY create entities for real people/organizations who would react to the ad"
|
||||
],
|
||||
"focus": "target_audience, competitors, influencers, media, consumer_groups"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -47,9 +69,14 @@
|
||||
"prompt_th": "จำลองเรื่องราวต่อจาก [เนื้อเรื่อง] โดยให้ตัวละครแต่ละตัวมีปฏิสัมพันธ์กันบนโซเชียลมีเดีย และทำนายตอนจบ",
|
||||
"prompt_en": "Simulate the story continuation from [plot] with characters interacting on social media, and predict the ending",
|
||||
"prompt_zh": "模拟从[情节]开始的故事延续,角色在社交媒体上互动,并预测结局",
|
||||
"placeholders": ["plot"],
|
||||
"placeholders": [
|
||||
"plot"
|
||||
],
|
||||
"entity_filter": {
|
||||
"exclude_types": ["Author", "Narrator"],
|
||||
"exclude_types": [
|
||||
"Author",
|
||||
"Narrator"
|
||||
],
|
||||
"focus": "characters, story_entities"
|
||||
}
|
||||
},
|
||||
@@ -60,11 +87,13 @@
|
||||
"prompt_th": "จำลองผลกระทบของ [กระแสสังคม] ต่อกลุ่มคนต่างๆ บนโซเชียลมีเดีย รวมถึงการแพร่กระจายของข้อมูล",
|
||||
"prompt_en": "Simulate the impact of [social trend] on different groups on social media, including information spread",
|
||||
"prompt_zh": "模拟[社会潮流]对不同群体在社交媒体上的影响,包括信息传播",
|
||||
"placeholders": ["social_trend"],
|
||||
"placeholders": [
|
||||
"social_trend"
|
||||
],
|
||||
"entity_filter": {
|
||||
"exclude_types": [],
|
||||
"focus": "public_figures, communities, media, influencers, general_public"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user