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