AIdeaText commited on
Commit
f74aca1
·
verified ·
1 Parent(s): b00aee5

Update modules/__init__.py

Browse files
Files changed (1) hide show
  1. 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
- from ..modules.ui.ui import (
18
- main,
19
- login_register_page,
20
- login_form,
21
- register_form,
22
- user_page,
23
- display_student_progress,
24
- display_morphosyntax_analysis_interface,
25
- display_semantic_analysis_interface,
26
- display_discourse_analysis_interface,
27
- display_chatbot_interface
28
- )
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
- from ..modules.admin.admin_ui import admin_page # Añade esta línea
31
 
32
- from ..modules.analysis_text.morpho_analysis import (
33
- get_repeated_words_colors,
34
- highlight_repeated_words,
35
- POS_COLORS,
36
- POS_TRANSLATIONS
37
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
- from ..modules.analysis_text.semantic_analysis import (
40
- visualize_semantic_relations,
41
- perform_semantic_analysis,
42
- create_semantic_graph
43
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
- from ..modules.analysis_text.discourse_analysis import (
46
- perform_discourse_analysis,
47
- compare_semantic_analysis
48
- )
 
 
 
 
 
 
 
49
 
50
- from ..modules.utils.spacy_utils import load_spacy_models
51
 
52
- from ..modules.chatbot.chatbot import (
53
- initialize_chatbot,
54
- get_chatbot_response,
55
- ClaudeAPIChat # Nueva clase
56
- )
 
 
 
 
57
 
58
- __all__ = [
59
- 'authenticate_user',
60
- 'register_user',
61
- 'initialize_mongodb_connection',
62
- 'get_student_data',
63
- 'store_morphosyntax_result',
64
- 'store_semantic_result',
65
- 'store_discourse_analysis_result',
66
- 'store_chat_history',
67
- 'create_admin_user',
68
- 'create_student_user',
69
- 'main',
70
- 'login_register_page',
71
- 'login_form',
72
- 'register_form',
73
- 'user_page',
74
- 'admin_page', # Añade esta línea
75
- 'display_morphosyntax_analysis_interface',
76
- 'display_semantic_analysis_interface',
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
+ }