Hub
Pricing About
WorkflowWorkflow

Use LLama3 as Local Model to perform sentiment analysis on Customer Review

Release 5.3AIGenerative AILlama3
knime profile image
Versionv1.0 KNIME AP 5.3 ReleaseLatest, created on 
Jul 10, 2024 11:14 AM
Drag & drop
Like
Download workflow
Workflow preview

This workflow demonstrates how to use a local model in KNIME Analytics Platform for sentiment analysis, offering an alternative to traditional lexicon-based methods.

You can easily download and run the workflow directly in your KNIME installation. For optimal performance, we recommend using the latest version of the KNIME Analytics Platform.

Workflow Details

This workflow showcases how to use a local model in KNIME Analytics Platform. Refer to the node description of the "Local GPT4ALL Chat Model Connector" for more information about setting up a local model on your machine.

You can only run this workflow locally since its large model size—several GB—makes it unsuitable for uploading to any KNIME Hub.

Note that the model's processing speed is related to your local machine's capacity. These models are designed to run with a powerful GPU so that performance may be slower on less capable machines.

Advantages of a Local Model:

  • No internet connection is needed.

  • There is no risk of data leaks.

Workflow Steps

  1. Model Setup

    • Set up your local model using the "Local ChatGPT4ALL Chat Model Connector" node description as a reference. You need to download the model to your machine.

  2. Data Input

    • E-commerce reviews are used to perform sentiment analysis using the local model.

  3. Data Sampling

    • Use the Row Sampling node to sample the data; initially, there were more than 20,000 entries but only 20 rows. This step is crucial for running the workflow on a standard laptop, as processing a large dataset would take a long time.

  4. Prompt Creation

    • Create the prompt for the LLM prompter. Example prompt: "Please analyze the sentiment of the following text and respond with either 'positive,' 'negative,' or 'neutral.' Provide only the sentiment label. Here is the review: This shirt is semi-fitted. I like it because it is not boxy but not overly tight. It is not heavy even though it is a sweatshirt material. I wish the neck was a bit higher, but I will wear a tee under it. The back is really cute. It is different, and I like that."

  5. Processing and Visualization

    • After the LLM Prompter node finishes processing, the workflows takes the responses, categorize and summarize the reviews based on the sentiment label (negative, neutral, positive), and plot a bar chart by the department with the count of reviews by sentiment label.

External resources

  • Llama3 LLM Model
  • GPT4ALL
Loading deploymentsLoading ad hoc jobs

Used extensions & nodes

Created with KNIME Analytics Platform version 5.3.0
  • Go to item
    KNIME AI ExtensionTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.3.0

    knime profile image
    knime
  • Go to item
    KNIME Base nodesTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.3.0

    knime profile image
    knime
  • Go to item
    KNIME ExpressionsTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.3.0

    knime profile image
    knime
  • Go to item
    KNIME ViewsTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.3.0

    knime profile image
    knime

Legal

By using or downloading the workflow, you agree to our terms and conditions.

KNIME
Open for Innovation

KNIME AG
Talacker 50
8001 Zurich, Switzerland
  • Software
  • Getting started
  • Documentation
  • Courses + Certification
  • Solutions
  • KNIME Hub
  • KNIME Forum
  • Blog
  • Events
  • Partner
  • Developers
  • KNIME Home
  • Careers
  • Contact us
Download KNIME Analytics Platform Read more about KNIME Business Hub
© 2025 KNIME AG. All rights reserved.
  • Trademarks
  • Imprint
  • Privacy
  • Terms & Conditions
  • Data Processing Agreement
  • Credits