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

📄 openviron.tex

📁 该压缩包为最新版htk的源代码,htk是现在比较流行的语音处理软件,请有兴趣的朋友下载使用
💻 TEX
📖 第 1 页 / 共 3 页
字号:
%/* ----------------------------------------------------------- */%/*                                                             */%/*                          ___                                */%/*                       |_| | |_/   SPEECH                    */%/*                       | | | | \   RECOGNITION               */%/*                       =========   SOFTWARE                  */ %/*                                                             */%/*                                                             */%/* ----------------------------------------------------------- */%/* developed at:                                               */%/*                                                             */%/*      Speech Vision and Robotics group                       */%/*      Cambridge University Engineering Department            */%/*      http://svr-www.eng.cam.ac.uk/                          */%/*                                                             */%/*      Entropic Cambridge Research Laboratory                 */%/*      (now part of Microsoft)                                */%/*                                                             */%/* ----------------------------------------------------------- */%/*         Copyright: Microsoft Corporation                    */%/*          1995-2000 Redmond, Washington USA                  */%/*                    http://www.microsoft.com                 */%/*                                                             */%/*          2001-2002 Cambridge University                     */%/*                    Engineering Department                   */%/*                                                             */%/*   Use of this software is governed by a License Agreement   */%/*    ** See the file License for the Conditions of Use  **    */%/*    **     This banner notice must not be removed      **    */%/*                                                             */%/* ----------------------------------------------------------- */%% HTKBook - Steve Young 15/11/95%\mychap{The Operating Environment}{openviron}\sidepic{Tool.shell}{80}{This chapter discusses the various ways of  controlling the operation of\HTK\ tools along with related aspects of file system organisation, errorreporting and memory management.   All of the operating system\index{operating system} and userinterface functions are provided by the \HTK\ module \htool{HShell}. Memory management is a low level function which is largely invisible tothe user, but it is useful to have a basic understanding of it in order toappreciate memory requirements and interpret diagnostic output fromtools.  Low level memory management in \HTK\ is provided by\htool{HMem} and the management of higher level structures such as vectorsand matrices is provided by \htool{HMath}.}\index{hshell@\htool{HShell}}\index{hmath@\htool{HMath}}\index{hmem@\htool{HMem}}The behaviour of a \HTK\ tool depends on three sources of information.Firstly,all \HTK\ tools are executed by issuing commands to the operatingsystem shell.  Each command typically contains the names of the various files that thetool needs to function and a number of optional arguments which control the detailed behaviour of the tool.  Secondly, as noted in chapter~\ref{c:htkoview} and shown in the adjacent figure, every \HTK\ tool uses a setof standard library modules to interface to the various file types andto connect with the outside world.  Many of these modules can becustomised by setting parameters in a {\it configuration file}.Thirdly, a small number of parameters are specified usingenvironment variables.  Terminal output mostly depends on the specific tool being used, however, thereare some generic output functions which are provided by the librarymodules and which are therefore common across tools.  These includeversion reporting, memory usage and error reporting.Finally, \HTK\ can read and write most data sources through pipes\index{pipes} as an alternativeto direct input and output from data files.  This allows filters to be used, and in particular, it allows many of the externalfiles used by \HTK\ to be stored directly in compressed form and then decompressed\textit{on-the-fly} when the data is read back in.All of the above is discussed in more detail in the following sections.\mysect{The Command Line}{cmdline}The general form of command line for invoking a tool is\footnote{All of the examples in this book assume theUNIX Operating System and the C Shell but the principles apply toany OS which supports hierarchical files and command line arguments}\index{command line!arguments}\index{command line!options}\begin{verbatim}           tool [options] files ...\end{verbatim}Options always consist of a dash followed by a single letter.  Some optionsare followed by an argument as follows\begin{tabbing}+++++ \= ++++++++++++ \=  \kill\>           \texttt{-i} \>  - a switch option \\\>           \texttt{-t 3} \> - an integer valued option \\\>           \texttt{-a 0.01} \> - a float valued option \\\>           \texttt{-s hello} \> - a string valued option \end{tabbing}   Option names consisting of a capital letter are common across all tools(see section~\ref{s:stdopts}).Integer arguments\index{command line!integer argument formats} may be given in any of the standard C formats, for example,\texttt{13}, \texttt{0xD} and \texttt{015} all represent the same number.Typing the name of a tool on its own always causes a short summary ofthe command line options to be printed in place of its normaloperation.  For example, typing\begin{verbatim}    HERest\end{verbatim}would result in the following output\begin{verbatim}    USAGE: HERest [options] hmmList dataFiles...     Option                                   Default     -c f    Mixture pruning threshold          10.0     -d s    dir to find hmm definitions       current     -m N    set min examples needed per model   3     -o s    extension for new hmm files        as src     -p N    set parallel mode to N             off     ...\end{verbatim}The first line shows the names of the required files and the restconsists of a listing of each option, its meaning, and its defaultvalue.The precise naming convention for specifying files depends on the operatingsystem being used, but \HTK\ always assumes the existence of a hierarchicalfile system and it maintains a distinction between directory pathsand file names.In general, a file will be located either inthe current directory, some subdirectory of the current directory or somesubdirectory of the root directory.  For example, in the command\begin{verbatim}      HList s1 dir/s2 /users/sjy/speech/s3\end{verbatim}file \texttt{s1} must be in the current directory, \texttt{s2} must be in thedirectory \texttt{dir} within the current directory and \texttt{s3} must be in thedirectory \texttt{/users/sjy/speech}.Some tools allow directories to be specified via configurationparameters and command line options.  In all cases, the final pathcharacter (eg / in UNIX) need not (but may be)included.  For example, both of the following are acceptable and haveequivalent effect\begin{verbatim}      HInit -L mymodels/new/  hmmfile data*      HInit -L mymodels/new   hmmfile data*\end{verbatim}  where the \texttt{-L} option specifies the directory in which to find the label files associated with the data files. \mysect{Script Files}{script}Tools which require a potentially very long list of files (e.g.\ trainingtools) always allow the files to be specified in a script\index{files!script}file\index{script files} via the \texttt{-S} option instead of via the commandline.\index{standard options!aaas@\texttt{-S}}This is particularly useful when runningunder an OS with limited file name expansion capability.  Thus, for example,\htool{HInit}\index{hinit@\htool{HInit}} may be invoked by either\begin{verbatim}     HInit hmmfile s1 s2 s3 s4 s5 ....\end{verbatim}  or\begin{verbatim}     HInit -S filelist hmmfile\end{verbatim}          where \texttt{filelist} holds the list of files \texttt{s1}, \texttt{s2}, etc.Each file listed in a script should be separated by white space or a new line.Usually, files are listed on separate lines, however, when using\htool{HCopy}\index{hcopy@\htool{HCopy}} which read pairs of files as itsarguments, it is normal to write each pair on a single line.  Script filesshould only be used for storing ellipsed\index{command line!ellipsed arguments}file list arguments. Note that shell meta-characters should not beused in script files and will not be interpreted by the \HTK\ tools.Starting with \HTK\ 3.1 the syntax of script fies has been extended.In addition to directly specifying the name of a physical file it ispossible to define aliases and to select a segment from a file. Thegeneral syntax of an extended filename \index{extended filenames} is\begin{verbatim}     logfile=physfile[s,e]   \end{verbatim}where \texttt{logfile} is the logical filename used by the HTK toolsand will appear in mlf files and similar. \texttt{physfile} is thephysical name of the actual file on disk that will be accessed and\texttt{s} and \texttt{e} are indices that can be used to select onlya segment of the file. One example of a use of this feature is theevaluation of different segmentations of the audio data. A newsegmentation can be used by creating a new script file without havingto create multiple copies of the data.A typical script file might look like:\begin{verbatim}s23-0001-A_000143_000291.plp=/data/plp/complete/s23-0001-A.plp[143,291]s23-0001-A_000291_000500.plp=/data/plp/complete/s23-0001-A.plp[291,500]s23-0001-A_000500_000889.plp=/data/plp/complete/s23-0001-A.plp[500,889]\end{verbatim}\mysect{Configuration Files}{config}Configuration files\index{configuration files|(}\index{files!configuration} are used for customising the \HTK\ working environment.They consist of a list of parameter-values pairs along with an optionalprefix which limits the scope of the parameter to a specific moduleor tool.The name of a configuration file can be specified explicitly on thecommand line using the \texttt{-C}\index{standardoptions!aaac@\texttt{-C}} command.  For example, when executing\begin{verbatim}    HERest ... -C myconfig  s1 s2 s3 s4 ...\end{verbatim}The operation of \htool{HERest} will depend on the parameter settingsin the file \texttt{myconfig}.    When an explicit configuration file is specified, only those parameters mentionedin that file are actually changed and all other parameters retain theirdefault values.  These defaults are built-in.  However, user-defined defaultscan be set by assigning the name of a default configuration file tothe environment variable \texttt{HCONFIG}\index{HCONFIG@\texttt{HCONFIG}}.\index{configuration files!default}Thus, for example, using the UNIX C Shell, writing\begin{verbatim}    setenv HCONFIG myconfig    HERest ... s1 s2 s3 s4 ...\end{verbatim}would have an identical effect to the preceding example.  However, in thiscase, a further refinement of the configuration values is possible sincethe opportunity to specify an explicit configuration file on the commandline remains.  For example, in\begin{verbatim}    setenv HCONFIG myconfig    HERest ... -C xconfig  s1 s2 s3 s4 ...\end{verbatim}\sidefig{Config}{60}{Defining a Configuration}{2}\noindentthe parameter values in \texttt{xconfig} will over-ride those in \texttt{myconfig} which in turn will over-ride the built-in defaults.In practice, most \HTK\ users will set general-purposedefault configuration values using \texttt{HCONFIG} and will then over-ridethese as required for specific tasks using the \texttt{-C} command line option.This is illustrated in Fig.~\href{f:Config} where the darkened rectanglesindicate \textit{active} parameter definitions.Viewed from above, 

⌨️ 快捷键说明

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