---
title: "Classify Text"
description: "Local-first visual environment for building and running AI workflows. Build agents visually, deploy anywhere, privacy by design."
canonical: https://docs.nodetool.ai/nodes/lib/nlp/classifytext
markdown: https://docs.nodetool.ai/nodes/lib/nlp/classifytext.md
product: NodeTool
source: https://github.com/nodetool-ai/nodetool/blob/main/docs/nodes/lib/nlp/classifytext.md
---

# Classify Text

**Type:** `lib.nlp.ClassifyText`

**Namespace:** `lib.nlp`

## Description

Trains a Naive Bayes classifier and classifies text.
    classify, categorize, naive bayes, machine learning, NLP

    Use cases:
    - Categorize text into predefined labels
    - Build simple spam detection
    - Classify customer support tickets
    - Sort documents by topic

## Properties

| Property | Type | Description | Default |
|----------|------|-------------|---------|
| text | `str` | Text to classify | `` |
| training_data | `list` | Array of {text, label} objects for training the classifier | `[]` |

## Outputs

| Output | Type | Description |
|--------|------|-------------|
| output | `str` |  |
| classifications | `list` |  |

## Related Nodes

Browse other nodes in the [lib.nlp](./) namespace.
