GithubHelp home page GithubHelp logo

Comments (5)

ZhixiuYe avatar ZhixiuYe commented on June 6, 2024

这个返回的score是计算的各个segment分类到segment score的得分,这个得分再输入到SCRF中取decode出一个label sequence。两个sent_len是因为我们需要的是从第i个词到第j个词的segment,因此需要两个下标。

from hscrf-pytorch.

AaronWhite95 avatar AaronWhite95 commented on June 6, 2024

这个score的size是batch_sizesent_lensent_lentag_sizetag_size,按照我自己的理解就是代表一个segment从前一个tag转移到当前tag的概率,不知道这么理解对不对。如果是这样的话那按照crf的形式这个是转移矩阵,那还有一个状态矩阵是怎么体现的呢
谢谢

from hscrf-pytorch.

ZhixiuYe avatar ZhixiuYe commented on June 6, 2024

转移矩阵是单独的一个tag_size*tag_size大小的矩阵,这上面说的score都是状态矩阵。状态矩阵是输入到句子通过神经网络算出来的得分;转移矩阵是独立于句子之外的,包含在CRF或SCRF中的可训练参数。

from hscrf-pytorch.

AaronWhite95 avatar AaronWhite95 commented on June 6, 2024

再麻烦问一下,如果score是状态矩阵的话那score的最后为什么要用两维tag_size*tag_size,只表示一个segment的状态用一维不就够了吗。
还有能否问一下,HSCRF的Viterbi算法是怎么写的呢,多了一层循环不太会推导
谢谢

from hscrf-pytorch.

ZhixiuYe avatar ZhixiuYe commented on June 6, 2024

HSCRF的Viterbi算法就是SCRF的Viterbi算法,具体的你可以参考我的代码以及介绍SCRF的相关paper。
上面关于score的说法有点错误,不好意思。你可以从HSCRF_scores这个function中看出,这里的score是将状态矩阵和转移矩阵相结合以后的结果。转移矩阵是transition,状态矩阵并没有显示的写出来,是部分emb_x的加和,具体表达式推荐参考一下论文。

from hscrf-pytorch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.