Speech Recognition Tools

Size: px
Start display at page:

Download "Speech Recognition Tools"

Transcription

1 Speech Recognition Tools Mark Hasegawa-Johnson July 17, Bash, Sed, Awk 1.1 Installation If you are on a unix system, bash, sed, gawk, and perl are probably already installed. If not, ask your system administrator. If you are on Windows, download the Cygwin setup program from cygwin installation can be run as many times as you like; anything already installed on your PC will not be re-installed. In the screen that asks you which pieces of the OS you want to install, be sure to select (DOC) (man), (Interpreters) (gawk,perl), and (TEXT) (less). I also recommend (Math) (bc), a simple text-based calculator, and (Network) (inetutils,openssh). You can also install a complete X-windows server and set of clients from (XFree86) (fvwm,lesstif,xfree86-base,xfree86-startup,etc.), allowing you to (1) install X-based programs on your PC, and (2) run X-based programs on any unix computer on the network, with I/O coming from windows on your PC. Setting up X requires a little extra work; see If cygwin is installed in your computer in the directory c:/cygwin, it will create a stump of a unix hierarchy starting in that directory. For example, the directory c:/cygwin/usr/local/bin is available under cygwin as /usr/local/bin. Arbitrary directories elsewhere on your c: drive are available as /cygdrive/c/.... In order to use cygwin effectively, you need to set the environment variables HOME (to specify your home directory), DISPLAY (if you are using X-windows), and most importantly, PATH (to specify directories that should be searched for useful programs. This list should include at least /bin;/usr/bin;/usr/local/bin;/usr/x11r6/bin). In order to use bash, sed, awk, and perl, you will also need a good ASCII text editor. You can download Xemacs from Reading Assignments Manual pages are available, among other places, at If your computer is set up correctly, you can also read the bash man page by typing man bash at the cygwin/bash prompt. Read the bash manual page, sections: (Basic Shell Features) (Shell Syntax, Shell Commands, Shell Parameters, Shell Expansions). (Shell Builtins) (Bourne Shell Builtins, Bash Conditional Expressions, Shell Arithmetic, Shell Scripts). Alternatively, you can try reading the tutorial chapter in the O Reilly bash book. Read the sed manual page, or the sed tutorial chapter in the O Reilly sed and awk book. You may eventually want to learn gawk, but it s not required. The section of the gawk man page called Getting Started with awk is pretty good. So are the tutorial chapters in the O Reilly sed and awk book. 1.3 A bash/sed example Why not use C all the time? The answer is that some tasks are easier to perform with other programming languages: Manipulate file hierarchies: use bash and sed. 1

2 (Simple manipulation of tabular text files: gawk) Manipulate text files: use perl. Manipulate non-text files: use C. perl can do any of these things, but isn t very efficient for numerical calculations. C can also do any of the things listed, but perl has many builtin tools for string manipulation, so it s worthwhile to learn perl. gawk is easier than perl for simple manipulation of tabular text; it s up to you whether or not you want to try learning it. bash is a POSIX-compliant command interpreter, meaning that, like the DOSshell, you can type in a program name, and the program will run. Unlike the DOSshell, bash is also a pretty good programming language (not as good as BASIC or perl, but better than DOSshell or tcsh). For example, suppose you want to search through the entire /data/timit/train hierarchy 1, apply the C program extract to all WAV files in order to create MFC files, and create a file with extension TRP containing only the third column of each PHN file, and then move all of the resulting files to a directory hierarchy under /data/newfiles/train (but the new directory hierarchy doesn t exist yet). You could do all that by entering the following, either at the bash command prompt or in a shell script: if [! -e ${HOME/newfiles/train ]; then mkdir ${HOME/newfiles; mkdir ${HOME/newfiles/train; fi for dr in dr{1,2,3,4,5,6,7,8; do if [! -e ${HOME/newfiles/train/${dr ]; then echo mkdir ${HOME/newfiles/train/${dr; mkdir ${HOME/newfiles/train/${dr; fi for spkr in ls ${HOME/timit/train/${dr ; do if [! -e ${HOME/newfiles/train/${dr/${spkr ]; then echo mkdir ${HOME/newfiles/train/${dr/${spkr; mkdir ${HOME/newfiles/train/${dr/${spkr; fi cd ${HOME/timit/train/${dr/${spkr; for file in ls ; do case ${file in *.wav *.WAV ) MFCfile=${HOME/newfiles/train/${dr/${spkr/ echo ${file sed s/wav/mfc/;s/wav/mfc/ ; echo Copying file ${PWD/${file into file ${MFCfile; extract ${file ${MFCfile;; *.phn *.PHN ) TRPfile=${HOME/newfiles/train/${dr/${spkr/ echo ${file sed s/phn/trp/;s/phn/trp/ ; echo Extracting third column of file ${PWD/${file into file ${TRPfile; gawk {print $3 ${file > ${TRPfile; esac done done done Once you have created the entire new hierarchy, you can list the whole hierarchy using ls -R ${HOME/newfiles less 1 There are several copies of TIMIT floating around the lab. You can also buy your own copy for $100 from or download individual files from that web site for free. 2

3 You may have noticed by now that bash suffers from cryptic syntax. bash inherits syntax from sh, a command interpreter written at AT&T in the days when every ASCII character had to be chiseled on stone tablets in triplicate; thus bash uses characters economically. Three rules will help you to use bash effectively: 1. Keep in mind that,, and mean very different things. { and ${ mean very different things. [ standing alone is a synonym for the command test. 2. When trying to figure out how bash parses a line, you need to follow the seven steps of command expansion in the same order that bash follows them: brace expansion, tilde expansion, variable expansion, command substitution, arithmetic expansion, word splitting, and filename expansion, in that order. No, really, I m serious. Trying to read bash as pseudo-english leads only to frustration. 3. When writing your own bash scripts, trial and error is usually the fastest method. Use the echo command frequently, with appropriate variable expansions at each level, so you can see what bash thinks it is doing. About gawk: the only thing you absolutely need to know about gawk is that if you type the following command into the bash prompt, the file foo.txt will contain the M th, N th, and P th columns from the file bar.txt (where M,N,and P should be any single digits): gawk {printf("%s\t%s\t%s\n",$m,$n,$p) bar.txt > foo.txt 1.4 Homework Assignment Create a bash shell script that does the following things. Note that if you don t have the Switchboard transcription files, you can download them from Find the word transcription file corresponding to the A side of every conversation in Switchboard. Use gawk to copy the 2nd, 3rd, and 4th columns of that file to a new file that has the same basic filename, but resides in the directory $HOME/switchboard/A. Do NOT create subdirectories under this directory your goal is to get all of the side-a word transcriptions into the same directory. Do the same thing to the side-b transcriptions. Put them into $HOME/switchboard/B. 3

4 2 Perl 2.1 Reading Chapter 1 of Programming Perl by Larry Wall and Randall Schwartz (this book is sometimes available on-line at perl.com; in the perl community, it is called The Camel Book in order to distinguish it from all of the other perl books available). Larry Wall (the author of perl, as well as the author of the book) is an occasional linguist with a good sense of humor. This chapter is possibly the best written introduction to perl data structures and control flow, and contains better documentation on blocks, loops, and control flow statements (if, unless, while, until) than the man pages. The manual pages are available in HTML format on-line at Download the gzipped tar file, and unpack it on your own PC, so that you can keep it open while you program. You can read the manual pages using man under cygwin, but it is much easier to navigate this complicated document set using HTML. Before programming, you should read Chapter 1 of the Camel Book, plus the perldata man page and the first halves of the perlref and perlsub manual pages. While programming, you should have an HTML browser open so that you can easily look for useful information in the three manual pages just listed, and also in the perlsyn, perlop, perlfunc, and perlre pages. The perl motto is There is more than one way to do it. It is easy to write cryptic perl; it is somewhat more difficult to write legible perl. The perlstyle file contains a few suggestions useful in the quest to make your code more readable. Language Modeling. Chen and Goodman (Computer Speech and Language, 1998) performed extensive experiments using a variety of N-gram interpolation methods, and developed an improved method based on their experiments. Chen and XXX (IEEE Trans. SAP, 2000) contains a very readable review of the Chen-Goodman interpolation method, followed by enlightening comparison to a new maximum-entropy method. 2.2 An Example The following file, timit durations.pl, computes the mean and variance of the durations of every phoneme in the TIMIT database. #!/usr/bin/perl # # Compute mean and variance of phoneme durations # and logdurations in TIMIT. # # Usage (in a bash shell): # timit_durations.pl d:/timit/timit > timit_durations.txt # # Creates a text table in file timit_durations.txt # showing, for each phoneme, the number of times it was seen, # the mean and standard deviation of the duration in milliseconds, # and the mean and standard deviation of the log duration (in log ms). # # Status messages are printed to STDERR (usually the terminal). # # Mark Hasegawa-Johnson, 6/18/2002 # ############################################### # Subroutine to peruse a directory tree $_[0] 4

5 # sub peruse_tree { # Top directory is whatever was given as $_[0] # If I can t open it, die with an error message opendir(topdir, $_[0]) die "Can t opendir $_[0]: $!"; print STDERR "Reading from directory ",$_[0],"\n"; my(@filelist) = readdir(topdir); closedir(topdir); # Read entries of TOPDIR foreach $filename (@filelist) { # If last character of the filename is., ignore it if ( $filename =~ /\.$/ ) { # If it s any other directory,call peruse_tree on it elsif ( -d "$_[0]/$filename" ) { peruse_tree("$_[0]/$filename"); # If the filename ends in s[ix]\d+\.phn (case-insensitive), # then call the function read_words elsif ( $filename =~ /s[ix]\d+\.phn/i ) { read_phones("$_[0]/$filename"); ################################################### # Subroutine to convert TIMIT phone labels into Switchboard labels # sub timit2switchboard { my(@data) # Process each record, while there are records left for( my($n)=0; $n <= $#data; $n++ ) { # Merge some TIMIT labels into Switchboard superclasses if ( $data[$n][2] eq ax-h ) { $data[$n][2] = ax ; if ( $data[$n][2] eq axr ) { $data[$n][2] = er ; if ( $data[$n][2] eq ux ) { $data[$n][2] = uw ; if ( $data[$n][2] eq ix ) { $data[$n][2] = ih ; if ( $data[$n][2] eq dx ) { $data[$n][2] = t ; if ( $data[$n][2] eq nx ) { $data[$n][2] = n ; if ( $data[$n][2] eq hv ) { $data[$n][2] = hh ; # If this segment is a closure, # look to see if it is followed by a release. # If so, combine the two segments. if ( my($stop) = ($data[$n][2] =~ /([bdgptk])cl/) ) { # If next segment is the right stop release, # or if next segment is jh or ch and this segment is tcl or dcl, # set label of this segment equal to next segment, # set end time of this segment equal to end of next segment, 5

6 # and delete the next segment. if ( ($data[$n+1][2] eq $stop) (($data[$n+1][2] =~ /[cj]h/) && ($stop =~ /[td]/)) ) { $data[$n][2] = $data[$n+1][2]; $data[$n][1] = $data[$n+1][1]; splice(@data, $n+1, 1); # Otherwise, this must be an unreleased stop, # so best thing to do is just fix the phoneme label else { $data[$n][2] = $stop; # Return the array return(@data); ################################################### # Subroutine to read phoneme data # sub read_phones { # to null my(@data) = (); # Open the INPUTFILE or die with an error message open(inputfile,$_[0]) die "Unable to open input file $_[0]: $!"; # Read in all lines from the INPUTFILE foreach $_ (<INPUTFILE>) { # Read the next line, and store it in a private array; next line if failure chomp; my(@record) = split; # Push a reference to this new record onto list push(@data, \@record ); close(inputfile); # Convert phone labels into Switchboard = timit2switchboard(@data); # Process each record separately foreach $record (@data) { my($label) = $$record[2]; # Compute duration in milliseconds, assuming 16kHz sampling rate my($duration) = ($$record[1] - $$record[0]) / 16; my($logd) = log($duration); # Increment the global counters $PHONES_SEEN and $ACC{$label{ n $PHONES_SEEN++; $ACC{$label{ n ++; 6

7 # Add duration, square, logd, and logd^2 to accumulators # Note that these accumulators are global. # If this particular label has never before been seen, # perl automagically creates $PHN_SUM{$label, and gives # it an initial value of zero. Very convenient. # After that, the values keep on accumulating until the # top-level script is finished. $ACC{$label{ sum += $duration; $ACC{$label{ sumsq += ( $duration * $duration ); $ACC{$label{ sumlog += $logd; $ACC{$label{ sumsqlog += ( $logd * $logd ); ########################################### # Main Program # # Accumulate duration information # from all directories specified # on the command line # foreach $arg (@ARGV) { peruse_tree($arg); # When finished, print out a table # Print the header of the phoneme table print "LABEL\tN\tMEAN\tSTD\tMEANLOG\tSTDLOG\n"; # Phonemes are sorted in alphabetical order foreach $label ( sort keys(acc)) { # Get the hash reference contained in $ACC{$label $hr = $ACC{$label; # $n is the number of examples of this phoneme observed # Mean is sum of durations divided by number of tokens seen # Mean log is sum of log durations divided by number of tokens seen # Std is sqrt( (sumsq of durations - mean*sum) / (n-1) ) # Stdlog is same as above, but with logs $n = $$hr{ n ; $mean = $$hr{ sum /$n; $meanlog = $$hr{ sumlog /$n; $std = sqrt( ($$hr{ sumsq - $$hr{ sum * $mean) / ($n-1)); $stdlog = sqrt( ($$hr{ sumsqlog - $$hr{ sumlog * $meanlog) / ($n-1) ); # Print a line of the output table printf "%s\t%6d\t%6.0f\t%6.0f\t%6.2f\t%6.3f\n",$label,$n,$mean, $std,$meanlog,$stdlog; 7

8 2.3 Language Modeling A probabilistic grammar of language L may be considered useful if it satisfies one of the following two objectives: 1. Specifies the probability of observing any particular string of words, W = [w 1,..., w M ] in language L. 2. Specifies the various ways in which the meanings of words [w 1,..., w M ] may be combined in order to compute a sentence meaning, and specifies the probability that any one of the acceptable sentence meanings is what the talker was actually trying to say. An N-gram grammar is a stochastic automaton designed to satisfy grammar objective number 1 in the most efficient manner possible: p(w ) = M p(w m w m N+1,..., w m 1 ) (1) m=1 where the words w N,..., w 1 are defined to be the special symbol SENTENCE START. If the length of the N-gram, N, is larger than the length of the sentence, M, a correct N-gram specifies the probability of the sentence exactly. In practice, most N-grams are either bigrams (N = 2) or trigrams (N = 3), although a few sites have experimented with variable-length N-grams. The maximum-likelihood estimate of the bigram probability p(w m w m 1 ) given any training corpus is p ML (w m w m 1 ) = C(w m 1, w m ) w m C(w m 1, w m ) where the count C(w m 1, w m ) is the number of times that the given word sequence was observed in the training corpus. Because of the infinite productivity of human language, there are always an infinite number of perfectly reasonable word sequences that will not be observed in any finite-sized training corpus (typical language model training corpora contain 250,000,000 words). In order to allow the model to generalize to new observations, higher-order N-grams may be interpolated with lower-order N-grams. There are a number of ways to do this; one method is using an arbitrary fixed reduction of the word count, as follows: p I (w m w m 1 ) = ( C(wm 1,w m) D ( C(w m 1) ) DN1+(w m 1 ) C(w m 1) ) + ( DN1+(w m 1 ) C(w m 1) ) p I (w m ) C(w m 1, w m ) 1 p I (w m ) C(w m 1, w m ) = 0 where D 1 is an adjustable parameter, and p I (w m ) is any valid unigram probability estimate. Typical interpolation methods either use the maximum likelihood estimate p ML (w m ) = C(w m )/ w C(w), or interpolate between the p ML (w m ) and a 0-gram distribution that assumes all words to be equally likely. The term N 1+ (w m 1 ) is the number of distinct words that may follow w m 1. This term is necessary to make sure that 1 = p(w m w m 1 ) (4) w m Kneser and Ney (1995) demonstrated that equation 3 gives best results if the lower-order probability p I (w m ) is chosen so that p I (w m w m 1 ) satisfies the following equation: C(w m ) = w m 1 p I (w m w m 1 )C(w m 1 ) (5) Equation 5 says that the higher-order interpolated N-gram p I (w m w m 1 ) should be designed so that the database count C(w m ) is equal to its expected value given the count C(w m 1 ). Kneser and Ney demonstrated that one interpolation formula that satisfies equation 5 is p I (w m w m 1 ) = ( C(wm 1,w m) D ( C(w m 1) DN1+(w m 1 ) C(w m 1) ) + ) ( N1+( w m) N 1+( ) ( DN1+(w m 1 ) C(w m 1) ) ) ( ) N1+( w m) N 1+( ) C(w m 1, w m ) 1 C(w m 1, w m ) = 0 (2) (3) (6) 8

9 where N 1+ ( ) is the total number of lexicographically distinct bigrams observed in the training data, i.e. N 1+ ( ) = N 1+ (w m 1 ) = N 1+ ( w m ) (7) w m 1 w m Chen and Goodman demonstrated two improvements to the Kneser-Ney algorithm. First, they showed that the Kneser-Ney probabilities may be interpolated down to the 0-gram probability. Second, they showed that the discount parameter D should depend on the database count C(w m 1 w m ), i.e. 0 C(w m 1, w m ) = 0 D D(w m 1, w m ) = 1 C(w m 1, w m ) = 1 (8) D 2 C(w m 1, w m ) = 2 D 3+ C(w m 1, w m ) 3 Chen and Goodman suggest several empirical and theoretical methods for choosing the parameters D 1, D 2, D 3 ; their figure 11 suggests that for a small corpus (1 million words), the best values are approximately D 1 = 0.6, D 2 = 1.0, D 3 = 1.4. The top-level Chen-Goodman-Kneser-Ney probability p(w m w m 1 ) is calculated according to ( ) C(wm 1, w m ) D(w m 1, w m ) p CGKN (w m w m 1 ) = (9) C(w m 1 ) ( ) D1 N 1 (w m 1 ) + D 2 N 2 (w m 1 ) + D 3+ N 3+ (w m 1 ) + p CGKN (w m ) (10) C(w m 1 ) where N 1 (w m 1 ) is the number of distinct words that follow w m 1 exactly once in the training data, N 2 (w m 1 ) is the number that follow exactly twice, and N 3+ (w m 1 ) is the number that follow three or more times. The lower-level probability p CGKN (w m ) is based on N 1+ ( w m ), just as in the Kneser-Ney probability formula, but Chen and Goodman showed that this lower-level probability may in turn be interpolated, thus ( ) N1+ ( w m ) D(w m ) p CGKN (w m ) = (11) N 1+ ( ) ( ) D1 N 1 ( ) + D 2 N 2 ( ) + D 3+ N 3+ ( ) + p CGKN ( ) (12) N 1+ ( ) where N 1 ( ) is the number of words that appear exactly once in the training data, and p CGKN ( ) is the 0-gram probability (all words equally likely). Equations 10 and 12 are relatively complicated, but notice that all terms in these two equations can be computed from the bigram counts C(w m 1 w m ). In order to estimate the Chen-Goodman-Kneser-Ney probability, then, it is sufficient to find the count C(w m 1 w m ) of every bigram pair that appears in the training database, and then add up those numbers in appropriate ways. 2.4 Homework Use perl to accumulate sufficient statistics from the Switchboard corpus for the estimation of a Chen- Goodman-smoothed bigram language model. Your code should have two distinct sections: (1) First, find the bigram counts C(w m 1 w m ) for every possible word-pair in the training data, and then (2) manipulate the bigram counts in order to calculate p CGKN (w m w m 1 ).. Words that begin and end with square brackets (e.g., [laughter], [silence] ) should be merged into a single category (perhaps [silence] ). Partial-word utterances that use square brackets and possibly a dash should be converted into the full-word code before being entered into your database count (e.g. [com]puter becomes computer, [be]cau[se]- becomes because, -[a]bout becomes about ). Notice that there are more than 30,000 distinct words in Switchboard. If you try to represent C(w m 1 w m ) or p(w m w m 1 ) as a fully enumerated table, you will wind up with a table of size 900M. Don t do that. Instead, C(w m 1 w m ) should include entries for only the bigram pairs that have a nonzero count in the database (about 2M entries). The bigram probability p(w m w m 1 ) of any bigram with zero count is composed 9

10 of two terms: p CGKN (w m ) (depends only on w m ), and a term that depends only on w m 1. Store these two terms as separate output tables, with about 30K entries for each of these two tables. If you have extra time, consider training your language model on part of the Switchboard corpus, and then testing it on the remaining part. Check to see whether your cross-entropy measure is comparable to the cross-entropy measures that Chen and Goodman obtained on Switchboard (Figs. 3 and 4 show bigram and trigram Jelinek-Mercer smoothing; Figs. 5 and 6 show the advantage relative to Jelinek-Mercer of a number of different algorithms). 10

11 3 Training Monophone Models Using HTK 3.1 Installation Download HTK from You should download the standard distribution (gzipped tar file). You may also wish to download the samples.tar.gz file, which contains a demo you can run to test your installation. You may also wish to download the pre-compiled PDF copy of the HTKBook. Compile HTK as specified in the README file. Under windows, you will need to use a DOS prompt to compile, because the VCVARS32.bat file will not run under cygwin. Add the bin.win32 directory to your path (or appropriate other bin directory, if you are on unix). In order to test your distribution, move to the samples/htkdemo directory, and (assuming you are in a cygwin window by now) type./rundemo. 3.2 Readings 1. Primary readings are from the HTKBook. Before you begin, read sections and 6.2. Before you start creating acoustic features, read sections , 5.4, 5.6, , and Before you start training your HMMs, read sections and Those who do not already know HMMs may wish to read either HTKBook chapter 1, or read Rabiner (IEEE ASSP Magazine, January 1986) and Juang et al. (IEEE Trans. Information Theory 32(2): , 1986). Even those who already know HMMs may be interested in the discussion of HTK s token-passing algorithm in section 1.6 of the HTKBook. 3.3 Creating Label and Script Files A script file in HTK is a list of speech or feature files to be processed. HTK s feature conversion program, HCopy, expects an ordered list of pairs of input and output files. HTK s training and test programs, including HCompV, HInit, HRest, HERest, and HVIte, all expect a single-column ordered list of acoustic feature files. For example, if the file TRAIN2.scp contains d:/timit/timit/train/dr8/mtcs0/si1972.wav data/mtcs0si1972.mfc d:/timit/timit/train/dr8/mtcs0/si2265.wav data/mtcs0si2265.mfc... then the command line HCopy -S TRAIN2.scp... will convert SI1972.WAV and put the result into data/mtcs0si1972.mfc (assuming that the data directory already exists). Likewise, the command HInit -S TRAIN1.scp... works if TRAIN1.scp contains data/mtcs0si1972.mfc data/mtcs0si2265.mfc... The long names of files in the data directory are necessary because TIMIT files are not fully specified by the sentence number. The sentence SX3.PHN, for example, was uttered by talkers FAJW0, FMBG0, FPLS0, MILB0, MEGJ0, MBSB0, and MWRP0. If you concatenate talker name and sentence number, as shown above, the resulting filename is sufficient to uniquely specify the TIMIT sentence of interest. A master label file (MLF) in HTK contains information about the order and possibly the time alignment of all training files or all test files. The MLF must start with the seven characters #!MLF!# followed by a newline. After the global header line comes the name of the first file, enclosed in double-quote characters ( ); the filename should have extension.lab, and the path should be replaced by *. The next several lines give the phonemes from the first file, and the first file entry ends with a period by itself on a line. For example: #!MLF!# "*/SI1972.lab" sil p 11

12 sil. "*/SI1823.lab"... In order to use the initialization programs HInit and HRest, the start time and end time of each phoneme must be specified in units of 100ns (10 million per second). In TIMIT, the start times and end times are specified in units of samples (16,000 per second), so the TIMIT PHN files need to be converted. The times shown above in 100ns increments, for example, correspond to the following sample times in file SI1972.PHN: h# p... Notice that the h# symbol in SI1972.PHN has been changed into sil. TIMIT phoneme labels are too specific; for example, it is impossible to distinguish pau (pause) from h# (sentence-initial silence) or from tcl (/t/ stop closure) on the basis of short-time acoustics alone. For this reason, when converting.phn label files into entries in a MLF, you should also change phoneme labels as necessary in order to eliminate non-acoustic distinctions. Some possible label substitutions are pau:sil (silence), h#:sil, tcl:sil, pcl:sil, kcl:sil, bcl:vcl (voiced closure), dcl:vcl, gcl:vcl, ax-h:axh, axr:er, ix:ih, ux:uw, nx:n, hv:hh. The segments /q/ (glottal stop) and /epi/ (epinthetic stop) can be deleted entirely. All of the conversions described above can be done using a single perl script that searches through the TIMIT/TRAIN hierarchy. Every time it finds a file that matches the pattern S[IX]\d+.PHN (note: this means it should ignore files SA1.PHN and SA2.PHN), it should add necessary entries to the files TRAIN1.scp, TRAIN2.scp, and TRAIN.mlf, as shown above. When the program is done searching the TIMIT/TRAIN hierarchy, it should search TIMIT/TEST, creating the files TEST1.scp, TEST2.scp, and TEST.mlf. Finally, just in case you are not sure what phoneme labels you wound up with after all of that conversion, the TRAIN.mlf file can be parsed as follows to get your phoneme set: awk /[\.!]/{next;{print $3 TRAIN.mlf sort uniq > monophones The first block of awk code skips over any line containing a period or exclamation point. The second block of awk code looks at remaining lines, and prints out the third column of any such lines. The unix sort and uniq commands sort the resulting phoneme stream, and throw away duplicates. 3.4 Creating Acoustic Feature Files Create a configuration file similar to the one in HTKBook page 32. Add the modifier SOURCEFORMAT=NIST in order to tell HTK that the TIMIT waveforms are in NIST format. I also recommend a few changes to the output features, as follows. First, compute the real energy (MFCC E) instead of the cepstral pseudo-energy (MFCC 0). Second, set ENORMALISE to T (or just delete the ENORMALISE entry). Third, because the TIMIT sampling rate (16kHz) is higher than the sampling rate considered in Chapter 3 (probably 8kHz, though it is never specified), you should use more mel-frequency channels, a longer lifter, and a longer cepstral feature vector. How many more? Well, the human auditory system distinguishes about 26 critical bands below 4kHz, but only about 6 more critical bands between 4kHz and 8kHz; since MFCC warps the frequency axis to imitate human hearing, you only need to increase NUMCHANS from 26 to about 32. Increasing NUMCHANS causes an increase in the pseudo-temporal resolution of the cepstral vector, so you should increase all of the parameters NUMCHANS, CEPLIFTER and NUMCEPS by about the same percentage. Use HCopy to convert TIMIT waveform files into MFCC, as specified on page 33 of the HTK book. Convert both the TRAIN and TEST corpora of TIMIT. 3.5 HMM Training Use a text editor to create a prototype HMM with three emitting states (five states total), and with three mixtures per emitting state (see Fig. 7.3). Be sure that your mean and variance vectors contain the right number of acoustic features: three times the number of cepstral coefficients, plus three energy coefficients. 12

13 Change your configuration file: eliminate the SOURCEFORMAT specifier, and change TARGETKIND to MFCC E D A. Use HCompV as specified on page 34 to create the files hmm0/proto and hmm0/vfloors. Next, use your text editor to separate hmm/macros (as shown in Fig. 3.7) from the rest of the file hmm0/proto (the first line of hmm0/proto should now read ~h "proto"). Because your.lab files specify the start and end times of each phoneme in TIMIT, you can use HInit and HRest to initialize your HMMs before running HERest. Generally, the better you initialize an HMM, the better it will perform, so it is often a good idea to use HInit and HRest if you have relevant labeled training data. Run HInit as shown on page 120, i.e., if $phn is the name of some phoneme, type something like mkdir hmm1; HInit -I TRAIN.mlf -S TRAIN1.scp -H hmm0/macros -C config -T 1 -M hmm1 -l $phn hmm0/proto; sed "s/proto/$phn/" hmm1/proto > hmm1/$phn; Hint: once you have the lines above working for one phoneme label, put them inside a for loop to do the other phonemes. Re-estimate the phonemes using HRest, as shown on page 123. Again, once you have the function working for one phoneme, put it inside a for loop. HRest will iterate until the log likelihood converges (use the -T 1 option if you want to see a running tally of the log likelihood), or until it has attempted 20 training iterations in a row without convergence. If you want to allow HRest to iterate more than 20 times per phoneme (and if you have enough time), specify the -i option (I used -i 100). Once you have used HRest, you may wish to combine all of the trained phoneme files into a single master macro file (MMF). Assuming that all of your phoneme filenames are 1-3 characters in length, and that the newest versions are in the directory hmm2, they can be combined by typing cat hmm2/? hmm2/?? hmm2/??? > hmm2/hmmdefs Now run the embedded re-estimation function HERest to update all of the phoneme files at once. HERest improves on HRest because it allows for the possibility that transcribed phoneme boundaries may not be precisely correct. HERest can also be used to train a recognizer even if the start and end times of individual phonemes are not known. Unfortunately, HERest only performs one training iteration each time the program is called, so it is wise to run HERest several times in a row. Try running it ten times in a row (moving from directory hmm2 to hmm3, then hmm3 to hmm4, and so on up to hmm12). Hint: put this inside a for loop. 3.6 Testing In order to use HVIte and HResults to test your recognizer, you first need to create a dictionary and a grammar. For now, the grammar can just specify that a sentence may contain any number of phonemes: $phone = aa ae... zh ; ( <$phone> ) Parse your grammar using HParse as specified on page 27. The dictionary essentially specifies that each phoneme equals itself: aa aa ae ae... Because the dictionary is so simple, you don t need to parse it using HDMan. You can ignore all of the text associated with Fig. 3.3 in the book. Run HVIte as specified in section of the book; instead of tiedlist, you should use your own list of phonemes (perhaps you called it monophones ). You may have to specify -C config, so that HVite knows to compute delta-cepstra and accelerations. The -p option specifies the bonus that HVIte gives itself each time it inserts a new word. Start with a value of -p 0. Use -T 1 to force HVIte to show you the words it is recognizing as it recognizes them. If there are too many deletions, increase -p; if there are too many insertions, decrease -p. When you are done, use HResults to analyze the results: 13

14 HResults -I TEST.mlf monophones recout.mlf You should get roughly 55-60% correct, and your recognition accuracy should be somewhere in the range 40-60%. These terms are defined as follows: CORRECTNESS = 100 NREF SUBSTITUTIONS DELETIONS NREF NREF SUBSTITUTIONS DELETIONS INSERTIONS ACCURACY = 100 NREF Correctness is equal to the percentage of the reference labels (NREF) that were correctly recognized. Correctness does not penalize for insertion errors. Accuracy is a more comprehensive measure of recognizer quality, but it has many counter-intuitive properties: for example, Accuracy is not always between 0 and 100 percent. Recent papers often use the terms Precision and Recall instead, where Recall is defined to equal Correctness, and Precision is the percentage of the recognized labels that are correct, i.e., PRECISION = 100 NRECOGNIZED SUBSTITUTIONS INSERTIONS NRECOGNIZED NRECOGNIZED = NREF DELETIONS + INSERTIONS 14

15 4 Words and Triphones In this section, you will use the TIMIT monophone HMMs trained in the previous lecture as the starting point for a clustered triphone recognizer designed to transcribe the words spoken by a talker in the BU Radio News corpus. 4.1 Readings The HTK Book, chapters 10, 12, and sections from 14 about HBuild, HLStats, HHEd and HLEd. 4.2 Cepstral Mean Subtraction; Single-Pass Retraining If x t is a log-spectral vector or a cepstral vector, the frequency response of the microphone and the room will influence only the average value of x t. It is possible to reduce the dependence of your recognizer on any particular microphone by subtracting the average value of x t, averaged over an entire utterance, before training or testing the recognizer, i.e., y t = x t 1 T x t (13) T Equation 13 is called cepstral mean subtraction, or CMS. In HTK, CMS is implemented automatically if you append Z to the feature specification. For example, you can save the features as type MFCC E, then use a configuration file during training and testing that specifies a feature vector of type MFCC E D A Z. HTK offers a method called one-pass retraining (HTKBook section 8.X) that uses models trained with one type of feature vector (for example, MFCC E D A) in order to rapidly train models with a different feature vector type (for example, MFCC E D A A). In theory, you need to have available files of both data types, but since HTK can implement CMS on the fly when opening each feature file, there is no need to regenerate the training data. Just create a script file with two columns the old and new feature files, which in this case are the same file: data/si1972.mfc data/si1972.mfc... Then create a configuration file with entries HPARM1 and HPARM2, as specified in section 8.X of the HTKBook, and call HERest with the -r option, exactly as specified in that section. Compare the hmmdefs files for the old and new file types. You should notice that the feature file type listed at the top of each file has changed. You should also notice that the mean vectors of each Gaussian mixture have changed a lot, but the variance vectors have not changed as much. 4.3 Dictionaries In order to recognize words using sub-word recognition models, you need a pronunciation dictionary. Pronunciation dictionaries for talker F1A in the Radio News corpus are provided in F1A/RADIO/F1A.PRN and F1A/LABNEWS/F1ALAB.PRN. These dictionaries contain a number of diacritics that will be useful later, but are not useful now. Use sed, awk, or perl to get rid of the characters * and (syllable markers), and the notation +1 or +2 in any transcription line. In order to reduce the number of homonyms, you may also wish to convert all capital letters to lower-case (so that Rob and rob ) are not distinct), and also eliminate apostrophes (so that judges and judges are not distinct). You will also wish to make a few label substitutions in order to map radio news phonemes into the TIMIT phonemes defined last week: axr becomes er, pau and h# become sil, and every stop consonant (b,d,g,p,t,k) gets split into two consecutive TIMIT-style phones: a closure followed by a stop release. As an example, the radio news dictionaries might contain the following entry for Birdbrain s Birdbrain s b axr+1 d * b r ey n z t=1 15

16 Assuming that your TIMIT-based phoneme set includes er but not axr, you would wish to automatically translate this entry to read birdbrains vcl b er vcl d vcl b r ey n z or, by adding a rule that deletes the stop release when the following segment is another consonant, you might get birdbrains vcl b er vcl vcl b r ey n z Notice that there is another alternative: instead of modifying the dictionary to match your HMM definitions, you could modify your HMM definitions to match the dictionary. Specifically, er could be relabeled as axr, sil could be relabeled as h#, and you could concatenate your stop closure and stop release states in order to create new stop consonant models. You could even create models of * and with no emitting states. Once you have converted your dictionaries, you should concatenate them together, then apply the unix utilities sort and uniq to the result, e.g., convert dict.pl F1A/RADIO/F1A.PRN F1A/LABNEWS/F1ALAB.PRN sort uniq > F1A.dict. HTK utilities will not work unless the words in the dictionary are orthographically sorted (alphabetic, all capitalized words before all diminutive words). 4.4 Transcriptions Create master label files using almost the same perl script that you used for TIMIT, but with.wrd-file inputs instead of.phn-file inputs. Also, every waveform file in RADIO NEWS is uniquely named, so you don t need to concatenate the directory and filename. The resulting master label files should look something like this, although the start times and end times are completely optional: #!MLF!# "*/F1AS01P1.lab" a cape cod In order to train the grammar, you need a word-level master label file, as shown above. In order to train the HMMs, though, you need a phoneme-level master label file. The phone-level MLF can be computed from the dictionary + word-level-mlf using the HLEd command (see section 12.8 in the HTK Book). Create a file called expand.hled that contains just one command, EX Then type HLEd -d F1A.dict -l * -i phone\_level.mlf expand.hled word\_level.mlf If HLEd fails, the most likely cause is that your master label file contains entries with times but no words. HLEd will, unfortunately, not tell you where those entries are. Try printing out all lines that have less than three columns using a command like gawk nf<3{print word\_level.mlf Scan the output to make sure that you don t have phantom words with start times and end times but no word labels. 4.5 Creation of MFCCs Create a two-column and a one-column script file for your training data, and the same for your test data, just as you did for TIMIT. The two-column script file will look something like: d:/radio_news/f1a/radio/s01/f1as01p1.sph d:/radio_news/f1a/radio/s01/f1as01p2.sph data/f1as01p1.mfc data/f1as01p2.mfc 16

17 You may use any subset of the data for training, and any other subset for test. I trained speakerdependent HMMs using the F1A/RADIO directory, and tested using the F1A/LABNEWS directory. You may get better recognition results if your training and test set both include part RADIO data and part LABNEWS data. Use HCopy to convert waveforms to MFCCs. 4.6 Bigram Grammar Construct a list of your entire vocabulary, including both training and test sets, using awk {print $1 F1A.dict sort uniq > wordlist Seeding your grammar with words from the test set is cheating, but for datasets this small, it may be the only way to avoid huge numbers of out-of-vocabulary errors. Given a master label file for your entire training data, the command HLStats will compute a backed-off bigram language model for you, and HBuild will convert the bigram file into a format that can be used by other HTK tools. See sections 12.4 and 12.5 in the HTKBook for examples; note that you will need to specify both the -I and -S options to HLStats. 4.7 Monophone HMMs If your dictionary matches the labels on your TIMIT monophone models, you should be able to use the TIMIT models now to perform recognition on the radio news corpus. Try it: HVIte -C config_recog -H timit/macros -H timit/hmmdefs -S (one-column test script) \ -l * -i recout1.mlf -t w (HBuild output file) \ -p 5 -s 3 F1A.dict monophones HResults -I (test MLF) monophones recout1.mlf The -p and -s options set the word insertion penalty and the grammar weight, respectively. These parameters are described in section 13.3 of the HTKBook. Adjusting these parameters can cause huge changes in your recognition performance; 5 might or might not be a good value. In any case, your results will probably be pretty horrible. Radio news was recorded using different microphones than TIMIT, by different talkers. You can account for these differences by adapting the models (using HEAdapt) or by re-estimating them (using HERest) you probably have enough data to use reestimation instead of adaptation. Re-estimate your models using HERest, and then run HVIte again. Your results should improve somewhat, but may still be disappointing. How can you improve your results still further? 4.8 Word-Internal Triphones In order to use word-internal triphones, you need to augment your transcriptions using a special wordboundary phoneme label. The sp (short pause) phoneme is intended to represent zero or more frames of silence between words. Add sp to the end of every entry in your dictionary using awk or perl. After you have added sp to the end of every entry, add another entry of the form silence sil The silence model must not end with an sp. Now you need to augment your HMM definitions, exactly as listed in section and of the HTK book. This consists of four steps. First, add sp to the end of your monophones list file. Second, edit your hmmdefs file with a text editor, in order to create the sp model by copying the middle state of the sil model. Third, use HHEd with the script given in Finally, use HVIte in forced-alignment mode, in order to create a new reference transcription of the training data. Be sure to use the -b silence option to add silences to the beginning and end of each transcription; otherwise your sentence will end with an sp model, and that will cause HERest to fail. 17

18 Now that you have your word-boundary marker, you are ready to create word-internal triphones. Use HLEd exactly as in section of the HTKBook. Because of the small size of this database, the test set may contain triphones missing from the training data. In order to accomodate missing triphones, concatenate the monophone and triphone files, so that any missing triphones can at least be modeled using monophones: sort monophones triphones uniq > allphones Finally, use HHEd as in section of the HTKBook, but use the allphones list instead of the triphones list to specify your set of output phones. Re-estimate your triphone models a few times using HERest. HERest will complain that some triphones are observed only one or two times in the training data. I guess we need a larger training database. Test the result using HVIte. The presence of monophones in your phoneme list will confuse HVIte. In order to force the use of triphones whenever possible, your config file should contain the entries FORCECXTEXP = T ALLOWXWRDEXP = F Your recognition performance with triphones should be better than it was with monophones. 4.9 Tied-State Triphones Because of the sparsity of the training data, many triphone models are not well trained. The problem can be alleviated somewhat by using the same parameters in multiple recognition models. This process is called parameter tying. Chapter 10 of the HTKBook describes many, many different methods of parameter tying, all of which are frequently used in practical recognition systems. I suggest using the data-driven clustering method for the current exercise (section 10.4), although tree-based clustering (section 10.5) might work almost as well. Run HERest with the -s option, in order to generate a file called stats file. Then create an HHEd script that starts with the command RO (threshold) stats file where (threshold) specifies the minimum expected number of times a state should be visited in order to count for parameter tying (I used 20). Use perl, awk, or even just bash to add commands of the following form to your HHEd script: TC "aas2" {(aa,*-aa,aa+*,*-aa+*).state[2] TC "aas3" {(aa,*-aa,aa+*,*-aa+*).state[3] TC "aas4" {(aa,*-aa,aa+*,*-aa+*).state[4] You can be more general, if you like. For example, the following command would allow HTK to consider tying together the first state of aa with the last state of any phoneme that precedes aa: TC "aas2" {(aa,*-aa,aa+*,*-aa+*).state[2],(*-*+aa,*+aa).state[4] Run HHEd in order to perform data-based tying (use the -T option to see what HHEd is doing). Use HERest to re-estimate the models a few times, then test using HVIte and HResults. Your performance may still not be wonderful, but it should be better than you obtained without parameter tying. For reference, the NIST Hub-4 and Hub-5 competitions (1997 and 1998, respectively) used large databases of broadcast news training data similar to the Radio News corpus. Typical performance of the competition systems was in the range of 30-40% word error rate (word error rate = accuracy). The winning system was trained using HTK, plus a large amount of external code. 18

19 5 Prosody Recent papers talk about three aspects of prosody that might be modeled by a speech recognition system: Lexical stress: Lexically unstressed vowels may be transcribed and modeled as a type of schwa (ax, ix, or axr), or as some type of full vowel. The status of /ax/ as a distinct vowel has much empirical support. /ix/ and /ax/ may not be distinct in practical systems. It is possible to argue that /er/ is always reduced, so that /er/ and /axr/ are not really distinct. Several studies have examined the distinction between unreduced unstressed vowels and stressed vowels. Greenberg (1999) found that stressed vowels are longer and have higher energy than unstressed vowels with the same phoneme label, but he did not control for accent placement. van Kuijk et al. (1999) compared accented stressed, unaccented stressed, unreduced unstressed, and reduced vowels, and found no acoustic difference between the middle two categories. Consonant reduction has apparently never been studied in speech recognition. Pitch accent. When a pitch accent is placed on a word, it is usually placed on or near the lexically stressed syllable. The duration, energy, or spectral distinctiveness of the lexically stressed syllable may then be increased. Articulatory studies (Fougeron et al.) indicate that consonants in accented syllables are produced more distinctively than consonants in unaccented syllables. Phrase boundaries. The rhyme of the final syllable of a word preceding an intermediate or intonational phrase boundary is lengthened relative to comparable phonemes in the sentence (Wightman et al., 1991). In the Switchboard database, the duration histogram of words preceding a silence or disfluency has a mode that is one standard deviation higher than the duration histograms of other words in the database. This increased duration may be combined by a decrease in energy, and possibly by other spectral changes. 5.1 Reading Wightman, Shattuck-Hufnagel, and Price, Segmental durations in the vicinity of prosodic phrase boundaries. J. Acoust. Soc. Am. 91(3): , Fougeron and Keating, Articulatory strengthening at edges of prosodic domains. J. Acoust. Soc. Am 101: , Steven Greenberg and Leah Hitchcock, Stress-Accent and Vowel Quality in The Switchboard Corpus. NIST Large Vocabulary Continuous Speech Recognition Workshop, May Prosody-Dependent Transcriptions Write a perl script that reads in WRD transcription files and either TON or BRK files from one talker s data in the radio news corpus. Your script should create an HTK master label file containing either break-indexdependent or accent-dependent transcriptions. For example, a break-index-dependent transcription might append the number 4 after every word with a break index of at least 4, e.g. #!MLF!# "*/F2BS01P1.lab" 0 0 endsil a nineteen eighteen state constitutional amendment4 An accent-dependent transcription might append an exclamation point after every word containing a pitch accent, e.g. 19

20 #!MLF!# "*/F2BS01P1.lab" 0 0 endsil a nineteen! eighteen! state! constitutional amendment! F2B has about 170 sentences transcribed with prosody, while F1A and M1B have only about 75 sentences transcribed. Choose a talker with as many sentences as possible transcribed for prosody. Create a prosody-independent MLF by stripping out the prosodic symbols from your prosody-dependent MLF. The prosody-independent recognizer will serve as a reference model, so that you can tell whether any advantage is obtained by modeling prosody. 5.3 Prosody-Dependent Dictionary Write a perl script that reads in the dictionaries provided in the Radio News corpus, and produces an HTK-format dictionary with both prosody-dependent and prosody-independent versions of each word. If you are studying break indices, the phonemes in the final syllable of each pre-boundary word should be special pre-boundary phonemes, e.g., abilities ax b ih l ax t iy z sp abilities4 [abilities] ax b ih l ax t4 iy4 z4 sp If you are studying accent, the phonemes in the lexically stressed syllable of each lexically stressed word should be special, e.g., abilities ax b ih l ax t iy z sp abilities! [abilities] ax b! ih! l! ax t iy z sp Notice that in both cases, the output of HVIte should be specified to be independent of prosody, using the square-bracket notation. Use HLEd, together with your dictionary, to create prosody-dependent and prosody-independent monophonelevel MLF files. 5.4 Prosody-Dependent HMMs Train a set of monophone models including the sp model (or copy models from the last section). Create an HHEd script that duplicates your monophone models to create prosody-dependent models. If you are studying break indices, your HHEd script might contain the line DP "" 1 "4" If you are studying accent, your script might contain DP "" 1 "!" Train both prosody-dependent and prosody-independent monophone models by running HERest 3-5 times on each set of models. Use HLEd to split the prosody-dependent and prosody-independent monophone MLF files into triphone MLFs. Use HHEd to split the trained HMM macro files. Train both prosody-dependent and prosodyindependent triphone models by running HERest 3-5 times on each model set. Use HHEd to perform data-driven tying on the triphone models. For example, if you are studying accent, your HHEd script for tying the prosody-dependent HMMs might contain commands of the form TC "aas2" {(aa,aa!,*-aa,*-aa!,aa+*,aa!+*,*-aa+*,*-aa!+*).state[2] Train both prosody-dependent and prosody-independent clustered triphone HMMs by running HERest 3-5 times on each model set. 20

Lecture 5: Hidden Markov Models

Lecture 5: Hidden Markov Models Lecture 5: Hidden Markov Models Lecturer: Mark Hasegawa-Johnson (jhasegaw@uiuc.edu) TA: Sarah Borys (sborys@uiuc.edu) Web Page: http://www.ifp.uiuc.edu/speech/courses/minicourse/ May 27, 2005 1 Training

More information

Introduction to The HTK Toolkit

Introduction to The HTK Toolkit Introduction to The HTK Toolkit Hsin-min Wang Reference: - The HTK Book Outline An Overview of HTK HTK Processing Stages Data Preparation Tools Training Tools Testing Tools Analysis Tools A Tutorial Example

More information

Introduction to HTK Toolkit

Introduction to HTK Toolkit Introduction to HTK Toolkit Berlin Chen 2003 Reference: - The HTK Book, Version 3.2 Outline An Overview of HTK HTK Processing Stages Data Preparation Tools Training Tools Testing Tools Analysis Tools Homework:

More information

Detailed Notes on A Voice Dialing Application

Detailed Notes on A Voice Dialing Application Detailed Notes on A Voice Dialing Application It is assumed that you worked through steps 1-3 of the HTK Workshop 2010. These notes are intended to support you while working through the tutorial example

More information

Building a Simple Speaker Identification System

Building a Simple Speaker Identification System Building a Simple Speaker Identification System 1 Introduction 11 We will be using the Hidden Markov Model Toolkit (HTK) HTK is installed under linux on the lab chines Your path should already be set,

More information

HTK (v.3.1): Basic Tutorial

HTK (v.3.1): Basic Tutorial HTK (v.3.1): Basic Tutorial Nicolas Moreau / 02.02.2002 Content WHAT IS HTK?... 3 1 YES/NO RECOGNITION SYSTEM... 3 2 CREATION OF THE TRAINING CORPUS... 4 2.1 Record the Signal...4 2.2 Label the Signal...4

More information

Tutorial of Building an LVCSR System

Tutorial of Building an LVCSR System Tutorial of Building an LVCSR System using HTK Shih Hsiang Lin( 林士翔 ) Department of Computer Science & Information Engineering National Taiwan Normal University Reference: Steve Young et al, The HTK Books

More information

Scripting Languages Course 1. Diana Trandabăț

Scripting Languages Course 1. Diana Trandabăț Scripting Languages Course 1 Diana Trandabăț Master in Computational Linguistics - 1 st year 2017-2018 Today s lecture Introduction to scripting languages What is a script? What is a scripting language

More information

DT2118 Speech and Speaker Recognition. Outline. HTK, What is it? Short History. Notes. Notes. Notes. Notes. HTK Tutorial. Giampiero Salvi VT2014

DT2118 Speech and Speaker Recognition. Outline. HTK, What is it? Short History. Notes. Notes. Notes. Notes. HTK Tutorial. Giampiero Salvi VT2014 DT2118 Speech and Speaker Recognition HTK Tutorial Giampiero Salvi KTH/CSC/TMH giampi@kthse VT2014 1 / 39 Outline Introduction General Usage Data formats and manipulation Training Recognition 2 / 39 HTK,

More information

(Refer Slide Time: 01:12)

(Refer Slide Time: 01:12) Internet Technology Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No #22 PERL Part II We continue with our discussion on the Perl

More information

If you re using a Mac, follow these commands to prepare your computer to run these demos (and any other analysis you conduct with the Audio BNC

If you re using a Mac, follow these commands to prepare your computer to run these demos (and any other analysis you conduct with the Audio BNC If you re using a Mac, follow these commands to prepare your computer to run these demos (and any other analysis you conduct with the Audio BNC sample). All examples use your Workshop directory (e.g. /Users/peggy/workshop)

More information

c COPYRIGHT Microsoft Corporation. c COPYRIGHT Cambridge University Engineering Department.

c COPYRIGHT Microsoft Corporation. c COPYRIGHT Cambridge University Engineering Department. The HTK Book Steve Young Gunnar Evermann Dan Kershaw Gareth Moore Julian Odell Dave Ollason Valtcho Valtchev Phil Woodland The HTK Book (for HTK Version 3.1) c COPYRIGHT 1995-1999 Microsoft Corporation.

More information

Chapter 3. Speech segmentation. 3.1 Preprocessing

Chapter 3. Speech segmentation. 3.1 Preprocessing , as done in this dissertation, refers to the process of determining the boundaries between phonemes in the speech signal. No higher-level lexical information is used to accomplish this. This chapter presents

More information

Lecture 5. Essential skills for bioinformatics: Unix/Linux

Lecture 5. Essential skills for bioinformatics: Unix/Linux Lecture 5 Essential skills for bioinformatics: Unix/Linux UNIX DATA TOOLS Text processing with awk We have illustrated two ways awk can come in handy: Filtering data using rules that can combine regular

More information

EE627 Term Project : Jul Semester

EE627 Term Project : Jul Semester EE627 Term Project : Jul. 2013 Semester August 12, 2013 Title : Build and demonstrate a real time continuous speech recognition system in English Assigned to : Batch No. 1 TAs Assigned : Waquar Ahmad.

More information

Introduction Variables Helper commands Control Flow Constructs Basic Plumbing. Bash Scripting. Alessandro Barenghi

Introduction Variables Helper commands Control Flow Constructs Basic Plumbing. Bash Scripting. Alessandro Barenghi Bash Scripting Alessandro Barenghi Dipartimento di Elettronica, Informazione e Bioingegneria Politecnico di Milano alessandro.barenghi - at - polimi.it April 28, 2015 Introduction The bash command shell

More information

CSCI 4152/6509 Natural Language Processing. Perl Tutorial CSCI 4152/6509. CSCI 4152/6509, Perl Tutorial 1

CSCI 4152/6509 Natural Language Processing. Perl Tutorial CSCI 4152/6509. CSCI 4152/6509, Perl Tutorial 1 CSCI 4152/6509 Natural Language Processing Perl Tutorial CSCI 4152/6509 Vlado Kešelj CSCI 4152/6509, Perl Tutorial 1 created in 1987 by Larry Wall About Perl interpreted language, with just-in-time semi-compilation

More information

The HTK Book. Steve Young Gunnar Evermann Dan Kershaw Gareth Moore Julian Odell Dave Ollason Dan Povey Valtcho Valtchev Phil Woodland

The HTK Book. Steve Young Gunnar Evermann Dan Kershaw Gareth Moore Julian Odell Dave Ollason Dan Povey Valtcho Valtchev Phil Woodland The HTK Book Steve Young Gunnar Evermann Dan Kershaw Gareth Moore Julian Odell Dave Ollason Dan Povey Valtcho Valtchev Phil Woodland The HTK Book (for HTK Version 3.2) c COPYRIGHT 1995-1999 Microsoft Corporation.

More information

Khmer OCR for Limon R1 Size 22 Report

Khmer OCR for Limon R1 Size 22 Report PAN Localization Project Project No: Ref. No: PANL10n/KH/Report/phase2/002 Khmer OCR for Limon R1 Size 22 Report 09 July, 2009 Prepared by: Mr. ING LENG IENG Cambodia Country Component PAN Localization

More information

sottotitolo A.A. 2016/17 Federico Reghenzani, Alessandro Barenghi

sottotitolo A.A. 2016/17 Federico Reghenzani, Alessandro Barenghi Titolo presentazione Piattaforme Software per la Rete sottotitolo BASH Scripting Milano, XX mese 20XX A.A. 2016/17, Alessandro Barenghi Outline 1) Introduction to BASH 2) Helper commands 3) Control Flow

More information

A Big Step. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

A Big Step. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers A Big Step Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers Copyright 2006 2009 Stewart Weiss What a shell really does Here is the scoop on shells. A shell is a program

More information

Applications of Keyword-Constraining in Speaker Recognition. Howard Lei. July 2, Introduction 3

Applications of Keyword-Constraining in Speaker Recognition. Howard Lei. July 2, Introduction 3 Applications of Keyword-Constraining in Speaker Recognition Howard Lei hlei@icsi.berkeley.edu July 2, 2007 Contents 1 Introduction 3 2 The keyword HMM system 4 2.1 Background keyword HMM training............................

More information

The HTK Book. The HTK Book (for HTK Version 3.4)

The HTK Book. The HTK Book (for HTK Version 3.4) The HTK Book Steve Young Gunnar Evermann Mark Gales Thomas Hain Dan Kershaw Xunying (Andrew) Liu Gareth Moore Julian Odell Dave Ollason Dan Povey Valtcho Valtchev Phil Woodland The HTK Book (for HTK Version

More information

Digital Humanities. Tutorial Regular Expressions. March 10, 2014

Digital Humanities. Tutorial Regular Expressions. March 10, 2014 Digital Humanities Tutorial Regular Expressions March 10, 2014 1 Introduction In this tutorial we will look at a powerful technique, called regular expressions, to search for specific patterns in corpora.

More information

Scripting. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

Scripting. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers Scripting Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers Adapted from Practical Unix and Programming Hunter College Copyright 2006 2009 Stewart Weiss What a shell

More information

Perl Tutorial. Diana Inkpen. School of Information Technology and Engineering University of Ottawa. CSI 5180, Fall 2004

Perl Tutorial. Diana Inkpen. School of Information Technology and Engineering University of Ottawa. CSI 5180, Fall 2004 Perl Tutorial Diana Inkpen School of Information Technology and Engineering University of Ottawa CSI 5180, Fall 2004 1 What is Perl Practical Extraction and Report Language. Created, implemented, maintained

More information

Learning The Lexicon!

Learning The Lexicon! Learning The Lexicon! A Pronunciation Mixture Model! Ian McGraw! (imcgraw@mit.edu)! Ibrahim Badr Jim Glass! Computer Science and Artificial Intelligence Lab! Massachusetts Institute of Technology! Cambridge,

More information

Lecture 8: Speech Recognition Using Finite State Transducers

Lecture 8: Speech Recognition Using Finite State Transducers Lecture 8: Speech Recognition Using Finite State Transducers Lecturer: Mark Hasegawa-Johnson (jhasegaw@uiuc.edu) TA: Sarah Borys (sborys@uiuc.edu) Web Page: http://www.ifp.uiuc.edu/speech/courses/minicourse/

More information

Basic Linux (Bash) Commands

Basic Linux (Bash) Commands Basic Linux (Bash) Commands Hint: Run commands in the emacs shell (emacs -nw, then M-x shell) instead of the terminal. It eases searching for and revising commands and navigating and copying-and-pasting

More information

for (i=1; i<=100000; i++) { x = sqrt (y); // square root function cout << x+i << endl; }

for (i=1; i<=100000; i++) { x = sqrt (y); // square root function cout << x+i << endl; } Ex: The difference between Compiler and Interpreter The interpreter actually carries out the computations specified in the source program. In other words, the output of a compiler is a program, whereas

More information

Unix as a Platform Exercises + Solutions. Course Code: OS 01 UNXPLAT

Unix as a Platform Exercises + Solutions. Course Code: OS 01 UNXPLAT Unix as a Platform Exercises + Solutions Course Code: OS 01 UNXPLAT Working with Unix Most if not all of these will require some investigation in the man pages. That's the idea, to get them used to looking

More information

Unix as a Platform Exercises. Course Code: OS-01-UNXPLAT

Unix as a Platform Exercises. Course Code: OS-01-UNXPLAT Unix as a Platform Exercises Course Code: OS-01-UNXPLAT Working with Unix 1. Use the on-line manual page to determine the option for cat, which causes nonprintable characters to be displayed. Run the command

More information

Shells and Shell Programming

Shells and Shell Programming Shells and Shell Programming 1 Shells A shell is a command line interpreter that is the interface between the user and the OS. The shell: analyzes each command determines what actions are to be performed

More information

The HTK Hidden Markov Model Toolkit: Design and Philosophy. SJ Young. September 6, Cambridge University Engineering Department

The HTK Hidden Markov Model Toolkit: Design and Philosophy. SJ Young. September 6, Cambridge University Engineering Department The HTK Hidden Markov Model Toolkit: Design and Philosophy SJ Young CUED/F-INFENG/TR.152 September 6, 1994 Cambridge University Engineering Department Trumpington Street, Cambridge, CB2 1PZ (sjy@eng.cam.ac.uk)

More information

Answers to AWK problems. Shell-Programming. Future: Using loops to automate tasks. Download and Install: Python (Windows only.) R

Answers to AWK problems. Shell-Programming. Future: Using loops to automate tasks. Download and Install: Python (Windows only.) R Today s Class Answers to AWK problems Shell-Programming Using loops to automate tasks Future: Download and Install: Python (Windows only.) R Awk basics From the command line: $ awk '$1>20' filename Command

More information

Shell Programming Overview

Shell Programming Overview Overview Shell programming is a way of taking several command line instructions that you would use in a Unix command prompt and incorporating them into one program. There are many versions of Unix. Some

More information

Modeling Coarticulation in Continuous Speech

Modeling Coarticulation in Continuous Speech ing in Oregon Health & Science University Center for Spoken Language Understanding December 16, 2013 Outline in 1 2 3 4 5 2 / 40 in is the influence of one phoneme on another Figure: of coarticulation

More information

Exercise sheet 1 To be corrected in tutorials in the week from 23/10/2017 to 27/10/2017

Exercise sheet 1 To be corrected in tutorials in the week from 23/10/2017 to 27/10/2017 Einführung in die Programmierung für Physiker WS 207/208 Marc Wagner Francesca Cuteri: cuteri@th.physik.uni-frankfurt.de Alessandro Sciarra: sciarra@th.physik.uni-frankfurt.de Exercise sheet To be corrected

More information

CSC209H Lecture 1. Dan Zingaro. January 7, 2015

CSC209H Lecture 1. Dan Zingaro. January 7, 2015 CSC209H Lecture 1 Dan Zingaro January 7, 2015 Welcome! Welcome to CSC209 Comments or questions during class? Let me know! Topics: shell and Unix, pipes and filters, C programming, processes, system calls,

More information

Perl. Perl. Perl. Which Perl

Perl. Perl. Perl. Which Perl Perl Perl Perl = Practical Extraction and Report Language Developed by Larry Wall (late 80 s) as a replacement for awk. Has grown to become a replacement for awk, sed, grep, other filters, shell scripts,

More information

Bash command shell language interpreter

Bash command shell language interpreter Principles of Programming Languages Bash command shell language interpreter Advanced seminar topic Louis Sugy & Baptiste Thémine Presentation on December 8th, 2017 Table of contents I. General information

More information

Chapter-3. Introduction to Unix: Fundamental Commands

Chapter-3. Introduction to Unix: Fundamental Commands Chapter-3 Introduction to Unix: Fundamental Commands What You Will Learn The fundamental commands of the Unix operating system. Everything told for Unix here is applicable to the Linux operating system

More information

for (i=1; i<=100000; i++) { x = sqrt (y); // square root function cout << x+i << endl; }

for (i=1; i<=100000; i++) { x = sqrt (y); // square root function cout << x+i << endl; } Ex: The difference between Compiler and Interpreter The interpreter actually carries out the computations specified in the source program. In other words, the output of a compiler is a program, whereas

More information

Please note that some of the resources used in this assignment require a Stanford Network Account and therefore may not be accessible.

Please note that some of the resources used in this assignment require a Stanford Network Account and therefore may not be accessible. Please note that some of the resources used in this assignment require a Stanford Network Account and therefore may not be accessible. CS 224N / Ling 237 Programming Assignment 1: Language Modeling Due

More information

Shells and Shell Programming

Shells and Shell Programming Shells and Shell Programming Shells A shell is a command line interpreter that is the interface between the user and the OS. The shell: analyzes each command determines what actions are to be performed

More information

9.2 Linux Essentials Exam Objectives

9.2 Linux Essentials Exam Objectives 9.2 Linux Essentials Exam Objectives This chapter will cover the topics for the following Linux Essentials exam objectives: Topic 3: The Power of the Command Line (weight: 10) 3.3: Turning Commands into

More information

Vi & Shell Scripting

Vi & Shell Scripting Vi & Shell Scripting Comp-206 : Introduction to Week 3 Joseph Vybihal Computer Science McGill University Announcements Sina Meraji's office hours Trottier 3rd floor open area Tuesday 1:30 2:30 PM Thursday

More information

The HTK Book. Steve Young Dan Kershaw Julian Odell Dave Ollason Valtcho Valtchev Phil Woodland. The HTK Book (for HTK Version 3.1)

The HTK Book. Steve Young Dan Kershaw Julian Odell Dave Ollason Valtcho Valtchev Phil Woodland. The HTK Book (for HTK Version 3.1) The HTK Book Steve Young Dan Kershaw Julian Odell Dave Ollason Valtcho Valtchev Phil Woodland The HTK Book (for HTK Version 3.1) c COPYRIGHT 1995-1999 Microsoft Corporation. All Rights Reserved First published

More information

A Brief Introduction to the Linux Shell for Data Science

A Brief Introduction to the Linux Shell for Data Science A Brief Introduction to the Linux Shell for Data Science Aris Anagnostopoulos 1 Introduction Here we will see a brief introduction of the Linux command line or shell as it is called. Linux is a Unix-like

More information

Perl. Many of these conflict with design principles of languages for teaching.

Perl. Many of these conflict with design principles of languages for teaching. Perl Perl = Practical Extraction and Report Language Developed by Larry Wall (late 80 s) as a replacement for awk. Has grown to become a replacement for awk, sed, grep, other filters, shell scripts, C

More information

Gender-dependent acoustic models fusion developed for automatic subtitling of Parliament meetings broadcasted by the Czech TV

Gender-dependent acoustic models fusion developed for automatic subtitling of Parliament meetings broadcasted by the Czech TV Gender-dependent acoustic models fusion developed for automatic subtitling of Parliament meetings broadcasted by the Czech TV Jan Vaněk and Josef V. Psutka Department of Cybernetics, West Bohemia University,

More information

The Online Unix Manual

The Online Unix Manual ACS-294-001 Unix (Winter Term, 2018-2019) Page 14 The Online Unix Manual Unix comes with a large, built-in manual that is accessible at any time from your terminal. The Online Manual is a collection of

More information

Example how not to do it: JMP in a nutshell 1 HR, 17 Apr Subject Gender Condition Turn Reactiontime. A1 male filler

Example how not to do it: JMP in a nutshell 1 HR, 17 Apr Subject Gender Condition Turn Reactiontime. A1 male filler JMP in a nutshell 1 HR, 17 Apr 2018 The software JMP Pro 14 is installed on the Macs of the Phonetics Institute. Private versions can be bought from

More information

Applying Backoff to Concatenative Speech Synthesis

Applying Backoff to Concatenative Speech Synthesis Applying Backoff to Concatenative Speech Synthesis Lily Liu Stanford University lliu23@stanford.edu Luladay Price Stanford University luladayp@stanford.edu Andrew Zhang Stanford University azhang97@stanford.edu

More information

19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd

19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd 19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd Will you walk a little faster? said a whiting to a snail, There s a porpoise close behind us, and he s treading

More information

UNIX Shell Programming

UNIX Shell Programming $!... 5:13 $$ and $!... 5:13.profile File... 7:4 /etc/bashrc... 10:13 /etc/profile... 10:12 /etc/profile File... 7:5 ~/.bash_login... 10:15 ~/.bash_logout... 10:18 ~/.bash_profile... 10:14 ~/.bashrc...

More information

C Shell Tutorial. Section 1

C Shell Tutorial. Section 1 C Shell Tutorial Goals: Section 1 Learn how to write a simple shell script and how to run it. Learn how to use local and global variables. About CSH The Barkley Unix C shell was originally written with

More information

Essentials for Scientific Computing: Bash Shell Scripting Day 3

Essentials for Scientific Computing: Bash Shell Scripting Day 3 Essentials for Scientific Computing: Bash Shell Scripting Day 3 Ershaad Ahamed TUE-CMS, JNCASR May 2012 1 Introduction In the previous sessions, you have been using basic commands in the shell. The bash

More information

Regular Expressions. Todd Kelley CST8207 Todd Kelley 1

Regular Expressions. Todd Kelley CST8207 Todd Kelley 1 Regular Expressions Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 POSIX character classes Some Regular Expression gotchas Regular Expression Resources Assignment 3 on Regular Expressions

More information

Scalable Trigram Backoff Language Models

Scalable Trigram Backoff Language Models Scalable Trigram Backoff Language Models Kristie Seymore Ronald Rosenfeld May 1996 CMU-CS-96-139 School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 This material is based upon work

More information

Privacy and Security in Online Social Networks Department of Computer Science and Engineering Indian Institute of Technology, Madras

Privacy and Security in Online Social Networks Department of Computer Science and Engineering Indian Institute of Technology, Madras Privacy and Security in Online Social Networks Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 25 Tutorial 5: Analyzing text using Python NLTK Hi everyone,

More information

CSE 413 Final Exam. June 7, 2011

CSE 413 Final Exam. June 7, 2011 CSE 413 Final Exam June 7, 2011 Name The exam is closed book, except that you may have a single page of hand-written notes for reference plus the page of notes you had for the midterm (although you are

More information

You will likely want to log into your assigned x-node from yesterday. Part 1: Shake-and-bake language generation

You will likely want to log into your assigned x-node from yesterday. Part 1: Shake-and-bake language generation FSM Tutorial I assume that you re using bash as your shell; if not, then type bash before you start (you can use csh-derivatives if you want, but your mileage may vary). You will likely want to log into

More information

ITST Searching, Extracting & Archiving Data

ITST Searching, Extracting & Archiving Data ITST 1136 - Searching, Extracting & Archiving Data Name: Step 1 Sign into a Pi UN = pi PW = raspberry Step 2 - Grep - One of the most useful and versatile commands in a Linux terminal environment is the

More information

Introduction to Regular Expressions Version 1.3. Tom Sgouros

Introduction to Regular Expressions Version 1.3. Tom Sgouros Introduction to Regular Expressions Version 1.3 Tom Sgouros June 29, 2001 2 Contents 1 Beginning Regular Expresions 5 1.1 The Simple Version........................ 6 1.2 Difficult Characters........................

More information

LING 408/508: Computational Techniques for Linguists. Lecture 5

LING 408/508: Computational Techniques for Linguists. Lecture 5 LING 408/508: Computational Techniques for Linguists Lecture 5 Last Time Installing Ubuntu 18.04 LTS on top of VirtualBox Your Homework 2: did everyone succeed? Ubuntu VirtualBox Host OS: MacOS or Windows

More information

Table Of Contents. 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands

Table Of Contents. 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands Table Of Contents 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands Getting onto the Zoo Type ssh @node.zoo.cs.yale.edu, and enter your netid pass when prompted.

More information

Shells & Shell Programming (Part B)

Shells & Shell Programming (Part B) Shells & Shell Programming (Part B) Software Tools EECS2031 Winter 2018 Manos Papagelis Thanks to Karen Reid and Alan J Rosenthal for material in these slides CONTROL STATEMENTS 2 Control Statements Conditional

More information

CS 25200: Systems Programming. Lecture 10: Shell Scripting in Bash

CS 25200: Systems Programming. Lecture 10: Shell Scripting in Bash CS 25200: Systems Programming Lecture 10: Shell Scripting in Bash Dr. Jef Turkstra 2018 Dr. Jeffrey A. Turkstra 1 Lecture 10 Getting started with Bash Data types Reading and writing Control loops Decision

More information

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming Intro to Programming Unit 7 Intro to Programming 1 What is Programming? 1. Programming Languages 2. Markup vs. Programming 1. Introduction 2. Print Statement 3. Strings 4. Types and Values 5. Math Externals

More information

Outline. CS3157: Advanced Programming. Feedback from last class. Last plug

Outline. CS3157: Advanced Programming. Feedback from last class. Last plug Outline CS3157: Advanced Programming Lecture #2 Jan 23 Shlomo Hershkop shlomo@cs.columbia.edu Feedback Introduction to Perl review and continued Intro to Regular expressions Reading Programming Perl pg

More information

COMS 6100 Class Notes 3

COMS 6100 Class Notes 3 COMS 6100 Class Notes 3 Daniel Solus September 1, 2016 1 General Remarks The class was split into two main sections. We finished our introduction to Linux commands by reviewing Linux commands I and II

More information

Unix/Linux Primer. Taras V. Pogorelov and Mike Hallock School of Chemical Sciences, University of Illinois

Unix/Linux Primer. Taras V. Pogorelov and Mike Hallock School of Chemical Sciences, University of Illinois Unix/Linux Primer Taras V. Pogorelov and Mike Hallock School of Chemical Sciences, University of Illinois August 25, 2017 This primer is designed to introduce basic UNIX/Linux concepts and commands. No

More information

1. Lexical Analysis Phase

1. Lexical Analysis Phase 1. Lexical Analysis Phase The purpose of the lexical analyzer is to read the source program, one character at time, and to translate it into a sequence of primitive units called tokens. Keywords, identifiers,

More information

Week - 01 Lecture - 04 Downloading and installing Python

Week - 01 Lecture - 04 Downloading and installing Python Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 01 Lecture - 04 Downloading and

More information

CSCI 4152/6509 Natural Language Processing Lecture 6: Regular Expressions; Text Processing in Perl

CSCI 4152/6509 Natural Language Processing Lecture 6: Regular Expressions; Text Processing in Perl Lecture 6 p.1 Faculty of Computer Science, Dalhousie University CSCI 4152/6509 Natural Language Processing Lecture 6: Regular Expressions; Text Processing in Perl 18-Jan-2019 Location: LSC Psychology P5260

More information

Figure 2.1: Role of Lexical Analyzer

Figure 2.1: Role of Lexical Analyzer Chapter 2 Lexical Analysis Lexical analysis or scanning is the process which reads the stream of characters making up the source program from left-to-right and groups them into tokens. The lexical analyzer

More information

UNIX II:grep, awk, sed. October 30, 2017

UNIX II:grep, awk, sed. October 30, 2017 UNIX II:grep, awk, sed October 30, 2017 File searching and manipulation In many cases, you might have a file in which you need to find specific entries (want to find each case of NaN in your datafile for

More information

CSE 413 Final Exam Spring 2011 Sample Solution. Strings of alternating 0 s and 1 s that begin and end with the same character, either 0 or 1.

CSE 413 Final Exam Spring 2011 Sample Solution. Strings of alternating 0 s and 1 s that begin and end with the same character, either 0 or 1. Question 1. (10 points) Regular expressions I. Describe the set of strings generated by each of the following regular expressions. For full credit, give a description of the sets like all sets of strings

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

CSE 374 Programming Concepts & Tools. Brandon Myers Winter 2015 Lecture 4 Shell Variables, More Shell Scripts (Thanks to Hal Perkins)

CSE 374 Programming Concepts & Tools. Brandon Myers Winter 2015 Lecture 4 Shell Variables, More Shell Scripts (Thanks to Hal Perkins) CSE 374 Programming Concepts & Tools Brandon Myers Winter 2015 Lecture 4 Shell Variables, More Shell Scripts (Thanks to Hal Perkins) test / if Recall from last lecture: test (not built-in) takes arguments

More information

MAT 003 Brian Killough s Instructor Notes Saint Leo University

MAT 003 Brian Killough s Instructor Notes Saint Leo University MAT 003 Brian Killough s Instructor Notes Saint Leo University Success in online courses requires self-motivation and discipline. It is anticipated that students will read the textbook and complete sample

More information

Trombone players produce different pitches partly by varying the length of a tube.

Trombone players produce different pitches partly by varying the length of a tube. Trombone players produce different pitches partly by varying the length of a tube. 7 Variables A variable is a connection between a name and a value.* That sounds simple enough, but some complexities arise

More information

5/8/2012. Exploring Utilities Chapter 5

5/8/2012. Exploring Utilities Chapter 5 Exploring Utilities Chapter 5 Examining the contents of files. Working with the cut and paste feature. Formatting output with the column utility. Searching for lines containing a target string with grep.

More information

CS 124/LINGUIST 180 From Languages to Information

CS 124/LINGUIST 180 From Languages to Information CS 124/LINGUIST 180 From Languages to Information Unix for Poets Dan Jurafsky (original by Ken Church, modifications by Chris Manning) Stanford University Unix for Poets (based on Ken Church s presentation)

More information

Shell Scripting. Jeremy Sanders. October 2011

Shell Scripting. Jeremy Sanders. October 2011 Shell Scripting Jeremy Sanders October 2011 1 Introduction If you use your computer for repetitive tasks you will find scripting invaluable (one of the advantages of a command-line interface). Basically

More information

CS 124/LINGUIST 180 From Languages to Information. Unix for Poets Dan Jurafsky

CS 124/LINGUIST 180 From Languages to Information. Unix for Poets Dan Jurafsky CS 124/LINGUIST 180 From Languages to Information Unix for Poets Dan Jurafsky (original by Ken Church, modifications by me and Chris Manning) Stanford University Unix for Poets Text is everywhere The Web

More information

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version... Contents Note: pay attention to where you are........................................... 1 Note: Plaintext version................................................... 1 Hello World of the Bash shell 2 Accessing

More information

10.4 Linear interpolation method Newton s method

10.4 Linear interpolation method Newton s method 10.4 Linear interpolation method The next best thing one can do is the linear interpolation method, also known as the double false position method. This method works similarly to the bisection method by

More information

22-Sep CSCI 2132 Software Development Lecture 8: Shells, Processes, and Job Control. Faculty of Computer Science, Dalhousie University

22-Sep CSCI 2132 Software Development Lecture 8: Shells, Processes, and Job Control. Faculty of Computer Science, Dalhousie University Lecture 8 p.1 Faculty of Computer Science, Dalhousie University CSCI 2132 Software Development Lecture 8: Shells, Processes, and Job Control 22-Sep-2017 Location: Goldberg CS 127 Time: 14:35 15:25 Instructor:

More information

Masters in Computer Speech Text and Internet Technology. Module: Speech Practical. HMM-based Speech Recognition

Masters in Computer Speech Text and Internet Technology. Module: Speech Practical. HMM-based Speech Recognition Masters in Computer Speech Text and Internet Technology Module: Speech Practical HMM-based Speech Recognition 1 Introduction This practical is concerned with phone-based continuous speech recognition using

More information

Overview. Search and Decoding. HMM Speech Recognition. The Search Problem in ASR (1) Today s lecture. Steve Renals

Overview. Search and Decoding. HMM Speech Recognition. The Search Problem in ASR (1) Today s lecture. Steve Renals Overview Search and Decoding Steve Renals Automatic Speech Recognition ASR Lecture 10 January - March 2012 Today s lecture Search in (large vocabulary) speech recognition Viterbi decoding Approximate search

More information

An Introduction to Stata By Mike Anderson

An Introduction to Stata By Mike Anderson An Introduction to Stata By Mike Anderson Installation and Start Up A 50-user licensed copy of Intercooled Stata 8.0 for Solaris is accessible on any Athena workstation. To use it, simply type add stata

More information

Lab 2: Training monophone models

Lab 2: Training monophone models v. 1.1 Lab 2: Training monophone models University of Edinburgh January 29, 2018 Last time we begun to get familiar with some of Kaldi s tools and set up a data directory for TIMIT. This time we will train

More information

Essential Skills for Bioinformatics: Unix/Linux

Essential Skills for Bioinformatics: Unix/Linux Essential Skills for Bioinformatics: Unix/Linux SHELL SCRIPTING Overview Bash, the shell we have used interactively in this course, is a full-fledged scripting language. Unlike Python, Bash is not a general-purpose

More information

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs Summer 2010 Department of Computer Science and Engineering York University Toronto June 29, 2010 1 / 36 Table of contents 1 2 3 4 2 / 36 Our goal Our goal is to see how we can use Unix as a tool for developing

More information

2.2 Syntax Definition

2.2 Syntax Definition 42 CHAPTER 2. A SIMPLE SYNTAX-DIRECTED TRANSLATOR sequence of "three-address" instructions; a more complete example appears in Fig. 2.2. This form of intermediate code takes its name from instructions

More information

Introduction to Git and GitHub for Writers Workbook February 23, 2019 Peter Gruenbaum

Introduction to Git and GitHub for Writers Workbook February 23, 2019 Peter Gruenbaum Introduction to Git and GitHub for Writers Workbook February 23, 2019 Peter Gruenbaum Table of Contents Preparation... 3 Exercise 1: Create a repository. Use the command line.... 4 Create a repository...

More information

COMS 3101 Programming Languages: Perl. Lecture 2

COMS 3101 Programming Languages: Perl. Lecture 2 COMS 3101 Programming Languages: Perl Lecture 2 Fall 2013 Instructor: Ilia Vovsha http://www.cs.columbia.edu/~vovsha/coms3101/perl Lecture Outline Control Flow (continued) Input / Output Subroutines Concepts:

More information

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0. L J Howell UX Software Ver. 1.0

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0. L J Howell UX Software Ver. 1.0 VISUAL GUIDE to RX Scripting for Roulette Xtreme - System Designer 2.0 L J Howell UX Software 2009 Ver. 1.0 TABLE OF CONTENTS INTRODUCTION...ii What is this book about?... iii How to use this book... iii

More information