ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

NetWork中NetNode的类型

2021-06-15 13:29:58  阅读:154  来源: 互联网

标签:typedef word NetWork Pron NetNode hmm 类型 struct


/* Types of node that can appear in the network */
enum {
   n_unused,            /* Node Instance not yet assigned */
   n_hmm=2,             /* Node Instance represents HMM */
   n_word=4,            /* Node Instance represents word end (or null) */
   n_tr0=4,             /* Entry token reaches exit in t=0 */
   n_wd0=1,             /* Exit token reaches word node in t=0 */
   n_wdstart=8,         /* Temporary wdstart node */
   n_nocontext=15,      /* binary and with this to remove context ids */
   n_lcontext=16,       /* Multiplication factor for context id */
   n_rcontext=16384     /* Multiplication factor for context id */
};
typedef int NetNodeType; 

上面是NetNode的类型,其中后四个比较少见,可以暂时不考虑。

最主要的、数量最多的就是n_hmm和n_word,分别代表hmm模型节点和词节点。也决定着NetNode里的联合体info将呈现HLink还是Pron。

struct _NetNode {
   NetNodeType type;    /* Type of this node (includes context) */
   union {
      HLink  hmm;       /* HMM (physical) definition */
      Pron   pron;      /* Word represented (may == null) */
   }
   info;                /* Extra information specific to type of node */
   char    *tag;        /* Semantic tagging information */
   int nlinks;          /* Number of nodes connected to this one */
   NetLink *links;      /* Array[0..nlinks-1] of links to connected nodes */
   NetInst *inst;       /* Model Instance (if one exists, else NULL) */   
   NetNode *chain;
   int aux;
};

HLink指向hmm对象,Pron指向WordPron对象。

typedef HMMDef * HLink;

typedef struct {
   struct _HMMSet *owner;  /* owner of this model */
   short numStates;        /* includes entry and exit states */
   StateElem *svec;        /* array[2..numStates-1] of StateElem */  
   SVector dur;            /* vector of model duration params, if any */   
   SMatrix transP;         /* transition matrix (logs) */
   int tIdx;               /* Transition matrix index */
   int nUse;               /* num logical hmm's sharing this def */
   Ptr hook;               /* general hook */
} HMMDef;
typedef struct _WordPron  *Pron;

typedef struct _WordPron{   /* storage for each pronunciation */
   short pnum;     /* Pronunciation number 1..nprons */
   short nphones;  /* Number of phones in pronuciation */
   LabId *phones;  /* Array[0..nphones-1] of phones */
   LogFloat prob;  /* Log probability of pronunciation */
   LabId outSym;   /* Output symbol generated when pronunciation recognised */
   Word word;      /* Word this is a pronuciation of */
   Pron next;      /* Next pronunciation of word */
   void *aux;      /* hook for temp info */
} WordPron;

它们在识别中起不同的作用。

除此之外,还有n_tr0表明这个节点是Tee模型,就是它对应的hmm模型的第一个入口状态可以直接跳到最后一个出口状态。

n_wd0表明token传递到词边界类型。这种情况下,首先它得是hmm模型,也是type&n_hmm不为零,然后分两个情况

标签:typedef,word,NetWork,Pron,NetNode,hmm,类型,struct
来源: https://blog.csdn.net/hjx5200/article/details/117822540

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有