e@0: #!/bin/bash e@0: e@0: if [ ! -f story.txt ]; then e@0: touch story.txt e@0: fi e@0: e@5: leafpad 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@5: if [ -d ~/brat/data/workspace ]; then e@5: rm ~/brat/data/workspace/*txt e@5: rm ~/brat/data/workspace/*ann e@0: else e@5: mkdir ~/brat/data/workspace e@5: cp ~/brat/data/training/annotation.conf ~/brat/data/workspace e@0: fi e@0: e@5: cp story_processed.txt story_processed.ann ~/brat/data/workspace e@5: cp annotation.conf ~/brat/data/workspace e@0: e@5: cd ~/brat e@0: e@13: python3 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@7: google-chrome '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@5: cp -f ~/brat/data/workspace/story_processed.txt . e@5: 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@6: libreoffice workspace/transcript.xls e@6: libreoffice 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