---
title: "TF-IDF"
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/tfidf
markdown: https://docs.nodetool.ai/nodes/lib/nlp/tfidf.md
product: NodeTool
source: https://github.com/nodetool-ai/nodetool/blob/main/docs/nodes/lib/nlp/tfidf.md
---

# TF-IDF

**Type:** `lib.nlp.TfIdf`

**Namespace:** `lib.nlp`

## Description

Computes TF-IDF scores for terms across multiple documents.
    tf-idf, term frequency, document frequency, text analysis, NLP

    Use cases:
    - Rank document relevance for a search query
    - Identify important terms in a collection of documents
    - Build keyword extraction pipelines
    - Compare document similarity by term importance

## Properties

| Property | Type | Description | Default |
|----------|------|-------------|---------|
| documents | `list` | List of text strings to compute TF-IDF across | `[]` |
| query | `str` | Term to compute TF-IDF for | `` |

## Outputs

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

## Related Nodes

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