the data format of Htkmlfreader
Hollow all,I want to analyse ECG signal using the cntk, but there are no existing reader which designed for existing ECG format. What I gonna to do is using the HTKMLFreader instead. I have already chack the .list .scp .mlf and .chunk file. Thereinto ,'list' file is very easy to find out .The problem is the format of other files especially the 'chunk' file. Is there anyone who know the format of other files,or who know where to find out the format. THANKS Oscar Zhang
The format of the HTKMLFReader comes from HTK. Please do a web search for HTKBook.
Basically, SCP lists all files you want to process, using this syntax:
id=pathname
I suggest to place the SCP file next to the features. Then you can use the more convenient format:
id=.../filename
where ... refers to the directory of the SCP file.
The MLF lists the labels, using this syntax:
#!MLF!#
"id"
labelBegin1 labelEnd1 label1
labelBegin2 labelEnd2 label1
...
.
"id"
labelBegin1 labelEnd1 label1
labelBegin2 labelEnd2 label1
...
.
...
i.e. one .-terminated section per input file, and one line per token. The label times are given in a time base of 10e-7, and speech frames are normally 10e-2, so please append 5 zeroes to every time index. Here is an actual example; note that everything after the 3rd column is ignored by CNTK:
#!MLF!#
"DanPhillips_2010X_09667100000_09671500000.lab"
0 100000 sil_s2 34.637276 sil 34.025116 !silence
100000 200000 b_s2.204 23.382130 sil-b+ax 56.846596 but
200000 300000 b_s3.286 20.942776
300000 400000 b_s4.307 12.521690
400000 500000 ax_s2.867 18.643864 b-ax+t 59.727169
500000 600000 ax_s3.352 13.306161
600000 700000 ax_s4.968 27.777145
700000 800000 t_s2.776 22.857733 ax-t+sil 75.242661
800000 900000 t_s3.891 21.147722
900000 1000000 t_s4.442 31.237209
1000000 1100000 sil_s2 25.725779 sil 1158.572510 !silence
1100000 3400000 sil_s3 843.169128
3400000 3600000 sil_s2 51.609562
3600000 4100000 sil_s3 193.558182
4100000 4200000 sil_s2 45.121952
.
"DanPhillips_2010X_09673400000_09725300000.lab"
0 100000 sil_s2 20.797060 sil 20.184900 !silence
100000 200000 dh_s2.13 -4.379911 sil-dh+ax -7.592157 that\'s
200000 300000 dh_s3.123 -1.974411
300000 400000 dh_s4.263 -1.237834
...
The chunk files have two versions, archives and individual files. Individual files are basically column-major matrices of float32, with a 12-byte header that contains sample size and number of samples. I suggest to start with individual files. The header:
struct fileheader
{
int nsamples;
int sampperiod;
short sampsize;
short sampkind;
sampsize is the size of a vector in bytes (=4 * feature dimension), sampkind should be set to 9 (USER). I think sampperiod should be 100000.
Let me know if this helps.
Yes,it works!Thanks for your help。