0

I am parsing many sentences in one file using: cat filename.txt | ./demo.sh > output.txt

Sometimes a sentence in there is not parsed and so there is no output and I need to be able to tell that that happened. So either I want to be able to print the sentence that was parsed before each parse or have some way to indicate that a sentence was not parsed in the file so I know the ordering.

Mayla
  • 1
  • I have another file that has the sentences in it and so I am trying to reconstruct the sentences from the dependency parse output to check if it is there or not, but I am having issues with matching again. I am not sure where in the code for syntaxnet to add a line to print out the sentence – Mayla Feb 05 '18 at 20:23

1 Answers1

0

To iterate over a bunch of files (in $FILES) with multiple sentences in each and print out the sentence that is running and then run the dependency parse, in order to add both to the output file (output_dp/output_$f)

for f in $FILES
do
  echo $f
  while read p; 
  do
    echo $p >> output_dp/output_$(basename "$f")
    echo $p | ./demo.sh >> output_dp/output_$(basename "$f")
  done < $f
done
Mayla
  • 1