This repository has been archived by the owner on Dec 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
146 lines (141 loc) · 3.5 KB
/
config.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
"""
This file contains all the default parameters used in the app
"""
import pandas as pd
import nltk
from texthero import preprocessing
# DOWNLOAD CORPUS
nltk.download('words')
load_clean_visualise = {
'FILE': 'Small File(s)',
'MODE': 'CSV',
'DATA_PATH': None,
'DATA': pd.DataFrame(),
'CSP': None,
'CLEAN': False,
'CLEAN_MODE': 'Simple',
'SAVE': False,
'OVERRIDE_FORMAT': None,
'VERBOSE': False,
'VERBOSITY': False,
'CLEANED_DATA': pd.DataFrame(),
'CLEANED_DATA_TOKENIZED': pd.DataFrame(),
'ADVANCED_ANALYSIS': False,
'SIMPLE_PIPELINE': [
preprocessing.remove_html_tags,
preprocessing.remove_diacritics,
preprocessing.remove_whitespace,
preprocessing.remove_urls,
preprocessing.drop_no_content
],
'PIPELINE': [
preprocessing.fillna,
preprocessing.lowercase,
preprocessing.remove_punctuation,
preprocessing.remove_html_tags,
preprocessing.remove_diacritics,
preprocessing.remove_whitespace,
preprocessing.remove_urls,
preprocessing.drop_no_content
],
# APPLY preprocessing.remove_digits(only_blocks=False) TO THE CUSTOM PIPELINE AFTER CLEANING
'FINALISED_DATA_LIST': [],
'DATA_COLUMN': None,
'TOKENIZE': True,
'EXTEND_STOPWORD': False,
'STOPWORD_LIST': '',
'ENGLISH_WORDS': set(nltk.corpus.words.words()),
'FINALISE': False,
'ANALYSIS_MODE': 'Data Cleaning',
'WORLD_MAP': True,
'GLOBE_DATA': None,
'GLOBE_FIG': None,
'MATCH': False,
'QUERY': None,
'QUERY_SUCCESS': False,
'QUERY_MODE': None,
'QUERY_DATA': pd.DataFrame(),
'MOD_MODE': 'Country Extraction',
'FIXED_KEY': True,
'HEIGHT': 400,
}
dtm = {
'DTM': pd.DataFrame(),
'FILE': 'Small File(s)',
'DATA': pd.DataFrame(),
'DATA_PATH': None,
'ANALYSIS': False,
'VERBOSE_DTM': False,
'VERBOSITY_DTM': False,
'VERBOSE_ANALYSIS': False,
'SAVE': False,
'OVERRIDE_FORMAT': None,
'MODE': 'CSV',
'DTM_copy': pd.DataFrame(),
'N': 100,
'CSP': None,
'ADVANCED_ANALYSIS': False,
'FINALISED_DATA_LIST': [],
'DATA_COLUMN': None,
'TOP_N_WORD_FIG': None
}
toolkit = {
'DATA': pd.DataFrame(),
'FILE': 'Small File(s)',
'MODE': 'CSV',
'DATA_PATH': None,
'CSP': None,
'SAVE': False,
'OVERRIDE_FORMAT': None,
'VERBOSE': False,
'VERBOSITY': 20,
'APP_MODE': 'Wordcloud',
'BACKEND_ANALYSER': 'VADER',
'MAX_WORDS': 200,
'CONTOUR_WIDTH': 3,
'HEIGHT': 400,
'WIDTH': 800,
'SENT_LEN': 3,
'NUM_TOPICS': 10,
'TOPIC_FRAME': None,
'LDA_VIS': None,
'LDA_MODEL': None,
'KW': None,
'TFIDF_MODEL': None,
'TFIDF_VECTORISED': None,
'NMF_MODEL': None,
'LSI_MODEL': None,
'LSI_DATA': None,
'MAR_FIG': None,
'WORD_FIG': None,
'LDA_VIS_STR': None,
'LDA_DATA': None,
'MODEL': None,
'ADVANCED_ANALYSIS': False,
'NLP_MODEL': 'en_core_web_sm',
'DATA_COLUMN': None,
'NLP': None,
'ONE_DATAPOINT': False,
'DATAPOINT_SELECTOR': 0,
'NLP_TOPIC_MODEL': 'Latent Dirichlet Allocation',
'MIN_DF': 2,
'MAX_DF': 0.95,
'MAX_ITER': 100,
'CV': None,
'VECTORISED': None,
'COLOUR': None,
'COLOUR_BCKGD': None,
'COLOUR_TXT': None,
'TOPIC_TEXT': [],
'SVG': None,
'HAC_PLOT': None,
'HAC_PLOT1': None,
'WORKER': 1,
'MAX_FEATURES': 5000,
'ALPHA': 0.1,
'L1_RATIO': 0.5,
'PLOT': False,
'W_PLOT': False,
'MIN_WORDS': 80,
'SUM_MODE': 'Basic'
}