Comments (5)
这个返回的score是计算的各个segment分类到segment score的得分,这个得分再输入到SCRF中取decode出一个label sequence。两个sent_len是因为我们需要的是从第i个词到第j个词的segment,因此需要两个下标。
from hscrf-pytorch.
这个score的size是batch_sizesent_lensent_lentag_sizetag_size,按照我自己的理解就是代表一个segment从前一个tag转移到当前tag的概率,不知道这么理解对不对。如果是这样的话那按照crf的形式这个是转移矩阵,那还有一个状态矩阵是怎么体现的呢
谢谢
from hscrf-pytorch.
转移矩阵是单独的一个tag_size*tag_size
大小的矩阵,这上面说的score都是状态矩阵。状态矩阵是输入到句子通过神经网络算出来的得分;转移矩阵是独立于句子之外的,包含在CRF或SCRF中的可训练参数。
from hscrf-pytorch.
再麻烦问一下,如果score是状态矩阵的话那score的最后为什么要用两维tag_size*tag_size,只表示一个segment的状态用一维不就够了吗。
还有能否问一下,HSCRF的Viterbi算法是怎么写的呢,多了一层循环不太会推导
谢谢
from hscrf-pytorch.
HSCRF的Viterbi算法就是SCRF的Viterbi算法,具体的你可以参考我的代码以及介绍SCRF的相关paper。
上面关于score的说法有点错误,不好意思。你可以从HSCRF_scores
这个function中看出,这里的score是将状态矩阵和转移矩阵相结合以后的结果。转移矩阵是transition,状态矩阵并没有显示的写出来,是部分emb_x的加和,具体表达式推荐参考一下论文。
from hscrf-pytorch.
Related Issues (20)
- asking for the cuda OOM questions HOT 1
- tried to construct a tensor HOT 3
- What is the dataset? HOT 1
- version of PyTorch HOT 2
- Have you tried this method on a Chinese dataset? HOT 1
- sequence lenght mismatch HOT 1
- no
- Can you offer me the check point files? HOT 2
- out of memory HOT 4
- Question about scrf_to_crf in utils.py HOT 1
- logalpha initialize HOT 1
- Why the CoNLL 2003 NER dataset isn't annotated by BIOES tags as the paper described? HOT 2
- 请问有tensorflow版本的代码吗?
- 如何将HSCRF模型放入自己的模型做分类器使用?谢谢!
- 关于模型9
- 解释一下score,谢谢
- What is the format of the dataset? HOT 2
- Goldfactors format HOT 2
- How to use loss from HSCRF? HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hscrf-pytorch.