亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? word_align.pl

?? WinCE平臺上的語音識別程序
?? PL
字號:
#!/usr/bin/perl -w# word_align.pl - Calculate word error and accuracy for a recognition# hypothesis file vs. a reference transcription## Written by David Huggins-Daines <dhuggins@cs.cmu.edu> for Speech# Recognition and Understanding 11-751, Carnegie Mellon University,# October 2004.use strict;use Getopt::Long;use Pod::Usage;use vars qw($Verbose $IgnoreUttID);my ($help,%hyphash);GetOptions(	   'help|?' => \$help,	   'verbose|v' => \$Verbose,	   'ignore-uttid|i' => \$IgnoreUttID,	  ) or pod2usage(1);pod2usage(1) if $help;pod2usage(2) unless @ARGV == 2;my ($ref, $hyp) = @ARGV;open HYP, "<$hyp" or die "Failed to open $hyp: $!";while (defined(my $hyp_utt=<HYP>)){    my $hyp_uttid;    ($hyp_utt, $hyp_uttid) = s3_magic_norm($hyp_utt);    $hyphash{$hyp_uttid} = "$hyp_utt ($hyp_uttid)";}close HYP;open REF, "<$ref" or die "Failed to open $ref: $!";open HYP, "<$hyp" or die "Failed to open $hyp: $!";use constant INS => 1;use constant DEL => 2;use constant MATCH => 3;use constant SUBST => 4;use constant BIG_NUMBER => 1e50;my ($total_words, $total_match, $total_cost);my ($total_ins, $total_del, $total_subst);while (defined(my $ref_utt = <REF>)) {    my $hyp_utt;    my $ref_uttid;    my $hyp_uttid;    ($ref_utt,$ref_uttid)=s3_magic_norm($ref_utt);    if(defined $IgnoreUttID){	$hyp_utt = <HYP>;	die "UttID is ignored but file size mismatch between $ref and $hyp" unless defined($hyp_utt);    }else{	$hyp_utt=$hyphash{$ref_uttid};        die "UttID is not ignored but it could not found in any entries of the hypothesis file on line3 $. UTTID: $ref_uttid\n" unless defined($hyp_utt);    }    ($hyp_utt,$hyp_uttid)=s3_magic_norm($hyp_utt);    if(! defined $IgnoreUttID){	die "Utterance ID mismatch on line $.: $ref_uttid != $hyp_uttid"	    unless $ref_uttid eq $hyp_uttid;    }    # Split the text into an array of words    my @ref_words = split ' ', $ref_utt;    my @hyp_words = split ' ', $hyp_utt;    my (@align_matrix, @backtrace_matrix);    # Initialize the alignment and backtrace matrices    initialize(\@ref_words, \@hyp_words, \@align_matrix, \@backtrace_matrix);    # Do DP alignment maintaining backtrace pointers    my $cost = align(\@ref_words, \@hyp_words, \@align_matrix, \@backtrace_matrix);    # Find the backtrace    my ($alignment, $ins, $del, $subst, $match) = backtrace(\@ref_words, \@hyp_words,							    \@align_matrix, \@backtrace_matrix);    # Format the alignment nicely    my ($ref_align, $hyp_align) = ("", "");    foreach (@$alignment) {	my ($ref, $hyp) = @$_;	my $width = 0;	# Capitalize errors (they already are...), lowercase matches	if (defined($ref) and defined($hyp) and $ref eq $hyp) {	    $ref = lc $ref;	    $hyp = lc $hyp;	}	# Replace deletions with ***	foreach ($ref, $hyp) { $_ = "***" unless defined $_ };	# Find the width of this column	foreach ($ref, $hyp) { $width = length if length > $width };	$width = 3 if $width < 3; # Make it long enough for ***	# Space out the words and concatenate them to the output	$ref_align .= sprintf("%-*s ", $width, $ref);	$hyp_align .= sprintf("%-*s ", $width, $hyp);    }    print "$ref_align ($ref_uttid)\n$hyp_align ($hyp_uttid)\n";    # Print out the word error and accuracy rates    my $error = @ref_words == 0 ? 1 : $cost/@ref_words;    my $acc = @ref_words == 0 ? 0 : $match/@ref_words;    printf("Words: %d Correct: %d Errors: %d Percent correct = %.2f%% Error = %.2f%% Accuracy = %.2f%%\n",	   scalar(@ref_words), $match, $cost, $acc*100, $error*100, 100-$error*100);    print "Insertions: $ins Deletions: $del Substitutions: $subst\n";    $total_cost += $cost;    $total_match += $match;    $total_words += @ref_words;    $total_ins += $ins;    $total_del += $del;    $total_subst += $subst;}# Print out the total word error and accuracy ratesmy $error = $total_cost/$total_words;my $acc = $total_match/$total_words;printf("TOTAL Words: %d Correct: %d Errors: %d\nTOTAL Percent correct = %.2f%% Error = %.2f%% Accuracy = %.2f%%\n",       $total_words, $total_match, $total_cost, $acc*100, $error*100, 100-$error*100);print "TOTAL Insertions: $total_ins Deletions: $total_del Substitutions: $total_subst\n";# This function normalizes a line of a match file. sub s3_magic_norm{    my ($word)=@_;    # Remove line endings    chomp  $word;    # Normalize case    $word = uc $word;       # Remove filler words and context cues    $word =~ s/<[^>]+>//g;    $word =~ s/\+\+[^+]+\+\+//g;    $word =~ s/\+[^+]+\+//g;    # Remove alternative pronunciations    $word =~ s/\([1-9]\)//g;    # Remove class tags    $word =~ s/:\S+//g;    # This compute the uttid and remove it from a line.    $word =~ s/\(([^) ]+)[^)]*\)$// ;    # Split apart compound words and acronyms    $word =~ tr/_./  /;    return ($word,$1);}sub initialize {    my ($ref_words, $hyp_words, $align_matrix, $backtrace_matrix) = @_;    # All initial costs along the j axis are insertions    for (my $j = 0; $j <= @$hyp_words; ++$j) {	$$align_matrix[0][$j] = $j;    }    for (my $j = 0; $j <= @$hyp_words; ++$j) {	$$backtrace_matrix[0][$j] = INS;    }    # All initial costs along the i axis are deletions    for (my $i = 0; $i <= @$ref_words; ++$i) {	$$align_matrix[$i][0] = $i;    }    for (my $i = 0; $i <= @$ref_words; ++$i) {	$$backtrace_matrix[$i][0] = DEL;    }}sub align {    my ($ref_words, $hyp_words, $align_matrix, $backtrace_matrix) = @_;    for (my $i = 1; $i <= @$ref_words; ++$i) {	for (my $j = 1; $j <= @$hyp_words; ++$j) {	    # Find insertion, deletion, substitution scores	    my ($ins, $del, $subst);	    # Cost of a substitution (0 if they are equal)	    my $cost = $$ref_words[$i-1] ne $$hyp_words[$j-1];	    # Find insertion, deletion, substitution costs	    $ins = $$align_matrix[$i][$j-1] + 1;	    $del = $$align_matrix[$i-1][$j] + 1;	    $subst = $$align_matrix[$i-1][$j-1] + $cost;	    print "Costs at $i $j: INS $ins DEL $del SUBST $subst\n" if $Verbose;	    # Get the minimum one	    my $min = BIG_NUMBER;	    foreach ($ins, $del, $subst) {		if ($_ < $min) {		    $min = $_;		}	    }	    $$align_matrix[$i][$j] = $min;	    # If the costs are equal, prefer match or substitution	    # (keep the path diagonal).	    if ($min == $subst) {		print(($cost ? "SUBSTITUTION" : "MATCH"),		      "($$ref_words[$i-1] <=> $$hyp_words[$j-1])\n") if $Verbose;		$$backtrace_matrix[$i][$j] = MATCH+$cost;	    }	    elsif ($min == $ins) {		print "INSERTION (0 => $$hyp_words[$j-1])\n" if $Verbose;		$$backtrace_matrix[$i][$j] = INS;	    }	    elsif ($min == $del) {		print "DELETION ($$ref_words[$i-1] => 0)\n" if $Verbose;		$$backtrace_matrix[$i][$j] = DEL;	    }	}    }    return $$align_matrix[@$ref_words][@$hyp_words];}sub backtrace {    my ($ref_words, $hyp_words, $align_matrix, $backtrace_matrix) = @_;    # Backtrace to find number of ins/del/subst    my @alignment;    my $i = @$ref_words;    my $j = @$hyp_words;    my ($inspen, $delpen, $substpen, $match) = (0,0,0,0);    while (!($i == 0 and $j == 0)) {	my $pointer = $$backtrace_matrix[$i][$j];	print "Cost at $i $j: $$align_matrix[$i][$j]\n"	    if $Verbose;	if ($pointer == INS) {	    print "INSERTION (0 => $$hyp_words[$j-1])" if $Verbose;	    # Append the pair 0:hyp[j] to the front of the alignment	    unshift @alignment, [undef, $$hyp_words[$j-1]];	    ++$inspen;	    --$j;	    print " - moving to $i $j\n" if $Verbose;	}	elsif ($pointer == DEL) {	    print "DELETION ($$ref_words[$i-1] => 0)" if $Verbose;	    # Append the pair ref[i]:0 to the front of the alignment	    unshift @alignment, [$$ref_words[$i-1], undef];	    ++$delpen;	    --$i;	    print " - moving to $i $j\n" if $Verbose;	}	elsif ($pointer == MATCH) {	    print "MATCH ($$ref_words[$i-1] <=> $$hyp_words[$j-1])" if $Verbose;	    # Append the pair ref[i]:hyp[j] to the front of the alignment	    unshift @alignment, [$$ref_words[$i-1], $$hyp_words[$j-1]];	    ++$match;	    --$j;	    --$i;	    print " - moving to $i $j\n" if $Verbose;	}	elsif ($pointer == SUBST) {	    print "SUBSTITUTION ($$ref_words[$i-1] <=> $$hyp_words[$j-1])" if $Verbose;	    # Append the pair ref[i]:hyp[j] to the front of the alignment	    unshift @alignment, [$$ref_words[$i-1], $$hyp_words[$j-1]];	    ++$substpen;	    --$j;	    --$i;	    print " - moving to $i $j\n" if $Verbose;	}	else {	    last;	}    }    return (\@alignment, $inspen, $delpen, $substpen, $match);}__END__=head1 NAMEcalculate_wer - Calculate Word Error Rate from a reference and hypothesis file=head1 SYNOPSIS calculate_wer [options] reference_file hypothesis_file=head1 OPTIONS=over 8=item B<--help>, B<-?>Print a brief help message and exit.=item B<--verbose>, B<-v>Print out messages tracing the alignment algorithm.=cut

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久国产一区二区三区四区| 亚洲视频香蕉人妖| 欧美一区二区三区四区在线观看 | 亚洲午夜精品在线| 欧美激情一区二区三区在线| 日韩精品一区二区三区中文精品| 在线观看不卡视频| 91亚洲男人天堂| 成人动漫一区二区三区| 国产一区二区三区香蕉| 久久er99热精品一区二区| 日韩国产欧美一区二区三区| 亚洲综合免费观看高清完整版| 亚洲色图一区二区| 亚洲色图都市小说| 中文字幕亚洲成人| 日韩一区在线免费观看| 亚洲欧洲中文日韩久久av乱码| 18欧美乱大交hd1984| 成人欧美一区二区三区在线播放| 国产精品成人免费在线| 欧美激情综合五月色丁香 | 国产一区二区三区免费播放 | 亚洲精品成人悠悠色影视| 国产精品激情偷乱一区二区∴| 国产精品电影一区二区三区| 中文在线免费一区三区高中清不卡| 精品卡一卡二卡三卡四在线| 欧美大胆一级视频| 国产日韩高清在线| 国产精品乱人伦| 日韩一区在线免费观看| 亚洲激情五月婷婷| 香港成人在线视频| 男女激情视频一区| 国产精品88888| 成人免费视频视频| 91丨九色丨国产丨porny| 在线免费观看一区| 欧美挠脚心视频网站| 91精品国模一区二区三区| 日韩一区二区电影网| 日韩欧美激情四射| 久久精品水蜜桃av综合天堂| 国产精品久久夜| 亚洲精品亚洲人成人网在线播放| 亚洲国产精品一区二区久久恐怖片 | 中文字幕一区日韩精品欧美| 亚洲欧美日韩国产综合在线| 亚洲国产精品自拍| 久久99精品久久久久久| 成人精品亚洲人成在线| 欧美亚洲图片小说| 精品国产欧美一区二区| 国产精品久久99| 亚洲一区二区三区四区在线免费观看| 午夜视频在线观看一区二区三区| 亚洲v精品v日韩v欧美v专区| 美女脱光内衣内裤视频久久网站 | 国产精品人成在线观看免费| 亚洲成人在线免费| 国产精品一区久久久久| 色婷婷久久久亚洲一区二区三区| 欧美久久久久中文字幕| 国产日产欧产精品推荐色| 亚洲欧洲精品天堂一级| 亚洲狠狠爱一区二区三区| 国内不卡的二区三区中文字幕| 色悠悠久久综合| 91精选在线观看| 国产精品三级av在线播放| 亚洲第一综合色| 成人午夜av电影| 色综合久久66| 欧美r级在线观看| 亚洲午夜在线电影| www.亚洲国产| 91麻豆精品国产91久久久使用方法 | 欧美老人xxxx18| 亚洲欧洲av在线| 免费xxxx性欧美18vr| 色综合久久中文综合久久牛| 欧美一区二区视频在线观看| 国产精品黄色在线观看| 精品一区中文字幕| 欧美日韩综合在线免费观看| 国产欧美久久久精品影院| 色综合久久中文综合久久97| 26uuu欧美| 久久99久久精品| 粉嫩aⅴ一区二区三区四区| 精品少妇一区二区三区在线播放 | 亚洲免费观看高清完整版在线观看熊| 国产精品一二三四| 久久久精品日韩欧美| 国产一区二区在线看| 欧美xxx久久| 国产一区二区三区久久久| 日韩一级欧美一级| 91麻豆免费看| 欧美日本乱大交xxxxx| 久久婷婷成人综合色| 久久精品国产一区二区三 | 久久久久久久综合日本| 色综合天天综合网天天看片| 综合久久一区二区三区| 99天天综合性| 亚洲丝袜制服诱惑| 在线视频综合导航| 亚洲国产精品影院| 欧美一区二区三区四区高清| 美女在线一区二区| 久久夜色精品国产欧美乱极品| 国产自产高清不卡| 日本一区二区三区在线不卡| 成人午夜在线播放| 亚洲色图视频网| 欧美日韩精品一区二区三区蜜桃 | 一本大道av伊人久久综合| 一区二区三区小说| 香蕉乱码成人久久天堂爱免费| 久久99国产精品麻豆| 久久综合狠狠综合久久激情| 国产69精品久久99不卡| 国产精品美女久久久久久久网站| 不卡的av电影在线观看| 一区二区三区日韩| 91精品国产综合久久精品图片| 老司机免费视频一区二区三区| 久久青草欧美一区二区三区| 不卡一区二区三区四区| 亚洲最新视频在线播放| 欧美高清视频不卡网| 久久99这里只有精品| 国产精品传媒视频| 欧美日韩高清一区二区三区| 久久99国产精品成人| 亚洲欧洲日产国码二区| 欧美乱妇20p| 国产69精品久久777的优势| 一区二区三区在线免费视频| 91精品在线免费| 国产成人精品网址| 亚洲成人激情自拍| 久久九九影视网| 欧美日韩一二三| 国产精品一区一区三区| 亚洲自拍另类综合| 久久久久久久av麻豆果冻| 色噜噜狠狠成人网p站| 蜜臀av一级做a爰片久久| 国产精品私房写真福利视频| 欧美日韩国产天堂| 成人午夜视频在线| 免费成人av在线播放| 亚洲精品你懂的| 精品欧美一区二区三区精品久久| 99免费精品在线观看| 美女视频黄久久| 亚洲精品国产视频| 国产亚洲欧美激情| 欧美日韩久久久一区| 成人av网址在线| 精品一区二区三区视频在线观看| 亚洲一二三四久久| 国产精品久久久久三级| 日韩女优视频免费观看| 色综合亚洲欧洲| 国产成人精品影视| 免费看日韩a级影片| 亚洲精品中文字幕乱码三区| 久久免费国产精品| 欧美一区二区成人6969| 色94色欧美sute亚洲线路一久| 国产一区二区三区视频在线播放| 日韩精彩视频在线观看| 中文字幕一区二区三| 精品国产一二三| 日韩精品一区二区三区中文精品| 欧美体内she精视频| 色天天综合久久久久综合片| 国产精品一区二区免费不卡| 免费一级片91| 天天亚洲美女在线视频| 尤物在线观看一区| 国产精品久久久久久久裸模| 久久久精品国产免费观看同学| 在线播放中文一区| 欧美精品乱码久久久久久| 在线亚洲一区观看| 91九色最新地址| 91网站视频在线观看| 日韩女优视频免费观看| 欧美群妇大交群中文字幕| 91啪亚洲精品| 91免费视频大全| 日本高清不卡视频| 91久久国产最好的精华液| 91女神在线视频| 在线免费观看不卡av|