-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpredict_location_corpora_Tfid.py
80 lines (67 loc) · 2.09 KB
/
predict_location_corpora_Tfid.py
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import pandas as pd
import warnings
# Adjusting for Data Frame Output
pd.set_option('display.max_rows', None)
pd.set_option('display.max_columns', None)
pd.set_option('display.max_colwidth', None)
warnings.filterwarnings('ignore')
def make_corpora_tfid():
ai = ''
with open("part_location_data/AI.txt", 'r') as f:
data = f.read()
ai += data + ' '
ai = ai.replace('\n', ' ')
f.close()
art = ''
with open("part_location_data/Art.txt", 'r') as f:
data = f.read()
art += data + ' '
art = art.replace('\n', ' ')
f.close()
main_lib = ''
with open("part_location_data/MainLib.txt", 'r') as f:
data = f.read()
main_lib += data + ' '
main_lib = main_lib.replace('\n', ' ')
f.close()
rotary = ''
with open("part_location_data/Rotary.txt", 'r') as f:
data = f.read()
rotary += data + ' '
rotary = rotary.replace('\n', ' ')
f.close()
education = ''
with open("part_location_data/Education.txt", 'r') as f:
data = f.read()
education += data + ' '
education = education.replace('\n', ' ')
f.close()
edu_main_lib = ''
with open("part_location_data/EduMainLib.txt", 'r') as f:
data = f.read()
edu_main_lib += data + ' '
edu_main_lib = edu_main_lib.replace('\n', ' ')
f.close()
main_gate = ''
with open("part_location_data/MainGate.txt", 'r') as f:
data = f.read()
main_gate += data + ' '
main_gate = main_gate.replace('\n', ' ')
f.close()
student = ''
with open("part_location_data/Student.txt", 'r') as f:
data = f.read()
student += data + ' '
student = student.replace('\n', ' ')
f.close()
tunnel = ''
with open("part_location_data/Tunnel.txt", 'r') as f:
data = f.read()
tunnel += data + ' '
tunnel = tunnel.replace('\n', ' ')
f.close()
corpora = [
# AI, Art, MainLib, Rotary, Education, EduMainLib, MainGate, Student, Tunnel
ai, art, education, edu_main_lib, main_gate, main_lib, rotary, student, tunnel
]
return corpora