SlideShare a Scribd company logo
문장 벡터와 전방향 신경망을
이용한 스팸 문자 필터링
2017. 10. 14
Hyun-Young Lee, Seung-Shik Kang
Dept. of Computer Science, Kookmin University
01 개요
1.1 스팸 문자 메시지
1.2 단어 임베딩
02 스팸 문자 메시지 필터링 과정
2.1 자동띄기
2.2 단어 벡터 & 문장 벡터
2.3 전방향 신경망을 이용한 필터링
03 실험 및 결과
3.1 전방향 신경망 vs SVM light
목차
01 개요
1-1
01 스팸 문자 메시지
1) 스팸 문자 메시지의 지능화
① 한국어는 새로운 단어 및 줄임말 생성, 단어 변화에 있어서 자유롭다.
② 이를 이용한 단어의 패턴은 점차 지능해지고 있고, 사용자가 직접 차단 문구등을 등록해 스팸 문자를 차단 방식은
효율성이 낮다.
- 예를 들어, O1야ㄱl, 사♥랑, 경★ㅁr, ㅇk동, 0ㅑ동
스팸 문자 메시지
4 / 12
1-2
01 단어 임베딩
1) 단어 벡터
① 단어 벡터를 통한 자연어 처리의 저주인 차원 수 및 메모리에 효율성 증가
② Word2Vec을 통한 단어에 의미론적 접근이 가능하여, 동의어 처리 및 단어 유사도 평가에서 우수한 효과
를 보여준다.
- 단어의 의미는 같이 쓰이는 Context에 따라 추론 (distribution hypothesis)
단어 임베딩
5 / 12
02 스팸 문자 메시지 필터링 과정
2-1
01 스팸 문자 메시지 필터링 과정
스팸 문자 메시지 필터링 과정
7 / 12
자동 띄어
쓰기
Word2Vec Sen2Vec
FFNN
(전방향
신경망)
문장
HAM
SPAM
2-2
01 자동 띄어쓰기
1) 문자메시지 자동 띄어쓰기
① 사용자들이 띄어쓰지 않고 보내는 문자 메시지를 기반으로 Word2Vec를 생성시 무수히 많은 Word를 생성한다. 그
리고 그 Word들은 빈도수가 낮은 경향이 나타난다.
② 띄어 쓰기를 적용하지 않고 Word2Vec을 적용하면 아래와 같다.
- 예를 들어, “#/교/수/항/시/대/기#New”, 그리고 “좋은밤되세요내용없음”를 하나의 토큰으로 처리하게 된다. 이
를 예방하기 위해 띄어쓰기를 적용,
“#/교/수/항/시/대/기#New” -> “#/교/수/항/시/대/기#” ”New”, “좋은밤되세요내용없음” -> “좋은 밤 되세요 내용 없음”
자동 띄어쓰기
8 / 12
2-3 단어 벡터 및 문장 벡터
01 단어 벡터 및 문장 벡터
1) 단어벡터(Word2Vec)
• 본중심 단어의 주변 Context를 기반을 중심 단어 임베딩하여 중심단어 벡터를 구한다. (CBOW)
• 이 외에도 단어 임베딩으로는 GloVe, Skim-gram
2) 문장 벡터(Sen2Vec (Bag-of-word))
• 본문장을 구성하는 단어의 벡터화
• v(“natural language processing”) = v(“natural”) + v(“language”) + v(“processing”)
9 / 12
2-4
01 신경망 구조
전방향 신경망(Feedforward Neural Network)
10 / 12
1) 신경망 구조는 선형적 구조 + 비선형적 구조
• 선형적 구조 : F(x) = Wx + b
• 비선형 구조 : G(x) = Activation(x)
• Activation 후 새로운 벡터로 표현, 즉 그 전의 벡터를 선형적으로 분류가 가능하도록 약간 비튼다. (Topology)
• 예를 들어, sigmoid, Tanh 그리고 ReLU 등이 존재한다.
Activation 후
2-5 전방향 신경망(Feedforward Neural Network)
2) 전방향 신경망 구조(Feedforward Neural Network)
• 전반향 신경망 구조는 선형적 + 비선형적 함수의 조합을 통해서 비선형적 분류를 가능하게한다.
• 최종 Output 과 cost function(Cross-entropy with Softmax)를 가지고 Classification을 수행한다.
• Update method : Gradient Descent and so on
11 / 12
Softmax
03 실험 및 결과
3-1 실험 및 결과
02 내용 제목
1) 실험 (SVM light vs 전방향 신경망(FFNN))
• Word2Vec을 통해 생성된 워드벡터 이를 이용한 문장벡터 생성
• 문장 벡터를 기반으로 스팸 문자 메시지 필터링
• SVM light vs 전방향 신경망(FFNN)
• 전방향 신경망 : Hidden Layer 수, Activation function(sigmoid), cost function(cross entropy),
Update method(Gradient Descent)
2) 결과
• 전뱡향 신경망은 Hidden Layer 수를 증가 시킴으로써 스팸 문자 메시지 필터링은 증가 하였다.
• 하지만, Hidden Layer 수의 증가할 수록 정확도 증가 폭은 감소한다.
13 / 12
감사합니다.

More Related Content

Similar to Spam text message filtering by using sen2 vec and feedforward neural network

파이썬과 자연어 4 | word/doc2vec
파이썬과 자연어 4 | word/doc2vec파이썬과 자연어 4 | word/doc2vec
파이썬과 자연어 4 | word/doc2vec
김용범 | 무영인터내쇼날
 
(Papers Review)CNN for sentence classification
(Papers Review)CNN for sentence classification(Papers Review)CNN for sentence classification
(Papers Review)CNN for sentence classification
MYEONGGYU LEE
 
[224] backend 개발자의 neural machine translation 개발기 김상경
[224] backend 개발자의 neural machine translation 개발기 김상경[224] backend 개발자의 neural machine translation 개발기 김상경
[224] backend 개발자의 neural machine translation 개발기 김상경
NAVER D2
 
Natural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - BasicNatural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - Basic
KyeongUkJang
 
230112_word2vec1_논문리뷰.pdf
230112_word2vec1_논문리뷰.pdf230112_word2vec1_논문리뷰.pdf
230112_word2vec1_논문리뷰.pdf
minalang
 
자연어4 | 1차강의
자연어4 | 1차강의자연어4 | 1차강의
자연어4 | 1차강의
김용범 | 무영인터내쇼날
 

Similar to Spam text message filtering by using sen2 vec and feedforward neural network (6)

파이썬과 자연어 4 | word/doc2vec
파이썬과 자연어 4 | word/doc2vec파이썬과 자연어 4 | word/doc2vec
파이썬과 자연어 4 | word/doc2vec
 
(Papers Review)CNN for sentence classification
(Papers Review)CNN for sentence classification(Papers Review)CNN for sentence classification
(Papers Review)CNN for sentence classification
 
[224] backend 개발자의 neural machine translation 개발기 김상경
[224] backend 개발자의 neural machine translation 개발기 김상경[224] backend 개발자의 neural machine translation 개발기 김상경
[224] backend 개발자의 neural machine translation 개발기 김상경
 
Natural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - BasicNatural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - Basic
 
230112_word2vec1_논문리뷰.pdf
230112_word2vec1_논문리뷰.pdf230112_word2vec1_논문리뷰.pdf
230112_word2vec1_논문리뷰.pdf
 
자연어4 | 1차강의
자연어4 | 1차강의자연어4 | 1차강의
자연어4 | 1차강의
 

More from hyunyoung Lee

(Presentation)NLP Pretraining models based on deeplearning -BERT, GPT, and BART
(Presentation)NLP Pretraining models based on deeplearning -BERT, GPT, and BART(Presentation)NLP Pretraining models based on deeplearning -BERT, GPT, and BART
(Presentation)NLP Pretraining models based on deeplearning -BERT, GPT, and BART
hyunyoung Lee
 
(Paper Seminar) Cross-lingual_language_model_pretraining
(Paper Seminar) Cross-lingual_language_model_pretraining(Paper Seminar) Cross-lingual_language_model_pretraining
(Paper Seminar) Cross-lingual_language_model_pretraining
hyunyoung Lee
 
(Paper Seminar detailed version) BART: Denoising Sequence-to-Sequence Pre-tra...
(Paper Seminar detailed version) BART: Denoising Sequence-to-Sequence Pre-tra...(Paper Seminar detailed version) BART: Denoising Sequence-to-Sequence Pre-tra...
(Paper Seminar detailed version) BART: Denoising Sequence-to-Sequence Pre-tra...
hyunyoung Lee
 
(Paper Seminar short version) BART: Denoising Sequence-to-Sequence Pre-traini...
(Paper Seminar short version) BART: Denoising Sequence-to-Sequence Pre-traini...(Paper Seminar short version) BART: Denoising Sequence-to-Sequence Pre-traini...
(Paper Seminar short version) BART: Denoising Sequence-to-Sequence Pre-traini...
hyunyoung Lee
 
(Paper seminar)Learned in Translation: Contextualized Word Vectors
(Paper seminar)Learned in Translation: Contextualized Word Vectors(Paper seminar)Learned in Translation: Contextualized Word Vectors
(Paper seminar)Learned in Translation: Contextualized Word Vectors
hyunyoung Lee
 
(Paper seminar)Retrofitting word vector to semantic lexicons
(Paper seminar)Retrofitting word vector to semantic lexicons(Paper seminar)Retrofitting word vector to semantic lexicons
(Paper seminar)Retrofitting word vector to semantic lexicons
hyunyoung Lee
 
(Paper seminar)real-time personalization using embedding for search ranking a...
(Paper seminar)real-time personalization using embedding for search ranking a...(Paper seminar)real-time personalization using embedding for search ranking a...
(Paper seminar)real-time personalization using embedding for search ranking a...
hyunyoung Lee
 
Neural machine translation inspired binary code similarity comparison beyond ...
Neural machine translation inspired binary code similarity comparison beyond ...Neural machine translation inspired binary code similarity comparison beyond ...
Neural machine translation inspired binary code similarity comparison beyond ...
hyunyoung Lee
 
Language grounding and never-ending language learning
Language grounding and never-ending language learningLanguage grounding and never-ending language learning
Language grounding and never-ending language learning
hyunyoung Lee
 
Glove global vectors for word representation
Glove global vectors for word representationGlove global vectors for word representation
Glove global vectors for word representation
hyunyoung Lee
 
Word embedding method of sms messages for spam message filtering
Word embedding method of sms messages for spam message filteringWord embedding method of sms messages for spam message filtering
Word embedding method of sms messages for spam message filtering
hyunyoung Lee
 
Memory Networks
Memory NetworksMemory Networks
Memory Networks
hyunyoung Lee
 
Word embeddings
Word embeddingsWord embeddings
Word embeddings
hyunyoung Lee
 
How to use tensorflow
How to use tensorflowHow to use tensorflow
How to use tensorflow
hyunyoung Lee
 
Natural language processing open seminar For Tensorflow usage
Natural language processing open seminar For Tensorflow usageNatural language processing open seminar For Tensorflow usage
Natural language processing open seminar For Tensorflow usage
hyunyoung Lee
 
large-scale and language-oblivious code authorship identification
large-scale and language-oblivious code authorship identificationlarge-scale and language-oblivious code authorship identification
large-scale and language-oblivious code authorship identification
hyunyoung Lee
 
Word2Vec
Word2VecWord2Vec
Word2Vec
hyunyoung Lee
 
NLTK practice with nltk book
NLTK practice with nltk bookNLTK practice with nltk book
NLTK practice with nltk book
hyunyoung Lee
 
Skip gram and cbow
Skip gram and cbowSkip gram and cbow
Skip gram and cbow
hyunyoung Lee
 
SVM light and SVM Multiclass Practice
SVM light and SVM Multiclass PracticeSVM light and SVM Multiclass Practice
SVM light and SVM Multiclass Practice
hyunyoung Lee
 

More from hyunyoung Lee (20)

(Presentation)NLP Pretraining models based on deeplearning -BERT, GPT, and BART
(Presentation)NLP Pretraining models based on deeplearning -BERT, GPT, and BART(Presentation)NLP Pretraining models based on deeplearning -BERT, GPT, and BART
(Presentation)NLP Pretraining models based on deeplearning -BERT, GPT, and BART
 
(Paper Seminar) Cross-lingual_language_model_pretraining
(Paper Seminar) Cross-lingual_language_model_pretraining(Paper Seminar) Cross-lingual_language_model_pretraining
(Paper Seminar) Cross-lingual_language_model_pretraining
 
(Paper Seminar detailed version) BART: Denoising Sequence-to-Sequence Pre-tra...
(Paper Seminar detailed version) BART: Denoising Sequence-to-Sequence Pre-tra...(Paper Seminar detailed version) BART: Denoising Sequence-to-Sequence Pre-tra...
(Paper Seminar detailed version) BART: Denoising Sequence-to-Sequence Pre-tra...
 
(Paper Seminar short version) BART: Denoising Sequence-to-Sequence Pre-traini...
(Paper Seminar short version) BART: Denoising Sequence-to-Sequence Pre-traini...(Paper Seminar short version) BART: Denoising Sequence-to-Sequence Pre-traini...
(Paper Seminar short version) BART: Denoising Sequence-to-Sequence Pre-traini...
 
(Paper seminar)Learned in Translation: Contextualized Word Vectors
(Paper seminar)Learned in Translation: Contextualized Word Vectors(Paper seminar)Learned in Translation: Contextualized Word Vectors
(Paper seminar)Learned in Translation: Contextualized Word Vectors
 
(Paper seminar)Retrofitting word vector to semantic lexicons
(Paper seminar)Retrofitting word vector to semantic lexicons(Paper seminar)Retrofitting word vector to semantic lexicons
(Paper seminar)Retrofitting word vector to semantic lexicons
 
(Paper seminar)real-time personalization using embedding for search ranking a...
(Paper seminar)real-time personalization using embedding for search ranking a...(Paper seminar)real-time personalization using embedding for search ranking a...
(Paper seminar)real-time personalization using embedding for search ranking a...
 
Neural machine translation inspired binary code similarity comparison beyond ...
Neural machine translation inspired binary code similarity comparison beyond ...Neural machine translation inspired binary code similarity comparison beyond ...
Neural machine translation inspired binary code similarity comparison beyond ...
 
Language grounding and never-ending language learning
Language grounding and never-ending language learningLanguage grounding and never-ending language learning
Language grounding and never-ending language learning
 
Glove global vectors for word representation
Glove global vectors for word representationGlove global vectors for word representation
Glove global vectors for word representation
 
Word embedding method of sms messages for spam message filtering
Word embedding method of sms messages for spam message filteringWord embedding method of sms messages for spam message filtering
Word embedding method of sms messages for spam message filtering
 
Memory Networks
Memory NetworksMemory Networks
Memory Networks
 
Word embeddings
Word embeddingsWord embeddings
Word embeddings
 
How to use tensorflow
How to use tensorflowHow to use tensorflow
How to use tensorflow
 
Natural language processing open seminar For Tensorflow usage
Natural language processing open seminar For Tensorflow usageNatural language processing open seminar For Tensorflow usage
Natural language processing open seminar For Tensorflow usage
 
large-scale and language-oblivious code authorship identification
large-scale and language-oblivious code authorship identificationlarge-scale and language-oblivious code authorship identification
large-scale and language-oblivious code authorship identification
 
Word2Vec
Word2VecWord2Vec
Word2Vec
 
NLTK practice with nltk book
NLTK practice with nltk bookNLTK practice with nltk book
NLTK practice with nltk book
 
Skip gram and cbow
Skip gram and cbowSkip gram and cbow
Skip gram and cbow
 
SVM light and SVM Multiclass Practice
SVM light and SVM Multiclass PracticeSVM light and SVM Multiclass Practice
SVM light and SVM Multiclass Practice
 

Spam text message filtering by using sen2 vec and feedforward neural network

  • 1. 문장 벡터와 전방향 신경망을 이용한 스팸 문자 필터링 2017. 10. 14 Hyun-Young Lee, Seung-Shik Kang Dept. of Computer Science, Kookmin University
  • 2. 01 개요 1.1 스팸 문자 메시지 1.2 단어 임베딩 02 스팸 문자 메시지 필터링 과정 2.1 자동띄기 2.2 단어 벡터 & 문장 벡터 2.3 전방향 신경망을 이용한 필터링 03 실험 및 결과 3.1 전방향 신경망 vs SVM light 목차
  • 4. 1-1 01 스팸 문자 메시지 1) 스팸 문자 메시지의 지능화 ① 한국어는 새로운 단어 및 줄임말 생성, 단어 변화에 있어서 자유롭다. ② 이를 이용한 단어의 패턴은 점차 지능해지고 있고, 사용자가 직접 차단 문구등을 등록해 스팸 문자를 차단 방식은 효율성이 낮다. - 예를 들어, O1야ㄱl, 사♥랑, 경★ㅁr, ㅇk동, 0ㅑ동 스팸 문자 메시지 4 / 12
  • 5. 1-2 01 단어 임베딩 1) 단어 벡터 ① 단어 벡터를 통한 자연어 처리의 저주인 차원 수 및 메모리에 효율성 증가 ② Word2Vec을 통한 단어에 의미론적 접근이 가능하여, 동의어 처리 및 단어 유사도 평가에서 우수한 효과 를 보여준다. - 단어의 의미는 같이 쓰이는 Context에 따라 추론 (distribution hypothesis) 단어 임베딩 5 / 12
  • 6. 02 스팸 문자 메시지 필터링 과정
  • 7. 2-1 01 스팸 문자 메시지 필터링 과정 스팸 문자 메시지 필터링 과정 7 / 12 자동 띄어 쓰기 Word2Vec Sen2Vec FFNN (전방향 신경망) 문장 HAM SPAM
  • 8. 2-2 01 자동 띄어쓰기 1) 문자메시지 자동 띄어쓰기 ① 사용자들이 띄어쓰지 않고 보내는 문자 메시지를 기반으로 Word2Vec를 생성시 무수히 많은 Word를 생성한다. 그 리고 그 Word들은 빈도수가 낮은 경향이 나타난다. ② 띄어 쓰기를 적용하지 않고 Word2Vec을 적용하면 아래와 같다. - 예를 들어, “#/교/수/항/시/대/기#New”, 그리고 “좋은밤되세요내용없음”를 하나의 토큰으로 처리하게 된다. 이 를 예방하기 위해 띄어쓰기를 적용, “#/교/수/항/시/대/기#New” -> “#/교/수/항/시/대/기#” ”New”, “좋은밤되세요내용없음” -> “좋은 밤 되세요 내용 없음” 자동 띄어쓰기 8 / 12
  • 9. 2-3 단어 벡터 및 문장 벡터 01 단어 벡터 및 문장 벡터 1) 단어벡터(Word2Vec) • 본중심 단어의 주변 Context를 기반을 중심 단어 임베딩하여 중심단어 벡터를 구한다. (CBOW) • 이 외에도 단어 임베딩으로는 GloVe, Skim-gram 2) 문장 벡터(Sen2Vec (Bag-of-word)) • 본문장을 구성하는 단어의 벡터화 • v(“natural language processing”) = v(“natural”) + v(“language”) + v(“processing”) 9 / 12
  • 10. 2-4 01 신경망 구조 전방향 신경망(Feedforward Neural Network) 10 / 12 1) 신경망 구조는 선형적 구조 + 비선형적 구조 • 선형적 구조 : F(x) = Wx + b • 비선형 구조 : G(x) = Activation(x) • Activation 후 새로운 벡터로 표현, 즉 그 전의 벡터를 선형적으로 분류가 가능하도록 약간 비튼다. (Topology) • 예를 들어, sigmoid, Tanh 그리고 ReLU 등이 존재한다. Activation 후
  • 11. 2-5 전방향 신경망(Feedforward Neural Network) 2) 전방향 신경망 구조(Feedforward Neural Network) • 전반향 신경망 구조는 선형적 + 비선형적 함수의 조합을 통해서 비선형적 분류를 가능하게한다. • 최종 Output 과 cost function(Cross-entropy with Softmax)를 가지고 Classification을 수행한다. • Update method : Gradient Descent and so on 11 / 12 Softmax
  • 12. 03 실험 및 결과
  • 13. 3-1 실험 및 결과 02 내용 제목 1) 실험 (SVM light vs 전방향 신경망(FFNN)) • Word2Vec을 통해 생성된 워드벡터 이를 이용한 문장벡터 생성 • 문장 벡터를 기반으로 스팸 문자 메시지 필터링 • SVM light vs 전방향 신경망(FFNN) • 전방향 신경망 : Hidden Layer 수, Activation function(sigmoid), cost function(cross entropy), Update method(Gradient Descent) 2) 결과 • 전뱡향 신경망은 Hidden Layer 수를 증가 시킴으로써 스팸 문자 메시지 필터링은 증가 하였다. • 하지만, Hidden Layer 수의 증가할 수록 정확도 증가 폭은 감소한다. 13 / 12