WO2022242074A1 - 一种多特征融合的中文医疗文本命名实体识别方法 - Google Patents

一种多特征融合的中文医疗文本命名实体识别方法 Download PDF

Info

Publication number
WO2022242074A1
WO2022242074A1 PCT/CN2021/131596 CN2021131596W WO2022242074A1 WO 2022242074 A1 WO2022242074 A1 WO 2022242074A1 CN 2021131596 W CN2021131596 W CN 2021131596W WO 2022242074 A1 WO2022242074 A1 WO 2022242074A1
Authority
WO
WIPO (PCT)
Prior art keywords
word
dictionary
formula
vector
matrix
Prior art date
Application number
PCT/CN2021/131596
Other languages
English (en)
French (fr)
Inventor
王英龙
李佳康
舒明雷
周书旺
Original Assignee
山东省人工智能研究院
齐鲁工业大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 山东省人工智能研究院, 齐鲁工业大学 filed Critical 山东省人工智能研究院
Publication of WO2022242074A1 publication Critical patent/WO2022242074A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • G06F40/295Named entity recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the invention relates to the field of Chinese named entity recognition, in particular to a multi-feature fusion named entity recognition method for Chinese medical texts.
  • Named entity recognition technology can effectively identify and obtain specific information in electronic medical records, such as diseases, diagnosis and treatment plans, etc., and identify these information, which can be further used to count these different types of entity information and analyze these entity information. The relationship between them provides accurate data support for diagnosis and treatment.
  • word segmentation errors may occur.
  • the present invention provides a Chinese medical text named entity recognition method that enhances the effect of recognition with multi-feature fusion.
  • a multi-feature fusion method for named entity recognition of Chinese medical texts including:
  • step a) uses the Harbin Institute of Technology stop word table to remove the interference of stop words in the collected Chinese electronic medical record data, and use the opencc tool to convert all characters into simplified Chinese.
  • step d) scan all the characters in the Xinhua dictionary, collect the stroke order, keep the length of all n-grams greater than or equal to 3 and less than or equal to 6, and generate a dictionary D c_b after collecting the corresponding stroke order n-grams, and convert the dictionary D c_b is added to the dictionary D c to construct a new dictionary D c_o1 .
  • step e) scan all the characters in the Xinhua dictionary, collect radical information of characters, generate a dictionary D c_r , and add the dictionary D c_r to the dictionary D c_o .
  • step j) by the formula Calculate the loss function L, where x is the current word, y is the context word, T(w) is the set of all words in the sliding window of the current word, D is the entire text of the training corpus, ⁇ is the sigmoid function, and y′ is the random The selected word, ⁇ is the number of negative samples, E y′ ⁇ p is the sampling of y′ according to the word distribution, and p is the index of the negative sampling distribution.
  • step u) by the formula The loss function L is calculated, where ⁇ is the regularization parameter, ⁇ is the parameter set, and the loss function L is optimized by stochastic gradient descent.
  • the beneficial effects of the present invention are: use the word vector added with Chinese radicals and stroke order information to improve the traditional neural network input, so that the word vector can more completely represent the information of the characters in the Chinese case, and solve the polysemy of a word , in the case of pictophonetic characters, to improve the accuracy of the model.
  • word segmentation errors may occur when using the word vector-based method.
  • adding word information and fused word vectors can It's a good solution to this kind of problem.
  • Fig. 1 is a model flow chart of the present invention.
  • a multi-feature fusion method for named entity recognition of Chinese medical texts including:
  • Lattice-Lstm expands the Word-base cell on the basis of the traditional Lstm, and the word vector Input to the Lstm layer of the Lattice-Lstm model, through the formula Calculate the word memory unit in the Lstm layer forgotten door input gate and Forgotten Gate Information
  • is the sigmoid function
  • tanh is the activation function
  • b z is the bias vector
  • is the multi-feature word vector of the e-th character
  • is the state of the hidden layer at time e-1 is the state of the hidden layer at time e
  • This method of named entity recognition in Chinese medical texts based on multi-feature fusion considering the ambiguous semantics and pictophonetic characters of Chinese electronic medical records, and aiming at the characteristics of the field of Chinese medical records, uses word vectors added with Chinese radicals and stroke order information.
  • the traditional neural network input is improved, so that the word vector can more completely represent the information of the characters in the Chinese case, solve the polysemy of a word, and improve the accuracy of the model.
  • word segmentation errors may occur when using the word vector-based method, using the structural characteristics of the lattice-lstm network, adding word information, and fusing word vectors can It's a good solution to this kind of problem.
  • the preprocessing process in step a) is: use the Harbin Institute of Technology stop word table to remove the interference of stop words in the collected Chinese electronic medical record data, and use the opencc tool to convert all characters into simplified Chinese.
  • step d) scan all the characters in the Xinhua dictionary, collect the stroke order, keep the length of all n-grams greater than or equal to 3 and less than or equal to 6, and generate a dictionary D c_b after collecting the corresponding stroke order n-grams, and convert the dictionary D c_b is added to the dictionary D c to construct a new dictionary D c_o1 .
  • step e) scan all the characters in the Xinhua dictionary, collect radical information of characters, generate a dictionary D c_r , and add the dictionary D c_r to the dictionary D c_o .
  • step j) by the formula Calculate the loss function L, where x is the current word, y is the context word, T(w) is the set of all words in the sliding window of the current word, D is the entire text of the training corpus, and ⁇ is the sigmoid function.
  • y′ is a randomly selected word, called “negative sample”
  • is the number of negative samples
  • E y′ ⁇ p is y′ according to the word distribution
  • the sampling of , p is the exponent of the negative sampling distribution.
  • words with more occurrences in the corpus are easier to be sampled.
  • the model uses the method of stochastic gradient descent to optimize the loss function, so that the model can achieve the best effect.
  • the Viterbi algorithm uses the Viterbi algorithm to output the sequence with the highest probability, that is, the final label sequence P(y i
  • the penalty parameter of L2 is added as the loss function.
  • is the regularization parameter
  • is the parameter set.
  • the model uses the stochastic gradient descent method to optimize the loss function L, so that the model can achieve the best effect.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Algebra (AREA)
  • Databases & Information Systems (AREA)
  • Machine Translation (AREA)
  • Document Processing Apparatus (AREA)
  • Medical Treatment And Welfare Office Work (AREA)

Abstract

一种多特征融合的中文医疗文本命名实体识别方法,使用添加了中文偏旁部首以及笔画顺序信息的字向量,对传统的神经网络输入进行改进,使字向量能够更加完整的表征中文病例中字的信息,解决一词多义,形声字的情况,提高模型的准确度。考虑到使用基于字向量的方法很难处理词语之间的信息,但使用基于词向量的方法会出现分词错误的情况,利用lattice-lstm网络的结构特性,添加词的信息,融合字词向量能够很好的解决这类问题。

Description

一种多特征融合的中文医疗文本命名实体识别方法 技术领域
本发明涉及中文命名实体识别领域,具体涉及一种多特征融合的中文医疗文本命名实体识别方法。
背景技术
随着国内电子病例技术的成熟和应用,产生了大量的电子病历数据,非专业人员认识难以有效利用。
命名实体识别技术能够有效的识别并获取电子病历中特定信息,例如病症、诊疗方案、等等,把这些信息识别出来,可以进行进一步的利用,统计这些不同类别的实体信息和分析这些实体信息之间的关系,为诊疗提供精确的数据支持。
目前,人们把深度学习技术应用到中文医学文本上来。但这些深度学习的方法大部分都是面向英文的电子病历的,存在以下问题:
1)使用基于字的词嵌入算法,难以利用词汇的信息。
2)使用基于词的词嵌入算法,会出现分词错误的情况。
3)由于中文的特殊性,带来的一词多义和形声字的问题很难解决。
发明内容
本发明为了克服以上技术的不足,提供了一种提升识别的效果的多特征融合的中文医疗文本命名实体识别方法。
本发明克服其技术问题所采用的技术方案是:
一种多特征融合的中文医疗文本命名实体识别方法,包括:
a)对中文电子病历数据进行预处理;
b)对预处理完成的数据使用jieba分词工具分别按照字级别和词级别进行划分,分别得到字典D c和词典D w
c)对预处理完成的数据插入并细化标签,完成标准化处理,得到数据集F;
d)从新华字典中获取笔画顺序信息,构建新字典D c_o1
e)从新华字典中收集部首信息,构建新字典D c_r,并将D c_r加入到新字典D c_o1中 生成字典D c_o
f)取字典D c_o中x字的笔画n-gram的维度大小为|D c_o|×1的one-hot编码x re、部首维度大小为|D c_o|×1的one-hot编码x be以及字的维度大小为|D c_o|×1的one-hot编码x e_o,通过公式x o=x re+x be+x e_o计算得到相加后的特征融合的输入向量x o,其维度大小为|D c_o|×1,其中x re={x re1...x ren},x ren为第n个n-grams笔画顺序的one-hot编码;
g)通过索引映射将字典D c_o中每个字映射到N维空间,初始化一个N维空间的矩阵作为权重矩阵
Figure PCTCN2021131596-appb-000001
将字典D c_o所有的字映射到矩阵
Figure PCTCN2021131596-appb-000002
每个字与矩阵中的某一列相对应,通过公式
Figure PCTCN2021131596-appb-000003
取出中心字x o对应的字向量x e
h)初始化一个N维空间的矩阵作为权重矩阵
Figure PCTCN2021131596-appb-000004
作为背景字向量的矩阵,通过公式
Figure PCTCN2021131596-appb-000005
将字向量x e与权重矩阵
Figure PCTCN2021131596-appb-000006
中的上下文字做内积运算,得到每个字的计算结果q,式中y 0为背景字索引为0的向量,T为转置;
i)通过公式
Figure PCTCN2021131596-appb-000007
计算得到字向量x e与字向量y 0之间的相似度sim(x e,y 0),
Figure PCTCN2021131596-appb-000008
为x e的嵌入,
Figure PCTCN2021131596-appb-000009
为y 0的嵌入;
j)计算损失函数L,使用随机梯度下降法优化损失函数L,优化后将矩阵
Figure PCTCN2021131596-appb-000010
取出作为多特征字向量矩阵;
k)使用Word2vec训练中文电子病历数据的词向量,得到词向量矩阵
Figure PCTCN2021131596-appb-000011
l)数据集F中的某一输入语句x,x=z 1,z 2,...,z m、x=c 1,c 2,...,c n,其中z j为语句x的第j个字符,j∈{1,...,m},c i为语句x的第i个词,i∈{1,...,n};
m)将字序列x=z 1,z 2,...,z m输入Lattice-Lstm模型的嵌入层,通过公式
Figure PCTCN2021131596-appb-000012
计算每个字符z j被embedding表示为多特征的字向量
Figure PCTCN2021131596-appb-000013
e z为embedding层的权重矩阵;
n)将词序列x=c 1,c 2,...,c n输入Lattice-Lstm模型的嵌入层,通过公式
Figure PCTCN2021131596-appb-000014
计算每个
Figure PCTCN2021131596-appb-000015
被embedding表示为多特征的词向量
Figure PCTCN2021131596-appb-000016
为第b个字符到第e个字符组成的词语,e c为embedding矩阵;
o)将字向量
Figure PCTCN2021131596-appb-000017
输入到Lattice-Lstm模型的Lstm层,通过公式
Figure PCTCN2021131596-appb-000018
计算得到Lstm层中的单词记忆单元
Figure PCTCN2021131596-appb-000019
遗忘门
Figure PCTCN2021131596-appb-000020
输入门
Figure PCTCN2021131596-appb-000021
及遗忘门信息
Figure PCTCN2021131596-appb-000022
式中σ为sigmoid函数,tanh为激活函数,
Figure PCTCN2021131596-appb-000023
为权重矩阵,b z为偏置向量,
Figure PCTCN2021131596-appb-000024
为第e个字符的多特征的字向量,
Figure PCTCN2021131596-appb-000025
为e-1时刻的隐藏层状态,
Figure PCTCN2021131596-appb-000026
为e时刻的隐藏层状态,
Figure PCTCN2021131596-appb-000027
为对e-1时刻的细胞状态进行更新,
Figure PCTCN2021131596-appb-000028
为存储信息的节点;
p)将字典中匹配的结尾是e的词输入到Lattice-Lstm模型中的Word-base cell,通过公式
Figure PCTCN2021131596-appb-000029
计算得到Lattice-Lstm 模型中的单词记忆单元
Figure PCTCN2021131596-appb-000030
遗忘门
Figure PCTCN2021131596-appb-000031
输入门
Figure PCTCN2021131596-appb-000032
及词格信息
Figure PCTCN2021131596-appb-000033
b c为偏置向量,
Figure PCTCN2021131596-appb-000034
为权重矩阵,
Figure PCTCN2021131596-appb-000035
为词组首字的细胞状态,
Figure PCTCN2021131596-appb-000036
为词组首字的隐藏状态;
q)通过公式
Figure PCTCN2021131596-appb-000037
将词格
Figure PCTCN2021131596-appb-000038
融入当前字符Cell计算得到输入门向量
Figure PCTCN2021131596-appb-000039
式中
Figure PCTCN2021131596-appb-000040
为权重矩阵;
r)通过公式
Figure PCTCN2021131596-appb-000041
计算得到
Figure PCTCN2021131596-appb-000042
归一化后的值
Figure PCTCN2021131596-appb-000043
通过公式
Figure PCTCN2021131596-appb-000044
计算得到
Figure PCTCN2021131596-appb-000045
归一化的值
Figure PCTCN2021131596-appb-000046
D为训练语料的全部文本;
s)通过公式
Figure PCTCN2021131596-appb-000047
将句子中以字符e为结尾的词加入词格
Figure PCTCN2021131596-appb-000048
信息后得到
Figure PCTCN2021131596-appb-000049
t)通过公式
Figure PCTCN2021131596-appb-000050
计算隐藏层的输出
Figure PCTCN2021131596-appb-000051
u)通过公式
Figure PCTCN2021131596-appb-000052
计算概率P(y|x),式中
Figure PCTCN2021131596-appb-000053
为第i个隐含层的输出,i∈{1,...,l},l为一句话中字的个数,y′为任意label序列,l i为第i个的输出,
Figure PCTCN2021131596-appb-000054
为CRF模型中l i的参数,
Figure PCTCN2021131596-appb-000055
为CRF模型中每个l i的参数,
Figure PCTCN2021131596-appb-000056
为l i-1到l i的偏差,
Figure PCTCN2021131596-appb-000057
为每个l i-1到l i的偏差,得到的预测的标签序列y=l 1,l 2,...l l为中文电子病历数据的文本命名输出结果。
进一步的,步骤a)中预处理的过程为:对收集的中文电子病历数据使用哈工大停词表去除数据中停用词的干扰,使用opencc工具将所有字符转换成中文简体。
进一步的,步骤d)中扫描新华字典中所有的字符,收集笔画顺序,保持所有的n-gram的长度大于等于3小于等于6,收集对应的笔画顺序n-grams后生成字典D c_b,将字典D c_b与字典D c相加构建新字典D c_o1
进一步的,步骤e)中扫描新华字典中所有的字符,收集字的部首信息,生成字典D c_r,将字典D c_r加入到字典D c_o中。
进一步的,步骤j)中通过公式
Figure PCTCN2021131596-appb-000058
计算得到损失函数L,式中x为当前字,y为上下文字,T(w)为当前词语滑动窗口内的所有词语集合,D为训练语料的全部文本,σ为sigmoid函数,y′为随机选取的字,λ为负样例的个数,E y′~p为y′按照字分布进行的采样,p为负采样分布的指数。 步骤u)中通过公式
Figure PCTCN2021131596-appb-000059
计算得到损失函数L,式中λ为正则化参数,θ为参数集,使用随机梯度下降的方法优化损失函数L。本发明的有益效果是:使用添加了中文偏旁部首以及笔画顺序信息的字向量,对传统的神经网络输入进行改进,使字向量能够更加完整的表征中文病例中字的信息,解决一词多义,形声字的情况,提高模型的准确度。考虑到使用基于字向量的方法很难处理词语之间的信息,但使用基于词向量的方法会出现分词错误的情况,利用lattice-lstm网络的结构特性,添加词的信息,融合字词向量能够很好的解决这类问题。
附图说明
图1为本发明的模型流程图。
具体实施方式
下面结合附图1对本发明做进一步说明。
一种多特征融合的中文医疗文本命名实体识别方法,包括:
a)对中文电子病历数据进行预处理;
b)对预处理完成的数据使用jieba分词工具分别按照字级别和词级别进行划分,分别得到字典D c和词典D w
c)对预处理完成的数据插入并细化标签,完成标准化处理,得到数据集F;
d)从新华字典中获取笔画顺序信息,构建新字典D c_o1
e)从新华字典中收集部首信息,构建新字典D c_r,并将D c_r加入到新字典D c_o1中生成字典D c_o
f)取字典D c_o中x字的笔画n-gram的维度大小为|D c_o|×1的one-hot编码x re、部首维度大小为|D c_o|×1的one-hot编码x be以及字的维度大小为|D c_o|×1的one-hot编码x e_o,通过公式x o=x re+x be+x e_o计算得到相加后的特征融合的输入向量x o,其维度大小为|D c_o|×1,其中x re={x re1...x ren},x ren为 第n个n-grams笔画顺序的one-hot编码;
g)通过索引映射将字典D c_o中每个字映射到N维空间,初始化一个N维空间的矩阵作为权重矩阵
Figure PCTCN2021131596-appb-000060
将字典D c_o所有的字映射到矩阵
Figure PCTCN2021131596-appb-000061
每个字与矩阵中的某一列相对应,通过公式
Figure PCTCN2021131596-appb-000062
取出中心字x o对应的字向量x e
h)初始化一个N维空间的矩阵作为权重矩阵
Figure PCTCN2021131596-appb-000063
作为背景字向量的矩阵,通过公式
Figure PCTCN2021131596-appb-000064
将字向量x e与权重矩阵
Figure PCTCN2021131596-appb-000065
中的上下文字做内积运算,得到每个字的计算结果q,式中y 0为背景字索引为0的向量,T为转置;
i)基于当前字多特征融合的嵌入和上下文词的嵌入,来定义他们之间的相似度,具体的通过公式
Figure PCTCN2021131596-appb-000066
计算得到字向量x e与字向量y 0之间的相似度sim(x e,y 0),
Figure PCTCN2021131596-appb-000067
为x e的嵌入,
Figure PCTCN2021131596-appb-000068
为y 0的嵌入;
j)计算损失函数L,使用随机梯度下降法优化损失函数L,优化后将矩阵
Figure PCTCN2021131596-appb-000069
取出作为多特征字向量矩阵;
k)使用Word2vec训练中文电子病历数据的词向量,得到词向量矩阵
Figure PCTCN2021131596-appb-000070
l)数据集F中的某一输入语句x,x=z 1,z 2,...,z m、x=c 1,c 2,...,c n,其中z j为语句x的第j个字符,j∈{1,...,m},c i为语句x的第i个词,i∈{1,...,n};
m)将字序列x=z 1,z 2,...,z m输入Lattice-Lstm模型的嵌入层,通过公式
Figure PCTCN2021131596-appb-000071
计算每个字符z j被embedding表示为多特征的字向量
Figure PCTCN2021131596-appb-000072
e z为embedding层的权重矩阵;
n)将词序列x=c 1,c 2,...,c n输入Lattice-Lstm模型的嵌入层,通过公式
Figure PCTCN2021131596-appb-000073
计算每个
Figure PCTCN2021131596-appb-000074
被embedding表示为多特征的词向量
Figure PCTCN2021131596-appb-000075
为第b个字符到第e个字符组成的词语,e c为embedding矩阵;
o)Lattice-Lstm在传统的Lstm的基础上拓展了Word-base cell,将字向量
Figure PCTCN2021131596-appb-000076
输入到Lattice-Lstm模型的Lstm层,通过公式
Figure PCTCN2021131596-appb-000077
计算得到Lstm层中的单词记忆单元
Figure PCTCN2021131596-appb-000078
遗忘门
Figure PCTCN2021131596-appb-000079
输入门
Figure PCTCN2021131596-appb-000080
及遗忘门信息
Figure PCTCN2021131596-appb-000081
式中σ为sigmoid函数,tanh为激活函数,
Figure PCTCN2021131596-appb-000082
为权重矩阵,b z为偏置向量,
Figure PCTCN2021131596-appb-000083
为第e个字符的多特征的字向量,
Figure PCTCN2021131596-appb-000084
为e-1时刻的隐藏层状态,
Figure PCTCN2021131596-appb-000085
为e时刻的隐藏层状态,
Figure PCTCN2021131596-appb-000086
为对e-1时刻的细胞状态进行更新,
Figure PCTCN2021131596-appb-000087
为存储信息的节点;
p)将字典中匹配的结尾是e的词输入到Lattice-Lstm模型中的Word-base cell,通过公式
Figure PCTCN2021131596-appb-000088
计算得到Lattice-Lstm模型中的单词记忆单元
Figure PCTCN2021131596-appb-000089
遗忘门
Figure PCTCN2021131596-appb-000090
输入门
Figure PCTCN2021131596-appb-000091
及词格信息
Figure PCTCN2021131596-appb-000092
b c为偏置向量,
Figure PCTCN2021131596-appb-000093
为权重矩阵,
Figure PCTCN2021131596-appb-000094
为词组首字的细胞状态,
Figure PCTCN2021131596-appb-000095
为词组首字的隐藏状态;
q)通过公式
Figure PCTCN2021131596-appb-000096
将词格
Figure PCTCN2021131596-appb-000097
融入当前字符Cell计算得到输入门向量
Figure PCTCN2021131596-appb-000098
式中
Figure PCTCN2021131596-appb-000099
为权重矩阵;
r)通过公式
Figure PCTCN2021131596-appb-000100
计算得到
Figure PCTCN2021131596-appb-000101
归一化后的值
Figure PCTCN2021131596-appb-000102
通过公式
Figure PCTCN2021131596-appb-000103
计算得到
Figure PCTCN2021131596-appb-000104
归一化的值
Figure PCTCN2021131596-appb-000105
D为训练语料的全部文本;
s)通过公式
Figure PCTCN2021131596-appb-000106
将句子中以字符e为结尾的词加入词格
Figure PCTCN2021131596-appb-000107
信息后得到
Figure PCTCN2021131596-appb-000108
t)通过公式
Figure PCTCN2021131596-appb-000109
计算隐藏层的输出
Figure PCTCN2021131596-appb-000110
u)通过公式
Figure PCTCN2021131596-appb-000111
计算 概率P(y|x),式中
Figure PCTCN2021131596-appb-000112
为第i个隐含层的输出,i∈{1,...,l},l为一句话中字的个数,y′为任意label序列,l i为第i个的输出,
Figure PCTCN2021131596-appb-000113
为CRF模型中l i的参数,
Figure PCTCN2021131596-appb-000114
为CRF模型中每个l i的参数,
Figure PCTCN2021131596-appb-000115
为l i-1到l i的偏差,
Figure PCTCN2021131596-appb-000116
为每个l i-1到l i的偏差,得到的预测的标签序列y=l 1,l 2,...l l为中文电子病历数据的文本命名输出结果。
本基于多特征融合的中文医疗文本命名实体识别方法,考虑到中文电子病历语义不清和形声字的情况,针对中文病历领域的特性,使用添加了中文偏旁部首以及笔画顺序信息的字向量,对传统的神经网络输入进行改进,使字向量能够更加完整的表征中文病例中字的信息,解决一词多义,形声字的情况,提高模型的准确度。考虑到使用基于字向量的方法很难处理词语之间的信息,但使用基于词向量的方法会出现分词错误的情况,利用lattice-lstm网络的结构特性,添加词的信息,融合字词向量能够很好的解决这类问题。
优选的,步骤a)中预处理的过程为:对收集的中文电子病历数据使用哈工大停词表去除数据中停用词的干扰,使用opencc工具将所有字符转换成中文简体。进一步的,步骤d)中扫描新华字典中所有的字符,收集笔画顺序,保持所有的n-gram的长度大于等于3小于等于6,收集对应的笔画顺序n-grams后生成字典D c_b,将字典D c_b与字典D c相加构建新字典D c_o1
进一步的,步骤e)中扫描新华字典中所有的字符,收集字的部首信息,生成字典D c_r,将字典D c_r加入到字典D c_o中。
进一步的,步骤j)中通过公式
Figure PCTCN2021131596-appb-000117
计算得到损失函数L,式中x为当前字,y为上下文字,T(w)为当前词语滑动窗口内的所有词语集合,D为训练语料的全部文本,σ为sigmoid函数,为了避免softmax 带来的巨大计算量,采用了负采样的方式,y′为随机选取的字,称为“负样例”,λ为负样例的个数,E y′~p为y′按照字分布进行的采样,p为负采样分布的指数。其中语料中出现次数越多的词语越容易被采样到。模型使用随机梯度下降的方法优化损失函数,使模型达到最好的效果。
进一步的,利用维特比算法输出概率最大的序列,就是最终的标签序列P(y i|x i)进行连乘,得到添加log。通过极大似然估计,加上L2的惩罚参数作为损失函数。具体的:步骤u)中通过公式
Figure PCTCN2021131596-appb-000118
计算得到损失函数L,式中λ为正则化参数,θ为参数集,模型使用随机梯度下降的方法优化损失函数L,使模型达到最好的效果。
最后应说明的是:以上所述仅为本发明的优选实施例而已,并不用于限制本发明,尽管参照前述实施例对本发明进行了详细的说明,对于本领域的技术人员来说,其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (6)

  1. 一种多特征融合的中文医疗文本命名实体识别方法,其特征在于,包括:
    a)对中文电子病历数据进行预处理;
    b)对预处理完成的数据使用jieba分词工具分别按照字级别和词级别进行划分,分别得到字典D c和词典D w
    c)对预处理完成的数据插入并细化标签,完成标准化处理,得到数据集F;
    d)从新华字典中获取笔画顺序信息,构建新字典D c_o1
    e)从新华字典中收集部首信息,构建新字典D c_r,并将D c_r加入到新字典D c_o1中生成字典D c_o
    f)取字典D c_o中x字的笔画n-gram的维度大小为|D c_o|×1的one-hot编码x re、部首维度大小为|D c_o|×1的one-hot编码x be以及字的维度大小为|D c_o|×1的one-hot编码x e_o,通过公式x o=x re+x be+x e_o计算得到相加后的特征融合的输入向量x o,其维度大小为|D c_o|×1,其中x re={x re1…x ren},x ren为第n个n-grams笔画顺序的one-hot编码;
    g)通过索引映射将字典D c_o中每个字映射到N维空间,初始化一个N维空间的矩阵作为权重矩阵
    Figure PCTCN2021131596-appb-100001
    将字典D c_o所有的字映射到矩阵
    Figure PCTCN2021131596-appb-100002
    每个字与矩阵中的某一列相对应,通过公式
    Figure PCTCN2021131596-appb-100003
    取出中心字x o对应的字向量x e
    h)初始化一个N维空间的矩阵作为权重矩阵
    Figure PCTCN2021131596-appb-100004
    作为背景字向量的矩阵,通过公式
    Figure PCTCN2021131596-appb-100005
    将字向量x e与权重矩阵
    Figure PCTCN2021131596-appb-100006
    中的上下文字做内积运算,得到每个字的计算结果q,式中y 0为背景字索引为0的向量,T为转置;
    i)通过公式
    Figure PCTCN2021131596-appb-100007
    计算得到字向量x e与字向量y 0之间的相似度
    Figure PCTCN2021131596-appb-100008
    为x e的嵌入,
    Figure PCTCN2021131596-appb-100009
    为y 0的嵌入;
    j)计算损失函数L,使用随机梯度下降法优化损失函数L,优化后将矩阵
    Figure PCTCN2021131596-appb-100010
    取出作为多特征字向量矩阵;
    k)使用Word2vec训练中文电子病历数据的词向量,得到词向量矩阵
    Figure PCTCN2021131596-appb-100011
    l)数据集F中的某一输入语句x,x=z 1,z 2,...,z m、x=c 1,c 2,...,c n,其中z j为语句x的第j个字符,j∈{1,...,m},c i为语句x的第i个词,i∈{1,...,n};
    m)将字序列x=z 1,z 2,...,z m输入Lattice-Lstm模型的嵌入层,通过公式r i z=e z(z j)计算每个字符z j被embedding表示为多特征的字向量r i z,e z为embedding层的权重矩阵;
    n)将词序列x=c 1,c 2,...,c n输入Lattice-Lstm模型的嵌入层,通过公式
    Figure PCTCN2021131596-appb-100012
    计算每个
    Figure PCTCN2021131596-appb-100013
    被embedding表示为多特征的词向量
    Figure PCTCN2021131596-appb-100014
    为第b个字符到第e个字符组成的词语,e c为embedding矩阵;
    o)将字向量r i z输入到Lattice-Lstm模型的Lstm层,通过公式
    Figure PCTCN2021131596-appb-100015
    计算得到Lstm层中的单词记忆单元
    Figure PCTCN2021131596-appb-100016
    遗忘门
    Figure PCTCN2021131596-appb-100017
    输入门
    Figure PCTCN2021131596-appb-100018
    及遗忘门信息
    Figure PCTCN2021131596-appb-100019
    式中σ为sigmoid函数,tanh为激活函数,
    Figure PCTCN2021131596-appb-100020
    为权重矩阵,b z为偏置向量,
    Figure PCTCN2021131596-appb-100021
    为第e个字符的多特征的字向量,
    Figure PCTCN2021131596-appb-100022
    为e-1时刻的隐藏层状态,
    Figure PCTCN2021131596-appb-100023
    为e时刻的隐藏层状态,
    Figure PCTCN2021131596-appb-100024
    为对e-1时 刻的细胞状态进行更新,
    Figure PCTCN2021131596-appb-100025
    为存储信息的节点;
    p)将字典中匹配的结尾是e的词输入到Lattice-Lstm模型中的Word-base cell,通过公式
    Figure PCTCN2021131596-appb-100026
    计算得到Lattice-Lstm模型中的单词记忆单元
    Figure PCTCN2021131596-appb-100027
    遗忘门
    Figure PCTCN2021131596-appb-100028
    输入门
    Figure PCTCN2021131596-appb-100029
    及词格信息
    Figure PCTCN2021131596-appb-100030
    b c为偏置向量,
    Figure PCTCN2021131596-appb-100031
    为权重矩阵,
    Figure PCTCN2021131596-appb-100032
    为词组首字的细胞状态,
    Figure PCTCN2021131596-appb-100033
    为词组首字的隐藏状态;
    q)通过公式
    Figure PCTCN2021131596-appb-100034
    将词格
    Figure PCTCN2021131596-appb-100035
    融入当前字符Cell计算得到输入门向量
    Figure PCTCN2021131596-appb-100036
    式中
    Figure PCTCN2021131596-appb-100037
    为权重矩阵;
    r)通过公式
    Figure PCTCN2021131596-appb-100038
    计算得到
    Figure PCTCN2021131596-appb-100039
    归一化后的值
    Figure PCTCN2021131596-appb-100040
    通过公式
    Figure PCTCN2021131596-appb-100041
    计算得到
    Figure PCTCN2021131596-appb-100042
    归一化的值
    Figure PCTCN2021131596-appb-100043
    D为训练语料的全部文本;
    s)通过公式
    Figure PCTCN2021131596-appb-100044
    将句子中以字符e为结尾的词加入词格
    Figure PCTCN2021131596-appb-100045
    信息后得到
    Figure PCTCN2021131596-appb-100046
    t)通过公式
    Figure PCTCN2021131596-appb-100047
    计算隐藏层的输出
    Figure PCTCN2021131596-appb-100048
    u)通过公式
    Figure PCTCN2021131596-appb-100049
    计算概率P(y|x),式中
    Figure PCTCN2021131596-appb-100050
    为第i个隐含层的输出,i∈{1,...,l},l为一句话中字的个数,y′为任意label序列,l i为第i个的输出,
    Figure PCTCN2021131596-appb-100051
    为CRF模型中l i的参数,
    Figure PCTCN2021131596-appb-100052
    为CRF模型中每个l i的参数,
    Figure PCTCN2021131596-appb-100053
    为l i-1到l i的偏差,
    Figure PCTCN2021131596-appb-100054
    为每个l i-1到l i的偏差,得到的预测的标签序列y=l 1,l 2,...l l为中文电子病历数据的文本命名输出结果。
  2. 根据权利要求1所述的多特征融合的中文医疗文本命名实体识别方法,其特征在于,步骤a)中预处理的过程为:对收集的中文电子病历数据使用哈工大停词表去除数据中停用词的干扰,使用opencc工具将所有字符转换成中文简体。
  3. 根据权利要求1所述的多特征融合的中文医疗文本命名实体识别方法,其特征在于,步骤d)中扫描新华字典中所有的字符,收集笔画顺序,保持所有的n-gram的长度大于等于3小于等于6,收集对应的笔画顺序n-grams后生成 字典D c_b,将字典D c_b与字典D c相加构建新字典D c_o1
  4. 根据权利要求3所述的多特征融合的中文医疗文本命名实体识别方法,其特征在于,步骤e)中扫描新华字典中所有的字符,收集字的部首信息,生成字典D c_r,将字典D c_r加入到字典D c_o中。
  5. 根据权利要求1所述的多特征融合的中文医疗文本命名实体识别方法,其特征在于:步骤j)中通过公式
    Figure PCTCN2021131596-appb-100055
    计算得到损失函数L,式中x为当前字,y为上下文字,T(w)为当前词语滑动窗口内的所有词语集合,D为训练语料的全部文本,σ为sigmoid函数,y′为随机选取的字,λ为负样例的个数,E y′~p为y′按照字分布进行的采样,p为负采样分布的指数。
  6. 根据权利要求1所述的多特征融合的中文医疗文本命名实体识别方法,其特征在于:步骤u)中通过公式
    Figure PCTCN2021131596-appb-100056
    计算得到损失函数L,式中λ为正则化参数,θ为参数集,使用随机梯度下降的方法优化损失函数L。
PCT/CN2021/131596 2021-05-21 2021-11-19 一种多特征融合的中文医疗文本命名实体识别方法 WO2022242074A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110556687.7 2021-05-21
CN202110556687.7A CN113191150B (zh) 2021-05-21 2021-05-21 一种多特征融合的中文医疗文本命名实体识别方法

Publications (1)

Publication Number Publication Date
WO2022242074A1 true WO2022242074A1 (zh) 2022-11-24

Family

ID=76984598

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/131596 WO2022242074A1 (zh) 2021-05-21 2021-11-19 一种多特征融合的中文医疗文本命名实体识别方法

Country Status (2)

Country Link
CN (1) CN113191150B (zh)
WO (1) WO2022242074A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113191150B (zh) * 2021-05-21 2022-02-25 山东省人工智能研究院 一种多特征融合的中文医疗文本命名实体识别方法
CN117195877B (zh) * 2023-11-06 2024-01-30 中南大学 一种电子病历的词向量生成方法、系统、设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109871538A (zh) * 2019-02-18 2019-06-11 华南理工大学 一种中文电子病历命名实体识别方法
CN110866401A (zh) * 2019-11-18 2020-03-06 山东健康医疗大数据有限公司 基于注意力机制的中文电子病历命名实体识别方法及系统
CN111243699A (zh) * 2020-01-14 2020-06-05 中南大学 基于字词信息融合的中文电子病历实体抽取方法
CN112151183A (zh) * 2020-09-23 2020-12-29 上海海事大学 一种基于Lattice LSTM模型的中文电子病历的实体识别方法
EP3767516A1 (en) * 2019-07-18 2021-01-20 Ricoh Company, Ltd. Named entity recognition method, apparatus, and computer-readable recording medium
CN113191150A (zh) * 2021-05-21 2021-07-30 山东省人工智能研究院 一种多特征融合的中文医疗文本命名实体识别方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391485A (zh) * 2017-07-18 2017-11-24 中译语通科技(北京)有限公司 基于最大熵和神经网络模型的韩语命名实体识别方法
CN111444726B (zh) * 2020-03-27 2024-02-09 河海大学常州校区 基于双向格子结构的长短时记忆网络的中文语义信息提取方法和装置
CN111523320A (zh) * 2020-04-20 2020-08-11 电子科技大学 一种基于深度学习的中文病案分词方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109871538A (zh) * 2019-02-18 2019-06-11 华南理工大学 一种中文电子病历命名实体识别方法
EP3767516A1 (en) * 2019-07-18 2021-01-20 Ricoh Company, Ltd. Named entity recognition method, apparatus, and computer-readable recording medium
CN110866401A (zh) * 2019-11-18 2020-03-06 山东健康医疗大数据有限公司 基于注意力机制的中文电子病历命名实体识别方法及系统
CN111243699A (zh) * 2020-01-14 2020-06-05 中南大学 基于字词信息融合的中文电子病历实体抽取方法
CN112151183A (zh) * 2020-09-23 2020-12-29 上海海事大学 一种基于Lattice LSTM模型的中文电子病历的实体识别方法
CN113191150A (zh) * 2021-05-21 2021-07-30 山东省人工智能研究院 一种多特征融合的中文医疗文本命名实体识别方法

Also Published As

Publication number Publication date
CN113191150B (zh) 2022-02-25
CN113191150A (zh) 2021-07-30

Similar Documents

Publication Publication Date Title
Chang et al. Chinese named entity recognition method based on BERT
CN109635124B (zh) 一种结合背景知识的远程监督关系抽取方法
CN111274806B (zh) 分词和词性识别方法、装置及电子病历的分析方法、装置
Jiang et al. “Low-resource” text classification: A parameter-free classification method with compressors
CN111738003B (zh) 命名实体识别模型训练方法、命名实体识别方法和介质
CN111737496A (zh) 一种电力设备故障知识图谱构建方法
CN109800437A (zh) 一种基于特征融合的命名实体识别方法
WO2022242074A1 (zh) 一种多特征融合的中文医疗文本命名实体识别方法
CN111881256B (zh) 文本实体关系抽取方法、装置及计算机可读存储介质设备
CN113033183B (zh) 一种基于统计量与相似性的网络新词发现方法及系统
Gao et al. Named entity recognition method of Chinese EMR based on BERT-BiLSTM-CRF
CN113011194B (zh) 融合关键词特征和多粒度语义特征的文本相似度计算方法
CN117076653A (zh) 基于思维链及可视化提升上下文学习知识库问答方法
CN112541356A (zh) 一种生物医学命名实体识别的方法和系统
Ren et al. Detecting the scope of negation and speculation in biomedical texts by using recursive neural network
CN111476024A (zh) 一种文本分词方法、装置及模型训练方法
CN111191464A (zh) 基于组合距离的语义相似度计算方法
CN110675962A (zh) 一种基于机器学习和文本规则的中药药理作用识别方法及系统
CN111581943A (zh) 一种基于句子关联图的汉越双语多文档新闻观点句识别方法
Han et al. MAF‐CNER: A Chinese Named Entity Recognition Model Based on Multifeature Adaptive Fusion
CN115169349A (zh) 基于albert的中文电子简历命名实体识别方法
CN114388141A (zh) 一种基于药物实体词掩码和Insert-BERT结构的药物关系抽取方法
Wu et al. A radical-based method for Chinese named entity recognition
Jiang et al. Less is more: Parameter-free text classification with gzip
CN111046665A (zh) 一种领域术语语义漂移抽取方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21940518

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21940518

Country of ref document: EP

Kind code of ref document: A1