• Home
  • LLMs
  • Docker
  • Kubernetes
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • Archived
LLMs | Text Classification
  1. Text Classification
  2. Task-specific model (sentiment analysis)
  3. Text classification with generative models (OpenAI GPT)

  1. Text Classification
    The goal of the text classification tasks is to assign labels or classes to text.

    Applications of text classification:
    • Sentiment analysis.
    • Entities extraction.
    • ...

    Text classification can be used with:
    • Representation models: task-sepecific models and embedding models
    • Generative models

    There are two types of representation models for text classification:
    • Task-specific models: they are trained for specific tasks (sentiment analysis, ...).
    • Embedding models: they generate embeddings that can be used for text classification tasks.

    These models are created by fine-tuning a base representation models (like BERT).
  2. Task-specific model (sentiment analysis)
    Python code:

    Run the Python script:

    Output:
  3. Text classification with generative models (OpenAI GPT)
    Python code:

    Run the Python script:

    Output:
© 2025  mtitek