# Analyzers

## Create an Analyzer

To create a new Analyzer, click on the '**Analyzers**' from the left panel and click on the '**Create analyzer**' button. Fill out the form to create the desired analyzer. At minimum, this includes:

* Name of the analyzer.
* Description of what the analyzer does (optional).
* Select the analyzer type

### Analyzer Type

<table data-full-width="true"><thead><tr><th width="200">Name</th><th width="338">Description</th></tr></thead><tbody><tr><td>Text Classification</td><td>Uses a text classification model based on provided labels. It assesses the likelihood of the input text belonging to each label category. Multi-label is available in settings</td></tr><tr><td>Positive/Negative Analysis</td><td>Uses a fine-tuned RoBERTa model for sentiment analysis, returning a score between 0 to 1 for positive, negative, and neutral.</td></tr><tr><td>Emotion Identificaiton</td><td><p>Uses a fine-tuned DistilRoBERTa model for comprehensive sentiment analysis. It assesses the emotional tone of input text, providing scores for 7 distinct sentiment categories: </p><ul><li>Anger 🤬</li><li>Disgust 🤢</li><li>Fear 😨</li><li>Joy 😀</li><li>Neutral 😐</li><li>Sadness 😭</li><li>Surprise 😲</li></ul></td></tr></tbody></table>

### Analyzer Settings

On Analyzer detail page, you can specify additional settings

#### Multiple Labels

If you anticipate the response may belong to more than one labels, you'd want to enable the multi-label toggle.

<figure><img src="https://2399115798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWsdxCCToJ5K2nk2ZZvqc%2Fuploads%2FENUVl3fbh1CIs5PuV8XQ%2FScreenshot%202024-09-27%20at%206.50.44%E2%80%AFPM.png?alt=media&#x26;token=536eefa1-9fa7-437d-9f21-2de5eb50dc51" alt="" width="375"><figcaption></figcaption></figure>

#### Inference Attribute

You can choose which variable to analyze

<table><thead><tr><th width="170">Name</th><th>Description</th></tr></thead><tbody><tr><td>Input</td><td>The complete data submitted to the LLM.</td></tr><tr><td>Output</td><td>The generated response from the LLM</td></tr><tr><td>User Prompt</td><td>The user's query or input within the overall submission</td></tr><tr><td>Context</td><td>The context informtion within the submission</td></tr><tr><td>System Prompt</td><td>The instruction provided to the LLM as part of the entire input</td></tr></tbody></table>

## Smart Trigger An Analyzer in Production

### Add Trigger Logic

You can add Triggers on the Analyzer's detail page to automatically analyze an inference.

* Select the **Analyzer** you just created.
* Navigate to the '**Triggers**' section within the Analyzer detail page, and click on '**Add tag**'

### Implement Trigger in Inference Stream

* Ensure that the tags specified in the Analyzers' triggers are included when you stream your inference data.
* Follow the full [API documentation](https://app.ownlayer.com/docs#tag/inferences) for detailed instructions on how to implement triggers in your inference stream.

<figure><img src="https://2399115798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWsdxCCToJ5K2nk2ZZvqc%2Fuploads%2FSWunBlgJeuP0ZbUCFc1C%2FExport-1727478972569.gif?alt=media&#x26;token=2a69d1dc-f540-4cc5-adc9-dd92ef58af23" alt=""><figcaption></figcaption></figure>
