-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprepare_data.sh
executable file
·85 lines (54 loc) · 1.3 KB
/
prepare_data.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#! /bin/bash
# Configuration
DB_NAME=deepdive_titles
DB_USER=czhang
DB_PASSWORD="Password is set via the PGPASSWORD environment variable"
cd `dirname $0`
BASE_DIR=`pwd`
#dropdb -U $DB_USER deepdive_titles
#createdb -U $DB_USER deepdive_titles
psql -U $DB_USER -c "drop schema if exists public cascade; create schema public;" $DB_NAME
psql -U $DB_USER -c "CREATE TABLE docids(
id bigserial primary key,
docid text,
folder text);" $DB_NAME
psql -U $DB_USER -c "CREATE TABLE documents(
id bigserial primary key,
docid text,
document text);" $DB_NAME
psql -U $DB_USER -c "CREATE TABLE sentences(
id bigserial primary key,
docid text,
sentid text,
sentence text);" $DB_NAME
psql -U $DB_USER -c "CREATE TABLE drug_mentions(
id bigserial primary key,
docid text,
sentid text,
mid text,
start_wid int,
end_wid int,
type text,
is_correct boolean,
repr text,
features text[],
object text);" $DB_NAME
psql -U $DB_USER -c "CREATE TABLE gene_mentions(
id bigserial primary key,
docid text,
sentid text,
mid text,
start_wid int,
end_wid int,
type text,
is_correct boolean,
repr text,
features text[],
object text);" $DB_NAME
psql -U $DB_USER -c "CREATE TABLE relations(
id bigserial primary key,
type text,
mid1 text,
mid2 text,
is_correct boolean,
features text[]);" $DB_NAME