Python Artificial Intelligence Projects for Beginners



Download 16,12 Mb.
Pdf ko'rish
bet44/65
Sana02.01.2022
Hajmi16,12 Mb.
#311589
1   ...   40   41   42   43   44   45   46   47   ...   65
Bog'liq
Python Artificial Intelligence Projects for Beginners - Get up and running with 8 smart and exciting AI applications by Joshua Eckroth (z-lib.org)

skip-gram
, and the center
word is the input and the context words are the outputs:
In this technique, the center word vector is used to predict the context words given that
center word.
Both of these techniques perform well for most situations. They each have minor pros and
cons that will not be important for our use case.
Doc2Vec
We're going to use Word2Vec to detect positive and negative product, restaurant, and
movie reviews. We will do so with a slightly different form of Word2Vec known as
Doc2Vec
. In this case, the input is a document name, such as the filename, and the output is
the sliding window of the words from the document. This time, we will not have a center
word:


Applications for Comment Classification
Chapter 3
[ 66 ]
In this case, as a vector that helps us predict the words, from knowing the filename. In fact,
the input is not very important, which in this case is the filename. We just need to keep
track of the words on the right side, and that they all came from the same document. So, all
of those words will be connected to that filename, but the actual content of that filename is
not important. Since we can predict the document's words based on its filename, we can
effectively have a model that knows which words go together in a document. In other
words, that documents usually talk about just one thing, for example, learning that a lot of
different positive words are used in positive reviews and a lot of negative words are used
in negative reviews.
Document vector
After training, we have a new document and we want to find its document vector. We'll use
the word similarities learned during training to construct a vector that will predict the
words in the new document. We will use a dummy filename since the actual name is not
important. What's important is that it's just one name. So, all of these words get connected
together under that one name:
Once we get that new document vector, we can compare it with other document vectors
and find which known document from the past is the most similar, as follows:


Applications for Comment Classification
Chapter 3
[ 67 ]
Thus, we can use 
%PD7FD
 to find which documents are most similar to each other. This
will help us detect positive and negative reviews because, ideally, the positive reviews will
have document vectors that are similar to each other and this will be the same for negative
reviews. We expect 
%PD7FD
 to perform better than bag of words because 
%PD7FD
 learns
the words that are used together in the same document, so those words that are similar to
bag of words never actually learned any information about how similar the words are
different.

Download 16,12 Mb.

Do'stlaringiz bilan baham:
1   ...   40   41   42   43   44   45   46   47   ...   65




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish