comparison demo/workspace/semantic_analysis.sh @ 5:d0ac6786c3b9

changed it to work under docker
author Emmanouil Theofanis Chourdakis <e.t.chourdakis@qmul.ac.uk>
date Sat, 01 Dec 2018 12:46:25 +0000
parents 90155bdd5dd6
children 7abb4f6b3a91
comparison
equal deleted inserted replaced
4:682bac285498 5:d0ac6786c3b9
2 2
3 if [ ! -f story.txt ]; then 3 if [ ! -f story.txt ]; then
4 touch story.txt 4 touch story.txt
5 fi 5 fi
6 6
7 xdg-open story.txt 7 leafpad story.txt
8 read -p "Please edit and save a new story. Then press enter to continue." 8 read -p "Please edit and save a new story. Then press enter to continue."
9 9
10 cd .. 10 cd ..
11 python3 text2annotation.py workspace/story.txt ner_model.pkl rel_model.pkl 11 python3 text2annotation.py workspace/story.txt ner_model.pkl rel_model.pkl
12 cd - 12 cd -
13 13
14 if [ -d ../../brat/data/workspace ]; then 14 if [ -d ~/brat/data/workspace ]; then
15 rm ../../brat/data/workspace/*txt 15 rm ~/brat/data/workspace/*txt
16 rm ../../brat/data/workspace/*ann 16 rm ~/brat/data/workspace/*ann
17 else 17 else
18 mkdir ../../brat/data/workspace 18 mkdir ~/brat/data/workspace
19 cp ../../brat/data/training/annotation.conf ../../brat/data/workspace 19 cp ~/brat/data/training/annotation.conf ~/brat/data/workspace
20 fi 20 fi
21 21
22 cp story_processed.txt story_processed.ann ../../brat/data/workspace 22 cp story_processed.txt story_processed.ann ~/brat/data/workspace
23 cp annotation.conf ../../brat/data/workspace 23 cp annotation.conf ~/brat/data/workspace
24 24
25 cd ../../brat 25 cd ~/brat
26 26
27 python2 standalone.py & 27 python3 standalone.py &
28 PID=$! 28 PID=$!
29 29
30 echo "Please visit http://0.0.0.0:8001/index.xhtml#/workspace/story_processed" 30 echo "Please visit http://0.0.0.0:8001/index.xhtml#/workspace/story_processed"
31 echo "login with user:au1/pass:au1 and make your changes, and then press enter here" 31 echo "login with user:au1/pass:au1 and make your changes, and then press enter here"
32 xdg-open 'http://0.0.0.0:8001/index.xhtml#/workspace/story_processed' 32 google-chrome --no-sandbox 'http://0.0.0.0:8001/index.xhtml#/workspace/story_processed'
33 cd - 33 cd -
34 read 34 read
35 kill $PID 35 kill $PID
36 36
37 echo "Copying files over to current directory" 37 echo "Copying files over to current directory"
38 38
39 cp -f ../../brat/data/workspace/story_processed.txt . 39 cp -f ~/brat/data/workspace/story_processed.txt .
40 cp -f ../../brat/data/workspace/story_processed.ann . 40 cp -f ~/brat/data/workspace/story_processed.ann .
41 41
42 cd .. 42 cd ..
43 python3 annotation2script.py workspace/story_processed.ann workspace/story_quotes.json 43 python3 annotation2script.py workspace/story_processed.ann workspace/story_quotes.json
44 echo "Please edit the transcript .xls file if necessary. If you want to replace the voices, just record your voice and store them" 44 echo "Please edit the transcript .xls file if necessary. If you want to replace the voices, just record your voice and store them"
45 echo "using the filenames under column 'filename' in transcript.xls. Do the same for sfx.xls. Press enter here when you're done" 45 echo "using the filenames under column 'filename' in transcript.xls. Do the same for sfx.xls. Press enter here when you're done"
46 xdg-open workspace/transcript.xls 46 libreoffice-calc workspace/transcript.xls
47 xdg-open workspace/sfx.xls 47 libreoffice-calc workspace/sfx.xls
48 cd - 48 cd -
49 read 49 read
50 50
51 echo "Generated script is at story_processed_script.txt" 51 echo "Generated script is at story_processed_script.txt"
52 cat story_processed_script.txt 52 cat story_processed_script.txt