diff --git a/DataReader/LUSequenceReader/LUSequenceWriter.cpp b/DataReader/LUSequenceReader/LUSequenceWriter.cpp index d18976fcb..28815bcbc 100644 --- a/DataReader/LUSequenceReader/LUSequenceWriter.cpp +++ b/DataReader/LUSequenceReader/LUSequenceWriter.cpp @@ -125,10 +125,11 @@ namespace Microsoft { namespace MSR { namespace CNTK { if (outputFileIds.find(outputFile) == outputFileIds.end()) { FILE* ofs; + msra::files::make_intermediate_dirs(outputFile); string str(outputFile.begin(), outputFile.end()); ofs = fopen(str.c_str(), "wt"); if (ofs == nullptr) - RuntimeError("Cannot open open %s for writing", str.c_str()); + RuntimeError("Cannot open %s for writing", str.c_str()); outputFileIds[outputFile] = ofs; fp = ofs; } diff --git a/ExampleSetups/SLU/rnnlu.config b/ExampleSetups/SLU/rnnlu.config index d466cf280..0c2ac2648 100644 --- a/ExampleSetups/SLU/rnnlu.config +++ b/ExampleSetups/SLU/rnnlu.config @@ -329,7 +329,7 @@ LSTMTest=[ modelPath=$ExpDir$\cntkdebug.dnn - outputNodeNames=outputs + outputNodeNames=outputs:labels reader=[ # reader to use @@ -442,6 +442,11 @@ LSTMTest=[ file=$OutDir$\output.rec.txt token=$DataDir$\output.txt ] + + labels=[ + file=$OutDir$\output.lbl.txt + token=$DataDir$\output.txt + ] ] ] diff --git a/ExampleSetups/SLU/score.sh b/ExampleSetups/SLU/score.sh index 0f46f1aeb..99abf89ae 100644 --- a/ExampleSetups/SLU/score.sh +++ b/ExampleSetups/SLU/score.sh @@ -1,9 +1,9 @@ -# need to have outputs -# in this case is output.rec.txt +# need to have outputs and labels +# in this case is output.rec.txt and output.lbl.txt -awk '{str1=$1; getline < "output.rec.txt"; print str1" "$1 > "output.12.txt"}' feat.txt +awk 'NF {str1=$1; getline < "output.rec.txt"; print str1" "$1 > "output.12.txt"}' feat.txt -awk '{str1=$1; str2=$2; getline < "lbl.txt"; print str1" NNP "$1 " "str2 > "output.all.txt"}' output.12.txt +awk '{str1=$1; str2=$2; getline < "output.lbl.txt"; print str1" NNP "$1 " "str2 > "output.all.txt"}' output.12.txt cat output.all.txt | perl -ne '{chomp;s/\r//g;print $_,"\n";}' | perl conlleval.pl | head -10