Glossario

Incorporazioni

Scopri cosa sono gli embeddings e come potenziano l'IA catturando le relazioni semantiche nei dati per l'NLP, le raccomandazioni e la computer vision.

Addestra i modelli YOLO semplicemente
con Ultralytics HUB

Per saperne di più

In the realm of machine learning (ML) and artificial intelligence (AI), embeddings are a fundamental technique for representing complex data—such as words, sentences, images, or other items—as dense numerical vectors in a multi-dimensional space. This transformation is learned from data, enabling algorithms to capture the semantic meaning, context, or essential characteristics of the input. The primary advantage is that items deemed similar based on the training data are mapped to nearby points in this "embedding space," allowing machines to understand complex relationships and patterns far more effectively than traditional sparse representations like one-hot encoding.

Cosa sono le incorporazioni?

Embeddings are learned, relatively low-dimensional vector representations of discrete variables (like words) or complex objects (like images or user profiles). Unlike methods such as one-hot encoding which create very high-dimensional, sparse vectors where each dimension corresponds to a single item and lacks inherent relationship information, embeddings are dense vectors (usually with tens to thousands of dimensions) where each dimension contributes to representing the item's characteristics. Crucially, the position of these vectors in the embedding space captures semantic relationships. For instance, in word embeddings, words with similar meanings or used in similar contexts, like "king" and "queen" or "walking" and "ran," will have vectors that are mathematically close (e.g., using Cosine Similarity). This proximity reflects semantic similarity learned from the data.

Come funzionano le incorporazioni

Embeddings are typically generated using neural network (NN) models trained on large datasets through techniques like self-supervised learning. For example, a common technique for word embeddings, exemplified by Word2Vec, involves training a model to predict a word based on its surrounding words (its context) within a massive text corpus. During this training process, the network adjusts its internal parameters, including the embedding vectors for each word, to minimize prediction errors via methods like backpropagation. The resulting vectors implicitly encode syntactic and semantic information. The number of dimensions in the embedding space is a critical hyperparameter, influencing the model's capacity to capture detail versus its computational cost and risk of overfitting. Visualizing these high-dimensional data spaces often requires dimensionality reduction techniques like t-SNE or PCA, which can be explored using tools like the TensorFlow Projector.

Applicazioni delle incorporazioni

Embeddings are crucial components in many modern AI systems across various domains:

  • Natural Language Processing (NLP): Embeddings represent words, sentences, or entire documents. Models like BERT and Transformer architectures heavily rely on embeddings to understand language nuances for tasks such as machine translation, sentiment analysis, question answering, and powering effective semantic search. Example: A customer support chatbot uses sentence embeddings to find the most relevant answer in its knowledge base even if the user's query doesn't use the exact keywords.
  • Recommendation Systems: Embeddings can represent users and items (like movies, products, or articles). By learning embeddings such that users and the items they like are close in the embedding space, systems can recommend new items similar to those a user has previously interacted with or liked by similar users (collaborative filtering). Companies like Netflix and Amazon utilize this extensively.
  • Computer Vision (CV): Images or image patches can be converted into embeddings that capture visual features. This is fundamental for tasks like image retrieval (finding visually similar images), image classification, and serves as a basis for more complex tasks like object detection and image segmentation performed by models like Ultralytics YOLO. Example: An e-commerce platform uses image embeddings to allow users to upload a photo of a clothing item and find similar products in their catalog. Platforms like Ultralytics HUB facilitate the training and deployment of such models.
  • Graph Analytics: Embeddings can represent nodes and edges in graphs, capturing network structure and node relationships for tasks like link prediction or community detection, often using Graph Neural Networks (GNNs).
Leggi tutto