For NLP specifically, the pain is usually that your data is text — long strings that get truncated, label distributions you want to eyeball, token/length stats — and default pandas output fights you on all of that. Here are the options that actually help, roughly in order of effort:
The single biggest upgrade for "inspect freely" is an interactive table you can sort, filter, and search directly in the notebook. Good options:
- itables — turns any DataFrame into a searchable, sortable interactive table with one import. Great for text because you can search for a keyword and instantly see matching rows.
- PyGWalker — a Tableau-like drag-and-drop UI embedded in the notebook. You drag fields onto axes and it builds charts. Excellent for exploring label distributions, text-length histograms, class balance, etc. without writing plot code each time.
- Quak or buckaroo — newer interactive-grid tools, lighter than PyGWalker.
NLP-specific visualization
Beyond generic tables, these are built for text:
- scattertext — visualizes which words characterize different classes (very useful for classification tasks, ties right back to the Naive Bayes work you were doing — you can literally see which terms separate your categories).
- wordcloud or token-frequency bar charts per class — quick sanity checks on vocabulary.
- spaCy's displacy — if you care about entities, dependencies, or annotations.
Some people move NLP data exploration into a small Streamlit or Gradio app — a few lines gives you a browser page with a text box to search examples, dropdowns to filter by label, and live-updating stats. It's more setup, but you get a genuinely free-form "inspect anything" surface you can keep reusing across the project.
NLP clássico / tradicional
- spaCy — a mais usada para pipelines de produção: tokenização, POS-tagging, NER, dependências. Rápida e com uma API limpa. Boa para o trabalho de features que discutíamos antes (extrair tokens, entidades, etc.).
- NLTK — a mais antiga e didática. Excelente para aprender e para tarefas linguísticas (stemming, tokenização, corpora prontos), menos usada em produção.
- scikit-learn — não é específica de NLP, mas é o cavalo de batalha para classificação de texto tradicional. É aqui que vive o teu Naive Bayes, o TF-IDF (
TfidfVectorizer), SVMs, etc. - Gensim — especializada em modelos de tópicos (LDA) e embeddings clássicos (Word2Vec, Doc2Vec). Útil para similaridade e análise de grandes corpora.
- regex / spaCy Matcher — para regras e padrões, muitas vezes subestimadas mas essenciais.
Trabalho com LLMs
- Hugging Face Transformers — a biblioteca central de todo o ecossistema moderno. Dá-te acesso a milhares de modelos pré-treinados (BERT, GPT, T5, Llama, etc.) para inferência e fine-tuning. É a ponte entre o NLP clássico e os LLMs.
- Datasets e Tokenizers (também da Hugging Face) — para carregar/processar dados em escala e tokenização rápida.
- PyTorch (e menos TensorFlow/JAX) — o framework de deep learning por baixo de quase tudo. Precisas dele para treino/fine-tuning sério.
- PEFT / LoRA e bitsandbytes — para fine-tuning eficiente de modelos grandes sem precisar de hardware enorme (quantização, adaptadores).
- LangChain e LlamaIndex — para construir aplicações sobre LLMs: encadear prompts, RAG (retrieval-augmented generation), agentes, ligação a bases de dados vetoriais. LlamaIndex é mais focada em RAG/indexação; LangChain é mais generalista.
- vLLM e Ollama — para servir e correr modelos com eficiência (vLLM para throughput alto em servidor; Ollama para correr modelos localmente com facilidade).
- Bases de dados vetoriais — FAISS, Chroma, Qdrant, Pinecone — necessárias para RAG (guardar e pesquisar embeddings).
Se tivesse de resumir o caminho típico: começas em scikit-learn + spaCy para baselines (o teu Naive Bayes), e à medida que precisas de mais poder passas para Hugging Face Transformers sobre PyTorch, e depois LangChain/LlamaIndex + vLLM quando queres construir uma aplicação real com LLMs.
Como este ecossistema (sobretudo o de LLMs) evolui muito depressa, se quiseres posso pesquisar o que há de mais recente ou mais popular neste momento — surgem ferramentas novas com frequência. Queres que aprofunde alguma fase em concreto para o teu projeto?