最新资讯
reddit.com OpenAI 称 Astra 仅满足 10% 安全任务标准 dev.to FreeToken:在自有 GPU 上运行前沿 MoE 模型及其内存需求 dev.to 当 AI Agent 说“完成”时,究竟完成了什么? dev.to 部署 Underdog Bark 3.0 Pro:逐字转写、自定义后端与分块设置 dev.to 为艰难对话构建 AI:五个 Agent、一条安全正则与一位盲评监督者 techcrunch.com Palo Alto Networks 洽谈以 5 亿美元收购 AI Agent 安全初创公司 Clutch theinformation.com 黄仁勋被要求就涉华间谍指控向国会作简报 www.infoq.com Edera 推出 Object Capability Bounded Authority,试图将凭证与 AI Agent 工作负载隔离 wechat 这波杀疯了!旗舰级模型不限量、1个月视频额度免费领 bloomberg.com AI 抛售蔓延至信用市场,软银领跌亚洲美元债 dev.to 如何在专用 GPU 服务器上用 OpenAI 兼容 API 部署 LLM dev.to 审计 153 份 Claude Code 与 Codex 会话记录:User-Agent 与 URL 中的邮箱泄露
多元动态
登录 注册
行业动态 dev.to · @Tae Kim

为什么我无法在 API 调用中直接运行 Splink

原文 我的收藏

作者介绍 2asy.ai 新闻流水线使用 Splink 做实体解析:每批文章的公司提及会与注册表中已有记录做两两比对、聚类并更新注册表,通常耗时约 90 秒。在构建 ER API 时,作者发现 Splink 的比对需要跨全量语料做 blocking、候选对打分和 EM 概率校准,几十万条记录下是秒级计算而非毫秒级,无法放在 HTTP 请求路径中。最终 API 改为将传入名称与预计算的候选索引比对,返回超过阈值的最佳结果。

AI推荐理由 作者以 2asy.ai 新闻流水线为例,说明 Splink 实体解析在几十万条记录上做 blocking、候选对打分和 EM 校准需要数秒级计算,无法放进 HTTP 请求路径,因此 ER API 改为对预计算候选索引做比对并返回阈值以上的最佳结果。这是具体的工程取舍经验,对做实体解析/检索服务的开发者有参考价值;但属于个人博客经验分享,无基准数据或代码,结论仅适用于其自身规模。

62

正文

I got confused about this for longer than I expected. The 2asy.ai news pipeline uses Splink. Company mentions come in with each article batch, Splink runs pairwise comparison against everything already in the registry, clusters form, the registry updates. Usually takes about 90 seconds. Sometimes longer. Nobody is waiting for it. When I started building the ER API, I thought the API would just be a lighter version of that. Call Splink, get a match, return it. The response latency problem hit me within the first day of prototyping. Splink's actual comparison work involves blocking across the full corpus, scoring candidate pairs, then an EM step to calibrate probabilities. On a corpus with a few hundred thousand records, you're looking at seconds of compute, not milliseconds. You can't put that in the path of an HTTP request that someone's polling from their application. So the API compares an incoming name against a pre-computed candidate index and returns the top result above a threshold. That's fast enough. What I didn't think through carefully at the start was what you lose by doing it that way. Splink's EM step sees the full distribution of records together. Some pairs that look ambiguous in isolation are only resolvable in context because the EM algorithm essentially gets to vote across the whole population. The API doesn't have that. Each query is independent. I worked around the latency problem reasonably well. The threshold question has been messier. When a match comes back at 0.71, what should the caller do with that? In the news pipeline I can defer uncertain pairs to a review queue and come back to them. In the API you have to give the caller something. My first attempt was to just return the score and let callers use their own threshold. What I didn't anticipate was that most callers treat any result above their threshold as a hard match, regardless of how close to the threshold it is. The docs now include threshold guidance for different use cases, but I'm still getting questions about this, so I probably haven't described it clearly enough yet. Model retraining is the one I thought about least and arguably got most wrong. I collect labeled pairs continuously and retrain the Splink model for the pipeline every few weeks. Doing the same for the API turned out to be a problem. Even a small retrain shifts match probabilities slightly. If the API returns 0.84 for a query this week and 0.79 for the same query after a retrain, anyone who built automation against the API and didn't read the changelog will notice. I now pin the API to a specific model version and do explicit releases instead. This is more conservative than I'd like, but I don't have a cleaner answer. The 2asy.ai pipeline still uses full Splink batch resolution. The API handles point queries where a caller needs an answer immediately and doesn't have the corpus context to run it themselves. I knew from the start that these were different use cases. What I underestimated was how different the constraints would be. I build er-api, a multilingual entity resolution service for Korean, Japanese, Chinese, and English corporate data. More at hannune.ai.

来源报道 · 1 篇 · 以下链接均前往原始媒体

← 返回精选动态 原文

更多内容