Practical Intro to NLP 23: Evolution of word vectors Part 2 - Embeddings and Sentence Transformers

Practical AI by Ramsri
16 May 202417:21

Summary

TLDRThis script discusses the evolution of word and sentence vector algorithms in natural language processing (NLP). It highlights the transition from TF-IDF for document comparisons to dense vector representations like Word2Vec, which addressed the limitations of sparse vectors. The script also covers the introduction of algorithms like Sense2Vec for word sense disambiguation and contextual embeddings like ELMo. It emphasizes the significance of sentence transformers, which provide context-aware embeddings and are currently state-of-the-art for NLP tasks. The practical guide suggests using TF-IDF for high-level document comparisons and sentence transformers for achieving state-of-the-art accuracies in NLP projects.

Takeaways

  • 📊 Understanding the evolution of word and sentence vector algorithms is crucial for natural language processing (NLP).
  • 🔍 The pros and cons of each vector algorithm should be well understood for practical application in NLP tasks.
  • 📚 A baseline understanding of algorithms from TF-IDF to sentence Transformers is sufficient for many practical applications.
  • 🌟 Word2Vec introduced dense embeddings, allowing for real-world operations like analogies to be performed in vector space.
  • 🕵️‍♂️ Word2Vec's limitation is its inability to differentiate between different senses of a word, such as 'mouse' in computing vs. a rodent.
  • 📈 Sense2Vec improves upon Word2Vec by appending parts of speech or named entity recognition tags to words, aiding in disambiguation.
  • 📉 FastText addresses out-of-vocabulary words by dividing words into subtokens, but still has limitations in word sense disambiguation.
  • 🌐 Contextual embeddings like ELMo and BERT capture the context of words better than previous algorithms, improving word sense disambiguation.
  • 📝 Sentence embeddings, such as those from sentence Transformers, provide a more nuanced representation by considering word importance and context.
  • 🏆 State-of-the-art sentence Transformers can handle varying input lengths and generate high-quality vectors for words, phrases, sentences, and documents.
  • 🛠️ For lightweight tasks, TF-IDF or Word2Vec might suffice, but for state-of-the-art accuracy, sentence Transformers are recommended.

Q & A

  • What is the primary purpose of understanding the evolution of word and sentence vectors?

    -The primary purpose is to grasp the strengths and weaknesses of various word and sentence vector algorithms, enabling their appropriate application in natural language processing tasks.

  • How does the Word2Vec algorithm address the problem of sparse embeddings?

    -Word2Vec provides dense embeddings by training a neural network to predict surrounding words for a given word, which results in similar words having closer vector representations.

  • What is a limitation of Word2Vec when it comes to differentiating word senses?

    -Word2Vec struggles to differentiate between different senses of a word, such as 'mouse' referring to a computer mouse or a house mouse.

  • How does the Sense2Vec algorithm improve upon Word2Vec?

    -Sense2Vec appends parts of speech or named entity recognition tags to words during training, allowing it to differentiate between different senses of a word.

  • What is the main issue with using averaged word vectors for sentence embeddings?

    -Averaging word vectors does not capture the importance or context of individual words within the sentence, resulting in a loss of nuance.

  • How do contextual embeddings like ELMo address the shortcomings of Word2Vec and Sense2Vec?

    -Contextual embeddings like ELMo provide word vectors that are sensitive to the context in which they appear, thus improving word sense disambiguation.

  • What is the role of sentence transformers in generating sentence vectors?

    -Sentence transformers generate sentence vectors by considering the context and relationships among words, resulting in vectors that better represent the meaning of sentences.

  • How do algorithms like Skip-Thought Vectors and Universal Sentence Encoder improve upon traditional word vectors?

    -These algorithms focus on generating sentence or document vectors directly, aiming to capture the overall meaning rather than averaging individual word vectors.

  • What is the significance of using sentence transformers for state-of-the-art NLP projects?

    -Sentence transformers are currently the state of the art for generating high-quality sentence vectors, which are crucial for achieving high accuracy in NLP tasks.

  • How can dense embeddings from algorithms like sentence transformers be utilized for document comparison?

    -Dense embeddings can be used to convert documents into vectors, allowing for efficient comparison and retrieval of similar documents in vector databases.

Outlines

00:00

📚 Evolution of Word and Sentence Vectors

This paragraph discusses the evolution of word and sentence vector representations in natural language processing (NLP). It emphasizes the importance of understanding the strengths and weaknesses of various vector algorithms. The paragraph begins with an introduction to the concept of word embeddings and how they have progressed from simple vector representations to more complex, dense embeddings. It highlights the limitations of early algorithms like TF-IDF and word2vec, which struggled with word sense disambiguation and did not account for word importance within a sentence. The paragraph also introduces the concept of dense embeddings and how they allow for more nuanced operations within vector space, such as analogical reasoning. It concludes by discussing the evolution to algorithms like GloVe, which improved upon word2vec by incorporating part-of-speech tags and named entity recognition to better disambiguate word senses.

05:01

🧠 Contextual Embeddings and Sentence Vectors

The second paragraph delves into the concept of contextual embeddings, which aim to solve the issue of word sense disambiguation by considering the context in which a word is used. Algorithms like ELMo and BERT are introduced as they provide contextual embeddings that can differentiate between the same word used in different contexts. The paragraph also discusses the shift from word-level embeddings to sentence-level embeddings, which better capture the meaning of a sentence as a whole. It mentions algorithms like Skip-Thought Vectors, InferSent, and the Universal Sentence Encoder, which focus on generating sentence embeddings that are more representative of the sentence's meaning. The paragraph concludes by discussing the current state of the art in sentence embeddings, which are based on Transformer models. These models, like Sentence-BERT, are capable of generating high-quality sentence vectors that can be used for a variety of NLP tasks, including document classification and similarity comparison.

10:02

💡 Practical Applications of Sentence Vectors

This paragraph focuses on the practical applications of sentence vectors in NLP tasks. It explains how sentence vectors, unlike word vectors, are generated dynamically based on the context of the words within a sentence. The paragraph highlights the importance of considering word importance and context when generating sentence vectors, which allows for more accurate comparisons and classifications. It also discusses the efficiency of sentence vectors, which can be used to compare large volumes of text by converting documents into fixed-dimensional vectors. The paragraph provides a practical guide for choosing the right vector algorithm based on the complexity and accuracy requirements of a given task. It suggests using TF-IDF for lightweight tasks and sentence Transformers for state-of-the-art accuracy. The paragraph concludes by emphasizing the power of dense embeddings in enabling fast and efficient comparisons across large datasets.

15:03

🔍 The Future of Vector Representations in NLP

The final paragraph of the script looks towards the future of vector representations in NLP, specifically focusing on the capabilities of sentence Transformers. It discusses the versatility of these models, which can handle not just sentences but also single words, phrases, and documents, generating a single vector representation for each. The paragraph emphasizes the state-of-the-art nature of these models and their use in cutting-edge NLP projects. It also touches on the broader applications of vector representations, noting that not only text but also images can be converted into vectors for comparison and analysis. The paragraph concludes with a summary of the key points discussed in the script, reinforcing the importance of understanding the evolution and capabilities of word and sentence vectors for practical NLP applications.

Mindmap

Keywords

💡TF-IDF

TF-IDF, or Term Frequency-Inverse Document Frequency, is a numerical statistic that is intended to reflect how important a word is to a document in a collection or corpus. In the video, TF-IDF is described as a method for high-level document comparisons and classifications, but it has limitations such as the lack of word sense disambiguation and the sparsity of its vectors. It is positioned as an initial approach to understanding word importance in documents.

💡Word2Vec

Word2Vec is a group of related models that are used to produce word embeddings. These models are shallow, two-layer neural networks that are trained to reconstruct linguistic contexts of words. In the script, Word2Vec is mentioned as a significant evolution from TF-IDF, providing dense embeddings that allow for operations like analogies in vector space, such as 'king - man + woman = queen'.

💡Word Sense Disambiguation

Word Sense Disambiguation (WSD) is the process of identifying which sense (meaning) of a word is used in a particular context. The video discusses the limitations of Word2Vec in this regard, as it cannot differentiate between different senses of a word, such as 'mouse' referring to a computer device or a small rodent.

💡FastText

FastText is an extension of the Word2Vec model that allows for the understanding of rare words and phrases by treating them as compositions of their subword parts. It is mentioned in the script as a solution to the out-of-vocabulary words problem, where traditional Word2Vec might struggle.

💡Sense2Vec

Sense2Vec is an improvement over Word2Vec that attempts to address the issue of word sense disambiguation by incorporating context. In the video, it is explained as appending each word with its corresponding parts of speech or named entity recognition tags to train word vectors that can distinguish between different uses of the same word.

💡Contextual Embeddings

Contextual Embeddings are word vectors that are derived from the context in which words appear. The video discusses how algorithms like ELMo and BERT provide contextual embeddings, which are a significant step up from static word vectors like those produced by Word2Vec and FastText, as they can capture the varying meanings of words based on their surrounding text.

💡ELMo

ELMo, which stands for Embeddings from Language Models, is a deep contextualized word representation that captures the semantic meaning of words by considering the entire sentence. The video positions ELMo as a precursor to more advanced contextual embeddings, addressing the word sense disambiguation problem more effectively than Sense2Vec.

💡Sentence Embeddings

Sentence Embeddings are vector representations of sentences that capture the semantic meaning of the entire sentence. The video explains how sentence embeddings, unlike simple averages of word vectors, can weigh the importance of words within a sentence, providing a more accurate representation for tasks like similarity comparison.

💡Universal Sentence Encoder

The Universal Sentence Encoder is a model that provides a generic embedding for text, designed to work well for a wide range of tasks. It is mentioned in the script as an algorithm that deals directly with sentence-level embeddings, aiming to capture the full context of a sentence rather than relying on individual word vectors.

💡Sentence Transformers

Sentence Transformers are models that use Transformer architecture to generate sentence embeddings. They are highlighted in the video as the state-of-the-art approach for generating high-quality sentence embeddings that can capture complex relationships within sentences and are used in cutting-edge NLP projects.

Highlights

Understanding the evolution of word and sentence vectors is crucial for natural language processing (NLP).

TF-IDF is an early method for document comparison but lacks word sense disambiguation.

Word2Vec introduced dense embeddings to group similar words closer in vector space.

Word2Vec's ability to perform vector arithmetic like 'king - man + woman = queen'.

Word2Vec's limitation in differentiating between different senses of a word.

Sentence embeddings in Word2Vec are created by averaging word vectors, lacking emphasis on key terms.

Sense2Vec improves upon Word2Vec by incorporating parts of speech to differentiate word senses.

FastText addresses out-of-vocabulary words by dividing words into subtokens.

ElMo provides contextual embeddings, improving over Sense2Vec in word sense disambiguation.

Skip-thought vectors and InferSent focus on sentence-level embeddings for better context capture.

Universal Sentence Encoder and other algorithms use RNNs to generate sentence embeddings.

Sentence Transformers are state-of-the-art, using Transformer models for high-quality sentence embeddings.

Sentence Transformers can handle single words, phrases, sentences, or documents for vector generation.

Practical guide: Use TF-IDF for lightweight document comparisons and Word2Vec for dense vector needs.

For state-of-the-art accuracies in NLP, utilize Sentence Transformers.

Dense embeddings allow for efficient document comparison in vector databases.

Sentence Transformers dynamically generate vectors based on context, unlike static lookup tables.

Transcripts

play00:01

so at the end of the day you need to

play00:04

understand how the word and sentence

play00:06

vectors have evolved or time how the

play00:09

algorithms have evolved Etc and all you

play00:12

need to have most of the time is to have

play00:14

a strong understanding of the pros and

play00:17

cons of each of the word or sentence

play00:20

Vector algorithm and use them

play00:23

accordingly and on any day when you need

play00:25

to know more you can go and delve deeper

play00:28

into a particular gorithm to make any

play00:31

changes Etc but from a practical applied

play00:35

NLP standpoint if you just have a good

play00:39

Baseline understanding of tfidf word to

play00:42

work and all the variants up to sentence

play00:46

Transformers that's good enough so let's

play00:49

just see how word or sentence vectors

play00:51

have evolved over time so in the first

play00:54

category we have

play00:56

tfidf which falls into the category of

play00:59

Spar and embeding and we know that V

play01:04

attempted to solve this parse embedding

play01:07

Problem by providing a dense embedding

play01:10

because of uh its training strategy that

play01:14

involved training a neural network

play01:16

algorithm with corresponding surrounding

play01:19

words around a given word with that we

play01:22

were able to put together similar words

play01:25

in a closer embedding space so the

play01:28

vectors for similar words birds are

play01:31

closed together and because of the power

play01:33

of dense embedding as well as vectors

play01:36

being closed together whatever real

play01:39

world operations that we can think of we

play01:42

are able to kind of emulate them in the

play01:45

world Vector space as well which is King

play01:48

minus man plus woman equal to queen as

play01:52

well as any noun comparisons for example

play01:56

plural of mouse is mice Sim Illy

play02:01

elephant is elephants Etc so you can do

play02:04

comparisons like mice minus Mouse plus

play02:09

elephant is equal to elephants Etc and

play02:13

we have seen the problem with what to W

play02:16

which is it cannot differentiate between

play02:19

different senses of a word for example

play02:21

between computer mouse and the house

play02:23

mouse and also we have seen that when it

play02:25

comes to sentence

play02:27

embedding we are just averaging our the

play02:30

individual word vectors so there is no

play02:33

weightage or important given to certain

play02:36

keywords Etc and the next Evolution from

play02:39

word to W is actually sense to W so

play02:42

during training what we can do is we can

play02:46

append each word with its

play02:49

corresponding POS parts of speech or any

play02:52

or named entity recognition tag what I

play02:55

mean by that is let's say you have a

play02:57

word like Bank

play02:59

Bank could be a

play03:02

verb Bank could be a noun Financial Bank

play03:07

whereas verb could be like depend on

play03:09

somebody banking on somebody Etc so in

play03:12

such cases all you can do is in the

play03:14

context where bank is verb you can

play03:17

replace Bank by bankor V and in the

play03:20

context where bank is noun you can

play03:22

replace Bank uncore n and you can train

play03:26

a word Vector algorithm parts of speech

play03:29

appended entities so that when during

play03:32

query time when you give bankor n

play03:37

instead of getting Depend and other

play03:39

things as the near word vectors you'll

play03:43

mostly get financial bank related word

play03:46

vectors like loan Etc that's what you

play03:49

can do so sense to is actually an

play03:52

improvement over V to where you can

play03:56

actually append the sense of a given

play03:58

word even

play04:00

and also you have seen that to counter

play04:03

out of vocabulary words we have fast

play04:06

text which can divide a given word into

play04:08

its sub tokens again sense to is limited

play04:11

because when you take the case of mouse

play04:15

mouse is a noun both in both computer

play04:18

mouse as well as the house mouse so you

play04:21

cannot really differentiate with the

play04:24

parts of speech

play04:25

tag the other thing that you can do is

play04:28

give a named and idti recognition n tag

play04:32

as well appended to it but like I

play04:34

mentioned still it has some shortcomings

play04:37

so over TF IDF we have word to work and

play04:42

over word to we have sense to work but

play04:45

still we do have some issues which is

play04:48

which are one we are unable to fully

play04:52

resolve the context of a given word so

play04:55

we are unable to do word sense

play04:58

disambiguation so we still need

play05:00

contextual

play05:02

embeddings secondly we don't really have

play05:06

word importance captured because we are

play05:09

still doing look up for a given word and

play05:13

getting its word embedding and when

play05:15

you're getting sentence Vector you are

play05:18

just plainly averaging the word vectors

play05:20

whereas we want to also calculate the

play05:24

importance of a given word so we want to

play05:26

change the weights or we want a single

play05:29

word word to have more context and its

play05:33

embedding should come from Context

play05:35

across the words that are surrounding it

play05:39

and Elmo and B fall into this category

play05:42

of contextual embeddings so essentially

play05:45

if you give a sentence for example I'm

play05:48

going to the bank to deposit some money

play05:51

in that case automatically the word bank

play05:55

will have a different word

play05:57

embedding when compared to to another

play06:00

sense where I'm going to the river bank

play06:03

in both the sentences bank is a noun but

play06:07

since the context is different you'll

play06:11

have contextual embeddings because of

play06:13

algorithms like Elmo and B etc for

play06:16

Simplicity you can think of Elmo as the

play06:20

first contextual embedding that came out

play06:23

which tried to solve this word sense

play06:25

disambiguation problem that you had with

play06:27

mouse Bank Etc and then came algorithms

play06:33

that specifically focused on sentence to

play06:37

W approaches we just realized with wck

play06:40

that although we are able to get the

play06:42

perfect embedding for a given word just

play06:45

averaging the word vectors of words in a

play06:49

given sentence and getting a sentence

play06:52

Vector doesn't really suffice because

play06:56

plain averaging doesn't capture the

play06:59

complete picture of a sentence whereas

play07:01

we should be able to do some smart

play07:04

averaging across the word vectors of

play07:07

individual words in a sentence so in

play07:09

order to solve that several algorithms

play07:12

like skip thought vectors inferent and

play07:15

Universal sentence encoder came into

play07:18

existence which is instead of dealing on

play07:21

a word level they directly deal on a

play07:23

sentence level to give a unique Vector

play07:26

for the whole sentence such that similar

play07:29

sentences are closer together and these

play07:33

algorithms skip thought vectors inferent

play07:35

Universal sentence encoder they most of

play07:38

them used RNN recurrent neural networks

play07:41

like lstms and grus in order to generate

play07:44

these sentence embeddings of course

play07:46

Universal sentence encoder Had A

play07:49

variation which used Transformers which

play07:52

is the advanced

play07:54

algorithms that captures relationships

play07:57

among different words

play08:00

in order to get an embedding for a given

play08:02

word and moving further on current state

play08:05

of the art is actually sentence

play08:07

Transformers so these are Transformer

play08:09

based algorithms that are trained on top

play08:12

of bird Etc to encode sentences

play08:17

specifically to keep similar sentences

play08:20

closer together in the vector space and

play08:22

dissimilar sentences farther together in

play08:25

the vector space so they are fine tuned

play08:28

on top of

play08:30

bir like algorithms to produce high

play08:32

quality sentence embeddings and one

play08:35

thing to remember is that not only words

play08:38

or sentences or paragraphs are converted

play08:42

into Vector even images could be

play08:45

converted into vectors so there are

play08:47

models like clip and uh several Vision

play08:52

algorithms that can convert a given

play08:54

image into a single Vector of fixed

play08:58

Dimensions so that you can compare

play08:59

compare images among each other Etc so

play09:02

if you come to sentence Vector sentence

play09:04

Vector improves on top of the word

play09:09

Vector so you can see that the biggest

play09:12

shortcoming of word to V was there was

play09:14

no Word Sense disambiguation secondly

play09:17

the average Vector was pretty simple

play09:20

just averaging across all the words so

play09:24

sentence Vector essentially solves that

play09:26

problem where although it it is termed

play09:29

as sentence Vector you can just give an

play09:31

individual word or just a word phrase

play09:34

even and get Vector out of it for

play09:37

example you can just give a single word

play09:39

like Batman and get a vector or you can

play09:42

give multi-word like Donald Trump or Joe

play09:46

Biden Etc and also get a vector or you

play09:50

can give a sentence and a whole

play09:51

paragraph and get a vector so at the end

play09:54

of the day again just like ver

play09:59

sentence vectors that is sentence

play10:02

Transformers can convert a single word

play10:05

or just a phrase into a vector directly

play10:08

of 768 dimensions and again a sentence

play10:11

could be converted into a single Vector

play10:13

of 768 Dimensions the only difference is

play10:17

that in word Vector algorithms we just

play10:20

averaged out all the individual word

play10:23

vectors in a given sentence whereas when

play10:26

it comes to sentence vectors

play10:29

what happens is that for example a given

play10:32

word like

play10:33

directed directed does not independently

play10:37

have a vector of its own rather the

play10:40

directed

play10:42

Vector comes from a combination of all

play10:45

the surrounding words to the left and

play10:47

right of this so you can so you can kind

play10:50

of imagine that whatever we wanted to do

play10:53

which is smart weighted averaging of

play10:57

word vectors in V algorithm we kind of

play11:02

do that in sentence Transformer

play11:05

inherently where each individual Vector

play11:08

that we get is actually a smart weighted

play11:11

combination of other vectors and at the

play11:14

end we also combine average out all the

play11:18

vectors that we have in order to get the

play11:21

single smart Vector but remember that in

play11:24

V we have kind of a lookup table

play11:26

scenario where individual word and its

play11:28

Vector is obtained whereas in this case

play11:32

this individual Vector is not

play11:34

pre-calculated and kept in a lookup

play11:36

table but rather generated dynamically

play11:39

depending on the sentence so that Vector

play11:42

is very efficient and it captures all

play11:46

these complexities like Word Sense

play11:48

disambiguation like Mouse in both cases

play11:52

as well as the relationship of that word

play11:56

with respect to the corresponding words

play11:59

that are to the left and right so you

play12:01

can assume that unlike word vectors this

play12:05

is a smart Vector that is of 768

play12:07

Dimensions similarly for paragraph also

play12:10

it's the same we essentially have a max

play12:13

length usually one24 tokens or or tokens

play12:17

converted to some word count like 52 Etc

play12:21

so sentence vectors Etc can take let's

play12:24

say a paragraph of Maximum 500 Words Etc

play12:28

and it can generate a smart Vector even

play12:31

so at the end of the day a word is

play12:33

represented by a single Vector a noun

play12:35

phrase or verb phrase that is multi-word

play12:38

is also represented by a single Vector a

play12:41

sentence is represented by a single

play12:43

Vector a whole paragraph or document is

play12:46

also represented by a single Vector so

play12:49

now you can do easy comparisons among

play12:52

each other so just to recap everything

play12:55

that we have learned we have TF Ida for

play12:58

high high level document comparisons and

play13:01

classifications as well but it has quite

play13:04

a few shortcomings one is there is no

play13:08

word similarity that is embedded second

play13:11

is the vectors are very SP very sparse

play13:14

most of them are zeros so we moved from

play13:18

that to dense vectors that is instead of

play13:22

having 50,000 length we have now 360

play13:25

Dimensions or 768 Dimensions length

play13:28

vector so V was one such algorithm in

play13:33

order to tackle

play13:35

subwords we have fast text and in order

play13:39

to have Word Sense disambiguation we

play13:41

introduced sense Toc and beyond that we

play13:44

have Elmo which actually gives

play13:47

contextual embeddings and performs

play13:50

better than sens to so I just kept all

play13:53

of these algorithms from ver to Elmo in

play13:56

this dense word vectors because each of

play13:59

them improves or the other by solving

play14:03

some of the shortcomings of the before

play14:05

one now we realize that just getting

play14:08

vectors for word isn't sufficient we

play14:11

need to do better that is smart

play14:13

averaging to get a sentence Vector

play14:17

because a sentence Vector is not just

play14:19

plain averaging of individual word

play14:21

Vector we need to have some kind of

play14:24

weight or importance Factor also

play14:26

captured in the sentence Vector when we

play14:27

are getting the combined things

play14:30

so these algorithms like skip thought

play14:33

vectors inferent Universal sentence

play14:35

encod or USC improved on word vectors

play14:39

and tried to get us sentence vectors or

play14:42

document vectors straight away that are

play14:45

of higher quality that we can use for

play14:47

comparisons but still they had some

play14:50

shortcomings in the sense that the

play14:53

vectors are not of high

play14:55

quality and then came sentence

play14:58

Transformer

play15:00

which is on based on Transformer based

play15:03

algorithms for sentence vectors although

play15:05

it is called as sentence Vector it can

play15:07

take a single word or a multi-word

play15:10

phrase or a sentence or a document and

play15:14

generate Vector single Vector of let's

play15:16

say 768

play15:18

dimensions and this is currently the

play15:20

state of the art the sentence

play15:22

Transformers and its variants and they

play15:25

are the ones that are used in Cutting

play15:27

Edge State ofthe art projects NLP

play15:30

projects so the Practical guide is that

play15:34

if you're doing lightweight

play15:35

classification or high level comparisons

play15:38

you can use tfidf vectors if you have

play15:41

lot of Corpus if you don't have the

play15:44

Corpus and you want to do again

play15:47

lightweight classification and

play15:49

comparisons with dense vectors you can

play15:52

go for water because you don't need to

play15:55

have any Corpus or pre-train anything so

play15:58

averaged word vector and doing

play16:00

classifications or comparisons is a good

play16:03

Baseline but if you really want to hit

play16:06

it out and get state of the art

play16:07

accuracies you can use sentence

play16:10

Transformers and the power with dense

play16:13

embeddings is that even if you have 1

play16:16

million or 10 million documents you can

play16:18

just convert each of the document into a

play16:21

single Vector using sentence

play16:23

Transformers and you can place all those

play16:25

1 million or 10 million documents in a

play16:29

Vector database that is specifically

play16:31

designed for comparing vectors among

play16:35

each other now let's say you have a new

play16:37

movie plot or new document you can

play16:39

convert that into a vector and do very

play16:43

fast

play16:44

comparisons across all the 1 million or

play16:47

10 million documents that you have

play16:49

comparing the vectors to fetch the most

play16:51

similar vectors Etc so essentially

play16:54

remember this thing if you don't want to

play16:57

do heavy computation and want to do

play16:59

something very quickly you can use

play17:01

pre-trained what to algorithm and just

play17:04

get your embeddings and average

play17:07

embeddings and do

play17:09

comparisons that's rule number one to

play17:12

remember rule number two if you want to

play17:14

get state of the accuracies go for

play17:16

sentence Transformers thanks for

play17:19

watching

Rate This

5.0 / 5 (0 votes)

الوسوم ذات الصلة
NLPWord EmbeddingsSentence VectorsTF-IDFWord2VecContextual EmbeddingsTransformersFastTextSemantic SimilarityMachine Learning
هل تحتاج إلى تلخيص باللغة الإنجليزية؟