WhatDidYouDoWithAILoading
Back to the forum

Lab notes 分类时日期和样本号打架

1200 条笔记里一半手写,本地 12 GB GPU 的批量也很小。

I’m trying to classify lab notes, but the model keeps confusing sample IDs with dates. In this notebook stack, a line like “05/11” can mean a collection date, a storage label, or part of a sample code, and the classifier keeps picking the wrong one with annoying confidence.

The dataset is only 1,200 notes, and about half are handwritten, so the OCR noise leaks straight into the labels. I’m running a local Llama setup on a 12 GB GPU, which means I can’t batch much and the whole loop feels slow. I’ve tried prompt tweaks, but they mostly reshuffle the mistakes instead of fixing them.

I also split the notes by lab source and date range to see if the confusion was context-dependent. That helped a little, but not enough to trust the output without a human pass. The worst cases are the ones where the sample ID format is almost date-like; the model is very eager to normalize them into something it has seen before.

What surprised me is how much the model relies on surrounding words instead of the actual token pattern. I’m not sure yet whether the next step is more annotation, better OCR cleanup, or a small rules layer just for IDs that look like dates. At the moment all three seem necessary, which is not a great answer.

10 replies

Ethan Li#1 · 2026-07-24

手写那一半里,日期格式是固定的吗?

Emma Liu#2 · 2026-07-24

不固定,有的写成 05/11,有的直接写 5-11。

Derek Xu#3 · 2026-07-24

先做一个 sample-ID 正则白名单,通常能压掉大部分日期误判。

Mark Chen#4 · 2026-07-24

12 GB GPU 跑本地 Llama 还要分类,batch 小真的很折磨。

Paige Bell#5 · 2026-07-24

1,200 条其实不算少,但如果标签本身就混,模型再大也救不了。

Emma Liu#6 · 2026-07-24

对,标签定义现在也在补。我们内部有几类边界样本还没统一。

廖飞#7 · 2026-07-24

可以先把日期识别和样本号识别拆成两阶段,第一阶段只做候选切片,第二阶段再分类。这样 05/11 这种歧义点不会直接把主标签带偏。

肖安#8 · 2026-07-24

我们以前在 8k 条病理记录里也撞过这个坑,最后是把手写 OCR 的原始置信度一起喂给规则层。低置信度的数字串基本都先降权。

林溪#9 · 2026-07-24

手写那部分有页码或样本批次前缀吗?如果有,先从格式上切开,模型会轻松很多。

Emma Liu#10 · 2026-07-25

有一部分有前缀,但格式也不统一,像 A-05/11 和 A0511 混着来。现在我在试把日期候选和批次号候选分开打分,batch 只有 4,我得一点点看错例。