落地陆运私聊文字询价:选项核对后再建单查价,并按线路拉产品进群。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -22,12 +22,12 @@ _MODE_WORDS = (
|
||||
# 仅「键:值」一行一条,键必须是合同字段或展示名
|
||||
_LABEL_LINE = re.compile(
|
||||
r"^(起运地|起运港|目的地|目的港|品名|件数|毛重|体积|重量|重量\(KG\)|体积\(CBM\)|"
|
||||
r"包装方式|包装类型|货量|货物数量|整柜或拼柜|箱型箱量|报价日期|车型数量|"
|
||||
r"包装方式|包装类型|货量|货物数量|整柜或拼柜|箱型箱量|报价日期|车型/数量|车型数量|"
|
||||
r"贸易条款|货好时间|商品海关编码|海关编码|HS编码|HS|是否含油|是否含电|是否含磁)\s*[::]\s*(.+)$"
|
||||
)
|
||||
_LABEL_INLINE = re.compile(
|
||||
r"(起运地|起运港|目的地|目的港|品名|件数|毛重|体积|重量|重量\(KG\)|体积\(CBM\)|"
|
||||
r"包装方式|包装类型|货量|货物数量|整柜或拼柜|箱型箱量|报价日期|车型数量|"
|
||||
r"包装方式|包装类型|货量|货物数量|整柜或拼柜|箱型箱量|报价日期|车型/数量|车型数量|"
|
||||
r"贸易条款|货好时间|商品海关编码|海关编码|HS编码|HS|是否含油|是否含电|是否含磁)\s*[::]\s*(\S+)"
|
||||
)
|
||||
|
||||
@@ -84,10 +84,12 @@ def extract_inquiry_snapshot(
|
||||
|
||||
if injected_facts is not None:
|
||||
mode = (injected_mode or detect_transport_mode(text) or "").upper()
|
||||
facts = harvest_oral_measures(text, normalize_facts(dict(injected_facts)))
|
||||
subtype = str(facts.get("运输类型") or "").strip()
|
||||
return {
|
||||
"business_line": mode,
|
||||
"land_subtype": "",
|
||||
"facts": harvest_oral_measures(text, normalize_facts(dict(injected_facts))),
|
||||
"land_subtype": subtype,
|
||||
"facts": facts,
|
||||
"source": "injected",
|
||||
}
|
||||
mode = detect_transport_mode(text)
|
||||
@@ -107,12 +109,15 @@ def extract_inquiry_snapshot(
|
||||
mode = mode or str(b_payload.get("business_line") or "")
|
||||
source = "deepseek_b"
|
||||
facts = harvest_oral_measures(text, normalize_facts(facts))
|
||||
land_subtype = str((b_payload or {}).get("land_subtype") or facts.get("运输类型") or "").strip()
|
||||
if land_subtype and not str(facts.get("运输类型") or "").strip():
|
||||
facts["运输类型"] = land_subtype
|
||||
if not mode and facts.get("起运港") and facts.get("目的港") and "飞" in (text or ""):
|
||||
mode = "AIR"
|
||||
logger.info("extract.snapshot mode=%s keys=%s src=%s", mode or "-", sorted(facts), source)
|
||||
return {
|
||||
"business_line": mode,
|
||||
"land_subtype": (b_payload or {}).get("land_subtype") or "",
|
||||
"land_subtype": land_subtype,
|
||||
"facts": facts,
|
||||
"source": source,
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ _FIELD_KEYS = (
|
||||
"报价日期",
|
||||
"整柜或拼柜",
|
||||
"箱型箱量",
|
||||
"车型/数量",
|
||||
"车型数量",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user