get-raw-sentences.sh 1.55 KB
echo
echo
echo
echo "===================================Extraction============================================ "

cd /home/egaytan/automatic-extraction-growth-conditions/extraction-geo/outputs/

echo "Access to output extracted baglines"
echo "directory: "$(pwd);

index="/home/egaytan/automatic-extraction-growth-conditions/extraction-geo/reports/all-output-index.txt"
output="/home/egaytan/automatic-extraction-growth-conditions/CoreNLP/input/annotation/bg_sentences_v2.txt"
report="/home/egaytan/automatic-extraction-growth-conditions/extraction-geo/reports/bg_report_v2.txt"
echo
echo
echo
echo "==============================Baglines index files======================================= "
# absolute file output path
for gse in $(ls -1)
do
  cd $gse; ls -d $PWD/*; cd ..;
done > $index
echo "Number if extracted files"
wc -l $index
echo
echo
echo
echo "==============================Baglines extraction======================================="
echo
echo
echo "Add sentence-end-tag PGCGROWTHCONDITIONS"
for gsef in $( cat $index )
do
  cat $gsef | sort | uniq;
done | cut -f1 | cut -f2 -d'"' | sort | uniq | awk '{ print $_ " PGCGROWTHCONDITIONS" }'  > $output
echo
echo
echo "Number of total baglines: "$(wc -l $output );
echo
echo "Baglines report"


for gsef in $( cat ../reports/all-output-index.txt)
do
  cat $gsef | sort | uniq ;
done | cut -f2 | cut -f2 -d'"' | sed 's/_ch/./g' | cut -f1 -d'.' | sort | uniq -c |  awk '{print $1"\t"$2}' > $report

cat $report
echo
echo
echo "Saving file: /home/egaytan/automatic-extraction-growth-conditions/extraction/bg_sentences_v2.txt";