-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_usage.py
More file actions
27 lines (22 loc) · 877 Bytes
/
main_usage.py
File metadata and controls
27 lines (22 loc) · 877 Bytes
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
import numpy as np
import pandas as pd
from stages.use import use
from stages.preprocess import sentences_2D_to_3D, get_X_y
if __name__ == '__main__':
try:
print('Loading process data')
PD_DATA_SOURCES = ['process1.json.csv', 'process2.json.csv', 'process3.json.csv']
pd_corpus = np.array([])
for source in PD_DATA_SOURCES:
tmp = pd.read_csv('csv/process_descriptions/' + source, sep=',').values
if pd_corpus.any():
pd_corpus = np.concatenate((pd_corpus, tmp), axis=0)
else:
pd_corpus = tmp
pd_corpus = pd_corpus[:, 1:]
data_sentences = sentences_2D_to_3D(pd_corpus)
X, y = get_X_y(data_sentences)
use(X, y, use_synfeat=False)
use(X, y, use_synfeat=True)
except FileNotFoundError:
print('Run model training first!')