小黑NER旷日持久战:Lattice LSTM
文章平均质量分 53
爱喝喜茶爱吃烤冷面的小黑黑
这个作者很懒,什么都没留下…
展开
-
“疫气疯发“小黑戴面具死磕:Lattice整体模型
1.代码原理(1).以时间步t的流程图(2).举个栗子MultiInputLSTMCell,WordLSTMCell详见前面博客!!!2.代码实践import torchimport torch.nn as nnimport numpy as npimport torch.autograd as autogradfrom LatticeLSTM.model.latticelstm import MultiInputLSTMCell,WordLSTMCelldef init_list原创 2022-03-18 15:47:54 · 524 阅读 · 0 评论 -
小黑稳住死磕:MultiInputLSTMCell
1.MultiInputLSTMCell原理(1) 该字符不是某个词语结尾的情况:(2) 该字符是某个词语结尾的情况:其中:2.MultiInputLSTMCell代码import torch.nn as nnfrom torch.nn import init,functionalimport torchclass MultiInputLSTMCell(nn.Module): def __init__(self,input_size,hidden_size,use_bia原创 2022-03-16 22:36:10 · 539 阅读 · 0 评论 -
小黑公式与代码力量积蓄:WordLSTMCell
1.WordCell原理图2.WordCell门控单元原始公式:ib,ew=σ(Wi,exb,ew+Wi,bhb,c+bi)i_{b,e}^{w} = \sigma(W_{i,e}x_{b,e}^{w} + W_{i,b}h_{b,c} + b_{i})ib,ew=σ(Wi,exb,ew+Wi,bhb,c+bi)fb,ew=σ(Wf,exb,ew+Wf,bhb,c+bf)f_{b,e}^{w} = \sigma(W_{f,e}x_{b,e}^{w} + W_{f,b}h_{b,c} +原创 2022-03-14 20:19:39 · 748 阅读 · 0 评论 -
小黑模块代码分析:Tire Tree
示意图:import collections# Tire结点class TireNode(object): def __init__(self): self.children = collections.defaultdict(TireNode) self.is_word = False # Tire Treeclass Tire(object): def __init__(self): self.root = T原创 2022-03-09 13:24:13 · 238 阅读 · 0 评论