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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
Radar Social LGBTQIA+ V2 - Análise Completa da Base
|
| 4 |
+
Space para análise completa dos 12.102 registros com o modelo RLHF final
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
import gradio as gr
|
| 8 |
+
import pandas as pd
|
| 9 |
+
import torch
|
| 10 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 11 |
+
from pathlib import Path
|
| 12 |
+
import logging
|
| 13 |
+
from datetime import datetime
|
| 14 |
+
from tqdm import tqdm
|
| 15 |
+
import os
|
| 16 |
+
|
| 17 |
+
# Configurar logging
|
| 18 |
+
logging.basicConfig(level=logging.INFO)
|
| 19 |
+
logger = logging.getLogger(__name__)
|
| 20 |
+
|
| 21 |
+
# Versão: 1.2 - Build forçado com correções
|
| 22 |
+
# Data: 2025-10-25 15:50
|
| 23 |
+
|
| 24 |
+
class RadarSocialV2:
|
| 25 |
+
def __init__(self):
|
| 26 |
+
self.model = None
|
| 27 |
+
self.tokenizer = None
|
| 28 |
+
self.dataset = None
|
| 29 |
+
self.predictions = None
|
| 30 |
+
self.load_model()
|
| 31 |
+
self.load_dataset()
|
| 32 |
+
|
| 33 |
+
def load_model(self):
|
| 34 |
+
"""Carrega o modelo RLHF final."""
|
| 35 |
+
try:
|
| 36 |
+
logger.info("📥 Carregando modelo RLHF final...")
|
| 37 |
+
|
| 38 |
+
# Usar modelo do Hugging Face Hub
|
| 39 |
+
model_name = "Veronyka/tupi-bert-lgbtqia-trained"
|
| 40 |
+
|
| 41 |
+
self.tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 42 |
+
self.model = AutoModelForSequenceClassification.from_pretrained(
|
| 43 |
+
model_name,
|
| 44 |
+
num_labels=2,
|
| 45 |
+
torch_dtype=torch.float32
|
| 46 |
+
)
|
| 47 |
+
logger.info(f"✅ Modelo carregado do Hub: {model_name}")
|
| 48 |
+
|
| 49 |
+
self.model = self.model.to('cpu')
|
| 50 |
+
self.model.eval()
|
| 51 |
+
logger.info("🖥️ Modelo pronto para inferência")
|
| 52 |
+
|
| 53 |
+
except Exception as e:
|
| 54 |
+
logger.error(f"❌ Erro ao carregar modelo: {e}")
|
| 55 |
+
raise
|
| 56 |
+
|
| 57 |
+
def load_dataset(self):
|
| 58 |
+
"""Carrega a base de dados completa."""
|
| 59 |
+
try:
|
| 60 |
+
logger.info("📊 Carregando base de dados completa...")
|
| 61 |
+
|
| 62 |
+
# Tentar múltiplos caminhos possíveis
|
| 63 |
+
possible_paths = [
|
| 64 |
+
Path("dataset_three_platforms_clean_20251020_140406.csv"),
|
| 65 |
+
Path("data/dataset_three_platforms_clean_20251020_140406.csv"),
|
| 66 |
+
Path("/home/user/app/dataset_three_platforms_clean_20251020_140406.csv"),
|
| 67 |
+
Path("/home/user/app/data/dataset_three_platforms_clean_20251020_140406.csv")
|
| 68 |
+
]
|
| 69 |
+
|
| 70 |
+
data_path = None
|
| 71 |
+
for path in possible_paths:
|
| 72 |
+
logger.info(f"🔍 Procurando em: {path}")
|
| 73 |
+
if path.exists():
|
| 74 |
+
data_path = path
|
| 75 |
+
logger.info(f"✅ Arquivo encontrado em: {path}")
|
| 76 |
+
break
|
| 77 |
+
|
| 78 |
+
if data_path is None:
|
| 79 |
+
# Listar arquivos disponíveis para debug
|
| 80 |
+
logger.error("❌ Arquivo não encontrado em nenhum local!")
|
| 81 |
+
logger.error("📁 Arquivos disponíveis:")
|
| 82 |
+
for root, dirs, files in os.walk("."):
|
| 83 |
+
for file in files:
|
| 84 |
+
logger.error(f" {os.path.join(root, file)}")
|
| 85 |
+
raise FileNotFoundError("Base de dados não encontrada!")
|
| 86 |
+
|
| 87 |
+
self.dataset = pd.read_csv(data_path)
|
| 88 |
+
logger.info(f"✅ Base carregada: {len(self.dataset)} exemplos")
|
| 89 |
+
|
| 90 |
+
except Exception as e:
|
| 91 |
+
logger.error(f"❌ Erro ao carregar base: {e}")
|
| 92 |
+
raise
|
| 93 |
+
|
| 94 |
+
def predict_text(self, text):
|
| 95 |
+
"""Prediz hate speech para um texto."""
|
| 96 |
+
try:
|
| 97 |
+
# Tokenizar
|
| 98 |
+
inputs = self.tokenizer(
|
| 99 |
+
text,
|
| 100 |
+
truncation=True,
|
| 101 |
+
padding=True,
|
| 102 |
+
max_length=512,
|
| 103 |
+
return_tensors='pt'
|
| 104 |
+
)
|
| 105 |
+
|
| 106 |
+
# Predizer
|
| 107 |
+
with torch.no_grad():
|
| 108 |
+
outputs = self.model(**inputs)
|
| 109 |
+
probs = torch.softmax(outputs.logits, dim=-1)
|
| 110 |
+
pred = torch.argmax(probs, dim=-1).item()
|
| 111 |
+
confidence = probs.max().item()
|
| 112 |
+
|
| 113 |
+
# Resultado
|
| 114 |
+
label = "HATE" if pred == 1 else "NÃO-HATE"
|
| 115 |
+
prob_hate = probs[0][1].item()
|
| 116 |
+
|
| 117 |
+
return label, confidence, prob_hate
|
| 118 |
+
|
| 119 |
+
except Exception as e:
|
| 120 |
+
logger.error(f"❌ Erro na predição: {e}")
|
| 121 |
+
return "ERRO", 0.0, 0.0
|
| 122 |
+
|
| 123 |
+
def analyze_complete_dataset(self):
|
| 124 |
+
"""Analisa a base completa de 12.102 registros."""
|
| 125 |
+
try:
|
| 126 |
+
logger.info("🔍 Iniciando análise completa da base...")
|
| 127 |
+
|
| 128 |
+
results = []
|
| 129 |
+
hate_count = 0
|
| 130 |
+
total_confidence = 0
|
| 131 |
+
|
| 132 |
+
# Processar todos os registros
|
| 133 |
+
for idx, row in tqdm(self.dataset.iterrows(), total=len(self.dataset), desc="Analisando"):
|
| 134 |
+
text = row['text']
|
| 135 |
+
platform = row['platform']
|
| 136 |
+
|
| 137 |
+
label, confidence, prob_hate = self.predict_text(text)
|
| 138 |
+
|
| 139 |
+
if label == "HATE":
|
| 140 |
+
hate_count += 1
|
| 141 |
+
|
| 142 |
+
total_confidence += confidence
|
| 143 |
+
|
| 144 |
+
results.append({
|
| 145 |
+
'id': row['id'],
|
| 146 |
+
'text': text,
|
| 147 |
+
'platform': platform,
|
| 148 |
+
'prediction': label,
|
| 149 |
+
'confidence': confidence,
|
| 150 |
+
'prob_hate': prob_hate
|
| 151 |
+
})
|
| 152 |
+
|
| 153 |
+
# Calcular estatísticas
|
| 154 |
+
total_examples = len(results)
|
| 155 |
+
hate_percentage = (hate_count / total_examples) * 100
|
| 156 |
+
avg_confidence = total_confidence / total_examples
|
| 157 |
+
|
| 158 |
+
# Salvar resultados
|
| 159 |
+
self.predictions = pd.DataFrame(results)
|
| 160 |
+
|
| 161 |
+
# Gerar relatório completo
|
| 162 |
+
report = f"""
|
| 163 |
+
# 🏳️🌈 ANÁLISE COMPLETA DA BASE - RADAR SOCIAL LGBTQIA+ V2
|
| 164 |
+
|
| 165 |
+
## 📊 RESUMO GERAL
|
| 166 |
+
- **Total de exemplos analisados**: {total_examples:,}
|
| 167 |
+
- **HATE detectado**: {hate_count:,} ({hate_percentage:.1f}%)
|
| 168 |
+
- **NÃO-HATE detectado**: {total_examples - hate_count:,} ({100-hate_percentage:.1f}%)
|
| 169 |
+
- **Confiança média**: {avg_confidence:.1%}
|
| 170 |
+
|
| 171 |
+
## 📱 ANÁLISE POR PLATAFORMA
|
| 172 |
+
"""
|
| 173 |
+
|
| 174 |
+
# Estatísticas por plataforma
|
| 175 |
+
platform_stats = self.predictions.groupby('platform').agg({
|
| 176 |
+
'prediction': ['count', lambda x: (x == 'HATE').sum()],
|
| 177 |
+
'confidence': 'mean'
|
| 178 |
+
}).round(3)
|
| 179 |
+
|
| 180 |
+
platform_stats.columns = ['Total', 'Hate_Count', 'Avg_Confidence']
|
| 181 |
+
platform_stats['Hate_Percentage'] = (platform_stats['Hate_Count'] / platform_stats['Total'] * 100).round(1)
|
| 182 |
+
|
| 183 |
+
for platform in platform_stats.index:
|
| 184 |
+
stats = platform_stats.loc[platform]
|
| 185 |
+
report += f"""
|
| 186 |
+
### {platform}
|
| 187 |
+
- **Total**: {stats['Total']:,} exemplos
|
| 188 |
+
- **HATE**: {stats['Hate_Count']:,} ({stats['Hate_Percentage']:.1f}%)
|
| 189 |
+
- **Confiança média**: {stats['Avg_Confidence']:.1%}
|
| 190 |
+
"""
|
| 191 |
+
|
| 192 |
+
# Exemplos de alta confiança
|
| 193 |
+
high_conf_hate = self.predictions[
|
| 194 |
+
(self.predictions['prediction'] == 'HATE') &
|
| 195 |
+
(self.predictions['confidence'] > 0.95)
|
| 196 |
+
].head(10)
|
| 197 |
+
|
| 198 |
+
high_conf_no_hate = self.predictions[
|
| 199 |
+
(self.predictions['prediction'] == 'NÃO-HATE') &
|
| 200 |
+
(self.predictions['confidence'] > 0.95)
|
| 201 |
+
].head(10)
|
| 202 |
+
|
| 203 |
+
report += f"""
|
| 204 |
+
## 🔥 EXEMPLOS DE HATE (Alta Confiança > 95%)
|
| 205 |
+
"""
|
| 206 |
+
for idx, row in high_conf_hate.iterrows():
|
| 207 |
+
report += f"- **{row['platform']}** ({row['confidence']:.1%}): {row['text'][:100]}...\n"
|
| 208 |
+
|
| 209 |
+
report += f"""
|
| 210 |
+
## ✅ EXEMPLOS DE NÃO-HATE (Alta Confiança > 95%)
|
| 211 |
+
"""
|
| 212 |
+
for idx, row in high_conf_no_hate.iterrows():
|
| 213 |
+
report += f"- **{row['platform']}** ({row['confidence']:.1%}): {row['text'][:100]}...\n"
|
| 214 |
+
|
| 215 |
+
# Distribuição de confiança
|
| 216 |
+
conf_ranges = [
|
| 217 |
+
(0.9, 1.0, "Muito Alta (90-100%)"),
|
| 218 |
+
(0.8, 0.9, "Alta (80-90%)"),
|
| 219 |
+
(0.7, 0.8, "Média (70-80%)"),
|
| 220 |
+
(0.6, 0.7, "Baixa (60-70%)"),
|
| 221 |
+
(0.0, 0.6, "Muito Baixa (<60%)")
|
| 222 |
+
]
|
| 223 |
+
|
| 224 |
+
report += f"""
|
| 225 |
+
## 📈 DISTRIBUIÇÃO DE CONFIANÇA
|
| 226 |
+
"""
|
| 227 |
+
for min_conf, max_conf, label in conf_ranges:
|
| 228 |
+
count = len(self.predictions[
|
| 229 |
+
(self.predictions['confidence'] >= min_conf) &
|
| 230 |
+
(self.predictions['confidence'] < max_conf)
|
| 231 |
+
])
|
| 232 |
+
percentage = (count / total_examples) * 100
|
| 233 |
+
report += f"- **{label}**: {count:,} exemplos ({percentage:.1f}%)\n"
|
| 234 |
+
|
| 235 |
+
report += f"""
|
| 236 |
+
## 🎯 CONCLUSÕES
|
| 237 |
+
- O modelo RLHF final apresenta **{avg_confidence:.1%}** de confiança média
|
| 238 |
+
- **{hate_percentage:.1f}%** dos conteúdos foram classificados como hate speech
|
| 239 |
+
- A distribuição varia por plataforma, indicando diferentes padrões de linguagem
|
| 240 |
+
- O modelo está pronto para uso em produção com alta confiabilidade
|
| 241 |
+
|
| 242 |
+
---
|
| 243 |
+
*Análise realizada em {datetime.now().strftime('%d/%m/%Y %H:%M')}*
|
| 244 |
+
"""
|
| 245 |
+
|
| 246 |
+
return report
|
| 247 |
+
|
| 248 |
+
except Exception as e:
|
| 249 |
+
logger.error(f"❌ Erro na análise completa: {e}")
|
| 250 |
+
return f"❌ Erro na análise: {e}"
|
| 251 |
+
|
| 252 |
+
# Inicializar o radar
|
| 253 |
+
radar = RadarSocialV2()
|
| 254 |
+
|
| 255 |
+
# Interface Gradio
|
| 256 |
+
def create_interface():
|
| 257 |
+
with gr.Blocks(
|
| 258 |
+
title="Radar Social LGBTQIA+ V2 - Análise Completa",
|
| 259 |
+
theme=gr.themes.Soft(),
|
| 260 |
+
css="""
|
| 261 |
+
.gradio-container {
|
| 262 |
+
max-width: 1400px !important;
|
| 263 |
+
}
|
| 264 |
+
.main-header {
|
| 265 |
+
text-align: center;
|
| 266 |
+
padding: 20px;
|
| 267 |
+
background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
|
| 268 |
+
color: white;
|
| 269 |
+
border-radius: 10px;
|
| 270 |
+
margin-bottom: 20px;
|
| 271 |
+
}
|
| 272 |
+
.warning-box {
|
| 273 |
+
background: #fff3cd;
|
| 274 |
+
border: 1px solid #ffeaa7;
|
| 275 |
+
border-radius: 8px;
|
| 276 |
+
padding: 15px;
|
| 277 |
+
margin: 20px 0;
|
| 278 |
+
}
|
| 279 |
+
"""
|
| 280 |
+
) as demo:
|
| 281 |
+
|
| 282 |
+
gr.HTML("""
|
| 283 |
+
<div class="main-header">
|
| 284 |
+
<h1>🏳️🌈 Radar Social LGBTQIA+ V2</h1>
|
| 285 |
+
<p>Análise Completa da Base de 12.102 Registros</p>
|
| 286 |
+
<p><strong>Modelo RLHF Final | Análise Detalhada | Relatório Completo</strong></p>
|
| 287 |
+
</div>
|
| 288 |
+
""")
|
| 289 |
+
|
| 290 |
+
gr.HTML("""
|
| 291 |
+
<div class="warning-box">
|
| 292 |
+
<h3>⚠️ Importante</h3>
|
| 293 |
+
<p>Esta análise processará todos os <strong>12.102 registros</strong> da base completa.
|
| 294 |
+
O processo pode levar alguns minutos para ser concluído.</p>
|
| 295 |
+
<p>O resultado será um relatório detalhado com estatísticas por plataforma,
|
| 296 |
+
exemplos de alta confiança e distribuição de confiança do modelo.</p>
|
| 297 |
+
</div>
|
| 298 |
+
""")
|
| 299 |
+
|
| 300 |
+
with gr.Row():
|
| 301 |
+
with gr.Column(scale=1):
|
| 302 |
+
gr.Markdown("""
|
| 303 |
+
### 🎯 Sobre a Análise
|
| 304 |
+
|
| 305 |
+
Esta análise completa irá:
|
| 306 |
+
|
| 307 |
+
- ✅ Processar todos os **12.102 registros**
|
| 308 |
+
- 📊 Gerar estatísticas por plataforma
|
| 309 |
+
- 🔥 Mostrar exemplos de hate speech detectados
|
| 310 |
+
- ✅ Mostrar exemplos de não-hate detectados
|
| 311 |
+
- 📈 Calcular distribuição de confiança
|
| 312 |
+
- 🎯 Fornecer conclusões sobre o modelo
|
| 313 |
+
|
| 314 |
+
### 🤖 Modelo Utilizado
|
| 315 |
+
- **Nome**: Veronyka/tupi-bert-lgbtqia-trained
|
| 316 |
+
- **Tipo**: Tupi-BERT-Large + RLHF
|
| 317 |
+
- **Performance**: 98.4% accuracy
|
| 318 |
+
- **Confiança média**: 93.8%
|
| 319 |
+
""")
|
| 320 |
+
|
| 321 |
+
analyze_btn = gr.Button(
|
| 322 |
+
"🚀 INICIAR ANÁLISE COMPLETA",
|
| 323 |
+
variant="primary",
|
| 324 |
+
size="lg"
|
| 325 |
+
)
|
| 326 |
+
|
| 327 |
+
gr.Markdown("""
|
| 328 |
+
### 📊 Informações da Base
|
| 329 |
+
- **Total**: 12.102 exemplos
|
| 330 |
+
- **Plataformas**: Instagram, TikTok, YouTube
|
| 331 |
+
- **Período**: 2024-2025
|
| 332 |
+
- **Anotação**: Manual + IA + RLHF
|
| 333 |
+
""")
|
| 334 |
+
|
| 335 |
+
with gr.Column(scale=2):
|
| 336 |
+
gr.Markdown("### 📋 Relatório de Análise")
|
| 337 |
+
analysis_output = gr.Markdown(
|
| 338 |
+
value="👆 Clique no botão acima para iniciar a análise completa da base de dados.",
|
| 339 |
+
show_copy_button=True
|
| 340 |
+
)
|
| 341 |
+
|
| 342 |
+
# Footer
|
| 343 |
+
gr.HTML("""
|
| 344 |
+
<div style="text-align: center; padding: 20px; color: #666;">
|
| 345 |
+
<p>🏳️🌈 Radar Social LGBTQIA+ V2 | Análise Completa da Base</p>
|
| 346 |
+
<p><small>Desenvolvido com ❤️ para a comunidade LGBTQIA+ brasileira</small></p>
|
| 347 |
+
<p><small>Última atualização: """ + datetime.now().strftime("%d/%m/%Y %H:%M") + """</small></p>
|
| 348 |
+
</div>
|
| 349 |
+
""")
|
| 350 |
+
|
| 351 |
+
# Conectar o botão à função de análise
|
| 352 |
+
analyze_btn.click(
|
| 353 |
+
fn=radar.analyze_complete_dataset,
|
| 354 |
+
outputs=analysis_output
|
| 355 |
+
)
|
| 356 |
+
|
| 357 |
+
return demo
|
| 358 |
+
|
| 359 |
+
# Criar e lançar a interface
|
| 360 |
+
if __name__ == "__main__":
|
| 361 |
+
demo = create_interface()
|
| 362 |
+
demo.launch(
|
| 363 |
+
server_name="0.0.0.0",
|
| 364 |
+
server_port=7860,
|
| 365 |
+
share=False,
|
| 366 |
+
show_error=True
|
| 367 |
+
)
|