Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bojone/crf
/ functions
Functions
13 in github.com/bojone/crf
⨍
Functions
13
◇
Types & classes
2
↓ 1 callers
Function
cut
(s, trans)
word_seg.py:111
↓ 1 callers
Function
max_in_dict
(d)
word_seg.py:89
↓ 1 callers
Method
path_score
计算目标路径的相对概率(还没有归一化) 要点:逐标签得分,加上转移概率得分。 技巧:用“预测”点乘“目标”的方法抽取出目标路径的得分。
crf_keras.py:38
↓ 1 callers
Function
train_generator
()
word_seg.py:38
↓ 1 callers
Function
viterbi
(nodes, trans)
word_seg.py:97
Method
__init__
(self)
word_seg.py:137
Method
__init__
ignore_last_label:定义要不要忽略最后一个标签,起到mask的效果
crf_keras.py:12
Method
accuracy
(self, y_true, y_pred)
crf_keras.py:67
Method
build
(self, input_shape)
crf_keras.py:18
Method
call
(self, inputs)
crf_keras.py:51
Method
log_norm_step
递归计算归一化因子 要点:1、递归计算;2、用logsumexp避免溢出。 技巧:通过expand_dims来对齐张量。
crf_keras.py:25
Method
loss
(self, y_true, y_pred)
crf_keras.py:54
Method
on_epoch_end
(self, epoch, logs=None)
word_seg.py:139