-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs for Sentiment Analysis Node
- Loading branch information
1 parent
9dcd77b
commit d05693a
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
...tions/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.sentimentanalysis.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
#https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4 | ||
title: Sentiment Analysis | ||
description: Documentation for the Sentiment Analysis node in n8n, a workflow automation platform. Includes details of operations and configuration, and links to examples and credentials information. | ||
contentType: integration | ||
--- | ||
|
||
# Sentiment Analysis | ||
|
||
Use the Sentiment Analysis node to analyze the sentiment of incoming text data. Using the | ||
categories provided in the parameters (see below), each item is passed to the | ||
language model to determine its sentiment. | ||
|
||
## Node parameters | ||
|
||
**Text to Analyze** defines the input text for sentiment analysis. This is usually an expression | ||
that references a field from the input items. For example, this could be | ||
`{{ $json.chatInput }}` if the input is from a chat or message source. By default, it | ||
expects a `text` field. | ||
|
||
## Node options | ||
|
||
* **Sentiment Categories**: Define the categories that you want to classify your input as. | ||
By default, these are "Positive, Neutral, Negative". You can customize these categories | ||
to fit your specific use case, such as "Very Positive, Positive, Neutral, Negative, Very Negative" | ||
for more granular analysis. | ||
|
||
* **Include Detailed Results**: When enabled, this option includes sentiment strength and | ||
confidence scores in the output. Note that these scores are estimates generated by the | ||
language model and should be interpreted as rough indicators rather than precise measurements. | ||
|
||
* **System Prompt Template**: This option allows you to change the system prompt that's used for the sentiment analysis. It uses the `{categories}` placeholder for the categories. | ||
|
||
* **Enable Auto-Fixing**: When enabled, this option allows the node to automatically fix model outputs to ensure they match the expected format. This is done by sending the schema parsing error to the LLM and asking it to fix it. | ||
|
||
## Usage Notes | ||
|
||
1. **Model Temperature Setting**: It is strongly advised to set the temperature of the connected language model to 0 or a value very close to 0. This helps ensure that the results are as deterministic as possible, providing more consistent and reliable sentiment analysis across multiple runs. | ||
|
||
2. **Language Considerations**: The node's performance may vary depending on the language of the input text. For best results, ensure your chosen language model supports the input language. | ||
|
||
3. **Processing Large Volumes**: When analyzing large amounts of text, consider splitting the input into smaller chunks to optimize processing time and resource usage. | ||
|
||
4. **Iterative Refinement**: For complex sentiment analysis tasks, you may need to iteratively refine the system prompt and categories to achieve the desired results. | ||
|
||
## Example Usage | ||
|
||
### Basic Sentiment Analysis | ||
1. Connect a data source (e.g., RSS Feed, HTTP Request) to the Sentiment Analysis node. | ||
2. Set the "Text to Analyze" field to the relevant item property (e.g., `{{ $json.content }}` for blog post content). | ||
3. Keep the default sentiment categories. | ||
4. Connect the node's outputs to separate paths for processing positive, neutral, and negative sentiments differently. | ||
|
||
### Custom Category Analysis | ||
1. Modify the "Sentiment Categories" to "Excited, Happy, Neutral, Disappointed, Angry". | ||
2. Adjust your workflow to handle these five output categories. | ||
3. Use this setup to analyze customer feedback with more nuanced emotional categories. | ||
|
||
## Related resources | ||
|
||
--8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-overview-link.md" | ||
--8<-- "_glossary/ai-glossary.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters