Browse by Topic

Popular

Latest

Latest Posts

Illustration of sentence embeddings mapped as points in a vector space, with a query point and its nearest neighbors highlighted to represent semantic search.
Python

Python Sentence Transformers: Cosine Similarity and Semantic Search

Learn how to use Python sentence transformers and cosine similarity to build semantic search. Covers model loading, embeddings, similarity scoring, vector indexes, and practical trade-offs.

sentence-transformerscosine similaritysemantic searchembeddings
A diagram showing two sentences mapped to vectors in a high-dimensional space, with a cosine similarity angle between them.
Python

Python Sentence Transformers: Embeddings and Semantic Similarity

Learn how to generate sentence embeddings with Python's sentence-transformers library and compute semantic similarity with cosine similarity. The article also covers model selection, batching, and production considerations.

sentence-transformersembeddingssemantic-similaritynatural-language-processing
A diagram showing the Trainer class orchestrating a fine-tuning workflow with TrainingArguments controlling batch size, epochs, and evaluation.
Python

Fine-Tuning with Python Transformers Trainer and TrainingArguments

python transformers trainer trainingarguments and fine tuning: Learn how to fine-tune transformer models with the Python transformers Trainer and TrainingArguments, co...

Hugging FaceFine-tuningTrainer APITrainingArguments
Illustration of a GPU chip with multiple data streams flowing into a transformer model, representing batch inference
Python

Python Transformers GPU and Batch Inference

python transformers gpu and batch inference: Learn how to run Hugging Face Transformers models on GPU with batched inputs to improve throughput and reduce inference la...

transformersgpubatch inferencehuggingface
Illustration of a Python transformers model being saved to a local directory and reloaded, with weight files and configuration represented as labeled blocks.
Python

Save and Load Local Models with Python Transformers

Use save_pretrained and from_pretrained in Python to save and reload fine-tuned Hugging Face models from a local directory, including what gets written and common failure modes.

transformerssave_pretrainedfrom_pretrainedHugging Face
Diagram showing text input being tokenized and passed through a transformer model to produce embedding vectors.
Python

Python Transformers Embeddings and Feature Extraction

python transformers embeddings and feature extraction: Learn how to extract embeddings and feature vectors from text using Python Transformers, covering tokenization,...

embeddingsfeature extractiontransformersHugging Face
Illustration of Python Transformers handling text summarization, translation, and question answering tasks with distinct icons and a clean technical background.
Python

Python Transformers for Summarization, Translation, and QA

python transformers summarization translation and question answering: Learn to use Python Transformers for summarization, translation, and question answering with prac...

transformershuggingfacenlpsummarization
A diagram showing how padding tokens are added to shorter sequences and how the attention mask marks them as zero so the model ignores them.
Python

Python Transformers: Padding, Truncation, and Attention Masks

Understand how Hugging Face tokenizers use padding, truncation, and attention masks to shape batches for transformer models, with practical examples and common edge cases.

transformerstokenizerattention-maskspadding
Illustration of AutoTokenizer and AutoModel automatically selecting the correct model architecture from a checkpoint name.
Python

Using AutoTokenizer and AutoModel in Hugging Face Transformers

Learn how AutoTokenizer and AutoModel simplify loading pretrained models and tokenizers in the Hugging Face transformers library, including task-specific variants and tokenizer behavior.

Hugging FaceAutoTokenizerAutoModelPretrained Models
A diagram showing text flowing into a transformer pipeline node that splits into a sentiment classification branch and a text generation branch.
Python

Python Transformers Pipeline for Sentiment and Generation

python transformers pipeline text classification sentiment and generation: Use the Transformers pipeline API for sentiment analysis and text generation in Python: mode...

transformerspipeline APIsentiment analysistext generation