Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Commit

Permalink
Logging upgraded and bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorzZ1 committed Nov 11, 2023
1 parent 1593e57 commit 43646d0
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions container_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,27 @@ mkdir /common
mkdir /common/processed_ttl

for archive in "${archives[@]}"; do
mkdir /home/output_ttl_files/$archive
archive_dir=/home/output_ttl_files/$archive
if [ ! -d "$archive_dir" ]; then
mkdir $archive_dir
fi
for dir in "/input_pdf_files/$archive"/*; do
if [ -d "$dir" ]; then
mkdir /home/output_ttl_files/$archive/$(basename "$dir")
volume_dir=/home/output_ttl_files/$archive/$(basename "$dir")
if [ ! -d "$volume_dir" ]; then
mkdir $volume_dir
fi
for file in "$dir"/*; do
if [ -f "$file" ]; then
cp "$file" /common/$(basename "$file" .pdf).pdf
bash ./run.sh /common/$(basename "$file" .pdf).pdf
cp /common/processed_ttl/$(basename "$file" .pdf | tr '[:upper:]' '[:lower:]' | tr -d '_').ttl /home/output_ttl_files/$archive/$(basename "$dir")/$(basename "$file" .pdf).ttl
final_basename=$(basename "$file" .pdf | tr '[:upper:]' '[:lower:]' | tr -d '_')
if [ -e "/common/processed_ttl/$final_basename.ttl" ]; then
cp /common/processed_ttl/$final_basename.ttl /home/output_ttl_files/$archive/$(basename "$dir")/$(basename "$file" .pdf).ttl
else
echo "Grobid failed with scraping file, information from it will be skipped"
fi

fi
done
fi
Expand Down

0 comments on commit 43646d0

Please sign in to comment.