[hts-users:00693] Re: presetting parts of question trees
Hi,
Did you try the -p option of HHEd?
Using this option, you can directly use the pattern
as the name of the decision tree instead of the segment names.
e.g.
TB 0 mcep_s2_pau {*-pau+*.state[2].stream[1]}
TB 0 mcep_s2 {(*-a+*,*-i+*,*-u+*,*-e+*,*-o+*,.......).state[2].stream
[1]}
Alternatively, you may modify the HHEd like this
in order to manually define a question for the root node.
QS "is_pause" {*-pau+*}
TB 0 mcep_s2_ {*.state[2].stream[1]} "is_pause"
^^^^^^^^^^
The question for the root node
--- HTKTools/HHEd.c 2007-01-08 13:21:33.000000000 +0000
+++ /Users/junichi/Desktop/temp/htk/HTKTools/HHEd.c 2007-01-08
14:56:13.000000000 +0000
@@ -3138,7 +3140,7 @@ Boolean AnswerQuestion(Node *node, Quest
/* ValidProbNode: set tProb and sProb of given node according to best
possible question which is stored in quest field. */
-void ValidProbNode(Node *node, const double thresh, char *rootqName)
+void ValidProbNode(Node *node, const double thresh)
{
ILink i;
Question *q, *qbest;
@@ -3175,16 +3177,6 @@ void ValidProbNode(Node *node, const dou
occs[0],occs[1]);
fflush(stdout);
}
-
- if(rootqName != NULL){
- if(strcmp(q->qName->name,rootqName) != 0 ){
- if (sProb>LSMALL)
- AddItem(NULL,q,&node->qlist);
- }else{
- best=sProb;
- qbest=q;
- }
- }else{
if (sProb>best) {
if (qbest!=NULL) AddItem(NULL,qbest,&node->qlist);
best=sProb;
@@ -3194,7 +3186,6 @@ void ValidProbNode(Node *node, const dou
AddItem(NULL,q,&node->qlist);
}
}
- }
if (trace & T_TREE_BESTQ) {
if (qbest!=NULL)
printf(" BestQ %20s LogL %6.3f Imp %8.2f\n",
@@ -3534,7 +3525,7 @@ void TieLeafNodes(Tree *tree, char *macR
the actual clusters in rlist, the number of clusters
in numCl. The value of threshold determines when to stop.
macRoot is the root prefix of the name to use in the tie */
-void BuildTree (ILink ilist, double threshold, char *macRoot, char
*pattern, char *rootqName)
+void BuildTree (ILink ilist, double threshold, char *macRoot, char
*pattern)
{
int i,j,l,s,m,N,snum,state,numItems,numParam,count;
char buf[MAXSTRLEN];
@@ -3654,11 +3645,11 @@ void BuildTree (ILink ilist, double thre
tree->baseId->name,state,numItems,cprob/node-
>occ,node->occ);
fflush(stdout);
}
- ValidProbNode(node,threshold,rootqName);
+ ValidProbNode(node,threshold);
/* Now build the actual tree by repeated node splitting */
snum=0;
- node=FindBestSplit(tree->leaf,(rootqName==NULL)?threshold:0);
+ node=FindBestSplit(tree->leaf,threshold);
while(node != NULL) {
node->snum=snum++; node->quest->used=TRUE;
if (trace & T_DET) {
@@ -3674,8 +3665,8 @@ void BuildTree (ILink ilist, double thre
fflush(stdout);
}
SplitTreeNode(tree,node);
- ValidProbNode(node->yes,threshold,NULL);
- ValidProbNode(node->no, threshold,NULL);
+ ValidProbNode(node->yes,threshold);
+ ValidProbNode(node->no,threshold);
FreeItems(&node->qlist);
AddLeafList(node->yes,tree,threshold);
@@ -6095,7 +6084,6 @@ void TreeBuildCommand(void)
char *pattern, *p; /* pattern of items to use */
float thresh = 0.0;
int s;
- int ch;
ClearSet(streams);
@@ -6136,25 +6124,8 @@ void TreeBuildCommand(void)
for (s=1;s<=hset->swidth[0];s++)
streams.set[s] = TRUE;
- do {
- ch = GetCh(&source);
- if (ch=='\n') break;
- }
- while(ch!=EOF && isspace(ch));
- UnGetCh(ch,&source);
- if (ch!='\n') { /* Expicit root splitting */
- char rootqName[MAXSTRLEN]; /* name of question to use root
splitting */
- ChkedAlpha("question for root splitting ",rootqName);
- if (trace & T_BID) {
- printf("Question %s are used for root splitting \n",rootqName);
- fflush(stdout);
- }
- /* Do Tree based clustering */
- BuildTree(ilist, (double)thresh, macName, pattern, rootqName);
- }else{
/* Do Tree based clustering */
- BuildTree(ilist, (double)thresh, macName, pattern, NULL);
- }
+ BuildTree(ilist, (double)thresh, macName, pattern);
}
/* ------------- AU - Add Unseen Triphones Command --------- */
Regards,
Junichi Yamagishi
CSTR
On 2007/05/30, at 11:42, Nicholas Volk wrote:
Hi,
I have certain educated guesses on what nodes should work fine in
my dur/lf0/mcp trees.
Therefore, I would like to force my duration trees always to begin
with
a certain question, let's say
QS "is_pause" {*-pau+*}
Is there any easy way to build a tree where root node (and
hopefully it's
daughters as well) could be predetermined?
(The patterns I'd like to use are not always segment names.)
br,
Nicholas Volk
- References
-
- [hts-users:00692] presetting parts of question trees, Nicholas Volk