> For the complete documentation index, see [llms.txt](https://docs.chatlayer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chatlayer.ai/chatlayer-documentation-pt-br/nlp/natural-language-processing-nlp/sentiment-analysis.md).

# Análise de sentimento

Determine o sentimento da mensagem do usuário para redirecionar seu fluxo.

**Análise de sentimento** em [PLN](/chatlayer-documentation-pt-br/nlp/natural-language-processing-nlp.md) refere-se ao processo de determinar e categorizar automaticamente o tom emocional ou a atitude expressa na entrada de um usuário, permitindo que o bot responda adequadamente com base no sentimento detectado.

No Chatlayer, a análise de sentimento consiste em:

* um `nome`: seja neutro, positivo ou negativo.
* um `pontuação`: variando de 0 a 1.

## Ativar análise de sentimento

Para ativar a análise de sentimento no seu NLP:

1. Acesse qualquer página na sua **PLN** guia.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2F6w56gc5xoB2eyJYWKM7N%2FScreenshot%202024-08-28%20at%2010.41.09.png?alt=media&amp;token=b61ce513-3aa8-4ee2-a9df-7e997f6c27a1" alt="" width="375"><figcaption><p>Acesse as configurações de NLP na sua aba NLP.</p></figcaption></figure>

2. Clique no **Configurações** botão no canto superior direito.
3. Ative o **Análise de sentimento**.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FNRk7PejOgEmcBr9rk4d6%2FScreenshot%202024-08-28%20at%2010.42.10.png?alt=media&amp;token=07070dbf-ed20-4863-a211-6aea1c0f7f28" alt=""><figcaption></figcaption></figure>

4. Clique em **Salvar**.

## Acesse a análise de sentimento na sessão do usuário

Para acessar a análise de sentimento na sessão do usuário:

1. Use o bot [Depurador](/chatlayer-documentation-pt-br/buildabot/emulator.md#debug-your-bot) dentro do seu **Emulador**.
2. Encontre o `sentimento` no NLP. Ele consiste em:
   * `nome`: o nome do sentimento, seja positivo, negativo ou neutro.
   * o `pontuação` desse sentimento.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2F4nnFTkdeTNRzlvt5bwMK%2FScreenshot%202024-08-28%20at%2010.46.51.png?alt=media&amp;token=5873e1c8-cb6c-4ed6-b42f-6719b6b1ba96" alt="" width="310"><figcaption><p>Acesse o sentimento do seu usuário pelo Debugger.</p></figcaption></figure>

3. Clique no **3 pontos** ao lado do sentimento `nome` ou `pontuação` para copiar seu caminho ou valor e usá-los dentro de um [**Condição**](/chatlayer-documentation-pt-br/buildabot/flow-logic/dialog-state/plugins.md) bloco para conduzir a conversa.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2F4i3pg02QMz9D1OXoInvh%2FScreenshot%202024-08-28%20at%2010.57.05.png?alt=media&amp;token=64d176db-ad4c-4963-aba8-39eb3a5fbdac" alt="" width="375"><figcaption><p>Copie o caminho ou valor do sentimento para conduzir a conversa.</p></figcaption></figure>

{% hint style="info" %}
Você também pode verificar o sentimento de uma fala no [**Testar**](/chatlayer-documentation-pt-br/navegacao/natural-language-processing-nlp/intents.md#test-your-nlp) botão na sua aba NLP.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chatlayer.ai/chatlayer-documentation-pt-br/nlp/natural-language-processing-nlp/sentiment-analysis.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
