Spaces:
Running
Running
Update modules/text_analysis/semantic_analysis.py
Browse files
modules/text_analysis/semantic_analysis.py
CHANGED
|
@@ -95,20 +95,15 @@ def perform_semantic_analysis(text, nlp, lang_code):
|
|
| 95 |
key_concepts = identify_key_concepts(doc)
|
| 96 |
concept_graph = create_concept_graph(doc, key_concepts)
|
| 97 |
concept_graph_fig = visualize_concept_graph(concept_graph, lang_code)
|
| 98 |
-
entities = extract_entities(doc, lang_code)
|
| 99 |
-
entity_graph = create_entity_graph(entities)
|
| 100 |
-
entity_graph_fig = visualize_entity_graph(entity_graph, lang_code)
|
| 101 |
|
| 102 |
# Convertir figuras a bytes
|
| 103 |
concept_graph_bytes = fig_to_bytes(concept_graph_fig)
|
| 104 |
-
|
| 105 |
|
| 106 |
logger.info("Semantic analysis completed successfully")
|
| 107 |
return {
|
| 108 |
'key_concepts': key_concepts,
|
| 109 |
'concept_graph': concept_graph_bytes,
|
| 110 |
-
'entities': entities,
|
| 111 |
-
'entity_graph': entity_graph_bytes
|
| 112 |
}
|
| 113 |
except Exception as e:
|
| 114 |
logger.error(f"Error in perform_semantic_analysis: {str(e)}")
|
|
|
|
| 95 |
key_concepts = identify_key_concepts(doc)
|
| 96 |
concept_graph = create_concept_graph(doc, key_concepts)
|
| 97 |
concept_graph_fig = visualize_concept_graph(concept_graph, lang_code)
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
# Convertir figuras a bytes
|
| 100 |
concept_graph_bytes = fig_to_bytes(concept_graph_fig)
|
| 101 |
+
|
| 102 |
|
| 103 |
logger.info("Semantic analysis completed successfully")
|
| 104 |
return {
|
| 105 |
'key_concepts': key_concepts,
|
| 106 |
'concept_graph': concept_graph_bytes,
|
|
|
|
|
|
|
| 107 |
}
|
| 108 |
except Exception as e:
|
| 109 |
logger.error(f"Error in perform_semantic_analysis: {str(e)}")
|