e@0: #!/bin/bash e@0: e@0: if [ ! -f story.txt ]; then e@0: touch story.txt e@0: fi e@0: e@0: xdg-open story.txt e@0: read -p "Please edit and save a new story. Then press enter to continue." e@0: e@0: cd .. e@0: python3 text2annotation.py workspace/story.txt ner_model.pkl rel_model.pkl e@0: cd - e@0: e@0: if [ -d ../../brat/data/workspace ]; then e@0: rm ../../brat/data/workspace/*txt e@0: rm ../../brat/data/workspace/*ann e@0: else e@0: mkdir ../../brat/data/workspace e@0: cp ../../brat/data/training/annotation.conf ../../brat/data/workspace e@0: fi e@0: e@0: cp story_processed.txt story_processed.ann ../../brat/data/workspace e@0: cp annotation.conf ../../brat/data/workspace e@0: e@0: cd ../../brat e@0: e@0: python2 standalone.py & e@0: PID=$! e@0: e@0: echo "Please visit http://0.0.0.0:8001/index.xhtml#/workspace/story_processed" e@0: echo "login with user:au1/pass:au1 and make your changes, and then press enter here" e@0: xdg-open 'http://0.0.0.0:8001/index.xhtml#/workspace/story_processed' e@0: cd - e@0: read e@0: kill $PID e@0: e@0: echo "Copying files over to current directory" e@0: e@0: cp -f ../../brat/data/workspace/story_processed.txt . e@0: cp -f ../../brat/data/workspace/story_processed.ann . e@0: e@0: cd .. e@0: python3 annotation2script.py workspace/story_processed.ann workspace/story_quotes.json e@0: echo "Please edit the transcript .xls file if necessary. If you want to replace the voices, just record your voice and store them" e@0: echo "using the filenames under column 'filename' in transcript.xls. Do the same for sfx.xls. Press enter here when you're done" e@0: xdg-open workspace/transcript.xls e@0: xdg-open workspace/sfx.xls e@0: cd - e@0: read e@0: e@0: echo "Generated script is at story_processed_script.txt" e@0: cat story_processed_script.txt