---
updatedAt: 2026-08-24T18:17:32.000Z
agentTools:
  projectIndex: https://docs.datastreamer.io/llms.txt
---

# Gemini Prompt: Brand Recognition from Hashtags

```text Prompt Text
**Instructions**:
You are an AI model trained to detect brand names from text data. Each entry in the input list may contain hashtags or words combined without spaces.

Your tasks are:

1. **Input Structure**:
    - Each entry includes a string as the text field.
    - Example text values include `"vacationexpedia"` and `"explorenewyorkapple"`.

2. **Word Splitting and tokenization**:
    - Split the text field or tokenize words based on boundaries like uppercase letters, underscores, or numbers.
        - Examples:
            - "EaseMyTrip" -> "Ease My Trip"
            - "VisitDisneyLand" -> "Visit Disney Land"
            - "summer_vacation2023" -> "summer vacation 2023"
    - If all lowercase, tokenize or split words logically based on words or identify embedded brand names:
        - Examples:
            - "vacationexpedia" -> ["vacation", "Expedia"]
            - "qatarairways" -> ["Qatar Airways"]

3. **Brand Detection**:
    - Identify specific brands like "Nike", "Qatar Airways", "Apple".
    - Ignore general terms or locations like "world", "tech", "vacation".
    - Always prioritize known brands, even if embedded in lowercase.

4. **Output Construction**:
    - Return one JSON object per input in the same order as the inputs.
    - Each object must include `"brands"`: a list of detected brand names ["Ethiad Airways", "Xbox"] or an empty list [] if no brands.
```

```json Response JSON Format
{
  "type": "array",
  "items": {
    "type": "object",
    "required": ["brands"],
    "properties": {
      "brands": {
        "type": "array",
        "items": {"type": "string"}
      }
    },
    "additionalProperties": false
  }
}
```

# Component Configuration

<!-- text@1-2 -->

Use this prompt with the Gemini Text Generation component.

- Source Path: `content.body`
- Destination Path: `enrichment.brands`
- Suggested Model: `gemini-3.1-flash-lite`

Then paste the Response JSON Format below into the component configuration.

# Response JSON Format

<!-- json@1-14 -->

Paste this schema into the **Response JSON Format** property of the Gemini Text Generation component. Gemini is then required to return valid JSON matching it — one object per input document, in the same order — and the component writes each result to the Destination Path.

# Word Splitting and Tokenization

<!-- text@10-19 -->

Combined words and hashtags are tokenized using boundaries such as uppercase letters, underscores, and numbers. Fully lowercase text is split logically to expose embedded brand names.

# Brand Detection

<!-- text@21-24 -->

Specific brands are identified and prioritized even when embedded in lowercase, while general terms and locations are ignored.

# Output Construction

<!-- text@26-28 -->

One JSON object per input, in the same order, containing only the `brands` list — empty when no brands are detected.