venue_phrases.py 527 B

12345678910111213141516
  1. """会议短语识别 —— 从自然语言中提取会议/期刊名称及其别名."""
  2. from __future__ import annotations
  3. from ...utils.common import dedupe_strings_preserve_order
  4. def sanitize_venue_tokens(raw: list[str | None]) -> list[str]:
  5. cleaned = [
  6. t
  7. for x in raw or []
  8. if (t := str(x).strip())
  9. and len(t) <= 120
  10. and not t.lower().startswith(("http://", "https://"))
  11. and any(c.isalnum() for c in t)
  12. ]
  13. return dedupe_strings_preserve_order(cleaned, max_n=8)