Update modules/text_analysis/discourse_analysis.py
Browse files
modules/text_analysis/discourse_analysis.py
CHANGED
|
@@ -22,14 +22,14 @@ from .semantic_analysis import (
|
|
| 22 |
create_concept_graph,
|
| 23 |
visualize_concept_graph,
|
| 24 |
identify_key_concepts,
|
|
|
|
| 25 |
)
|
| 26 |
|
| 27 |
|
| 28 |
from .stopwords import (
|
| 29 |
get_custom_stopwords,
|
| 30 |
process_text,
|
| 31 |
-
get_stopwords_for_spacy
|
| 32 |
-
fig_to_bytes
|
| 33 |
)
|
| 34 |
|
| 35 |
|
|
@@ -91,16 +91,7 @@ ENTITY_LABELS = {
|
|
| 91 |
}
|
| 92 |
|
| 93 |
#################
|
| 94 |
-
|
| 95 |
-
"""Convierte una figura de matplotlib a bytes."""
|
| 96 |
-
try:
|
| 97 |
-
buf = io.BytesIO()
|
| 98 |
-
fig.savefig(buf, format='png', dpi=300, bbox_inches='tight')
|
| 99 |
-
buf.seek(0)
|
| 100 |
-
return buf.getvalue()
|
| 101 |
-
except Exception as e:
|
| 102 |
-
logger.error(f"Error en fig_to_bytes: {str(e)}")
|
| 103 |
-
return None
|
| 104 |
#################
|
| 105 |
def compare_semantic_analysis(text1, text2, nlp, lang):
|
| 106 |
"""
|
|
|
|
| 22 |
create_concept_graph,
|
| 23 |
visualize_concept_graph,
|
| 24 |
identify_key_concepts,
|
| 25 |
+
fig_to_bytes
|
| 26 |
)
|
| 27 |
|
| 28 |
|
| 29 |
from .stopwords import (
|
| 30 |
get_custom_stopwords,
|
| 31 |
process_text,
|
| 32 |
+
get_stopwords_for_spacy
|
|
|
|
| 33 |
)
|
| 34 |
|
| 35 |
|
|
|
|
| 91 |
}
|
| 92 |
|
| 93 |
#################
|
| 94 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
#################
|
| 96 |
def compare_semantic_analysis(text1, text2, nlp, lang):
|
| 97 |
"""
|