⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 labels.tex

📁 隐马尔科夫模型工具箱
💻 TEX
📖 第 1 页 / 共 3 页
字号:
the originals.  This is done by using the \texttt{-l} option.  For example,\begin{verbatim}    HLEd -l newlabs edfile.led l1 l2 l3\end{verbatim}would have the same effect as previously except that the newlabel files would be stored in the directory \texttt{newlabs}.Each edit command stored in an edit file\index{edit file} is identified bya mnemonic consisting of two letters\footnote{Some command names have single letter\index{edit commands!single letter} alternatives for compatibility withearlier versions of \HTK.}and must be stored on a separateline.  The supplied edit commands can be divided into two groups.The first group consist of commands which perform selective changes to specific labels and the second group contains commandswhich perform global transformations.  The reference section defines all of thesecommands.  Here a few examples will be given to illustrate theuse of \htool{HLEd}.As a first example, when using the TIMIT database\index{TIMIT database},  the original 61 phoneme symbol set is often mappedinto a simpler 48 phoneme symbol set.  The aim of this mappingis to delete all glottal stops, replace all closures preceding a voiced stop by a genericvoiced closure (\texttt{vcl}), all closures preceding an unvoiced stop by a genericunvoiced closure (\texttt{cl}) and the different types of silence toa single generic silence (\texttt{sil}).  A \htool{HLEd} script todo this might be\begin{verbatim}    # Map 61 Phone Timit Set -> 48 Phones    SO    DE q    RE cl pcl tcl kcl qcl    RE vcl bcl dcl gcl    RE sil h# #h pau\end{verbatim}The first line is a comment indicated by the initial hash character.The command on the second line is the {\it Sort} command \texttt{SO}\index{so@\texttt{SO} command}.\index{labels!sorting}This is an example of a global command.Its effect is to sort all the labels into time order.Normally the labels in a transcription will already be in time orderbut some speech editors simply output labels in the order that thetranscriber marked them.  Since this would confuse the re-estimationtools, it is good practice to explicitly sort all label files in thisway.The command on the third line is the {\it Delete} command \texttt{DE}\index{de@\texttt{DE} command}.  This isa selective command.  Its\index{labels!deleting}effect is to delete all of the labelslisted on the rest of the command line, wherever they occur.In this case, there isjust one label listed for deletion, theglottal stop  \texttt{q}.Hence, the overall effect of this command will be to delete all occurrencesof the \texttt{q} label in the edited label files.The remaining commands in this example script are {\it Replace} commands\texttt{RE}.  The effect of a Replace command is to substitute the firstlabel following the \texttt{RE}\index{re@\texttt{RE} command} for every occurrence of the remaining labelson that line.\index{labels!replacing}  Thus, for example, the command on the third line causes all occurrences of the labels \texttt{pcl},\texttt{tcl}, \texttt{kcl} or \texttt{qcl} to be replaced by the label \texttt{cl}.To illustrate the overall effect of the above \htool{HLEd} command script ona complete label file, the following \texttt{TIMIT} format label file\begin{verbatim}     0000 2241 h#     2241 2715 w     2715 4360 ow     4360 5478 bcl     5478 5643 b     5643 6360 iy     6360 7269 tcl     7269 8313 t     8313 11400 ay    11400 12950 dcl    12950 14360 dh    14360 14640 h#\end{verbatim}would be converted by the above script to the following\begin{verbatim}          0 1400625 sil     1400625 1696875 w     1696875 2725000 ow     2725000 3423750 vcl     3423750 3526875 b     3526875 3975000 iy     3975000 4543125 cl     4543125 5195625 t     5195625 7125000 ay     7125000 8093750 vcl     8093750 8975000 dh     8975000 9150000 sil \end{verbatim}Notice that label boundaries in TIMIT format are given in terms of samplenumbers (16kHz sample rate), whereas the edited output file is in \HTK\ format in which all times are in absolute 100ns units.  As well as the Replace command, there isalso a {\it Merge} command \texttt{ME}\index{me@\texttt{ME} command}.  This command is used to replace a sequence of labels by a single label.  \index{labels!merging}For example, the following commands would merge the closure and releaselabels in the previous TIMIT transcription into single labels\begin{verbatim}    ME b bcl b    ME d dcl dh    ME t tcl t\end{verbatim}As shown by this example, the label used for the merged sequence can bethe same as occurs in the original but some care is needed since\htool{HLEd} commands are normally applied in sequence.   Thus, a commandon line $n$ is applied to the label sequence that remains after thecommands on lines 1 to $n-1$ have been applied.There is one exception to the above rule of sequential edit commandapplication.  The {\it Change} command \index{labels!changing}\texttt{CH}\index{ch@\texttt{CH} command} provides for contextsensitive replacement.  However, when a sequence of Change commands occurin a script, the sequence is applied as a block so that the contextswhich apply for each command are those that existed just prior to theblock being executed. The Change command takes 4 arguments \texttt{X A YB} such that every occurrence of label \texttt{Y} in the context of\texttt{A \_ B} is changed to the label \texttt{X}.  The contexts\texttt{A} and \texttt{B} refer to sets of labels and  are defined byseparate \textit{Define Context} commands \texttt{DC}\index{dc@\texttt{DC} command}.   The \texttt{CH} and\texttt{DC} commands are primarily used for creating context sensitivelabels.  For example, suppose that a set of context-dependent phonememodels are needed for TIMIT.  Rather than treat all possible contextsseparately and build separate triphones for each  (see below), thepossible contexts  will be grouped into just 5 broad classes: C(consonant), V (vowel), N (nasal), L (liquid) and S (silence). The goalthen is to translate a label sequence such as \texttt{sil b ah t iy n ...}into \texttt{sil+C S-b+V C-ah+C V-t+V C-iy+N V-n+ ...} where the\texttt{-} and \texttt{+} symbols within a label are recognised by \HTK\ as defining the left and right context, respectively. To perform thistransformation, it is necessary to firstly use \texttt{DC} commands todefine the 5 contexts, that is\begin{verbatim}    DC V iy ah ae eh ix ...     DC C t k d k g dh ...     DC L l r w j ...    DC N n m ng ...    DC S h# #h epi ...\end{verbatim}Having defined the required contexts, a change command must bewritten for each context dependent triphone, that is\begin{verbatim}    CH V-ah+V V ah V    CH V-ah+C V ah C    CH V-ah+N V ah N    CH V-ah+L V ah L     ...     etc\end{verbatim}This script will, of course, be rather long (25 $\times$ number ofphonemes) but it can easily be generated automaticaly by a simple program or shell script.The previous example shows how to transform a set of phonemes into acontext dependent set in which the contexts are user-defined.\index{labels!context dependent} Forconvenience, \htool{HLEd} provides a set of global transformation commandsfor converting phonemic transcriptions to conventional left or rightbiphones, or full triphones.  For example, a script containing the single{\it Triphone Conversion} command \texttt{TC}\index{tc@\texttt{TC} command} will convert phoneme files to regulartriphones.  As an illustration, applying the \texttt{TC} command to a filecontaining the sequence \texttt{sil b ah t iy n ...} would  give thetransformed sequence \texttt{sil+b sil-b+ah b-ah+t ah-t+iy t-iy+n iy-n+ ...}. Notice that thefirst and last phonemes in the sequence  cannot be transformed in thenormal way.  Hence, the left-most and right-most contexts of thesestart and end phonemes can be specifiedexplicitly as arguments to the \texttt{TC} commands if required.  Forexample, the command \texttt{TC \# \#} would give the sequence\texttt{\#-sil+b sil-b+ah b-ah+t ah-t+iy t-iy+n iy-n+ ... +\#}.  Also, the contexts at pauses and word boundaries can be blockedusing the\texttt{WB} command.   For example, if \texttt{WB sp} was executed, theeffect of a subsequent \texttt{TC} command on the sequence \texttt{sil b ah t sp iy n ...} would be to give the sequence \texttt{sil+b sil-b+ah b-ah+t ah-t sp iy+n iy-n+ ...}, where \texttt{sp} represents a short pause. Conversely, the \texttt{NB} command can be used to ignore a label as far as context is concerned.  For example,if  \texttt{NB sp} was executed, theeffect of a subsequent \texttt{TC} command on the sequence \texttt{sil b ah t sp iy n ...} would be to give the sequence \texttt{sil+b sil-b+ah b-ah+t ah-t+iy sp t-iy+n iy-n+ ...}.When processing \HTK\ format label files with multiple levels, only the level 1 (i.e. left-most) labels are affected.\index{labels!moving level}  To process a higherlevel, the \textit{Move Level} command \texttt{ML}\index{ml@\texttt{ML} command} should be used.For example, in the script\begin{verbatim}    ML 2    RE one 1    RE two 2    ...\end{verbatim}the Replace commands are applied to level 2 which is the first levelabove the basic level.  The command \texttt{ML 1} returns to the base level.  A complete level can be deleted by the \textit{Delete Level} command \texttt{DL}.  This command canbe given a numeric argument to delete a specific level orwith no argument, the current level is deleted.Multiple levels can also be split into single level alternativesby using the \textit{Split Level} command \texttt{SL}.When processing \HTK\ format files with multiple alternatives,each alternative is processed as though it were a separate file.Remember also that in addition to the explicit \htool{HLEd} commands,levels and alternatives can be filtered on input by setting theconfiguration variables \texttt{TRANSLEV}\index{translev@\texttt{TRANSLEV}} and \texttt{TRANSALT}\index{transalt@\texttt{TRANSALT}} (see section~\ref{s:labstruct}).Finally, it should be noted that most \HTK\ tools require all HMMs used in a system to be defined in\index{HMM lists}a {\it HMM List}.  \htool{HLEd} can be made to automatically generate sucha list as a by-product of editing the label files by using the \texttt{-n} option.  For example, the following command would applythe script \texttt{timit.led} to all files in the directory \texttt{tlabs},write the converted files to the directory \texttt{hlabs}and also write out a list of all new labels in the editedfiles to \texttt{tlist}.\begin{verbatim}    HLEd -n tlist -l hlabs -G TIMIT timit.led tlabs/*\end{verbatim}Notice here that the \texttt{-G} option is used to inform \htool{HLEd} that the format of the source files is \texttt{TIMIT}. This could alsobe indicated by setting the configuration variable \texttt{SOURCELABEL}\index{sourcelabel@\texttt{SOURCELABEL}}.\mysect{Summary}{labelsum}Table~\href{t:labelcparms} lists all of theconfiguration parameters  recognised by \htool{HLabel}along with a brief description.  A missing module name means that it is recognised bymore than one module. \begin{center}\begin{tabular}{|p{1.4cm}|p{3.0cm}|p{6.4cm}|} \hlineModule & Name  & Description  \\ \hline\htool{HLabel} & \texttt{LABELSQUOTE}  & Specify label quote character \\\htool{HLabel} & \texttt{SOURCELABEL}    & Source label format \\\htool{HLabel} & \texttt{SOURCERATE}    & Sample period for SCRIBE format \\\htool{HLabel} & \texttt{STRIPTRIPHONES} & Remove triphone contexts on input \\\htool{HLabel} & \texttt{TARGETLABEL}    &  Target label format\\\htool{HLabel} & \texttt{TRANSALT}  & Filter alternatives on input \\\htool{HLabel} & \texttt{TRANSLEV}  & Filter levels on input \\\htool{HLabel} & \texttt{V1COMPAT}  & Version 1.5 compatibility mode \\               & \texttt{TRACE}           & trace control (default=0) \\ \hline\end{tabular}\tabcap{labelcparms}{Configuration Parameters used with Labels}\end{center}%%% Local Variables: %%% mode: latex%%% TeX-master: "htkbook"%%% End: 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -