Jump to content

Token embedding (machine learning): Difference between revisions

From Wikibase
No edit summary
No edit summary
Line 1: Line 1:
[[Category:Token]]
[[Category:Token]]
[[File:Sub-word token embedding.png|thumbnail|350px|A visual representation of embedding of sub-word tokens in [[natural language processing (NLP)]].]]
[[File:Sub-word token embedding.png|thumbnail|350px|A visual representation of embedding of sub-word tokens in [[natural language processing (NLP)]].]]
[[File:Embedding space.png|thumbnail|350px|Each dimension of an '''embedding space''' encodes some semantic meaning. As such, words with similar meanings are spatially adjacent to each other.]]
Let $t_i \in T$ be [[token (machine learning)|token]]s obtained from [[tokenisation (machine learning)|tokenisation]] of raw data.
Let $t_i \in T$ be [[token (machine learning)|token]]s obtained from [[tokenisation (machine learning)|tokenisation]] of raw data.


Line 12: Line 13:
$$
$$


$\mathbb{E}$ is then known as the n-dimensional '''embedding space''' of $\operatorname{E}$.
$\mathbb{E}$ is then known as the n-dimensional '''embedding space''' of $\operatorname{E}$, which contains '''embedding vectors''' $\vec e_i$.


== Matrix representation ==
== Matrix representation ==

Revision as of 20:32, 10 November 2026

Languages: English · français · Esperanto

A visual representation of embedding of sub-word tokens in natural language processing (NLP). · Open in a new tab
Each dimension of an embedding space encodes some semantic meaning. As such, words with similar meanings are spatially adjacent to each other. · Open in a new tab

Let $t_i \in T$ be tokens obtained from tokenisation of raw data.

Let $\mathbb{E}\equiv \mathbb{R}^n$ be a vector space.

Then vector embedding function

$$\begin{gathered} \operatorname{E}: T \to \mathbb{E}\\ \forall t_i \in T: t_i \mapsto \vec{e}_i \end{gathered}$$

$\mathbb{E}$ is then known as the n-dimensional embedding space of $\operatorname{E}$, which contains embedding vectors $\vec e_i$.

Matrix representation

Let $\mathbf{E} \in \mathbb{R}^{|\mathcal{V}| \times n}$ be an vector embedding matrix.

$$ \vec{e}_i = \mathbf{E}[t_i]. $$