e@0
|
1 #!/bin/bash
|
e@0
|
2
|
e@0
|
3 if [ ! -f story.txt ]; then
|
e@0
|
4 touch story.txt
|
e@0
|
5 fi
|
e@0
|
6
|
e@5
|
7 leafpad story.txt
|
e@0
|
8 read -p "Please edit and save a new story. Then press enter to continue."
|
e@0
|
9
|
e@0
|
10 cd ..
|
e@0
|
11 python3 text2annotation.py workspace/story.txt ner_model.pkl rel_model.pkl
|
e@0
|
12 cd -
|
e@0
|
13
|
e@5
|
14 if [ -d ~/brat/data/workspace ]; then
|
e@5
|
15 rm ~/brat/data/workspace/*txt
|
e@5
|
16 rm ~/brat/data/workspace/*ann
|
e@0
|
17 else
|
e@5
|
18 mkdir ~/brat/data/workspace
|
e@5
|
19 cp ~/brat/data/training/annotation.conf ~/brat/data/workspace
|
e@0
|
20 fi
|
e@0
|
21
|
e@5
|
22 cp story_processed.txt story_processed.ann ~/brat/data/workspace
|
e@5
|
23 cp annotation.conf ~/brat/data/workspace
|
e@0
|
24
|
e@5
|
25 cd ~/brat
|
e@0
|
26
|
e@13
|
27 python3 standalone.py &
|
e@0
|
28 PID=$!
|
e@0
|
29
|
e@0
|
30 echo "Please visit http://0.0.0.0:8001/index.xhtml#/workspace/story_processed"
|
e@0
|
31 echo "login with user:au1/pass:au1 and make your changes, and then press enter here"
|
e@7
|
32 google-chrome 'http://0.0.0.0:8001/index.xhtml#/workspace/story_processed'
|
e@0
|
33 cd -
|
e@0
|
34 read
|
e@0
|
35 kill $PID
|
e@0
|
36
|
e@0
|
37 echo "Copying files over to current directory"
|
e@0
|
38
|
e@5
|
39 cp -f ~/brat/data/workspace/story_processed.txt .
|
e@5
|
40 cp -f ~/brat/data/workspace/story_processed.ann .
|
e@0
|
41
|
e@0
|
42 cd ..
|
e@0
|
43 python3 annotation2script.py workspace/story_processed.ann workspace/story_quotes.json
|
e@0
|
44 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
|
45 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
|
46 libreoffice workspace/transcript.xls
|
e@6
|
47 libreoffice workspace/sfx.xls
|
e@0
|
48 cd -
|
e@0
|
49 read
|
e@0
|
50
|
e@0
|
51 echo "Generated script is at story_processed_script.txt"
|
e@0
|
52 cat story_processed_script.txt
|