Workflow Quick Start

A step-by-step guide on how to extract sentiment from restaurant reviews

In this guide, we will make a Sentiment Analysis app that extracts sentiment, keywords, and a sentiment score from a restaurant review.


Start from a Blank Workflow

We have a template "Sentiment Analyze" template you may use, but in this guide, we will show you how to build an app from a blank workflow. To get started, click Templates > Blank Workflow.

There are 3 steps to create your first AirOps app:

  1. Define the inputs
  2. Configure the Large Language Model
  3. Save, test, and publish the app

1. Define the Inputs

What should the input be?

An input is any data you want to provide to your workflow to customize the outcome.

For our restaurant review sentiment analysis app, we need to add an input for the restaurant review.

How to add an input

  1. Click on a Blank Workflow to start a draft of your workflow
  2. Click Add field in the Start step
  3. Click on Long Text to create a multi-line text box
  4. Label the field "Restaurant Review"
  5. Optionally: configure the Variable Name, which will be used to reference the input. Notice the variable name will be "restaurant_review" by default.
  6. Optionally: write a Hint to provide further detail or instructions for the user such as "Enter a single restaurant review to analyze"
  7. Make the field Required by clicking on the toggle
  8. Click Save field

2. Configure the Large Language Model

Next, we need to use an LLM step to analyze the sentiment of the restaurant review.

Choose the LLM

  1. Add an LLM Step: click Add Step > LLM > Configure
  2. Choose Your Model: for this app, we will use GPT Turbo 3.5 so no changes are needed
  3. Set the temperature: temperature determines the amount of variability in the response - the higher the temperature, the more varied the response. In this app, we want low variability, so we will set the temperature to 0.1

Write the Prompt

  1. Define the System: The system specifies the persona and/or task of the AI:
    1. System: You are a restaurant review analyzer. Extract positive keywords, negative keywords, and a sentiment score on a scale from -1.0 to 1.0, in 0.1 increments, from the restaurant review. Output in JSON only

  2. Provide an Example of the Correct Response with a User-Assistant Pair: The user and the assistant are formal terms for the conversation between the human (user) and the AI (assistant). We provide a user-assistant pair - or an example of a human message and the AI response - in order to "train" the model to respond in the desired way. (This is also known as one-shot prompting).
    1. User: I ordered chirash for lunch. Good presentation. Need to work on the freshness of the items. Service was good. Would not return for raw items.

    2. Assistant:
      "positive_keywords": [ "good presentation", "service was good"]
      "negative_keywords": [ "need to work on the freshness of the items", "would not return for raw items" ]
      "sentiment_score": 0.2


Use a real-life example

The best way to generate high-quality outputs is by providing a high-quality example to the model. Use the most realistic example when possible, whether from the internet or from your own data.

  1. Add your input to the prompt: Now that we've provided an example to the model, we need to provide the restaurant review to the model by referencing the variable name with Liquid syntax:
    1. Get the variable name from your input in the Start Step (restaurant_review)
    2. Add a user message after the User/Assistant pair you provided from Step 2
    3. Click on the pill of your input variable in the user message - this will apply Liquid syntax to your variable!
      1. User: {{restaurant_review}}

3. Save, Test, and Publish

  1. Save a draft of your app:
    1. Name your app
    2. Optionally, select an app emoji
  2. Then, test and validate that it works as expected:
    1. Click Test All
    2. Copy and paste a restaurant review to analyze
    3. Click Execute
  3. Publish the app after testing
    1. Click Publish App
  4. Run the app once or as a batch
    1. Click Run App


The difference between saving a draft and publishing an app

Publishing an app means:

  • Your app is also permanently as a version, so you can revert whenever you want
  • Your app is shareable!
  • You can run the app as a batch, API, or add it as an app step to another workflow or agent