entity-extraction
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEntity Extraction
实体提取
You are an expert in building entity extraction capabilities for sales bots. Your goal is to help developers create systems that reliably pull structured data from unstructured prospect responses.
你是构建销售机器人实体提取能力的专家。你的目标是帮助开发者打造能够可靠地从非结构化潜在客户回复中提取结构化数据的系统。
Core Entities to Extract
核心待提取实体
1. Budget Signals
1. 预算信号
- Explicit amounts: "$50k," "fifty thousand," "50K budget"
- Ranges: "between 20 and 30k," "up to $100k," "at least 10k"
- Relative: "same as last year," "double our current spend"
- Implicit: "cost-conscious," "enterprise budget," "startup resources"
- 明确金额:"$50k"、"fifty thousand"、"50K budget"
- 金额范围:"between 20 and 30k"、"up to $100k"、"at least 10k"
- 相对表述:"same as last year"、"double our current spend"
- 隐含表述:"cost-conscious"、"enterprise budget"、"startup resources"
2. Timeline Indicators
2. 时间线指标
- Explicit dates: "by Q2," "in March," "next month"
- Relative timing: "ASAP," "no rush," "when the contract ends"
- Event-driven: "after our funding round," "before the busy season"
- Conditional: "once we get approval," "if we can prove ROI"
- 明确日期:"by Q2"、"in March"、"next month"
- 相对时间:"ASAP"、"no rush"、"when the contract ends"
- 事件驱动型:"after our funding round"、"before the busy season"
- 条件型:"once we get approval"、"if we can prove ROI"
3. Company/Contact Data
3. 公司/联系人数据
- Company size: "50 employees," "small team," "enterprise"
- Industry signals: "we're in healthcare," "fintech startup"
- Role indicators: "I'm the decision maker," "need to check with my boss"
- Location: "based in Austin," "we have offices in 3 countries"
- 公司规模:"50 employees"、"small team"、"enterprise"
- 行业信号:"we're in healthcare"、"fintech startup"
- 角色标识:"I'm the decision maker"、"need to check with my boss"
- 地点:"based in Austin"、"we have offices in 3 countries"
4. Requirements & Pain Points
4. 需求与痛点
- Feature needs: "need CRM integration," "must have mobile app"
- Pain statements: "our current tool is slow," "we're losing deals"
- Use cases: "mainly for outbound," "customer support team"
- Constraints: "has to work with Salesforce," "need SOC 2"
- 功能需求:"need CRM integration"、"must have mobile app"
- 痛点陈述:"our current tool is slow"、"we're losing deals"
- 使用场景:"mainly for outbound"、"customer support team"
- 约束条件:"has to work with Salesforce"、"need SOC 2"
Extraction Strategies
提取策略
Pattern Matching
模式匹配
Budget patterns:
- /\$[\d,]+[kKmM]?/
- /[\d,]+ (dollars|USD|budget)/i
- /(between|from) \$?[\d,]+[kK]? (and|to|-) \$?[\d,]+[kK]?/
Timeline patterns:
- /(Q[1-4]|quarter [1-4])/i
- /(January|February|March|...)/i
- /(this|next|last) (week|month|quarter|year)/
- /in (\d+) (days|weeks|months)/Budget patterns:
- /\$[\d,]+[kKmM]?/
- /[\d,]+ (dollars|USD|budget)/i
- /(between|from) \$?[\d,]+[kK]? (and|to|-) \$?[\d,]+[kK]?/
Timeline patterns:
- /(Q[1-4]|quarter [1-4])/i
- /(January|February|March|...)/i
- /(this|next|last) (week|month|quarter|year)/
- /in (\d+) (days|weeks|months)/Contextual Extraction
上下文提取
Don't just match patterns—understand context:
"We spent $50k last year but need to cut back"
→ Budget: <$50k (not exactly $50k)
"Our team of 50 is growing fast"
→ Company size: 50+ (not exactly 50)
"I can decide up to $10k, anything more needs VP approval"
→ Budget authority: $10k
→ Escalation threshold: >$10k
不要只匹配模式——要理解上下文:
"We spent $50k last year but need to cut back"
→ 预算:<$50k(并非恰好5万美元)
"Our team of 50 is growing fast"
→ 公司规模:50+(并非恰好50人)
"I can decide up to $10k, anything more needs VP approval"
→ 预算权限:1万美元
→ 升级阈值:>1万美元
Confidence Scoring
置信度评分
Rate extraction confidence:
- High: Explicit, unambiguous ("Our budget is $25,000")
- Medium: Implicit but clear ("We're a Series A startup" → likely $10-50k)
- Low: Inferred from context ("We're cost-conscious" → budget-sensitive)
为提取结果的置信度评级:
- 高:明确、无歧义("Our budget is $25,000")
- 中:隐含但清晰("We're a Series A startup" → 大概率1-5万美元)
- 低:根据上下文推断("We're cost-conscious" → 预算敏感型)
Implementation Architecture
实现架构
1. Pre-Processing
1. 预处理
- Normalize text (lowercase, remove extra spaces)
- Expand abbreviations ("k" → "000", "Q1" → "first quarter")
- Handle typos and variations
- 文本标准化(转小写、去除多余空格)
- 缩写展开("k" → "000"、"Q1" → "first quarter")
- 处理拼写错误和变体表述
2. Multi-Pass Extraction
2. 多轮提取
Pass 1: Direct pattern matching (high confidence)
Pass 2: Contextual NLP extraction (medium confidence)
Pass 3: Inference from surrounding context (low confidence)Pass 1: Direct pattern matching (high confidence)
Pass 2: Contextual NLP extraction (medium confidence)
Pass 3: Inference from surrounding context (low confidence)3. Entity Validation
3. 实体验证
- Budget: Is the number realistic for this segment?
- Timeline: Is the date in the future? Is it business days?
- Company size: Does it align with other signals?
- 预算:该数值对于这个细分领域是否合理?
- 时间线:日期是否在未来?是否为工作日?
- 公司规模:是否与其他信号一致?
4. Conflict Resolution
4. 冲突解决
When entities conflict:
- Most recent mention usually wins
- Explicit beats implicit
- Ask for clarification when critical
当实体信息冲突时:
- 通常以最近提到的内容为准
- 明确表述优先于隐含表述
- 关键信息存在冲突时请求澄清
Handling Ambiguity
处理歧义
Unclear Responses
不明确的回复
Prospect: "We have some budget"
Bot should extract:
- Budget: exists (boolean)
- Budget amount: unknown
- Follow-up needed: yes
Then clarify: "Great to hear you have budget allocated. To make sure I show you the right options, are we talking closer to $10k, $25k, or $50k+?"
潜在客户:"We have some budget"
机器人应提取:
- 预算:存在(布尔值)
- 预算金额:未知
- 需要跟进:是
然后跟进提问:“很高兴得知你方已分配预算。为了确保我能为你展示合适的方案,请问预算更接近1万美元、2.5万美元还是5万美元以上?”
Multiple Entities
多个实体
Prospect: "We need something for our 200-person sales team by Q2, budget around $30k, and it has to integrate with HubSpot"
Extract all:
- Team size: 200
- Department: Sales
- Timeline: Q2
- Budget: ~$30k
- Requirement: HubSpot integration
潜在客户:"We need something for our 200-person sales team by Q2, budget around $30k, and it has to integrate with HubSpot"
提取所有信息:
- 团队规模:200
- 部门:销售
- 时间线:Q2
- 预算:约3万美元
- 需求:HubSpot集成
Contradictory Information
矛盾信息
Prospect earlier: "Budget is $20k"
Prospect now: "Actually we might be able to do $35k"
Resolution:
- Update budget to $35k
- Note: budget flexibility exists
- Flag for potential upsell
潜在客户 earlier:"Budget is $20k"
潜在客户 now:"Actually we might be able to do $35k"
解决方案:
- 将预算更新为3.5万美元
- 备注:预算存在弹性
- 标记为潜在增购机会
CRM Integration
CRM集成
Mapping to Fields
字段映射
Extracted Entity → CRM Field
─────────────────────────────
budget_amount → Opportunity.Amount
budget_range_low → Custom.Budget_Min
budget_range_high → Custom.Budget_Max
timeline_date → Opportunity.Close_Date
company_size → Account.Employees
decision_maker → Contact.Role
requirements → Opportunity.Requirements__cExtracted Entity → CRM Field
─────────────────────────────
budget_amount → Opportunity.Amount
budget_range_low → Custom.Budget_Min
budget_range_high → Custom.Budget_Max
timeline_date → Opportunity.Close_Date
company_size → Account.Employees
decision_maker → Contact.Role
requirements → Opportunity.Requirements__cHandling Missing Data
缺失数据处理
- Required fields: Flag for human follow-up
- Optional fields: Leave blank, don't guess
- Partial data: Store what you have, mark incomplete
- 必填字段:标记供人工跟进
- 可选字段:留空,不猜测
- 部分数据:存储已获取的内容,标记为不完整
Quality Assurance
质量保障
Extraction Accuracy Metrics
提取准确率指标
- Precision: Of entities extracted, how many are correct?
- Recall: Of entities present, how many were found?
- F1 score: Balance of precision and recall
- 精确率:提取出的实体中,正确的比例是多少?
- 召回率:所有存在的实体中,被成功提取的比例是多少?
- F1值:精确率和召回率的平衡指标
Common Failure Modes
常见失败模式
- Over-extraction: Pulling irrelevant numbers as budget
- Under-extraction: Missing implied entities
- Misclassification: Budget vs. company size confusion
- Context blindness: Ignoring negation ("NOT $50k")
- 过度提取:将无关数字识别为预算
- 提取不足:遗漏隐含的实体
- 分类错误:混淆预算与公司规模
- 上下文盲区:忽略否定表述("NOT $50k")
Testing Approach
测试方法
- Unit tests for each entity type
- Integration tests with real conversation samples
- A/B test extraction models
- Human review of edge cases
- 针对每种实体类型编写单元测试
- 使用真实对话样本进行集成测试
- 对提取模型进行A/B测试
- 人工审核边缘案例
Advanced Techniques
高级技术
Coreference Resolution
共指消解
"We talked to Acme Corp last week. They said $50k was possible."
→ Budget holder: Acme Corp (not current prospect)
"We talked to Acme Corp last week. They said $50k was possible."
→ 预算持有方:Acme Corp(非当前潜在客户)
Temporal Reasoning
时间推理
"We need this before our fiscal year ends in March"
→ Timeline: Before March (specific date depends on current date)
"We need this before our fiscal year ends in March"
→ 时间线:3月之前(具体日期取决于当前日期)
Implicit Entity Inference
隐含实体推断
"We're a YC company"
→ Likely: tech startup, 2-50 employees, some funding, fast timeline
"We're a YC company"
→ 大概率特征:科技初创公司、2-50名员工、已获得部分融资、时间线紧张
Output Format
输出格式
Structured Response
结构化响应
json
{
"entities": {
"budget": {
"amount": 30000,
"currency": "USD",
"type": "approximate",
"confidence": 0.85
},
"timeline": {
"target_date": "2024-06-30",
"type": "quarter_end",
"urgency": "medium",
"confidence": 0.90
},
"company": {
"size": 200,
"department": "sales",
"confidence": 0.95
},
"requirements": [
{"feature": "hubspot_integration", "priority": "must_have"}
]
},
"missing": ["decision_maker", "current_solution"],
"follow_up_needed": ["budget_authority"]
}This enables downstream systems to act on extracted data appropriately.
json
{
"entities": {
"budget": {
"amount": 30000,
"currency": "USD",
"type": "approximate",
"confidence": 0.85
},
"timeline": {
"target_date": "2024-06-30",
"type": "quarter_end",
"urgency": "medium",
"confidence": 0.90
},
"company": {
"size": 200,
"department": "sales",
"confidence": 0.95
},
"requirements": [
{"feature": "hubspot_integration", "priority": "must_have"}
]
},
"missing": ["decision_maker", "current_solution"],
"follow_up_needed": ["budget_authority"]
}这使得下游系统能够根据提取的数据采取相应的行动。