DHEIVER commited on
Commit
60c0b74
·
verified ·
1 Parent(s): eb84126

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -13
app.py CHANGED
@@ -4,17 +4,10 @@ from sentence_transformers import SentenceTransformer
4
  import numpy as np
5
  from typing import Dict, List, Tuple
6
  from textblob import TextBlob
7
- import nltk
8
- from nltk.tokenize import sent_tokenize
9
-
10
- # Download NLTK data
11
- nltk.download(['punkt', 'punkt_tab'])
12
- nltk.download('punkt', language='portuguese')
13
 
14
  # Load embeddings model
15
  model = SentenceTransformer('all-MiniLM-L6-v2')
16
 
17
- # Define questions with categories and context
18
  PERGUNTAS = [
19
  {
20
  "categoria": "autoconhecimento",
@@ -43,7 +36,6 @@ PERGUNTAS = [
43
  }
44
  ]
45
 
46
- # Add tone categories
47
  TONE_PATTERNS = {
48
  "confiante": ["certamente", "sem dúvida", "confio", "tenho certeza", "definitivamente"],
49
  "reflexivo": ["penso que", "considero", "reflito", "analiso", "pondero"],
@@ -52,7 +44,6 @@ TONE_PATTERNS = {
52
  "emocional": ["sinto", "emocionalmente", "impactado", "motivado", "frustrado"]
53
  }
54
 
55
- # Enhanced response system
56
  RESPOSTAS_COACH = {
57
  "autoconhecimento": {
58
  "positive": [
@@ -140,10 +131,7 @@ class EnhancedCoach:
140
  self.response_quality_metrics = []
141
 
142
  def analyze_response_quality(self, text: str) -> Dict[str, float]:
143
- try:
144
- sentences = sent_tokenize(text, language='portuguese')
145
- except LookupError:
146
- sentences = [s.strip() for s in text.split('.') if s.strip()]
147
 
148
  metrics = {
149
  "depth": self._calculate_depth(text),
 
4
  import numpy as np
5
  from typing import Dict, List, Tuple
6
  from textblob import TextBlob
 
 
 
 
 
 
7
 
8
  # Load embeddings model
9
  model = SentenceTransformer('all-MiniLM-L6-v2')
10
 
 
11
  PERGUNTAS = [
12
  {
13
  "categoria": "autoconhecimento",
 
36
  }
37
  ]
38
 
 
39
  TONE_PATTERNS = {
40
  "confiante": ["certamente", "sem dúvida", "confio", "tenho certeza", "definitivamente"],
41
  "reflexivo": ["penso que", "considero", "reflito", "analiso", "pondero"],
 
44
  "emocional": ["sinto", "emocionalmente", "impactado", "motivado", "frustrado"]
45
  }
46
 
 
47
  RESPOSTAS_COACH = {
48
  "autoconhecimento": {
49
  "positive": [
 
131
  self.response_quality_metrics = []
132
 
133
  def analyze_response_quality(self, text: str) -> Dict[str, float]:
134
+ sentences = [s.strip() for s in text.split('.') if s.strip()]
 
 
 
135
 
136
  metrics = {
137
  "depth": self._calculate_depth(text),