From 561670accdc5aa799e7d2ba3ce3fa2f825a656fa Mon Sep 17 00:00:00 2001 From: rey jean-Francois Date: Thu, 1 Aug 2013 14:15:41 +0200 Subject: [PATCH] remove output redirections --- main_tools/ConfPass.sh | 11 +++--- main_tools/ExploitConfidencePass.sh | 71 +++++++++++++++++++------------------ main_tools/FirstPass.sh | 21 +++++------ main_tools/SecondPass.sh | 21 +++++------ main_tools/ThirdPass.sh | 15 ++++---- 5 files changed, 66 insertions(+), 73 deletions(-) diff --git a/main_tools/ConfPass.sh b/main_tools/ConfPass.sh index b56b845..679b348 100755 --- a/main_tools/ConfPass.sh +++ b/main_tools/ConfPass.sh @@ -84,9 +84,6 @@ if [ $DEBUG -eq 1 ] then set -x echo -e "## Mode DEBUG ON ##" - REDIRECTION_OUTPUT="" - else - REDIRECTION_OUTPUT=" 2> /dev/null" fi # mode verbose enable @@ -114,6 +111,8 @@ then exit 1 fi +print_info "[${BASENAME}] => Conf Pass start | $(date +'%d/%m/%y %H:%M:%S')" 1 + #-------------# # GLOBAL VARS # #-------------# @@ -216,7 +215,7 @@ then if [ $pourcentageres -lt 85 ] then print_info "[${BASENAME}] Calcul Confidence $INPUT_DIR $RES_NAME" 1 - $MAIN_SCRIPT_PATH/ConfidenceMeasure.sh $INPUT_DIR $RES_NAME $REDIRECTION_OUTPUT + $MAIN_SCRIPT_PATH/ConfidenceMeasure.sh $INPUT_DIR $RES_NAME else print_info "[${BASENAME}] Skipping Confidence Calcul $INPUT_DIR/$RES_NAME" 1 @@ -242,8 +241,8 @@ for f in `ls ${RES_CONF_DIR}`; do $SCRIPT_PATH/formatRES.pl $RES_CONF_DIR/$f; do # create USF configuration file echo -e "name $AUTHOR\nfileName $BASENAME\nfileExt wav\nsegFile $OUTPUT_DIR/$BASENAME.seg" > $OUTPUT_DIR/$BASENAME.usf_cfg # create USF file -print_info "$SCRIPT_PATH/res2out.pl --dir $RES_CONF_DIR --format USF --ignore $RULES/asupp --out $USF_FILE.tmp --usf_config $OUTPUT_DIR/$BASENAME.usf_cfg $REDIRECTION_OUTPUT" 3 -$SCRIPT_PATH/res2out.pl --dir $RES_CONF_DIR --format USF --ignore $RULES/asupp --out $USF_FILE.tmp --usf_config $OUTPUT_DIR/$BASENAME.usf_cfg $REDIRECTION_OUTPUT +print_info "$SCRIPT_PATH/res2out.pl --dir $RES_CONF_DIR --format USF --ignore $RULES/asupp --out $USF_FILE.tmp --usf_config $OUTPUT_DIR/$BASENAME.usf_cfg" 3 +$SCRIPT_PATH/res2out.pl --dir $RES_CONF_DIR --format USF --ignore $RULES/asupp --out $USF_FILE.tmp --usf_config $OUTPUT_DIR/$BASENAME.usf_cfg rm $OUTPUT_DIR/$BASENAME.usf_cfg > /dev/null 2>&1 cat $USF_FILE.tmp | $SCRIPT_PATH/BdlexUC.pl $RULES/basic -f > $USF_FILE cp $USF_FILE ${OUTPUT_DIR}/${BASENAME}.usf diff --git a/main_tools/ExploitConfidencePass.sh b/main_tools/ExploitConfidencePass.sh index 3314b72..93183dd 100755 --- a/main_tools/ExploitConfidencePass.sh +++ b/main_tools/ExploitConfidencePass.sh @@ -92,9 +92,6 @@ if [ $DEBUG -eq 1 ] then set -x echo -e "## Mode DEBUG ON ##" - REDIRECTION_OUTPUT="" - else - REDIRECTION_OUTPUT=" 2> /dev/null" fi # mode verbose enable @@ -116,6 +113,8 @@ then exit 1 fi +print_info "[${BASENAME}] => ExploitConfPass start | $(date +'%d/%m/%y %H:%M:%S')" 1 + #-------------# # GLOBAL VARS # #-------------# @@ -173,6 +172,10 @@ echo "LEX_SPEERAL=$EXT_LEX/speeral/${lexname}_ext" >> $OUTPUT_DIR/ExploitConfPas echo "LEX_BINODE_SPEERAL=$EXT_LEX/speeral/${lexname}_ext.bin" >> $OUTPUT_DIR/ExploitConfPass.cfg print_info "[${BASENAME}] Save config in $OUTPUT_DIR_BASENAME/ExploitConfPass.cfg" 1 +#---------------# +# Check Pass # +#---------------# + #-----------------------# # Segmentation by show # #-----------------------# @@ -182,25 +185,25 @@ print_info "[${BASENAME}] Save config in $OUTPUT_DIR_BASENAME/ExploitConfPass.cf # segment using the last generated file # and create a ctm file by show -print_info "Segmentation by show" 1 +print_info "[${BASENAME}] Segmentation by show" 1 # -> to txt -print_info "Create txt from scored res" 2 +print_info "[${BASENAME}] Create txt from scored res" 2 cat ${RES_CONF_DIR}/*.res > $INPUT_DIR/$BASENAME.sctm cat $INPUT_DIR/$BASENAME.seg | $SIGMUND_BIN/myConvert.pl $INPUT_DIR/$BASENAME.sctm $INPUT_DIR/$BASENAME.tmp cat $INPUT_DIR/$BASENAME.tmp | $SCRIPT_PATH/BdlexUC.pl $RULES/basic -f | sed -e "s/_/ /g" | sort -nt 'n' -k '2' > $INPUT_DIR/$BASENAME.txt # -> to tagger + lemme -print_info "Tag pos and lem in txt file" 2 +print_info "[${BASENAME}] Tag pos and lem in txt file" 2 iconv -t ISO_8859-1 $INPUT_DIR/$BASENAME.txt > $INPUT_DIR/$BASENAME.tmp $SIGMUND_BIN/txt2lem.sh $INPUT_DIR/$BASENAME.tmp $INPUT_DIR/$BASENAME.taglem # merge sctm and taglem -print_info "Merge scored ctm with tag pos and lem file" 2 +print_info "[${BASENAME}] Merge scored ctm with tag pos and lem file" 2 cat $INPUT_DIR/$BASENAME.sctm | $SCRIPT_PATH/BdlexUC.pl ${RULES}/basic -f | iconv -t ISO_8859-1 | $SCRIPT_PATH/scoredCtmAndTaggedLem2All.pl $INPUT_DIR/$BASENAME.taglem > $INPUT_DIR/$BASENAME.ctl # -> new seg -print_info "Create xml file and run Topic Seg" 2 +print_info "[${BASENAME}] Create xml file and run Topic Seg" 2 $SIGMUND_BIN/tagLem2xml.pl $INPUT_DIR/$BASENAME.taglem $INPUT_DIR/$BASENAME.doc.xml rm $INPUT_DIR/$BASENAME.tmp #$INPUT_DIR/$BASENAME.taglem @@ -212,12 +215,12 @@ rm 0.xml $INPUT_DIR/show.seg if [ $CHECK -eq 1 ] then - if [ ! -s $INPUT_DIR/$BASENAME.show.seg ];then echo -e "ERROR : no Topic segmentation" >> $ERRORFILE; fi + if [ ! -s $INPUT_DIR/$BASENAME.show.seg ];then echo -e "[${BASENAME}] ERROR : no Topic segmentation" >> $ERRORFILE; fi fi # Segment ctm into several show files and create a seg list by show -print_info "Segment ctm into show files and a seg list by show" 2 -$SCRIPT_PATH/ctm2show.pl $INPUT_DIR/$BASENAME.ctl $INPUT_DIR/$BASENAME.show.seg $SHOW_DIR $REDIRECTION_OUTPUT +print_info "[${BASENAME}] Segment ctm into show files and a seg list by show" 2 +$SCRIPT_PATH/ctm2show.pl $INPUT_DIR/$BASENAME.ctl $INPUT_DIR/$BASENAME.show.seg $SHOW_DIR #-----------------------------------------------------------# # SOLR QUERIES # @@ -227,7 +230,7 @@ $SCRIPT_PATH/ctm2show.pl $INPUT_DIR/$BASENAME.ctl $INPUT_DIR/$BASENAME.show.seg # concat word + add date 2 day before and after the show # # query document & multimedia # #-----------------------------------------------------------# -print_info "Create SOLR queries and ASK SOLR" 1 +print_info "[${BASENAME}] Create SOLR queries and ASK SOLR" 1 for show in $(ls $SHOW_DIR/*.ctm) do bn=$(basename $show .ctm) @@ -241,7 +244,7 @@ do if [ $(wc -w "$SHOW_DIR/$bn.queries" | cut -f1 -d' ') -gt 0 ]; then query=$(cat $SHOW_DIR/$bn.queries)"&fq=docDate:[$datePattern]" echo $query > $SHOW_DIR/$bn.queries - python $SCRIPT_PATH/ProcessSOLRQueries.py $SHOW_DIR/$bn.queries $SOLR_RES/$bn.keywords.tmp $SOLR_RES/$bn.txt.tmp $REDIRECTION_OUTPUT + python $SCRIPT_PATH/ProcessSOLRQueries.py $SHOW_DIR/$bn.queries $SOLR_RES/$bn.keywords.tmp $SOLR_RES/$bn.txt.tmp cat $SOLR_RES/$bn.keywords.tmp | sort -u > $SOLR_RES/$bn.keywords cat $SOLR_RES/$bn.txt.tmp | sort -u > $SOLR_RES/$bn.txt rm $SOLR_RES/*.tmp > /dev/null 2>&1 @@ -266,7 +269,7 @@ done # 3) Try to find OOVs acousticly in the current segment # 4) Generate the .trigg file #------------------------------------------------------------------------------------------------ -print_info "Build trigger files" 1 +print_info "[${BASENAME}] Build trigger files" 1 for i in `ls $SOLR_RES/*.keywords` do basename=`basename $i .keywords` @@ -275,7 +278,7 @@ do # Tokenize & produce coverage report # Use filter you need # - print_info "keywords filtering and produce coverage report" 2 + print_info "[${BASENAME}] keywords filtering and produce coverage report" 2 # Default filter cat $i | $SCRIPT_PATH/CleanFilter.sh | ${SCRIPT_PATH}/ApplyCorrectionRules.pl ${LEXICON}.regex | $SCRIPT_PATH/BdlexUC.pl $RULES/basic -t |\ $SCRIPT_PATH/CoverageReportMaker.pl --out $SOLR_RES/${basename}_tmp_report $LEXICON.bdlex_tok @@ -287,13 +290,13 @@ do # Extract "real" OOV and phonetize them # -> petit filtrage persoo pour eviter d'avoir trop de bruits # - print_info "Extract OOV and phonetize them" 2 + print_info "[${BASENAME}] Extract OOV and phonetize them" 2 ${SCRIPT_PATH}/FindNormRules.pl $SOLR_RES/${basename}_tmp_report/report.oov $LEXICON.bdlex_tok | cut -f3 | grep -v "#" | grep -v "^[A-Z]\+$" | grep -v "^[0-9]" | grep --perl-regex -v "^([a-z']){1,3}$" | $SCRIPT_PATH/BdlexUC.pl $RULES/basic -f | iconv -t ISO_8859-1 -f UTF-8 | ${LIA_LTBOX}/lia_phon/script/lia_lex2phon_variante | grep -v "core dumped" | cut -d"[" -f1 | sort -u | ${SCRIPT_PATH}/PhonFormatter.pl | iconv -f ISO_8859-1 -t UTF-8 | $SCRIPT_PATH/BdlexUC.pl $RULES/basic -t > $SOLR_RES/${basename}.phon_oov # # Search INVOC & OOV in the current lattice # - print_info "Search INVOC and OOV in the current lattice" 2 + print_info "[${BASENAME}] Search INVOC and OOV in the current lattice" 2 cat $SOLR_RES/${basename}_tmp_report/report.invoc | grep -v "\b0" | cut -f1 | grep -v --perl-regex -v "^[a-zA-Z']{1,3}$" | grep -v --perl-regex "^[a-zA-Z0-9]{1,3}$" | grep -v "" | grep -v "" | $SCRIPT_PATH/BdlexUC.pl $RULES/basic -t > $TRIGGER_CONFZONE/$basename.tosearch cat $SOLR_RES/${basename}.phon_oov | cut -f1 >> $TRIGGER_CONFZONE/$basename.tosearch @@ -304,7 +307,7 @@ do # # Produce the boost file for the next decoding pass # - print_info "Produce trigg file : $baseseg " 3 + print_info "[${BASENAME}] Produce trigg file : $baseseg " 3 cat $RES_CONF_DIR/$baseseg.res | $SCRIPT_PATH/ScoreCtm2trigg.pl $TRIGGER_CONFZONE/$baseseg.acousticlyfound > $TRIGGER_CONFZONE/$baseseg.trigg done @@ -316,14 +319,14 @@ done # 1) Related text are collected in order to find the invoc word with maximizing the ppl (LM proba) # 2) The current lexicon is extended with all the valid OOVs #----------------------------------------------------------------------------------------------- -print_info "Build extended Speeral Lexicon" 1 +print_info "[${BASENAME}] Build extended Speeral Lexicon" 1 mkdir -p $EXT_LEX/final mkdir -p $EXT_LEX/tmp mkdir -p $EXT_LEX/tmp/txt # # Collect the acousticly found oov and their phonetisation # -print_info "Get all OOV and retrieve all phonetisation" 2 +print_info "[${BASENAME}] Get all OOV and retrieve all phonetisation" 2 for i in `ls $SOLR_RES/*.phon_oov` do basename=`basename $i .phon_oov` @@ -341,7 +344,7 @@ do # Extract OOV really added # cat $SOLR_RES/$basename.phon_oov | cut -f1 | sort -u > $EXT_LEX/$basename.oov - $SCRIPT_PATH/intersec.pl $EXT_LEX/$basename.oov $EXT_LEX/$basename.acousticlyfound > $EXT_LEX/$basename.oov_acousticlyfound $REDIRECTION_OUTPUT + $SCRIPT_PATH/intersec.pl $EXT_LEX/$basename.oov $EXT_LEX/$basename.acousticlyfound > $EXT_LEX/$basename.oov_acousticlyfound # # Retrieve all phonetisation # @@ -351,16 +354,16 @@ done # # Merge OOVs and their phonetisation # -print_info "Merge OOV and their phonetisation" 2 +print_info "[${BASENAME}] Merge OOV and their phonetisation" 2 lexname=$(basename $LEXICON) cat $EXT_LEX/*.oov_acousticlyfound_phon | sort -u > $EXT_LEX/final/all.oov_acousticlyfound_phon cat $EXT_LEX/*.oov_acousticlyfound | sort -u | grep --perl-regex -v "^([a-z']){3}$" > $EXT_LEX/final/all.oov_acousticlyfound -$SCRIPT_PATH/MergeLexicon.pl $EXT_LEX/final/all.oov_acousticlyfound_phon > $EXT_LEX/final/${lexname}_ext.phon $REDIRECTION_OUTPUT +$SCRIPT_PATH/MergeLexicon.pl $EXT_LEX/final/all.oov_acousticlyfound_phon > $EXT_LEX/final/${lexname}_ext.phon # # Collect + clean retrieved txt # -print_info "Collect and clean SOLR txt answers" 2 +print_info "[${BASENAME}] Collect and clean SOLR txt answers" 2 # choose filter # default cat $SOLR_RES/*.txt | $SCRIPT_PATH/CleanFilter.sh | $SCRIPT_PATH/ApplyCorrectionRules.pl ${LEXICON}.regex | $SCRIPT_PATH/BdlexUC.pl $RULES/basic -t > $EXT_LEX/final/all.bdlex_txt @@ -374,7 +377,7 @@ cat $SOLR_RES/*.txt | $SCRIPT_PATH/CleanFilter.sh | $SCRIPT_PATH/ApplyCorrection # - Expected format : # # -print_info "Construct map file" 2 +print_info "[${BASENAME}] Construct map file" 2 rm -f $EXT_LEX/final/${lexname}_ext.map 2>/dev/null rm -f $EXT_LEX/final/${lexname}.unvalid_oov 2>/dev/null @@ -392,7 +395,7 @@ do if [ -f $EXT_LEX/tmp/txt/$oov.bdlex_txt ]; then nbWords=`wc -l $EXT_LEX/tmp/txt/$oov.bdlex_txt | cut -f1 -d" "` if [ $nbWords -eq 0 ]; then - echo "UNVALID OOV: $oov => $nbWords occurrences" + echo "[${BASENAME}] UNVALID OOV: $oov => $nbWords occurrences" echo "$oov" >> $EXT_LEX/final/${lexname}.unvalid_oov else # @@ -408,12 +411,12 @@ do echo "$phonLine" | sed "s|\t|\t$candidate\t|" >> $EXT_LEX/final/${lexname}_ext.map done < $EXT_LEX/tmp/$oov.phon else - echo "UNVALID OOV: $oov => no availaible Candidate word in LM" + echo "[${BASENAME}] UNVALID OOV: $oov => no availaible Candidate word in LM" echo "$oov" >> $EXT_LEX/final/${lexname}.unvalid_oov fi fi else - echo "UNVALID OOV: $oov" + echo "[${BASENAME}] UNVALID OOV: $oov" echo "$oov" >> $EXT_LEX/final/${lexname}.unvalid_oov fi done < $EXT_LEX/final/all.oov_acousticlyfound @@ -426,7 +429,7 @@ lexname=`basename $LEXICON` # # Build the final trigger file # -print_info "Clean trigg files" 2 +print_info "[${BASENAME}] Clean trigg files" 2 mkdir -p $TRIGGER_CONFZONE/speeral/ 2> /dev/null mkdir -p $EXT_LEX/speeral/ 2> /dev/null for i in `ls $TRIGGER_CONFZONE/*.trigg` @@ -437,15 +440,15 @@ done # # Compile the speeral extended lexicon # -print_info "Compile Speeral extended lexicon" 2 -$SPEERAL_PATH/bin/buildmappedbinode $LEXICON.bdlex_phon $EXT_LEX/final/${lexname}_ext.map $AM_SKL $EXT_LEX/speeral/${lexname}_ext $REDIRECTION_OUTPUT +print_info "[${BASENAME}] Compile Speeral extended lexicon" 2 +$SPEERAL_PATH/bin/buildmappedbinode $LEXICON.bdlex_phon $EXT_LEX/final/${lexname}_ext.map $AM_SKL $EXT_LEX/speeral/${lexname}_ext if [ $CHECK -eq 1 ] then check_exploitconfpass_lex_check "${EXT_LEX}/speeral/${lexname}_ext" if [ $? -eq 1 ] then - echo -e "ERROR : Building Speeral Lexicon $INPUT_DIR " >> $ERRORFILE + echo -e "[${BASENAME}] ERROR : Building Speeral Lexicon $INPUT_DIR " >> $ERRORFILE exit 1; fi fi @@ -455,8 +458,8 @@ fi # CLOSE # #-------# # Seem OK -print_info "<= End $BASENAME Solr | $(date +'%d/%m/%y %H:%M:%S')" 1 -echo -e "#Solr $BASENAME " >> $LOGFILE +print_info "[${BASENAME}] <= End $BASENAME Solr | $(date +'%d/%m/%y %H:%M:%S')" 1 +echo -e "[${BASENAME}] #Solr $BASENAME " >> $LOGFILE # unlock directory mv "$OUTPUT_DIR/EXPLOITCONFPASS.lock" "$OUTPUT_DIR/EXPLOITCONFPASS.unlock" diff --git a/main_tools/FirstPass.sh b/main_tools/FirstPass.sh index 30e853c..75ee49f 100755 --- a/main_tools/FirstPass.sh +++ b/main_tools/FirstPass.sh @@ -88,9 +88,6 @@ if [ $DEBUG -eq 1 ] then set -x echo -e "## Mode DEBUG ON ##" - REDIRECTION_OUTPUT="" -else - REDIRECTION_OUTPUT=" 2> /dev/null" fi # mode verbose enable @@ -201,7 +198,7 @@ if [ $error -eq 1 ] then print_message $WARNING 2 "[${BASENAME}] $WAV_FILE is not a wav file at 16000 Hz, 1 channel, 16bits\nhave to convert" print_message $INFO 3 "[${BASENAME}] avconv -i $WAV_FILE -threads 4 -vn -f wav -ac 1 -ar 16000 -ab 256000 $OUTPUT_DIR_BASENAME/$BASENAME.wav" - avconv -i $WAV_FILE -threads 4 -vn -f wav -ac 1 -ar 16000 -ab 256000 $OUTPUT_DIR_BASENAME/$BASENAME.wav $REDIRECTION_OUTPUT + avconv -i $WAV_FILE -threads 4 -vn -f wav -ac 1 -ar 16000 -ab 256000 $OUTPUT_DIR_BASENAME/$BASENAME.wav WAV_FILE=$OUTPUT_DIR_BASENAME/$BASENAME.wav FILENAME=$BASENAME.wav print_message $INFO 1 "[${BASENAME}] new wav file : $WAV_FILE" @@ -223,7 +220,7 @@ print_info "[${BASENAME}] convert WAV -> PLP" 1 echo $FILENAME > $OUTPUT_DIR_BASENAME/list.tmp print_info "[${BASENAME}] $BIN_PATH/lia_plp_mt.32 --lst $OUTPUT_DIR_BASENAME/list.tmp --input_dir $(dirname $WAV_FILE) --output_dir $OUTPUT_DIR_BASENAME --input_type WAV --output_type HTK --nb_coef 12 --cms" 3 -$BIN_PATH/lia_plp_mt$ARCH --lst $OUTPUT_DIR_BASENAME/list.tmp --input_dir $(dirname $WAV_FILE) --output_dir $OUTPUT_DIR_BASENAME --input_type WAV --output_type HTK --nb_coef 12 --cms $REDIRECTION_OUTPUT +$BIN_PATH/lia_plp_mt$ARCH --lst $OUTPUT_DIR_BASENAME/list.tmp --input_dir $(dirname $WAV_FILE) --output_dir $OUTPUT_DIR_BASENAME --input_type WAV --output_type HTK --nb_coef 12 --cms if [ $CHECK -eq 1 ] then @@ -245,7 +242,7 @@ print_info "[${BASENAME}] Launch speakers diarization" 1 # Calcul seg file print_info "[${BASENAME}] java -Xmx4096m -jar $BIN_PATH/LIUM_SpkDiarization-4.2.jar --fInputMask=${WAV_FILE} --sOutputMask=${SEG_FILE} $BASENAME" 3 #java -Xmx8000m -Xms2048 -jar $BIN_PATH/LIUM_SpkDiarization-4.2.jar --fInputMask=${WAV_FILE} --sOutputMask=${SEG_FILE} $BASENAME -java -Xmx4096m -jar $BIN_PATH/LIUM_SpkDiarization-4.2.jar --fInputMask=${WAV_FILE} --sOutputMask=${SEG_FILE} $BASENAME $REDIRECTION_OUTPUT #–doCEClustering +java -Xmx4096m -jar $BIN_PATH/LIUM_SpkDiarization-4.2.jar --fInputMask=${WAV_FILE} --sOutputMask=${SEG_FILE} $BASENAME #–doCEClustering if [ $CHECK -eq 1 ] && ( [ ! -e $SEG_FILE ] || [ -z $SEG_FILE ] ) then @@ -274,7 +271,7 @@ fi print_info "[${BASENAME}] Cut PLP file depending to LBL segmentations" 1 print_info "[${BASENAME}] $BIN_PATH/gcep $PLP_FILE $LBL_FILE 500 $PLP_DIR -FSEG" 3 -$SPEERAL_TOOLS/gcep $PLP_FILE $LBL_FILE 500 $PLP_DIR -FSEG $REDIRECTION_OUTPUT +$SPEERAL_TOOLS/gcep $PLP_FILE $LBL_FILE 500 $PLP_DIR -FSEG if [ $CHECK -eq 1 ] then @@ -326,9 +323,9 @@ do todo=$OUTPUT_DIR_BASENAME/plp_${MODS[$i]}.lst while [ $redo -gt 0 ]; do rm $RES_DIR/*.lock > /dev/null 2>&1 - print_info "[${BASENAME}] $SPEERAL_BIN $todo $RES_DIR ${SPEERAL_CFG[$i]} -r $PLP_DIR -m $SPEERAL_AM/${MODS[$i]}.hmm -c $SPEERAL_AM/${MODS[$i]}.cls $FORKS --lock $REDIRECTION_OUTPUT" 3 + print_info "[${BASENAME}] $SPEERAL_BIN $todo $RES_DIR ${SPEERAL_CFG[$i]} -r $PLP_DIR -m $SPEERAL_AM/${MODS[$i]}.hmm -c $SPEERAL_AM/${MODS[$i]}.cls $FORKS --lock" 3 # Run speeral - $SPEERAL_BIN ${todo} $RES_DIR ${SPEERAL_CFG[$i]} -r $PLP_DIR -m $SPEERAL_AM/${MODS[$i]}.hmm -c $SPEERAL_AM/${MODS[$i]}.cls $FORKS --lock $REDIRECTION_OUTPUT + $SPEERAL_BIN ${todo} $RES_DIR ${SPEERAL_CFG[$i]} -r $PLP_DIR -m $SPEERAL_AM/${MODS[$i]}.hmm -c $SPEERAL_AM/${MODS[$i]}.cls $FORKS --lock # Check if error if [ $CHECK -eq 1 ] @@ -386,15 +383,15 @@ fi #---------------# print_info "[${BASENAME}] Convert .res into .ctm" 1 # .res => .ctm -$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format CTM --ignore $RULES/asupp --out $OUTPUT_DIR_BASENAME/$BASENAME.1pass.ctm $REDIRECTION_OUTPUT +$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format CTM --ignore $RULES/asupp --out $OUTPUT_DIR_BASENAME/$BASENAME.1pass.ctm print_info "[${BASENAME}] Convert .res into .trs" 1 # .res => .trs echo -e "name $AUTHOR\nfileName $BASENAME\nfileExt wav\nsegFile $OUTPUT_DIR_BASENAME/$BASENAME.seg" > $OUTPUT_DIR_BASENAME/$BASENAME.trs_cfg -$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TRS --ignore $RULES/asupp --out $OUTPUT_DIR_BASENAME/$BASENAME.1pass.trs --trs_config $OUTPUT_DIR_BASENAME/$BASENAME.trs_cfg $REDIRECTION_OUTPUT +$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TRS --ignore $RULES/asupp --out $OUTPUT_DIR_BASENAME/$BASENAME.1pass.trs --trs_config $OUTPUT_DIR_BASENAME/$BASENAME.trs_cfg rm $OUTPUT_DIR_BASENAME/$BASENAME.trs_cfg 2> /dev/null print_info "[${BASENAME}] Convert .res into .txt" 1 # .res => .txt -$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TXT --ignore $RULES/asupp --out $OUTPUT_DIR_BASENAME/$BASENAME.1pass.txt $REDIRECTION_OUTPUT +$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TXT --ignore $RULES/asupp --out $OUTPUT_DIR_BASENAME/$BASENAME.1pass.txt print_info "[${BASENAME}] <= P1 End | $(date +'%d/%m/%y %H:%M:%S')" 1 # unlock directory diff --git a/main_tools/SecondPass.sh b/main_tools/SecondPass.sh index 99f2a76..14fb2c6 100755 --- a/main_tools/SecondPass.sh +++ b/main_tools/SecondPass.sh @@ -88,9 +88,6 @@ if [ $DEBUG -eq 1 ] then set -x echo -e "## Mode DEBUG ON ##" - REDIRECTION_OUTPUT="" - else - REDIRECTION_OUTPUT=" 2> /dev/null" fi # mode verbose enable @@ -235,7 +232,7 @@ do if [ $RERUN -eq 0 ] || ( [ ! -e $HMM/$speaker.hmm ] || [ -z $HMM/$speaker.hmm ] ) then print_info "[${BASENAME}] $SPEERAL_TOOLS/mllrmap $SPEERAL_AM/${MODS[$i]}.hmm -LR -b$LST/$speaker.lst -d$PLP_DIR_P1/ -t.plp -i3 -c.seg -o$HMM/$speaker.hmm -a$RES_DIR_P1/" 3 - $SPEERAL_TOOLS/mllrmap $SPEERAL_AM/${MODS[$i]}.hmm -LR -b$LST/$speaker.lst -d$PLP_DIR_P1/ -t.plp -i3 -c.seg -o$HMM/$speaker.hmm -a$RES_DIR_P1/ $REDIRECTION_OUTPUT + $SPEERAL_TOOLS/mllrmap $SPEERAL_AM/${MODS[$i]}.hmm -LR -b$LST/$speaker.lst -d$PLP_DIR_P1/ -t.plp -i3 -c.seg -o$HMM/$speaker.hmm -a$RES_DIR_P1/ fi if [ $CHECK -eq 1 ] && ( [ ! -e $HMM/$speaker.hmm ] || [ -z $HMM/$speaker.hmm ] ) @@ -253,7 +250,7 @@ do if [ -s $HMM/$speaker.hmm ] && ( [ $RERUN -eq 0 ] || ( [ ! -e $HMM/$speaker.cls ] || [ -z $HMM/$speaker.cls ] )) then print_info "[${BASENAME}] $SPEERAL_TOOLS/gclust_pdf $HMM/$speaker.hmm $HMM/$speaker.cls -i $SPEERAL_AM/${MODS[$i]}.cls" 3 - $SPEERAL_TOOLS/gclust_pdf $HMM/$speaker.hmm $HMM/$speaker.cls -i $SPEERAL_AM/${MODS[$i]}.cls $REDIRECTION_OUTPUT + $SPEERAL_TOOLS/gclust_pdf $HMM/$speaker.hmm $HMM/$speaker.cls -i $SPEERAL_AM/${MODS[$i]}.cls fi if [ $CHECK -eq 1 ] && ( [ ! -e $HMM/$speaker.cls ] || [ -z $HMM/$speaker.cls ] ) then @@ -266,12 +263,12 @@ do ## Speeral decoding if [ -s $HMM/$speaker.hmm ] && [ -s $HMM/$speaker.cls ] then - print_info "[${BASENAME}] $SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_CFG[$i]} -r $PLP_DIR_P1 -m $HMM/$speaker.hmm -c $HMM/$speaker.cls $FORKS --lock $REDIRECTION_OUTPUT" 3 - $SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_CFG[$i]} -r $PLP_DIR_P1 -m $HMM/$speaker.hmm -c $HMM/$speaker.cls $FORKS --lock $REDIRECTION_OUTPUT + print_info "[${BASENAME}] $SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_CFG[$i]} -r $PLP_DIR_P1 -m $HMM/$speaker.hmm -c $HMM/$speaker.cls $FORKS --lock" 3 + $SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_CFG[$i]} -r $PLP_DIR_P1 -m $HMM/$speaker.hmm -c $HMM/$speaker.cls $FORKS --lock else print_warn "[${BASENAME}] $HMM/$speaker.hmm and $speaker.cls empty, do default decoding..." 2 - print_info "[${BASENAME}] $SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_CFG[$i]} -r $PLP_DIR_P1 -m $SPEERAL_AM/${MODS[$i]}.hmm -c $SPEERAL_AM/${MODS[$i]}.cls $FORKS --lock $REDIRECTION_OUTPUT" 3 - $SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_CFG[$i]} -r $PLP_DIR_P1 -m $SPEERAL_AM/${MODS[$i]}.hmm -c $SPEERAL_AM/${MODS[$i]}.cls $FORKS --lock $REDIRECTION_OUTPUT + print_info "[${BASENAME}] $SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_CFG[$i]} -r $PLP_DIR_P1 -m $SPEERAL_AM/${MODS[$i]}.hmm -c $SPEERAL_AM/${MODS[$i]}.cls $FORKS --lock" 3 + $SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_CFG[$i]} -r $PLP_DIR_P1 -m $SPEERAL_AM/${MODS[$i]}.hmm -c $SPEERAL_AM/${MODS[$i]}.cls $FORKS --lock fi if [ $CHECK -eq 1 ] @@ -323,15 +320,15 @@ fi print_info "[${BASENAME}] Convert .res into .ctm" 1 # .res => .ctm -$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format CTM --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.2pass.ctm $REDIRECTION_OUTPUT +$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format CTM --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.2pass.ctm print_info "[${BASENAME}] Convert .res into .trs" 1 # .res => .trs echo -e "name $AUTHOR\nfileName ${BASENAME}\nfileExt wav\nsegFile ${OUTPUT_DIR_BASENAME}/${BASENAME}.seg" > ${OUTPUT_DIR_BASENAME}/${BASENAME}.trs_cfg -$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TRS --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.2pass.trs --trs_config ${OUTPUT_DIR_BASENAME}/${BASENAME}.trs_cfg $REDIRECTION_OUTPUT +$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TRS --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.2pass.trs --trs_config ${OUTPUT_DIR_BASENAME}/${BASENAME}.trs_cfg rm ${OUTPUT_DIR_BASENAME}/${BASENAME}.trs_cfg > /dev/null 2>&1 print_info "[${BASENAME}] Convert .res into .txt" 1 # .res => .txt -$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TXT --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.2pass.txt $REDIRECTION_OUTPUT +$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TXT --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.2pass.txt print_info "[${BASENAME}] <= P2 End | $(date +'%d/%m/%y %H:%M:%S')" 1 # unlock directory diff --git a/main_tools/ThirdPass.sh b/main_tools/ThirdPass.sh index 2766d3c..bf3bffd 100755 --- a/main_tools/ThirdPass.sh +++ b/main_tools/ThirdPass.sh @@ -85,9 +85,6 @@ if [ $DEBUG -eq 1 ] then set -x echo -e "## Mode DEBUG ON ##" - REDIRECTION_OUTPUT="" - else - REDIRECTION_OUTPUT=" 2> /dev/null" fi # mode verbose enable @@ -196,11 +193,11 @@ do ## Speeral decoding if [ -s $HMM/$speaker.hmm ] && [ -s $HMM/$speaker.cls ] then - print_info "$SPEERAL_BIN $LST/$speaker.lst $RES_DIR $SPEERAL_THIRD_CFG -r $PLP_DIR_P1 -m $HMM/$speaker.hmm -c $HMM/$speaker.cls $FORKS --lock $REDIRECTION_OUTPUT" 3 - $SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_THIRD_CFG} -r $PLP_DIR_P1 -m $HMM/$speaker.hmm -c $HMM/$speaker.cls $FORKS --lock $REDIRECTION_OUTPUT + print_info "$SPEERAL_BIN $LST/$speaker.lst $RES_DIR $SPEERAL_THIRD_CFG -r $PLP_DIR_P1 -m $HMM/$speaker.hmm -c $HMM/$speaker.cls $FORKS --lock" 3 + $SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_THIRD_CFG} -r $PLP_DIR_P1 -m $HMM/$speaker.hmm -c $HMM/$speaker.cls $FORKS --lock else print_warn "$HMM/$speaker.hmm and $speaker.cls empty, do default decoding..." 2 - $SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_THIRD_CFG} -r $PLP_DIR_P1 -m $SPEERAL_AM/${MODS[$i]}.hmm -c $SPEERAL_AM/${MODS[$i]}.cls $FORKS --lock $REDIRECTION_OUTPUT + $SPEERAL_BIN $LST/$speaker.lst $RES_DIR ${SPEERAL_THIRD_CFG} -r $PLP_DIR_P1 -m $SPEERAL_AM/${MODS[$i]}.hmm -c $SPEERAL_AM/${MODS[$i]}.cls $FORKS --lock fi if [ $CHECK -eq 1 ] @@ -234,13 +231,13 @@ rm ${OUTPUT_DIR_BASENAME}/.tmp > /dev/null 2>&1 #---------------# # .res => .ctm -$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format CTM --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.3pass.ctm $REDIRECTION_OUTPUT +$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format CTM --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.3pass.ctm # .res => .trs echo -e "name $AUTHOR\nfileName ${BASENAME}\nfileExt wav\nsegFile ${OUTPUT_DIR_BASENAME}/${BASENAME}.seg" > ${OUTPUT_DIR_BASENAME}/${BASENAME}.trs_cfg -$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TRS --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.3pass.trs --trs_config ${OUTPUT_DIR_BASENAME}/${BASENAME}.trs_cfg $REDIRECTION_OUTPUT +$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TRS --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.3pass.trs --trs_config ${OUTPUT_DIR_BASENAME}/${BASENAME}.trs_cfg rm ${OUTPUT_DIR_BASENAME}/${BASENAME}.trs_cfg > /dev/null 2>&1 # .res => .txt -$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TXT --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.3pass.txt $REDIRECTION_OUTPUT +$SCRIPT_PATH/res2out.pl --dir $RES_DIR --format TXT --ignore $RULES/asupp --out ${OUTPUT_DIR_BASENAME}/${BASENAME}.3pass.txt print_info "<= End $BASENAME P3 | $(date +'%d/%m/%y %H:%M:%S')" 1 -- 1.8.2.3