view demo/workspace/semantic_analysis.sh @ 13:16066f0a7127 tip

fixed the problem with brat
author Emmanouil Theofanis Chourdakis <e.t.chourdakis@qmul.ac.uk>
date Sat, 08 Dec 2018 11:02:40 +0000
parents 014bc3f21382
children
line wrap: on
line source
#!/bin/bash

if [ ! -f story.txt ]; then
    touch story.txt
fi

leafpad story.txt
read -p "Please edit and save a new story. Then press enter to continue."

cd ..
python3 text2annotation.py workspace/story.txt ner_model.pkl rel_model.pkl
cd -

if [ -d ~/brat/data/workspace ]; then
    rm ~/brat/data/workspace/*txt
    rm ~/brat/data/workspace/*ann
else
    mkdir ~/brat/data/workspace
    cp ~/brat/data/training/annotation.conf ~/brat/data/workspace
fi

cp story_processed.txt story_processed.ann ~/brat/data/workspace
cp annotation.conf ~/brat/data/workspace

cd ~/brat

python3 standalone.py &
PID=$!

echo "Please visit http://0.0.0.0:8001/index.xhtml#/workspace/story_processed"
echo "login with user:au1/pass:au1 and make your changes, and then press enter here"
google-chrome  'http://0.0.0.0:8001/index.xhtml#/workspace/story_processed'
cd -
read
kill $PID

echo "Copying files over to current directory"

cp -f ~/brat/data/workspace/story_processed.txt .
cp -f ~/brat/data/workspace/story_processed.ann .

cd ..
python3 annotation2script.py workspace/story_processed.ann workspace/story_quotes.json
echo "Please edit the transcript .xls file if necessary. If you want to replace the voices, just record your voice and store them"
echo "using the filenames under column 'filename' in transcript.xls. Do the same for sfx.xls. Press enter here when you're done"
libreoffice workspace/transcript.xls
libreoffice workspace/sfx.xls
cd -
read

echo "Generated script is at story_processed_script.txt"
cat story_processed_script.txt