Spaces:
Running
Running
Update modules/database/semantic_mongo_db.py
Browse files
modules/database/semantic_mongo_db.py
CHANGED
|
@@ -42,8 +42,12 @@ def store_student_semantic_result(username, text, analysis_result):
|
|
| 42 |
'timestamp': datetime.now(timezone.utc).isoformat(),
|
| 43 |
'text': text,
|
| 44 |
'analysis_type': 'semantic',
|
| 45 |
-
'
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
}
|
| 48 |
|
| 49 |
# Insertar en MongoDB
|
|
|
|
| 42 |
'timestamp': datetime.now(timezone.utc).isoformat(),
|
| 43 |
'text': text,
|
| 44 |
'analysis_type': 'semantic',
|
| 45 |
+
'metrics': {
|
| 46 |
+
'key_concepts': analysis_result.get('key_concepts', []),
|
| 47 |
+
'concept_centrality': analysis_result.get('concept_centrality', {})
|
| 48 |
+
},
|
| 49 |
+
'graph_data': base64.b64encode(analysis_result.get('concept_graph', b'')).decode('utf-8'),
|
| 50 |
+
'language': st.session_state.get('lang_code', 'en')
|
| 51 |
}
|
| 52 |
|
| 53 |
# Insertar en MongoDB
|