Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Desafio: analisando sentimentos em várias resenhas

Você é um assistente especializado em análise de sentimentos e atendimento ao cliente. Analise as resenhas abaixo e gere a saída exclusivamente no formato JSON.

Regras:

  • Identifique o idioma original da resenha
  • Todo o conteúdo do JSON deve ser escrito no idioma pt-BR
  • O resumo deve ter no máximo 30 palavras
  • "pontos_fortes" deve conter apenas palavras chave
  • "pontos_fracos" deve conter apenas palavras chave
  • "sentimento" deve conter apenas um destes valores:
    • "positivo"
    • "negativo"
    • "neutro"
    • "indiferente"
  • Gere também uma resposta ao cliente no idioma original identificado

Estrutura obrigatória do JSON:

{
"id_resenha": "",
"resumo": "",
"pontos_fortes": [],
"pontos_fracos": [],
"sentimento": "",
"resposta_cliente": ""
}

Idioma: XXXXX

A "resposta_cliente" deve:

  • Ser no idioma XXXXX
  • Ter tom profissional e cordial
  • Agradecer o feedback
  • Citar pelo menos um ponto positivo e um ponto negativo mencionados pela pessoa cliente

Retorne apenas o JSON e as informações finais solicitadas, sem explicações adicionais.

Resenha 1:
"I use the air fryer a lot. It works very well. I made hamburgers in it last night, they were wonderful! The rack you put the food on is a little hard to clean. It has lots of crevices that food gets in. The basket itself is very easy to clean. I also do not trust the rack not to fall out when dumping out food, like French fries."

Resenha 2:
"Air fryer works fine until the handle breaks off. There's only 3 screws that attach the handle to a plastic piece on the basket. The plastic piece breaks and the screws fall out so there's no way to attach the handle to the basket rendering the air fryer useless. If there were 4 screws or if the screws attached to metal the handle attachment would have been much more secure and less prone to breaking."

Resenha 3:
"Even though I returned it for the bigger one of the same company I liked the fryer. Very easy to use but hard to judge. Seafood button isn't fish and it was a guessing game how to cook the product. I overcooked it and the chicken legs came out crispy, but the other side was raw. But this is my first time using an air fryer so maybe it's me. Very sleek on the counter, buttons light up nicely. I made tater tots and they came out perfect and stayed hot. I liked it so much that I returned this one and bought a bigger model from the same company."

2 respostas
solução!

Oi, Estudante! Como vai?

Agradeço por compartilhar suas reflexões e aprendizados com a comunidade Alura.

Gostei da sua estruturação do prompt, pois você definiu regras claras para o formato da saída, idioma e classificação dos sentimentos. Importante também a preocupação em limitar o resumo e padronizar os valores do campo "sentimento", isso ajuda bastante na consistência das respostas geradas pela IA.

Continue explorando esse tipo de refinamento em prompts, porque isso melhora muito a qualidade das respostas. Dica: para reduzir respostas fora do padrão JSON, peça também que a IA “valide a estrutura antes de responder” e “não inclua texto fora do JSON”. Isso ajuda no controle do resultado.

Alura Conte com o apoio da comunidade Alura na sua jornada. Abraços e bons estudos!

Obrigado pelas dicas!