Update modules/__init__.py
Browse files- modules/__init__.py +120 -82
modules/__init__.py
CHANGED
@@ -1,93 +1,131 @@
|
|
1 |
# modules/__init__.py
|
2 |
|
3 |
-
from ..modules.auth.auth import authenticate_user, register_user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
-
from ..modules.database.database import (
|
6 |
-
initialize_mongodb_connection,
|
7 |
-
get_student_data,
|
8 |
-
store_application_request,
|
9 |
-
store_morphosyntax_result,
|
10 |
-
store_semantic_result,
|
11 |
-
store_discourse_analysis_result,
|
12 |
-
store_chat_history,
|
13 |
-
create_admin_user,
|
14 |
-
create_student_user
|
15 |
-
)
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
-
from ..modules.admin.admin_ui import admin_page # Añade esta línea
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
-
from ..modules.utils.spacy_utils import load_spacy_models
|
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 |
-
'display_discourse_analysis_interface',
|
78 |
-
'display_chatbot_interface',
|
79 |
-
'display_student_progress',
|
80 |
-
'get_repeated_words_colors',
|
81 |
-
'highlight_repeated_words',
|
82 |
-
'POS_COLORS',
|
83 |
-
'POS_TRANSLATIONS',
|
84 |
-
'visualize_semantic_relations',
|
85 |
-
'perform_semantic_analysis',
|
86 |
-
'create_semantic_graph',
|
87 |
-
'perform_discourse_analysis',
|
88 |
-
'compare_semantic_analysis',
|
89 |
-
'load_spacy_models',
|
90 |
-
'initialize_chatbot',
|
91 |
-
'get_chatbot_response',
|
92 |
-
'ClaudeAPIChat'
|
93 |
-
]
|
|
|
1 |
# modules/__init__.py
|
2 |
|
3 |
+
#from ..modules.auth.auth import authenticate_user, register_user
|
4 |
+
def load_auth_functions():
|
5 |
+
from modules.auth.auth import(
|
6 |
+
authenticate_user,
|
7 |
+
register_user
|
8 |
+
)
|
9 |
+
return {
|
10 |
+
'main' : main,
|
11 |
+
'authenticate_user': authenticate_user,
|
12 |
+
'register_user': register_user
|
13 |
+
}
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
+
def load_database_function():
|
17 |
+
from modules.database.database import (
|
18 |
+
initialize_mongodb_connection,
|
19 |
+
get_student_data,
|
20 |
+
store_application_request,
|
21 |
+
store_morphosyntax_result,
|
22 |
+
store_semantic_result,
|
23 |
+
store_discourse_analysis_result,
|
24 |
+
store_chat_history,
|
25 |
+
create_admin_user,
|
26 |
+
create_student_user
|
27 |
+
)
|
28 |
+
return {
|
29 |
+
'main' : main,
|
30 |
+
'initialize_mongodb_connection' : initialize_mongodb_connection,
|
31 |
+
'get_student_data' : get_student_data,
|
32 |
+
'store_application_request' : store_application_request,
|
33 |
+
'store_morphosyntax_result' : store_morphosyntax_result,
|
34 |
+
'store_semantic_result' : store_semantic_result,
|
35 |
+
'store_discourse_analysis_result' : store_discourse_analysis_result,
|
36 |
+
'store_chat_history' : store_chat_history,
|
37 |
+
'create_admin_user' : create_admin_user,
|
38 |
+
'create_student_user' : create_admin_user
|
39 |
+
}
|
40 |
|
|
|
41 |
|
42 |
+
def load_ui_functions():
|
43 |
+
from modules.ui.ui import (
|
44 |
+
main,
|
45 |
+
login_register_page,
|
46 |
+
login_form,
|
47 |
+
register_form,
|
48 |
+
user_page,
|
49 |
+
display_student_progress,
|
50 |
+
display_morphosyntax_analysis_interface,
|
51 |
+
display_semantic_analysis_interface,
|
52 |
+
display_discourse_analysis_interface,
|
53 |
+
display_chatbot_interface
|
54 |
+
)
|
55 |
+
return {
|
56 |
+
'main' : main,
|
57 |
+
'login_register_page' : login_register_page,
|
58 |
+
'login_form' : login_form,
|
59 |
+
'register_form' : register_form,
|
60 |
+
'user_page' : user_page,
|
61 |
+
'display_student_progress' : display_student_progress,
|
62 |
+
'display_morphosyntax_analysis_interface' : display_morphosyntax_analysis_interface,
|
63 |
+
'display_semantic_analysis_interface' : display_semantic_analysis_interface,
|
64 |
+
'display_discourse_analysis_interface' : display_discourse_analysis_interface,
|
65 |
+
'display_chatbot_interface' : display_chatbot_interface
|
66 |
+
}
|
67 |
|
68 |
+
def load_admin_functions():
|
69 |
+
from modules.admin.admin_ui import (
|
70 |
+
admin_page # Añade esta línea
|
71 |
+
)
|
72 |
+
return {
|
73 |
+
'admin_page' : admin_page
|
74 |
+
}
|
75 |
+
|
76 |
+
def morpho_analysis_functions():
|
77 |
+
from modules.analysis_text.morpho_analysis import (
|
78 |
+
get_repeated_words_colors,
|
79 |
+
highlight_repeated_words,
|
80 |
+
POS_COLORS,
|
81 |
+
POS_TRANSLATIONS
|
82 |
+
)
|
83 |
+
return {
|
84 |
+
'get_repeated_words_colors' : get_repeated_words_colors,
|
85 |
+
'highlight_repeated_words' : highlight_repeated_words,
|
86 |
+
'highlight_repeated_words' : POS_COLORS,
|
87 |
+
'highlight_repeated_words' : POS_TRANSLATIONS
|
88 |
+
}
|
89 |
|
90 |
+
def semantic_analysis_text_functions():
|
91 |
+
from modules.analysis_text.semantic_analysis import (
|
92 |
+
visualize_semantic_relations,
|
93 |
+
perform_semantic_analysis,
|
94 |
+
create_semantic_graph
|
95 |
+
)
|
96 |
+
return {
|
97 |
+
'visualize_semantic_relations' : visualize_semantic_relations,
|
98 |
+
'perform_semantic_analysis' : perform_semantic_analysis,
|
99 |
+
'create_semantic_graph' : create_semantic_graph
|
100 |
+
}
|
101 |
|
|
|
102 |
|
103 |
+
def discourse_analysis_text_functions():
|
104 |
+
from modules.analysis_text.discourse_analysis import (
|
105 |
+
perform_discourse_analysis,
|
106 |
+
compare_semantic_analysis
|
107 |
+
)
|
108 |
+
return {
|
109 |
+
'perform_discourse_analysis' : perform_discourse_analysis,
|
110 |
+
'compare_semantic_anaysis' : compare_semantic_analysis
|
111 |
+
}
|
112 |
|
113 |
+
def spacy_utils_functions():
|
114 |
+
from modules.utils.spacy_utils import (
|
115 |
+
load_spacy_models
|
116 |
+
)
|
117 |
+
return {
|
118 |
+
'load_spacy_models' : load_spacy_models
|
119 |
+
}
|
120 |
+
|
121 |
+
def chatbot_functions():
|
122 |
+
from modules.chatbot.chatbot import (
|
123 |
+
initialize_chatbot,
|
124 |
+
get_chatbot_response,
|
125 |
+
ClaudeAPIChat # Nueva clase
|
126 |
+
)
|
127 |
+
return {
|
128 |
+
'initialize_chatbot' : initialize_chatbot,
|
129 |
+
'get_chatbot_response' : get_chatbot_response,
|
130 |
+
'ClaudeAPIChat' : ClaudeAPIChat # Nueva clase
|
131 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|