AIdeaText commited on
Commit
07a81c0
1 Parent(s): 1f28395

Update modules/__init__.py

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