电子病历主诉部分结构化
主要功能说明:
- 主要是基于分词库构建,然后根据上下文语义进行结构化
- 目前按照分词库分为如下几类:时间词库、方位词库、症状词库、性质词库、描述性文字词库、部位词库、疾病名称词库
- 需要维护词库,词库路径配置文件在jar包里的ermInfo.properties的dicDir配置
- 如果需要自己添加词库,可以修com.minz.med.hospi.DicComplain.DicComplain()方法。
- 由于需要将病历中的文字变为标准的编码格式,建立一个dic.txt,建立这种映射关系。
自定义分词规则方法:
// 2月余
lhs = new ArrayList<ComplainSpan>();
rhs = new ArrayList<ComplainType>(); // right-hand .
rhs.add(ComplainType.No);
rhs.add(ComplainType.numberSuffix);
lhs.add(new ComplainSpan(2, ComplainType.timeDsc));
addProduct(rhs, lhs);
自定义添加词库
// 加入词库文件
load("desctext.txt", ComplainType.descText, 10000);
//如果单词少也可直接加入词
addWord("半", 0, ComplainType.No, 200000);
将jar添加后,直接调用HospitalRecExcator的静态方法:
System.out.println(HospitalRecExcator.extractComplain("p肝癌术后化疗后,复发2次介入治疗后1月余"));
返回结果:
[
{
"symptomatic": "",
"symptomaticPart": "",
"symptomaticLocal": "",
"nature": "",
"descText": "术后;化疗后;",
"timeDsc": "",
"disease": "肝癌"
},
{
"symptomatic": "",
"symptomaticPart": "",
"symptomaticLocal": "",
"nature": "复发",
"descText": "次数;TACE术后;",
"timeDsc": ">1个月",
"disease": ""
}
]
Windows/Mac/Linux 全平台支持
本系统需要如下依赖:
- JDK 8 及以上
- eclipse Neon.3及以上