I nte rna t io na l J o urna l o f   E lect rica l a nd   Co m pu t er   E ng ineering   ( I J E CE )   Vo l.   15 ,   No .   3 J u n e   20 25 ,   p p .   3396 ~ 3 4 0 9   I SS N:  2088 - 8 7 0 8 ,   DOI 1 0 . 1 1 5 9 1 /ijece. v 15 i 3 . pp 3 3 9 6 - 3 4 0 9           3396       J o ur na l ho m ep a g e h ttp : //ij ec e. ia esco r e. co m   Artif i cia l int e llig ence f o r au tom a tic  mo dera tion o te x tual  co ntent  in  o nline   cha ts and so cia l n etworks       So lo m iia   L ia s k o v s k a 1 ,   Rex   B a ca rr a 2 ,   Yev hen M a rt y n 3 ,   V o lo dy m y r   B a idy ch 4   J a m il Abeda lra him   J a m il Al s a y a y deh 5   1 D e p a r t me n t   o f   A r t i f i c i a l   I n t e l l i g e n c e ,   Lv i v   P o l y t e c h n i c   N a t i o n a l   U n i v e r si t y ,   L v i v ,   U k r a i n e   2 D e p a r t me n t   o f   G e n e r a l   E d u c a t i o n   a n d   F o u n d a t i o n ,   R a b d a n   A c a d e m y ,   A b u   D h a b i ,   U n i t e d   A r a b   Em i r a t e s   3 D e p a r t me n t   o f   I n f o r mat i o n   Te c h n o l o g i e s a n d   E l e c t r o n i c   C o mm u n i c a t i o n S y st e ms,  Lv i v   S t a t e   U n i v e r si t y   o f   Li f e   S a f e t y   L v i v ,   U k r a i n e   4 D e p a r t me n t   I n f o r ma t i o n   Te c h n o l o g i e s Kh me l n y t sk y i   N a t i o n a l   U n i v e r si t y ,   K h me l n y t s k ,   U k r a i n e   5 D e p a r t me n t   o f   E n g i n e e r i n g   T e c h n o l o g y ,   F a k u l t i   Te k n o l o g i   D a n   K e j u r u t e r a a n   El e k t r o n i k   D a n   K o m p u t e r ,   U n i v e r s i t i   Te k n i k a l   M a l a y si M e l a k a ,   M e l a k a ,   M a l a y s i a       Art icle  I nfo     AB S T RAC T   A r ticle  his to r y:   R ec eiv ed   Ma r   1 1 ,   2 0 2 4   R ev is ed   Feb   1 7 ,   2 0 2 5   Acc ep ted   Ma r   5 ,   2 0 2 5       Th e   a rti c le  e x p lo re fu n d a m e n tal  tec h n iq u e fo c o n v e rti n g   tex in t o   n u m e rica d a ta  fo m a c h in e   lea rn in g   a lg o rit h m s.  It  m e ti c u l o u sl y   e x a m in e v a rio u s   m e th o d s,   in c l u d i n g   wo r d   v e c to r   re p re se n tati o n   v ia   n e u ra l   n e two r k s   li k e   Wo r d 2 Ve c ,   a n d   e x p lain t h e   p rin c ip les   b e h in d   li n e a m o d e l su c h   a lo g isti c   re g re ss io n   a n d   s u p p o rt   v e c to m a c h in e s.  C o n v o lu ti o n a n e u ra l   n e two rk (CNN a n d   l o n g   sh o rt - term   m e m o ry   (LS TM m e th o d s   a re   a lso   d isc u ss e d ,   c o v e rin g   th e ir   c o m p o n e n ts,   m e c h a n ism s,  a n d   train in g   p ro c e ss e s.  Th e   re se a rc h   e x ten d to   d e v e l o p i n g   a n d   tes ti n g   so ftwa re   f o s p a m   d e tec ti o n ,   h a te  sp e e c h   id e n t ifi c a ti o n ,   a n d   r e c o g n izin g   o ffe n siv e   la n g u a g e .   Us in g   tw o   d a tas e ts o n e   fo lab e led   tex m e ss a g e a n d   a n o th e fo Twit ter  p o sts th e   stu d y   a n a l y z e d a ta  to   a d d re ss   c h a ll e n g e li k e   imb a lan c e d   d a ta.  c o m p a ra ti v e   a n a l y sis  a m o n g   li n e a m o d e ls,   d e e p   n e u ra n e two rk s,   a n d   sin g le - lay e m o d e ls,   u si n g   p re - tr a in e d   b id irec ti o n a l   e n c o d e r   re p re se n tatio n s   fro m   tran sfo rm e rs  (BERT )   n e two rk ,   re v e a ls  p r o m isin g   re su lt s.  Th e   c o n v o lu ti o n a n e u ra n e two rk   sta n d o u wit h   a   re m a rk a b le  a c c u ra c y   o f   0 . 9 5 .   Th e   stu d y   a lso   a d a p ts   n e u ra n e two rk   a rc h i tec tu re fo r   h a te  s p e e c h   a n d   o ffe n siv e   la n g u a g e   c las sifica ti o n .   K ey w o r d s :   Ar tific ial  in tellig en ce   L an g u ag e   class if icatio n   Ma ch in lear n in g   alg o r ith m s   Neu r al  n etwo r k s   Sp am   d etec tio n   T h is i a n   o p e n   a c c e ss   a rticle   u n d e r th e   CC B Y - SA   li c e n se .     C o r r e s p o nd ing   A uth o r :   J am il Ab ed alr ah im   J am il Alsay ay d eh   Dep ar tm en t o f   E n g in ee r in g   T e ch n o lo g y ,   Fak u lti T e k n o lo g d an   Keju r u ter aa n   E lek tr o n ik   d a n   Ko m p u te r   ( FTKE K) ,   Un iv er s iti T ek n ik al   Ma lay s ia  Me lak   7 6 1 0 0   Me lak a,   Ma lay s ia   E m ail: ja m il@ u tem . ed u . m y       1.   I NT RO D UCT I O N   Du to   th v ast  v o lu m e   o f   c o n ten cr ea ted   an d   d is tr ib u ted   o n   th I n ter n et,   it  h as  b ec o m in cr ea s in g ly   ch allen g in g   f o r   m o d er ato r s   to   p r o m p tl y   d etec an d   r em o v h ar m f u o r   o b jectio n ab l co n ten [ 1 ] [ 3 ] Ad d itio n ally ,   th d y n am ic  n at u r o f   o n lin co n ten an d   u s er   in ter ac tio n s   m ak es  it  d if f icu lt  to   estab lis h   s ta tic   r u les  o r   g u id elin es  f o r   m o d er ato r s   to   ad h er to .   T h u s ,   th u tili za tio n   o f   ar tific ial  in tellig en ce   f o r   a u to m atic   m o d er atio n   p r esen ts   p er tin en an d   cr u cial  s o lu tio n   to   th is   is s u e.   Ou r   o b jectiv e   is   to   in v esti g ate  th e   ef f ec tiv en ess   o f   e m p lo y in g   n eu r al  n etwo r k s   f o r   r e g u latin g   tex co n ten t,   s p ec if ically   in   d etec tin g   s p am ,   h ate  s p ee ch ,   an d   ab u s iv lan g u ag u s in g   m ac h in e   lear n in g   alg o r ith m s .   T h is   in v o lv es  a n aly zin g   th e   f ea tu r es  o f   m ac h in lear n in g   m eth o d s   f o r   n atu r al   lan g u ag p r o ce s s in g   task s ,   s u ch   as  tex t   class if icatio n ,   d e v elo p in g   a   m o d el  f o r   id en tif y in g   s p am   m ess ag es  b ased   o n   d ee p   n eu r al  n etwo r k s ,   co m p ar in g   th r esu lts   o b tain ed   with   Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J E lec  &   C o m p   E n g     I SS N:   2088 - 8 7 0 8         A r tifi cia l in tellig en ce   fo r   a u to ma tic  mo d era tio n   o f te xtu a l c o n ten t …   ( S o l o miia   Lia s ko vska )   3397   class ical  m ac h in lear n in g   m eth o d s ,   cr ea tin g   te x cla s s if icatio n   m o d el  f o r   d etec ti n g   h ate   s p ee ch   a n d   o f f en s iv lan g u ag e   b ased   o n   th tr ain ed   b id ir ec tio n al  en c o d er   r e p r esen tatio n s   f r o m   tr a n s f o r m er s   ( B E R T )   tr an s f o r m er   m o d el,   an d   an aly zin g   th ac cu r ac y   an d   e f f icien cy   o f   th d ev elo p ed   m o d el.   T o   ac co m p lis h   th is ,   we  p r o p o s th d ev elo p m en t o f   s o f twar im p lem en tatio n   o f   m ac h in lear n in g   alg o r ith m s   d esig n ed   to   d etec t   s p am   an d   h ate  s p ee ch   in   o n lin co m m u n icatio n .   Ou r   r esear ch   in teg r ates  m eth o d s   an d   alg o r ith m s   o f   n atu r a l   lan g u ag p r o ce s s in g   co m m o n l y   u tili ze d   f o r   tex t c lass if icatio n .   T h u s ,   i n   o r d e r   t o   u t i l i z e   t h e   m o s t   a p p r o p r i a t e   a n d   u p - to - d a t e   i n f o r m a t i o n ,   a s   w e l l   a s   e f f e c t i v e   m e t h o d s ,   it   i s   n e c e s s a r y   t o   v e r i f y   t h e   r e l e v a n c e   o f   t h e   d a t a   i n v o l v e d   i n   o u r   r e s e a r c h .   A m o n g   t h e   s u b j e c t   a r e a s   t o   w h i c h   s c i e n t i f i c   w o r k s   c o r r e l a t i n g   w i t h   o u r   c h o s e n   s c i e n t i f i c   d i r e c t i o n   c a n   b e l o n g   a r e   c o m p u t e r   s c i e n c e ,   e n g i n e e r i n g ,   a n d   m a t h e m a t i c s .   I t   i s   e v i d e n t   t h a t   t h e   c h o i c e   i s   q u i t e   o b v i o u s   a n d   a l i g n s   w i t h   o u r   s c i e n t i f i c   o b j e c t i v e s   t o   i n v e s t i g a t e   t h e   e f f e c t i v e n e s s   o f   u s i n g   n e u r a l   n e t w o r k s   t o   r e g u l a t e   t e x t u a l   c o n t e n t   u s i n g   m a c h i n e   l e a r n i n g   m e t h o d s .   W o r k s   [ 4 ] [ 8 ]   d elv in to   th e   m eth o d s   an d   m ea n s   o f   d ete ctin g   s o cial  s p am ,   wh ich   en co m p ass es   illeg al  tex co n ten [ 9 ] [ 1 3 ] ,   o f f en s iv lan g u ag e,   h ate  s p ee ch ,   cy b e r b u lly in g ,   an d   d is in f o r m atio n .   I n   [ 1 ] ,   th e   n ee d   f o r   th e   d e v elo p m e n o f   e f f ec tiv m eth o d s   f o r   d etec tin g   s o cial  s p am   is   em p h asized ,   w h er ein   th e   s u p p o r v ec to r   m eth o d   ( SVM) ,   r an d o m   f o r est,  an d   n aiv e   B ay esian   alg o r ith m   a r em p l o y ed   t o   a d d r ess   th is   cr u cial  s o cial  p r o b lem .   T h ey   p r o p o s co n ce p f o r   d ev elo p in g   m o r ac cu r ate  a n d   co n tex t - d ep en d en h o s tile  lan g u ag e   d etec tio n   s y s tem s   [ 1 4 ] .   Su c h   m ac h in lear n in g   a lg o r ith m s   as  th s u p p o r t   v ec t o r   m eth o d ,   r an d o m   f o r est,  B ay esian   class if ier ,   k - n ea r est  n eig h b o r s   m eth o d ,   a n d   m u ltil ay er   p er ce p tr o n   ar e x p lo r ed   in   [ 3 ] .   I n   [ 4 ] v ar io u s   s p ee ch   m o d els - tr an s f o r m er s   lik B E R T ,   XL Net,   an d   R o B E R T ar co m p ar ed   in   th eir   ef f icac y   in   d etec tin g   click b ait  h ea d lin es.   Ad d itio n ally ,   [ 6 ]   u n d er s co r e s   th n ec ess i ty   f o r   in ter d is cip lin ar y   co o p er atio n   am o n g   in f o r m atio n   tech n o lo g y   p r o f ess io n als,  s o cio lo g is ts ,   an d   leg al  ex p er ts   to   d ev is ef f ec tiv an d   eth ical  s o lu tio n s   to   th p r o b lem   o f   h a r m f u l c o n ten t.    Var io u s   wo r k s   o f f e r   s o lu tio n s   to   th s p am   p r o b lem .   I n   [ 5 ] ,   m o d el  b ased   o n   th c o n v o lu tio n al   n eu r al  n etwo r k   ( C NN)   ar ch itectu r is   p r o p o s ed .   R esear ch   [ 7 ]   claim s   th at  th e   d ee p   lear n in g   lo n g   s h o r t - ter m   m em o r y   ( L STM )   m o d el  o u tp er f o r m s   o th e r   m o d els  in   ter m s   o f   all  m etr ics:   ac cu r ac y ,   r el iab ilit y ,   r ec all,   an d   F1 - s co r e.   I n   [ 8 ] ,   th em p h asis   is   o n   th p r o b lem   o f   class if ic atio n   ac cu r ac y   o f   em o tio n al  co lo r in g   in   tex d ata,   an d   it is   f o u n d   th at  th b est m o d el  is   r an d o m   f o r est,  ac h ie v in g   an   ac cu r ac y   o f   o v e r   8 0 %.   R esear ch   [ 1 5 ] [ 1 9 ]   u n d er s co r es  th im p o r tan ce   o f   class if icatio n   ac cu r ac y   an d   s p am   m ess ag d etec tio n   u s in g   tr an s f o r m er   m o d els  an d   e n s em b le  lear n i n g   [ 2 0 ] .   P r o p o s ed   tr an s f o r m er   m o d els,  i n clu d in g   B E R T   an d   eXtr em Gr ad ien B o o s tin g   ( XGBo o s t) ,   ar u tili ze d   f o r   s p am   class if icatio n   an d   d etec tio n .   An o th er   g r o u p   o f   wo r k s   p r o p o s es  d ir ec tio n s   an d   m eth o d s   f o r   s o lv in g   th s p am   p r o b lem   [ 2 0 ] [ 2 4 ] T h au th o r s   o f   [ 1 6 ]   in tr o d u ce   n ew  a p p r o ac h   to   tex class if icatio n   b ased   o n   C NN  an d   B id ir ec tio n al  L STM   m o d els,  wh ich ,   in   th eir   o p in io n ,   b etter   ca p t u r s em an tic  in f o r m atio n   a n d   d e m o n s tr ate  in c r ea s ed   ac cu r ac y   f o r   twee clas s if icatio n .   T h wo r k   [ 2 5 ]   s u g g ests   an   ap p r o ac h   t h a co m b in es  p r e - tr ain e d   tr an s f o r m er   m o d el  with   C NN ,   wh ile  [ 2 1 ] ,   [ 2 2 ] ,   [ 2 6 ]   p r esen ts   s p am   d etec tio n   s y s tem   in   th T witter   n etwo r k   in   r ea l - tim alo n g s id s en tim en an aly s is   u s in g   m ac h in lear n in g   an d   d ee p   lear n i n g   m eth o d s .   T h au t h o r s   o f   [ 1 7 ]   p r o p o s es  n ew  ap p r o ac h   to   im p r o v in g   s p am   d etec tio n   u s in g   d ee p   r ec u r r en n eu r al  n etwo r k ,   w h ile  [ 1 8 ] [ 2 0 ]   p r esen ts   a   b in ar y   class if ier   b ased   o n   m ac h in lear n in g .   I n   ar ticle   [ 9 ] ,   b ased   o n   c o m p r eh en s iv e   r ev i ew  o f   m eth o d s   an d   ev alu atio n   m etr ics  f o r   d etec ti n g   s o cially   u n ac ce p ta b le  s tatem en ts ,   it  is   co n clu d ed   th at  f u tu r r esear ch   s h o u ld   f o cu s   o n   d e v elo p in g   m o r r eliab le  an d   ac cu r ate  m eth o d s   c ap ab le  o f   co p in g   with   th d y n am ics  o f   te x d at a   f lo ws  o n   o n lin e   p latf o r m s   [ 2 7 ] ,   [ 2 8 ] .   On lin c o m m u n icatio n   ab u s tak es  m an y   f o r m s     it  ca n   b e   cy b er b u lly in g ,   m is in f o r m atio n ,   s p am ,   an d   m o r e.   On lin p r o p ag an d d eser v es  p ar ticu lar   atten tio n     th r o u g h   wid esp r ea d   u s o f   f ak ac co u n ts   o n   s o cial  m ed ia,   v ar io u s   p o liti ca o r   p u b lic  f ig u r es  an d   o r g an izatio n s   ca n   d is s em in ate  d esire d   in f o r m ati o n   to   s h ap e   p u b lic  o p in io n .   T h is   cr ea tes  ch allen g f o r   i n f o r m atio n   f ilter in g   an d   co n tr o [ 2 9 ] [ 3 1 ] .   T y p ica lly ,   o wn er s   o f   v ar io u s   o n lin e   f o r u m s   o r   c h ats  u s p e o p le  to   m o n ito r   p u b lis h ed   co n ten t,  b u th is   m eth o d   h as  o b v io u s   d r awb ac k s     p er s o n   p h y s ically   ca n n o r ev iew  th co n ten o f   h u n d r e d s   o f   m ess ag es  p o s ted   in   s h o r p er io d ,   esp ec ially   d u r i n g   m as s   s p am   attac k s   o n   u s er s .   L ar g p latf o r m s   s u ch   as   T witter   [ 2 3 ] ,   [ 2 6 ]   o r   Face b o o k   u s s o f twar e   to o ls   to   d etec co n ten th at   v io lates  p latf o r m   r u les,  b u t   th ey   also   h av lim itatio n s     t h ese  to o ls   o f ten   d o   n o t   co n s id er   th e   m ess ag co n tex o r   th e   cu ltu r al   b ac k g r o u n d   o f   its   au th o r ,   th u s   th ey   f r eq u en tly   b lo ck   co n te n th at  d o es  n o v io late  co m m u n ity   g u id elin es  [ 1 4 ] ,   [ 1 8 ] ,   [ 2 0 ] ,   [ 2 2 ] T h is   is s u is   h ig h ly   r elev an f o r   s o cial  n etwo r k   I n s tag r am .   T h er ef o r e,   m o d e r n   au to m ated   co n ten m o d er atio n   to o ls   ar n o t f lawless ,   an d   d esp ite  ex is tin g   s o lu tio n s   th at  u s ar tific ial  in tellig en ce   to   d etec illi cit  co n ten t,   th is   ar ea   r eq u ir es f u r th er   r esear ch   [ 3 2 ] [ 3 7 ] .       2.   M E T H O   I n   th is   s cien tific   wo r k ,   a u t h o r s   s o lv th task   o f   tex t   class if icatio n   u s in g   m ac h in lear n in g   alg o r ith m s   [ 3 8 ] [ 4 0 ] .   Su ch   al g o r ith m s   ar n o ab le  to   wo r k   d ir ec tly   with   tex d ata,   f o r   th is   th ey   n ee d   to   b e   co n v er ted   in to   n u m er ical   f o r m at  -   v ec to r s .   T h er ef o r e,   we   a n aly ze d   t h m ain   m eth o d s   [ 4 1 ] [ 4 3 ]   o f   tex t   d ata   r ep r esen tatio n   [ 4 4 ] o n e - h o v ec to r ,   b ag   o f   wo r d s ,   ter m   f r eq u en cy in v er s d o cu m en f r eq u en cy   ( T F - I DF)   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 0 8 8 - 8 7 0 8   I n t J E lec  &   C o m p   E n g ,   Vo l.   15 ,   No .   3 J u n e   20 25 :   3 3 9 6 - 3 4 0 9   3398   n - g r am s ,   as  well  as  v ec to r   r ep r esen tatio n   o f   wo r d s   an d   i ts   im p lem en tatio n   th r o u g h   t h wo r d 2 v ec   m o d el    [ 4 5 ] [ 4 8 ] .   I n   p ar ticu lar ,   two   m o d el  ar c h itectu r es  ar e   in v o lv ed   in   th e   r esear ch   [ 4 9 ] [ 5 2 ] :   C o n tin u o u s   b ag   o f   wo r d s   ( C B OW )   an d   Sk ip - g r a m ,   lin ea r   m ac h in e   lear n in g   al g o r ith m s   an d   n eu r al  n etwo r k s .   T h er e   ar s ev e r al  m eth o d s ,   th m o s co m m o n   o f   wh ich   is   “b ag   o f   wo r d s . ”  T h b ag   o f   wo r d s   m ar k s   th p r esen ce   o f   wo r d   in   in p u d o cu m e n ts   co m p ar ed   to   all  wo r d s   in   t h d ataset.   T h er ef o r e,   its   im p lem en tatio n   r eq u ir es  d ictio n a r y   o f   all  u s ed   wo r d s   an d   a n   i n d icat o r   o f   w o r d   p r esen ce   [ 5 3 ] ,   [ 5 4 ] .   All  d ata  in p u tted   in to   m ac h in lear n in g   m o d els  will th u s   b r ep r esen ted   as n u m er ical  v ec to r s   ( 1 ) :     [ 1 , 2 , 3 ] ,     ( 1 )     T h p r e v io u s   m eth o d   ca n   b i m p r o v e d   b y   r ep r esen tin g   ea ch   wo r d   in   t h v ec to r   n o ju s as   0   o r   1 ,   b u r ath er   b y   its   co u n in   th d o cu m en t   o r   its   f r eq u e n cy   r elativ to   t h to tal  n u m b er   o f   wo r d s   in   th tex t.  T h m ai n   d r awb ac k   o f   th is   ap p r o ac h   is   th at  wo r d s   ap p ea r in g   in   ev er y   d o cu m e n will  h av th h ig h est  f r eq u en cy   an d   cr ea te  in f o r m atio n al  n o is e.   T o   ad d r ess   th is   is s u e,   ter m   f r eq u en cy in v er s d o cu m e n f r eq u en cy   ( T F - I DF)   ex is ts     m etr ic  t h at  d eter m i n es  th s ig n if ican ce   o f   wo r d   f o r   s p ec if ic   d o c u m en t   ag a in s its   s ig n if ican ce   f o r   th e n tire   co r p u s .   I is   lo g i ca to   ass u m th at  wo r d   a p p ea r in g   in   all  in p u d ata  will  h a v lo v alu f o r   a   s p ec if ic  d o cu m en t,  wh er ea s   wo r d   ap p ea r i n g   in   o n l y   o n d o cu m e n will  b etter   d escr ib it.  T F - I DF  i s   ca lcu lated   f o r   ea ch   wo r d ,   a n d   th h ig h e r   th v alu o f   th e   m etr ic,   th m o r s ig n i f ican th wo r d   is   f o r   th e   d o cu m e n t.  T h f o r m u la  f o r   th m etr ic  is   as ( 2 ) :       =  l og ( )     ( 2 )          ter m   f r eq u e n cy ,       to tal  n u m b er   o f   d o cu m en ts ,       n u m b er   o f   d o cu m en ts   co n tain in g   th wo r d .   T h ess en ce   o f   o u r   r esear ch   is   th u s o f   m ac h i n lear n in g   alg o r ith m s   to   d etec t sp am .     Den s v ec to r s   o r   co n tex v ec t o r s   ar v ec to r s   u s ed   to   d escr ib wo r d   b ased   o n   its   r elatio n s h ip s   with   o th er   wo r d s .   Giv en   s en ten ce ,   we  ca n   tak a   s p ec if ic  win d o ar o u n d   th c h o s en   wo r d   with   s ize  o f   n   wo r d s   to   r ep r esen its   co n tex t.  W o r d s   th at  h a v s im ilar   c o n tex ts     m ea n in g   th ey   s h ar e   th s am e   s u r r o u n d in g   wo r d s   as  wo r d   x ,   will  b e   co n s id er e d   s y n o n y m s   o r   s em an tically   s im ilar   to   wo r d   y .   T h en ,   f o r   t h c h o s en   wo r d ,   we  ca n   f o r m   v ec t o r   [ 1 , 2 , 3 ] wh er ea c h   v a r iab le  r ep r esen ts   th f r eq u e n cy   o f   ea ch   wo r d ' s   o cc u r r en ce   in   t h e   co r p u s   with in   th v icin ity   o f   th ch o s en   wo r d .   Sin ce   wo r d s   ar r ep r esen ted   as  v ec to r s ,   we  ca n   m ea s u r th e   s im ilar ity   b etwe en   wo r d s   u s in g   th f o r m u la  o f   th d o t p r o d u ct,   s p ec if ically   f in d in g   th co s in s im ilar ity   ( 3 ) :     c os = | | | |     ( 3 )     wh er a   an d   b   a r v ec to r   r ep r esen tatio n s   o f   wo r d s .   W o r d 2 v ec   is   two - lay er   n e u r al  n et wo r k   th at  p r o ce s s es  tex b y   “v ec to r izin g ”  wo r d s .   I tak es  tex tu al  co r p u s   as  in p u an d   p r o d u ce s   s et  o f   d en s v ec t o r s   r ep r esen tin g   wo r d s   in   th at  c o r p u s .   T h er a r two   m ain   ar ch it ec tu r es: C B O W   an d   s k ip - g r a m .   Au th o r s   u s ed   Py th o n   p r o g r a m m in g   lan g u ag e,   lib r a r ies  f o r   m ac h in lear n in g ,   n atu r al   lan g u ag e   p r o ce s s in g   an d   d ata  v is u aliza tio n   NL T K ,   s k lear n ,   m atp l o tlib . p y p l o t,  s ea b o r n ,   n ea ttex as  to o ls   f o r   r esear ch .   As  d ev elo p m en e n v ir o n m e n t,  Go o g le  C o lab   was  u s ed   a n   in ter ac tiv o n lin en v i r o n m en f o r   p er f o r m in g   d ata  an aly s is   an d   v is u aliza tio n   task s ,   wh ich   allo ws  y o u   to   b r ea k   th c o d i n to   s ep ar ate  p ar ts ,   r u n   th em   in d ep en d en tly   o f   ea ch   o t h er ,   v is u alize s   th p r o ce s s   o f   co d e x ec u tio n   in   r ea l tim an d   g iv e s   th o p p o r tu n ity   to   im m ed iately   s ee   th r esu lt  ex ec u tio n   o f   th d esire d   p a r o f   th p r o g r am ,   wh ich   g r ea tly   s im p lifie s   th eir   wr itin g   an d   d e b u g g i n g .     2 . 1 .     Cla s s if ier  o f   lin ea m o d els,  L S T M ,   s pa m   ba s ed  CN a nd   B E RT   2 . 1 . 1 .   Da t a   a na ly s is   a nd   pre - pro ce s s ing   T h d ataset  u s ed   f o r   m o d el   tr ain in g   c o n s is ts   o f   5 , 5 7 4   tex t   m ess ag es,  wh ich   ar e   lab eled   a s   s p am   an d   non - s p am .   Fig u r 1   p r esen ts   an   o v er v iew  o f   th d ataset,   in clu d in g   g en e r al  s tatis tic s   s u ch   as  wo r d   f r eq u en cy   an d   class   d is tr ib u tio n .   T h is   v i s u aliza tio n   h elp s   to   u n d er s tan d   th n atu r e   o f   th e   d ata  an d   its   b alan ce ,   wh ich   is   cr itical  f o r   tr ain in g   ef f ec tiv cl ass if icatio n   m o d els.   Sto p - wo r d s   ar e   wo r d s   th at   ar p r esen in   th tex t,   b u b y   th em s elv es  d o   n o m ak e   s en s e,   s u ch   as   co n ju n ctio n s ,   p r ep o s itio n s ,   o t h er   o f f icial  p ar ts   o f   s p ee ch ,   a n d   ex clam atio n s .   Als o ,   s to p   wo r d s   u s u ally   in clu d wo r d s   th at  ar f o u n d   in   alm o s all  co r p o r o f   ce r tain   lan g u ag e.   B y   th r o win g   th em   o u t ,   y o u   ca n   g et  r id   o f   u n n ec ess ar y   n o is an d   g i v m o r weig h t   to   wo r d s   t h at  ar e   m o r im p o r tan t   an d   h a v a   s ig n if ican im p ac o n   th co n ten o f   th d o cu m e n t.  T h NL T K   lib r ar y   co n tain s   b u ilt - in   lis t o f   s to p   wo r d s   f o r   ea ch   lan g u a g e.       Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J E lec  &   C o m p   E n g     I SS N:   2088 - 8 7 0 8         A r tifi cia l in tellig en ce   fo r   a u to ma tic  mo d era tio n   o f te xtu a l c o n ten t …   ( S o l o miia   Lia s ko vska )   3399       Fig u r 1 .   Descr ip tio n   an d   v is u aliza tio n   o f   th d ata  s et        Sin ce   th s p ec if ic   m ea n in g   o f   wo r d s   is   r elativ ely   u n im p o r ta n f o r   s p am   d etec tio n ,   s tem m i n g   ca n   b u s ed .   I is   m u ch   f aster   an d   ea s ier   to   im p lem en t.  T h er ar s ev er al  s tem m in g   im p lem en ta tio n s   in   th NL T K   lib r ar y .   T h tar g et  v ar iab le  in   th d ataset  tak es  t wo   s tr in g   v alu es.  Sin ce   th m o d els  ca n   o n ly   wo r k   d ir ec tly   with   n u m er ical  d ata,   we  e n c o d th v al u o f   t h tar g et  v ar iab le  ac co r d in g   to   th b i n ar y   class if icatio n   p r o b lem .   Usi n g   th e   b u ilt - in   tr a in _ test _ s p lit()   f u n ctio n   o f   t h e   s k lear n   lib r a r y ,   we  s p lit  th d ata  s et  in to   tr ain in g   an d   test   s am p les.  T o k e n izatio n   is   th e   p r o ce s s   o f   d iv id in g   a   d o c u m en t   in to   wo r d   co m p o n en ts   -   to k en s ,   a f te r   to k en izatio n ,   we  will  co n v er t   d o cu m en ts   in to   n u m er ical  v ec to r s   u s in g   th m eth o d s   o f   “b ag   o f   wo r d s ”,   n - g r am s   an d   TF - I DF .   T o   d o   th i s ,   we  will  u s th s k lear n   lib r ar y   p ac k ag f o r   e x tr ac tin g   f ea tu r es  f r o m   tex d ata   an d   class es  f o r   v ec to r izatio n .   L et's  in v o lv in s tan ce s   o f   th C o u n tVec to r izer   an d   T f id f T r a n s f o r m er   class es  to   cr ea te  n ew  d atasets   f o r   ea c h   f ea tu r ex tr ac tio n   m et h o d .   Fo r   ea ch   o f   th e   d ata  s ets,  we  t r ain   two   lin ea r   m o d els:   lo g is tic  r eg r ess io n   an d   th e   s u p p o r t v ec to r   m eth o d .   W will u s th f o llo win g   m etr ics to   e v alu ate  th m o d els:     Acc u r ac y - s co r   th r atio   o f   th n u m b er   o f   c o r r ec tly   p r e d icted   class es  to   th n u m b er   o f   all  p r e d icted   d ata,   ch ar ac ter izes th ac c u r ac y   o f   th e   m o d el;     Pre cisi o n - s co r   th e   r atio   o f   th n u m b er   o f   c o r r ec tly   p r ed i cted   p o s itiv ( y =1 )   d ata  to   th n u m b er   o f   all   p r ed icted   p o s itiv d ata,   wh ic h   ch ar ac ter izes  th e   er r o r   with   wh ich   th e   m o d el  ca n   ac c ep t   d ata  m ar k ed   as  n eg ativ as p o s itiv e;     R ec all    th r atio   o f   t h n u m b er   o f   c o r r ec tly   p r ed icted   p o s itiv d ata  to   th e   s u m   o f   th n u m b er   o f   co r r ec tly   p r ed icted   p o s itiv an d   f alsely   p r ed icted   n eg ativ d ata,   c h ar ac ter izes  th m o d el' s   ab il i ty   to   d eter m in e   p o s itiv d ata;     F1 - s co r   m etr ic  u s ed   to   ca lcu late  th r atio   o f   th p r o p o r tio n   o f   o b jects  th at  wer class if ied   b y   th e   m o d el  as  p o s itiv an d   r ea lly   wer p o s itiv to   th e   p r o p o r tio n   o f   f o u n d   p o s itiv d ata  f r o m   all  p o s itiv d ata   in   th s et,   ca lcu lated   b y   th f o r m u la:     = 2 + 1   2         wh er β    is   th weig h t f o r   m e tr ics.   Af ter   tr ain in g   th e   m o d el  a n d   t esti n g   th m o d el,   t h f o llo win g   m etr ics we r o b tain e d :     Acc u r ac y - s co r e= 0 . 9 5 2 ,   p r ec is io n - s co r e= 0 . 9 7 ,   r ec all=0 . 9 3 ,   f 1 - p o in t=0 . 9 5   f o r   lo g is tic  r eg r ess io n   tr ain ed   o n   “b ag   o f   wo r d s ”;     Acc u r ac y - s co r e= 0 . 9 4 ,   p r ec is io n - s co r e= 0 . 9 6 4 ,   r ec all=0 . 9 1 ,   f 1 - p o in t=0 . 9 3 6   f o r   th e   m et h o d   o f   s u p p o r v ec to r s   tr ain ed   o n   th b ag   o f   wo r d s ”;     Acc u r ac y - s co r e= 0 . 9 4 ,   p r ec is io n - s co r e= 0 . 9 8 8   r ec all=0 . 8 9 ,   f 1 - s co r e= 0 . 9 3   f o r   lo g is tic  r eg r ess io n   tr ain ed   o n   th “b ag   o f   u n ig r am   a n d   b ig r a m ”;     Acc u r ac y - s co r e= 0 . 9 4 7 ,   p r ec i s io n - s co r e= 0 . 9 8 8 ,   r ec all=0 . 9 ,   f 1 - s co r e= 0 . 9 4   f o r   th m eth o d   o f   s u p p o r t   v ec to r s   tr ain ed   o n   th b ag   o f   u n ig r am   a n d   b ig r am ”;     Acc u r ac y - s co r e= 0 . 9 5 ,   p r ec is io n - s co r e= 0 . 9 7 6 ,   r ec all=0 . 9 2 2 ,   f 1 - s co r e= 0 . 9 5   f o r   lo g is tic  r e g r ess io n   tr ain ed   on  TF - I DF   v ec to r s ;     Acc u r ac y - s co r e= 0 . 9 6 7 9 1 4 4 3 8 5 0 2 6 7 3 8 ,   p r ec is io n - s co r e= 0 . 9 8 ,   r ec all=0 . 9 5 5 ,   f 1 - s co r e= 0 . 9 6 6   f o r   th s u p p o r t v ec t o r   m eth o d   tr ai n ed   o n   TF - I DF   v ec to r s .   T o   v is u alize   th q u ality   o f   t h m o d els,  we  will  o u tp u t h e   er r o r   m atr ix   f o r   ea ch   d ata  s e f o r   ea ch   m o d el.   Fig u r 2   d em o n s tr ates  wh er Fig u r 2 ( a)   s h o ws  er r o r   m atr ices  f o r   lo g is tic  r eg r ess i o n   an d   Fig u r 2 ( b )   s h o ws  th s u p p o r v ec to r   m et h o d   th at   we  ca n   s ee   th at   b o th   m o d els  f o r   b ag - of - w o r d s   d ata   ar eq u ally   g o o d   at  id en tify in g   n o n - s p am   m ess ag e s .   B u t th lin ea r   r eg r ess io n   m e th o d   is   b etter   at  d ir ec tl y   class if y in g   s p am   its elf .     Fig u r 3   d em o n s tr ates  th at  th ab o v m atr ices  an d   we  ca n   co n clu d th at  f o r   d ata  s ets  c o n tain in g   u n ig r am   a n d   b i g r am .   Fig u r 3 ( a)   s h o ws  er r o r   m atr ices  f o r   lo g is tic  r eg r ess io n   ( lef t) .   Fig u r 3 ( b )   s h o ws  th e   s u p p o r t v ec t o r   m eth o d   th e   m o d els g iv alm o s t id en tical  r esu lts ,   b u t in   tu r n   p r ed ict  less   f alse p o s itiv d ata.     W ca n   co n clu d th at  th d eter m in atio n   o f   th m ess ag lab e as  s p am   o r   n o s p am   d o es  n o im p r o v e   m u ch   wh e n   tak i n g   in t o   ac co u n th a d d itio n al  c o n tex t.   B ec au s wh en   u s in g   th e   n - g r am s   d ataset,   th o v e r all  ac cu r ac y   o f   th m o d el  d id   n o t   im p r o v e,   it  ev en   d ec r ea s ed   s lig h tly ,   b u at  th s am tim th m o d el  d o es  less   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 0 8 8 - 8 7 0 8   I n t J E lec  &   C o m p   E n g ,   Vo l.   15 ,   No .   3 J u n e   20 25 :   3 3 9 6 - 3 4 0 9   3400   s p am   d etec tio n   er r o r s .   Fewer   f alse - p o s itiv d ata  a n d   th e   lo west  ac cu r ac y   a r d em o n s tr at ed   b y   m o d els  tr ain e d   o n   d ata  in   th TF - I DF   in d icato r   f o r m at.   Fo r   T F - I DF  f o r m at  d ata  in   F ig u r 4   d em o n s tr ates  th at  th s u p p o r v ec to r   m et h o d   b etter   class if ie s   m ess ag es  co n tain in g   s p am ,   wh ile  allo win g   f ewe r   er r o r s   th an   lo g is tic  r eg r ess io n .   Fig u r 4 ( a)   s h o ws  er r o r   m atr ices f o r   lo g is tic  r eg r ess io n .   Fig u r 4 ( b )   s h o ws th s u p p o r t v ec to r   m eth o d .           ( a)   ( b )     Fig u r 2 .   E r r o r   m atr ices f o r   l o g is tic  r eg r ess io n   ( a)   an d   th s u p p o r v ec to r   m et h o d   a n d     ( b )   f o r   th b ag   o f   wo r d s ”  d at s et           ( a)   ( b )     Fig u r 3 .   E r r o r   m atr ices f o r   l o g is tic  r eg r ess io n   ( lef t)   ( a)   an d   th s u p p o r v ec to r   m eth o d   an d     ( b )   ( r ig h t)   f o r   t h “b ag   o f   wo r d s ”  d ata  s et           ( a)   ( b )     Fig u r 4 .   E r r o r   m atr ices f o r   l o g is tic  r eg r ess io n   ( a)   an d   th s u p p o r v ec to r   m et h o d   ( b )   f o r   t h TF - I DF   d ataset     Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J E lec  &   C o m p   E n g     I SS N:   2088 - 8 7 0 8         A r tifi cia l in tellig en ce   fo r   a u to ma tic  mo d era tio n   o f te xtu a l c o n ten t …   ( S o l o miia   Lia s ko vska )   3401   3.   RE SU L T S AN D I SCU SS I O   T h is   s ec tio n   d escr ib es  u s in g   C NN  an d   L STM   n eu r al  n etwo r k   ar c h itectu r es  f o r   s p am   cla s s if icatio n .   I n   o r d er   to   tr ain   n e u r al  n etwo r k s   o n   o u r   d ata,   it  is   n ec ess ar y   to   b r in g   all  v ec to r s ,   th at  is ,   all  d o cu m en ts ,   to   f ix ed   len g th .   As  th e   d im e n s io n   v alu e   o f   th v ec to r s ,   a u th o r s   tak th e   len g th   o f   th lar g est  d o cu m e n t.  Au th o r s   ch an g th d im en s io n ality   o f   th v ec to r s   u s in g   th p ad _ s eq u en ce s ( )   f u n ctio n   o f   th e   K er as  lib r ar y ,   th p ad d in g ar g u m e n will  h av th v alu “p o s t”,   wh ich   in d ica tes  th ze r o   v alu es  o f   th f u n c tio n ,   d u to   wh ich   we  ex p an d   t h v ec to r   an d   ad d   th em   to   th e n d .     3 . 1 .     Descript io n o f   t he  net w o rk   a r chit ec t ure   E m b ed d in g   lay er in p u d ata   to   th e   n etwo r k   is   a   s eq u e n ce   o f   wo r d s ,   wh ich   ar r ep r esen ted   as   in teg er s   wo r d   in d e x es  in   th d ictio n ar y .   T h E m b ed d in g   L a y er   tr a n s f o r m s   th ese  i n teg er s   i n to   v ec t o r s   o f   g iv e n   d im en s io n   c o n tain in g   th r e p r esen tatio n   o f   th wo r d   th r o u g h   its   co n tex tu al  r elatio n s h ip   w ith   o th er   wo r d s .   8 0   is   th s ize  o f   th len g th   o f   th e   in p u t v ec to r   o f   to k en s ,   a n d   th e   d im en s io n   o f   d e n s v ec to r s   is   1 0 0 ;     L STM lay er   o f   an   L STM   n etwo r k   th at  ca n   s to r lo n g - ter m   d ep en d e n cies  in   s eq u en tial  d ata.   I co n s is ts   o f   n eu r o n s   f o r   p r o ce s s in g   s eq u en tial  in p u d ata  an d   s av i n g   in f o r m atio n   ab o u th s tate  o f   th n eu r al  n etwo r k ;     Glo b alM ax Po o lin g 1 D:  lay er   ac tin g   as  f ilter   f o r   f ea t u r es  g en er ated   b y   L STM ,   it s   o u tp u is   th m ax im u m   v alu f r o m   ea ch   v e cto r   o f   f ea tu r es;     Dr o p o u t   an d   b atch   n o r m aliza t io n d r o p o u lay e r   is   ap p lied   af ter   th e   L STM   lay er   t o   f ilter   th n u m b er   o f   f ir in g   n eu r o n s   to   p r ev en o v er tr ain in g .   Af ter   th at,   b atch   n o r m aliza tio n   is   ap p lied   to   s tan d ar d ize  th in p u t   d ata  to   th p r ev io u s   lay e r ;     Den s e:  f u lly   c o n n ec ted   lay e r   ac ce p ts   L STM   o u t p u d ata   a f ter   p r o ce s s in g   b y   s ev er al  lay er s ,   co n tain s   8 0   n eu r o n s ,   f o r   n o n lin ea r   tr a n s f o r m atio n   o f   th in p u d ata  b y   th r ec tifie d   lin ea r   u n it  ( R eL U )   ac tiv atio n   f u n ctio n ;     Dr o p o u t: r e p ea ted   r e m o v al  o f   p ar t o f   n eu r o n s ;     Den s e:  an   o u tp u d e n s lay er   with   o n n eu r o n   an d   s ig m o id   ac tiv atio n   f u n ctio n ,   u s ed   to   ca lcu late  th e   o u tp u p r o b a b ilit y   th at  an   o b je ct  b elo n g s   to   class .   Fig u r 5   p r esen ts   th e   p er f o r m an ce   o f   th e   L STM - b ased   n etwo r k .   Fig u r 5 ( a)   s h o ws  th ac cu r ac y   cu r v f o r   b o th   tr ain i n g   an d   v alid atio n   s ets,  in d icatin g   co n s is ten im p r o v em en an d   g o o d   g en er aliza tio n .   Fig u r 5 ( b )   illu s tr ates  th lo s s   cu r v e,   wh ich   s tead ily   d ec r e ases ,   s u g g esti n g   th at  th m o d el  is   n o o v er f itti n g   an d   is   lear n in g   ef f ec tiv ely   o v e r   tim e.           ( a)   ( b )     Fig u r 5 .   Gr a p h   o f   n etwo r k   lo s s es a n d   ac cu r ac y   b ased   o n   L STM   m o d el  ( a)   ac c u r ac y   p lo an d   ( b )   lo s s   p lo t       Fro m   th g iv en   g r ap h s ,   we  ca n   s ay   th at  th n etwo r k   is   n o o v er tr ain ed ,   b ec a u s th lo s s es  o n   th e   v alid atio n   d ata  ar co n s tan t ly   d ec r ea s in g .   W in itialize   th co n v o lu tio n al  n e u r al  n etwo r k .   Fig u r 6   d em o n s tr ates th ar ch itectu r o f   co n v o lu tio n al  n eu r al  n etw o r k .   L et's p er f o r m   t h f o llo win g   d e s cr ip tio n   o f   th e   n etwo r k   ar ch it ec tu r e:     E m b ed d in g   lay er :   th lay er   v ec to r izes  th in p u t   d ata  in to   d en s co n tex v ec to r s .   T h s ize  o f   th e   in p u t   v ec to r s   is   8 0 ,   a n d   th d im en s io n   o f   t h d e n s v ec to r s   is   5 0 .   C o n v o lu tio n al  lay er c o n v o lu tio n al  lay e r   co n tain in g   6 4   f ilter s   is   ap p lied ,   with   o n e - d im e n s io n al  k e r n el  o f   d im e n s io n   3   an d   R eL ac tiv atio n   f u n ctio n .   T h is   lay e r   p e r f o r m s   co n v o lu tio n   o p e r atio n   o n   th in p u t   s eq u en ce   th u s   f o r m in g   f ea t u r m ap   f o r   th v ec t o r .   Glo b alM ax Po o lin g 1 D:  T h in p u d ata  ar f e atu r m ap s   f r o m   th co n v o lu t io n al  lay er ,   th e   cu r r en lay er   in   tu r n   s elec ts   t h m ax im u m   v alu f r o m   ea c h   f ea tu r m ap ,   th u s   r ed u cin g   th d ata  v o lu m an d   h ig h lig h tin g   th m o s im p o r tan in f o r m atio n .   Dr o p o u a n d   B atch   No r m aliza tio n r em o v in g   p a r o f   t h e   n eu r o n s   an d   s tan d ar d izin g   th in p u d ata  to   s p ee d   u p   an d   r eg u late  th n etwo r k .   Den s e:  th o u tp u d ata  Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 0 8 8 - 8 7 0 8   I n t J E lec  &   C o m p   E n g ,   Vo l.   15 ,   No .   3 J u n e   20 25 :   3 3 9 6 - 3 4 0 9   3402   af ter   “scr ee n in g ”  an d   s tan d ar d izatio n   p ass es  th r o u g h   f u ll y   co n n ec te d   d en s lay er   with   2 5 6   n e u r o n s   an d   R eL ac tiv atio n   f u n ctio n .   T h is   lay er   p er f o r m s   n o n - lin ea r   tr an s f o r m atio n   o f   th in p u d at a,   en ab lin g   th e   n etwo r k   t o   lear n   co m p lex   d at r elatio n s h ip s .   Dr o p o u an d   b atch   n o r m aliza tio n :   r ep ea ted l y   r em o v in g   p a r o f   th n e u r o n s   an d   s tan d a r d izin g   th in p u d ata  to   s p ee d   u p   a n d   r e g u late  th n etwo r k .   Fig u r e   7 ( a)   d em o n s tr ates  th at  p lo t   th a cc u r ac y   a n d   Fig u r 7 ( b )   d e m o n s tr ates   th at  lo s s es  o f   th co n v o lu tio n al  n etwo r k .     T h is   m o d el  is   also   n o o v e r tr ain ed o n ca n   s ay   th at  th a cc u r ac y   v al u es  f o r   th e   tr ain in g   d ata  ar e   r elev an f o r   th e   en tire   d ataset  s in ce   th ey   c o in cid e   with   th m o d el' s   ac cu r ac y   f o r   th v alid atio n   d ata.   T h e   ac cu r ac y   o f   th e   co n v o lu tio n al   n eu r al  n etwo r k   ex ce ed s   t h a cc u r ac y   o f   th e   lo n g   s h o r t - ter m   m em o r y   n etwo r k .   Fig u r 8   d em o n s tr ates a   co m p r eh en s iv co m p ar is o n ,   let' s   o u tp u t th co n f u s io n   m atr ices f o r   th d ee p   n etwo r k s   an d   ca lcu late  th k ey   m etr ics.           Fig u r 6 .   Ar c h itectu r o f   co n v o lu tio n al  n eu r al  n etwo r k           ( a)   ( b )     Fig u r 7 .   Plo t o f   ac cu r ac y   an d   lo s s   f o r   co n v o lu tio n al  n eu r a l n etwo r k   ( a )   ac cu r ac y   an d   ( b )   lo s s           ( a)   ( b )     Fig u r 8 .   T h co n f u s io n   m atr ices f o r   ( a)   L STM   an d   ( b )   C NN    Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J E lec  &   C o m p   E n g     I SS N:   2088 - 8 7 0 8         A r tifi cia l in tellig en ce   fo r   a u to ma tic  mo d era tio n   o f te xtu a l c o n ten t …   ( S o l o miia   Lia s ko vska )   3403   Me tr ics f o r   th m o d els:   Acc u r ac y   Sco r e:  0 . 9 2 ,   Pre cisi o n   Sco r e:  0 . 8 8 ,   R ec all: 0 . 9 8 ,   F1 - Sco r e:  0 . 9 2 8   f o r   L STM .   Acc u r ac y   Sco r e:  0 . 9 5 ,   Pre cisi o n   Sco r e:  0 . 9 6 ,   R ec all: 0 . 9 4 ,   F1 - Sco r e:  0 . 9 5   f o r   C NN.     3 . 2 .     P a ra m et er s   a na ly s is ,   a nd   re s ults    B E R T   i s   a   l a n g u a g e   r e p r e s e n t a t i o n   m o d e l   d e s i g n e d   t o   c r e a t e   b i d i r e c t i o n al   r e p r e s e n ta t i o n s   f o r   d e e p   n e u r a l   n e t w o r k s   o n   r a w ,   u n a n n o t a t e d   t e x t   b y   c o m b i n i n g   l e f a n d   r i g h t   c o n te x t s   i n   al l a y e r s .   Al l   m o d el s   i n   t h B E R T   f a m i l y   u s e   a   p a r t i a l   i m p l e m e n t a ti o n   o f   t r a n s f o r m e r   m o d e l s ,   n a m e l y   e n c o d e r s ,   a s   t h e   n e t w o r k ' s   o u t p u t   i s   l a n g u a g e   m o d e l .   B E R T   is   p r e - t r a i n e d   o n   d i r t y   t e x t   d a t a ,   s o   t h e r e   i s   n o   n e e d   t o   p e r f o r m   p r e p r o c e s s i n g   t h a t   w as  u s e d   f o r   li n e a r   m o d e ls   a n d   n e u r a l   n e t w o r k s .   De n s l a y e r f u l l y   c o n n e c t e d   l a y e r   c o n s is t i n g   o f   o n e   n e u r o n   a n d   l o g i s ti c   a ct i v a ti o n   f u n c t i o n   t o   r e t u r n   t h e   p r o b a b i l it y   o f   a n   o b j e c t   b el o n g i n g   t o   a   cl a s s .   N e x s t e p   i s   t o   t r ai n   t h m o d e l   a n d   o u t p u t   t h e   c o n f u s i o n   m a t r i x   F i g u r e   9   d e m o n s tr a t e s   l o s s   a n d   a c c u r ac y   p l o ts   s i m il a r l y   t o   d e e p   n e t w o r k s .           Fig u r 9 .   T h lo s s   an d   ac c u r ac y   p lo t f o r   th B E R T - b ased   m o d el       B E R T   i s   tr ain ed   u s in g   m ask ed   to k en   p r e d ictio n   an d   n e x s en ten ce   p r ed ictio n .   T h r o u g h   t h is   tr ain in g   p r o ce s s ,   B E R T   ac q u ir es  co n tex tu al,   laten r ep r esen tatio n s   o f   to k en s   b ased   o n   th eir   co n tex t.  Fig u r 1 0   d em o n s tr ates th lo s s   an d   ac c u r ac y   p l o t f o r   th B E R T - b ased   m o d el.               Fig u r 1 0 .   T h lo s s   an d   ac cu r a cy   p lo t f o r   th B E R T - b ased   m o d el       3 . 3 .     Co m pa riso n a nd   dis cus s io n   Fo r   class if icatio n ,   we  will  u s e   th ar ch itectu r es  o f   m o d els  f o r   s p am   class if icatio n ,   b u s in ce   we  h av e   th r ee   class es   in   th d ataset,   f o r   ea ch   o f   th n etwo r k s ,   we  n ee d   to   ch an g th o u tp u lay er   an d   th lo s s   f u n ctio n .   As  th o u t p u lay e r ,   we  u s ed   d en s co n n ec ted   lay er   with   o n n e u r o n   an d   a   lo g is tic  ac tiv atio n   f u n ctio n ,   t h u s   o b tain in g   th p r o b ab ilit y   o f   a n   o b ject  b el o n g i n g   to   th tar g et  class .   Af ter   m ak in g   ch a n g es to   th e   ar ch itectu r e,   we  will  tr ain   d e ep   lear n in g   m o d els  an d   d em o n s tr ate  th lo s s   an d   ac cu r ac y   g r ap h .   Fig u r 1 1   d em o n s tr ates  ac cu r ac y   a n d   lo s s   p lo f o r   th L STM - b ased   m o d el.   Fig u r 1 2   d em o n s tr ate s   ac cu r ac y   an d   lo s s   p lo t f o r   th C NN - b ased   m o d el   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 0 8 8 - 8 7 0 8   I n t J E lec  &   C o m p   E n g ,   Vo l.   15 ,   No .   3 J u n e   20 25 :   3 3 9 6 - 3 4 0 9   3404       Fig u r 1 1 .   Acc u r ac y   an d   l o s s   p lo t f o r   th L STM - b ased   m o d el           Fig u r 1 2 .   Acc u r ac y   an d   l o s s   p lo t f o r   th C NN - b ased   m o d el       T o   an aly ze   th e   ac cu r ac y   o f   th m o d els,  we   will  ap p ly   c o n f u s io n   m atr ix .   Fig u r e   1 3   d e m o n s tr ates  co n f u s io n   m atr ices  f o r   L ST Fig u r 1 3 ( a )   an d   C NN  Fi g u r 1 3 ( b ) .   T h r esu lts   o f   th co n f u s io n   m atr ices  allo u s   to   u n d er s tan d   th p e r f o r m a n ce   o f   th m o d els.  B o th   m o d els  m ak th m o s er r o r s   wh en   class if y in g   h ate  s p ee ch ,   o f ten   m is tak in g   it  f o r   o f f en s iv lan g u ag e.   Sp ec if ically ,   th ac cu r ac y   in   class if y in g   p o s ts   co n tain in g   h ate  s p ee ch   is   lo wer   th an   th e   ac cu r ac y   in   cla s s if y in g   p o s ts   co n tain in g   o f f en s iv lan g u a g o r   “n o r m al”   p o s ts .   T h e   m o d els  p er f o r m   b est  at  d is tin g u is h in g   o f f e n s iv lan g u ag e   f r o m   r eg u lar   p o s ts .   Ov er all,   co n s id er in g   all  er r o r   v alu es,  it  ca n   b co n clu d ed   th at  th is   im p lem en tatio n   o f   th c o n v o lu ti o n al  n eu r al  n etwo r k   h an d les th task   b etter   th a n   th lo n g   s h o r t - ter m   m e m o r y   n et wo r k .           ( a)   ( b )     Fig u r 1 3 .   C o n f u s io n   m atr ices f o r   ( a )   L STM   an d   ( b )   C NN      Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J E lec  &   C o m p   E n g     I SS N:   2088 - 8 7 0 8         A r tifi cia l in tellig en ce   fo r   a u to ma tic  mo d era tio n   o f te xtu a l c o n ten t …   ( S o l o miia   Lia s ko vska )   3405   L e t' s   c o m p u t e   t h e   m et r i cs   o f   th e   m o d e l s   f o r   e a c h   c l a s s   f o r   c o m p a r i s o n ,   a n d   w e   c a n   s e e   t h e   r e s u l ts   i n   T a b l e s   1   a n d   2 .   T h es e   t a b l es  p r e s e n t h e   p e r f o r m a n c o f   th e   L S T a n d   C N m o d e l s   a c r o s s   h a t s p e e c h ,   o f f e n s i v e   l a n g u a g e ,   a n d   r e g u la r   p o s t s .   T a b l e   3   f u r t h e r   d e m o n s t r a t es   t h e   cl as s i f i c a ti o n   m et r i c s   f o r   t h e   B E R T - b a s e d   m o d e l ,   a ll o w i n g   f o r   a   c o m p r e h e n s i v e   c o m p a r i s o n   a m o n g   a l l   t h r e e   a p p r o a c h e s .   T a b l e   1   s h o w s   m et r i cs   f o r   e a c h   c l as s   o f   p u b l i c at i o n   f o r   t h e   L S T M   m o d e l .   T a b l e   2   s h o ws  f o r   e a c h   c l a s s   f o r   p u b l i c a ti o n   f o r   t h e   C NN   m o d e l .       T ab le  1 .   Me tr ics f o r   ea ch   class   o f   p u b licatio n s   f o r   th L STM   m o d el     A c c u r a c y - sc o r e   P r e c i s i o n - sc o r e   R e c a l l   F1 - sc o r e   H a t e   sp e e c h   0 . 7 5   0 . 7 8   0 . 6 2   0 . 6 9   O f f e n si v e   l a n g u a g e   0 . 7 5   0 . 8   0 . 7 1   0 . 7 5   R e g u l a r   p o st s   0 . 7 5   0 . 8   0 . 7 4 5   0 . 7 7       T ab le  2 .   Me tr ics f o r   ea ch   class   o f   p u b licatio n s   f o r   th C NN  m o d el     A c c u r a c y - sc o r e   P r e c i s i o n - sc o r e   R e c a l l   F1 - sc o r e   H a t e   sp e e c h   0 . 7 6   0 . 7 2   0 . 6 8   0 . 7 0   O f f e n si v e   l a n g u a g e   0 . 7 6   0 . 8 2   0 . 7 4   0 . 7 8   R e g u l a r   p o st s   0 . 7 6   0 . 8 1   0 . 8 1   0 . 8 1       T ab le  3 .   Me tr ics f o r   ea ch   class   o f   p u b licatio n s   f o r   th m o d el  b ased   o n   B E R T     A c c u r a c y - S c o r e   P r e c i s i o n - sc o r e   R e c a l l   F1 - sc o r e   H a t e   sp e e c h   0 . 3   0 . 3 3   0 . 3   0 . 3 1   O f f e n si v e   l a n g u a g e   0 . 3   0 . 3 5   0 . 3 2   0 . 3 3   R e g u l a r   p o st s   0 . 3   0 . 3 2   0 . 3 3   0 . 3 2       T h p r o p o s ed   ar ch itectu r e   b a s ed   o n   B E R T   f ield s   r at h er   p o o r   r esu lts .   W ca n   ass u m t h at  th is   is   r elate d   to   th e   n o n lin ea r ity   o f   d ep en d e n cies  in   tex tu al   d ata  s in ce   o u r   n etwo r k   is   ess en tially   eq u iv alen t   to   a   lin ea r   m o d el  with   s in g le  E m b ed d in g   lay er .   I n   th co n tex o f   s p am   d etec tio n ,   c o m p ar ativ s tu d y   was  co n d u cte d   f o r   lin ea r   m o d els,   d ee p   n eu r al  n etwo r k s ,   a n d   s in g le - lay er   m o d els  u s in g   th e   p r e - tr ain e d   B E R T   n etwo r k .   A d d itio n al  d atasets   wer cr ea ted   f o r   d if f er en t   tex t   r ep r esen tatio n   tech n iq u es,  n a m ely   b ag - of - w o r d s ,   n - g r am s ,   a n d   TF - I DF .   As  r e s u lt,  th r ee   p air s   o f   lo g is tic  r eg r ess io n   an d   s u p p o r v ec to r   m a ch in m o d els  wer e   tr ain ed .   All  m o d els  ac h iev ed   r ea s o n ab ly   h ig h   o v er all  ac c u r ac y ,   with   lo g is tic  r eg r ess io n   p er f o r m in g   b etter   in   id en tify in g   s p am   f o r   th s tan d ar d   b ag - of - w o r d s ,   wh ile  th s u p p o r v ec to r   m ac h i n h ad   h ig h er   m etr ics  f o r     TF - I DF .   T h lo west  o v er all  ac cu r ac y   was  o b s er v e d   f o r   th TF - I DF   d ata  f o r m at,   alth o u g h   t h g ap   i n   all  m etr ics  f o r   th th r ee   d atasets   is   n o s ig n if ican t.  Dee p   m o d el s   an d   th B E R T - b ased   m o d el  wer th en   tr ain ed .   T h co n v o lu tio n al  n eu r al  n etwo r k   m o d el  d em o n s tr ated   th h i g h est ac cu r ac y   with   a   v alu o f   0 . 9 5 .   Fo r   th class if icatio n   o f   h ate   s p ee ch   an d   o f f en s iv lan g u ag e,   we  u s ed   th s am n eu r al  n etwo r k   ar ch itectu r es  as  f o r   s p am ,   a d ap tin g   th eir   o u tp u lay e r   f o r   m u lti - class   class if icat io n   task s .   Ag ain ,   th co n v o l u tio n al  n e u r al  n etwo r k   ac h iev ed   t h h ig h est  ac cu r ac y   -   0 . 7 6 ,   wh ile  th B E R T - b a s ed   m o d el  s h o wed   v er y   lo r esu lts   -   0 . 3 .       4.   CO NCLU SI O N   T h m ain   tech n iq u es  f o r   r ep r e s en tin g   tex in   n u m er ical  f o r m at  f o r   m ac h in lear n in g   alg o r it h m s   wer in v esti g ated ,   an aly zin g   th eir   c h ar ac ter is tics ,   wo r k in g   p r in ci p les,  ad v an tag es,  a n d   d is ad v a n tag es.  T h m eth o d   o f   wo r d   v ec to r   r e p r esen tatio n   u s in g   n e u r al  n etwo r k s ,   ex em p lifie d   b y   th e   wo r d 2 v ec   m o d el,   was  d etailed .   Fo r   th ch o s en   lin ea r   m o d els lo g is tic  r eg r ess io n   an d   s u p p o r v ec to r   m ac h in es an   ex p lan at io n   o f   th eir   wo r k i n g   p r in cip les  an d   m ath em atica f o u n d atio n s   was  p r o v id e d .   T h e   d escr ip tio n   o f   co n v o lu tio n al  n eu r al  n etwo r k s   an d   th lo n g   s h o r t - ter m   m e m o r y   m eth o d   in clu d ed   th ei r   b asic  ar ch itectu r al  co m p o n e n ts ,   o p er atio n al  p r in ci p les,   an d   tr ain in g   p r o ce s s es.  T h s p ec if icity   o f   u s in g   c o n v o lu tio n a l la y er s   f o r   tex t u al  d ata  was a ls o   d is cu s s ed .   d ataset  was  s elec ted   f o r   ea ch   class if icatio n   task .   T h r ese ar ch   wo r k   in clu d es  d etailed   d escr ip tio n   o f   th e   d ata   p r ep r o ce s s in g   an d   f ea tu r e x tr ac tio n   p r o ce s s   u s in g   v ar io u s   m eth o d s .   C o r r esp o n d in g   im p lem en tatio n s   o f   m ac h in e   lear n in g   alg o r ith m s   wer tr ain ed   f o r   ea c h   d ataset,   an d   m o d el  p er f o r m a n ce   r esu lts   wer d em o n s tr ated .   I t   was  f o u n d   th at  lo g is tic  r eg r ess io n   an d   s u p p o r v ec to r   m a ch in es  ca n   class if y   s p am   with   h ig h   ac c u r ac y ,   an d   d if f er e n d ata  r ep r esen tatio n s   m in im ally   af f ec th e   m o d el  r esu lts .   Fro m   th r esear ch   f in d in g s ,   it  was  co n clu d ed   th at  d etec tin g   s p am   in   m ess ag es  is   wea k ly   d ep en d e n o n   th s em an tic   co n ten t o f   th tex t; f r eq u e n tly   u s ed   wo r d s   ca n   b cr u cial  i n d i ca to r s   o f   s p am .       Evaluation Warning : The document was created with Spire.PDF for Python.