> ## Documentation Index
> Fetch the complete documentation index at: https://trailblazer.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Review Simulator: Predict Nigerian Restaurant Reviews

> Simulate how any Nigerian taste persona would review a restaurant — star rating, authentic Pidgin English text, and tone label, all in one call.

The Review Simulator takes a taste persona and a set of restaurant details, then predicts exactly how that persona would review the place. It returns a star rating from 1 to 5, a written review in authentic Nigerian Pidgin English, and a tone label that describes the style of the generated text. Whether you're exploring the web app or integrating via API, the simulator gives you a window into how a real Nigerian diner would react.

## How it works

The simulator models a reviewer's habits from their persona — their average rating, price sensitivity, preferred vocabulary, and past reviews. It weighs those traits against the restaurant's features (like ambience, food quality, and price point) to generate a rating and review that feels true to how that person actually eats and talks. The output is not a generic summary; it reflects the persona's voice, from measured critique to full Pidgin energy.

## How to use it in the app

<Steps>
  <Step title="Go to the simulator">
    Navigate to [/simulator](https://naijataste.onrender.com/simulator) on the NaijaTaste web app.
  </Step>

  <Step title="Set your persona">
    Choose one of the three preset personas or, if you are signed in, your profile persona is pre-filled from your review history. You can also adjust individual persona fields manually.
  </Step>

  <Step title="Enter restaurant details">
    Type the restaurant name, its city, and select the features that describe it — for example, "expensive", "nice ambience", or "fast service".
  </Step>

  <Step title="Click Generate">
    Hit **Generate Review**. The simulator returns a star rating, the review text in Pidgin English, and a tone label within a few seconds.
  </Step>
</Steps>

<Tip>
  Signed-in users get persona traits calculated automatically from their review history — you don't need to fill anything in manually.
</Tip>

## Understanding the output

The response contains three fields:

* **`rating`** — A whole number from 1 to 5 reflecting how the persona would rate the restaurant. This is shaped by their `rating_tendency` (harsh, balanced, or generous) and how the restaurant features match their priorities.
* **`review_text`** — The written review in Nigerian Pidgin English. The language, vocabulary, and complaints or praise mirror the persona's `tone_keywords` and `sample_reviews`.
* **`tone_label`** — A single label describing the overall tone of the generated text.

### Tone labels

| Label          | Description                                                                                                                                                      |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pidgin-heavy` | The review is written almost entirely in Nigerian Pidgin English with minimal standard English. Expect strong vernacular, local idioms, and expressive phrasing. |
| `mixed`        | The review blends Pidgin and standard English. Common for personas who are expressive but not exclusively Pidgin speakers.                                       |
| `formal`       | The review reads in clear, structured English with little or no Pidgin. Typical for personas with a formal writing style in their sample reviews.                |
| `casual`       | Relaxed, conversational English without heavy Pidgin. The persona writes informally but not in full vernacular.                                                  |

## API usage

Send a `POST` request to `https://naijataste-api-vcp4.onrender.com/simulate-review` with a `persona` object and the restaurant details.

<CodeGroup>
  ```json Request theme={null}
  {
    "persona": {
      "user_id": "demo_user",
      "avg_rating": 3.2,
      "rating_tendency": "harsh",
      "price_sensitivity": "high",
      "tone_keywords": ["jollof", "service", "price", "portion"],
      "total_reviews": 45,
      "sample_reviews": [
        "The food was okay but too expensive for the portion size"
      ]
    },
    "item_name": "Yellow Chilli Victoria Island",
    "item_type": "restaurant",
    "location": "Lagos",
    "features": ["expensive", "nice ambience", "average food", "fast service"]
  }
  ```

  ```json Response theme={null}
  {
    "rating": 2,
    "review_text": "The ambience correct sha, but for this price? Abeg. Food no reach expectation at all. My wallet dey cry.",
    "tone_label": "pidgin-heavy"
  }
  ```
</CodeGroup>
