AIdeaText commited on
Commit
d713f7b
1 Parent(s): ffcf88f

Update modules/text_analysis/semantic_analysis.py

Browse files
modules/text_analysis/semantic_analysis.py CHANGED
@@ -63,9 +63,10 @@ ENTITY_LABELS = {
63
  }
64
  }
65
 
66
- def identify_key_concepts(doc):
67
- word_freq = Counter([token.lemma_.lower() for token in doc if token.pos_ in ['NOUN', 'VERB'] and not token.is_stop])
68
- return word_freq.most_common(10) # Top 10 conceptos clave
 
69
 
70
  def create_concept_graph(text, concepts):
71
  vectorizer = TfidfVectorizer()
 
63
  }
64
  }
65
 
66
+ def identify_key_concepts(doc, top_n=10):
67
+ # Identificar sustantivos, verbos y adjetivos más frecuentes
68
+ word_freq = Counter([token.lemma_.lower() for token in doc if token.pos_ in ['NOUN', 'VERB', 'ADJ'] and not token.is_stop])
69
+ return word_freq.most_common(top_n)
70
 
71
  def create_concept_graph(text, concepts):
72
  vectorizer = TfidfVectorizer()