본문 바로가기
데이터&AI

남자 vs 여자, 글쓰기 특징을 알아보자!!(feat. 네이버 댓글통계정보)

by 일등박사 2022. 1. 16.
728x90

 

그래?ㅋ
그래??^^

 

위에 두 글이 있습니다.

하나는 남성이, 하나는 여성이 쓴 글이라면, 

누가 남성, 누가 여성일까요??


이번 포스팅에서는 성별에 따른 글쓰기 특징을 알아보겠습니다!!!

근거 Data는 네이버의 13,791개 뉴스에서 크롤링한 6,688,560개 댓글들!!

 

 

결론부터 알아볼까요!??

 

 

 

 

 

 

 

ㅁ 여성의 글

사용단어 가능성
ㅠ  84.5%
84%
ㅠㅠ(연속으로) 82.4%
ㅜㅜ(연속으로) 79.9%
!!(연속으로) 73.9%
! 71.5%
^^ 68%
..(연속으로) 55.3%
. 54.2%
??(연속으로) 53.2%
~ 51.4%

 

 

 

 

 

 

 

 

ㅁ 남성의 글

사용단어 가능성
70.2%
ㅋㅋ(연속으로) 69.2%
62.8%
- 55.3%
(문장끝에) .  53.6%
? 50.8%

 

ㅁ기타 항목

- 문장이 길면 길수록 여성!

- 띄어쓰기가 많으면 많을 수록 여성!

- 대부분의 댓글은 남성!(전체 댓글의 3/4인 75%)

 

어때요??ㅎㅎ

개인적 느낌과 맞는점이 있으신가요??ㅎㅎ

 

저는ㅋ남자일까요?ㅋㅋ아니면 여성일까요?ㅎ.

 

 

 

이제 위의 결과를 구한 과정을 함께

알아봅시다!!

 

 

2022.01.09 - [일등박사의 생각/데이터분석] - 네이버의 댓글 및 댓글 통계정보 크롤링하기 (Feat. python)

 

네이버의 댓글 및 댓글 통계정보 크롤링하기 (Feat. python)

안녕하세요!!! 정보는 돈이라는 빅데이터의 시대!! 기업은 고객 데이터와 생산 데이터, 그리고 데이터 판매업체로부터 구매한 다양한 고품질의 정보들을 분석하며 재미있는 인사이트들을 많이

drfirst.tistory.com

위 포스팅을 통해 어떻게 

데이터를 수집하는지 알 수 있습니다!!

 

비록 각각의 글을 누가 쓴지 알 수는 없지만

한 뉴스 댓글 집단에 대하여

여성비중이 비교적 높은지

남성비중이 비교적 높은지를 

알 수 있고!!

 

그 데이터를 근거로 추론해 보았습니다!!^^

 

 

 

 

 

 

 

그리하여!!

1. 알아보고자하는 특성 정의

1. 문장의 길이
2. 띄어쓰기의 갯수
3. .의 개수
4. ..(연속으로)의 개소
5. (문장의 마지막에) . 인 개수
6. ㅋ의 개수
7. ㅋㅋ의 개수
8. ㅎ의 개수
9. ^^의 개수
10. - 의 개수
11. ~ 의 개수
12. !의 개수
13. !!(연속으로)의 개수
14. ?의 개수
15. ??(연속으로)의 개수
16. ㅠㅠ(연속으로)의 개수
17. ㅠ의 개수
18. ㅜ의 개수
19. ㅜㅜ(연속으로)의 개수

2. 전체 데이터에 대한 분석 시작!!

for row in range(len(df)):
    sentence_len         = 0
    space_cnt            = 0
    dot_cnt              = 0
    dotdot_cnt           = 0
    finaldot_cnt         = 0
    z_cnt                = 0
    zz_cnt               = 0
    h_cnt                = 0
    smile_cnt            = 0
    wave_cnt             = 0
    dasi_cnt             = 0
    strong_cnt           = 0
    strongstrong_cnt     = 0
    wuwu_cnt             = 0
    wu_cnt               = 0
    yuyu_cnt             = 0
    yu_cnt               = 0
    question_cnt         = 0
    questionquestion_cnt = 0

    per_sentence_len         = 0
    per_space_cnt            = 0
    per_dot_cnt              = 0
    per_dotdot_cnt           = 0
    per_z_cnt                = 0
    per_zz_cnt               = 0
    per_h_cnt                = 0
    per_smile_cnt            = 0
    per_wave_cnt             = 0
    per_dasi_cnt             = 0
    per_strong_cnt           = 0
    per_strongstrong_cnt     = 0
    per_wuwu_cnt             = 0
    per_wu_cnt               = 0
    per_yuyu_cnt             = 0
    per_yu_cnt               = 0
    per_question_cnt         = 0
    per_questionquestion_cnt = 0
    
    for i in range(len(df['reply_all'][row])):
        sentence_len         += len(df['reply_all'][row][i])
        if  len(df['reply_all'][row][i])!= 0:
            
            
            space_cnt            += df['reply_all'][row][i].count(' ')   
            dot_cnt              += df['reply_all'][row][i].count('.')   
            dotdot_cnt           += df['reply_all'][row][i].count('..')  
            z_cnt                += df['reply_all'][row][i].count('ㅋ')   
            zz_cnt               += df['reply_all'][row][i].count('ㅋㅋ')
            h_cnt                += df['reply_all'][row][i].count('ㅎ')   
            smile_cnt            += df['reply_all'][row][i].count('^^')  
            wave_cnt             += df['reply_all'][row][i].count('~')   
            dasi_cnt             += df['reply_all'][row][i].count('-')   
            strong_cnt           += df['reply_all'][row][i].count('!')    
            strongstrong_cnt     += df['reply_all'][row][i].count('!!')  
            wuwu_cnt             += df['reply_all'][row][i].count('ㅜㅜ') 
            wu_cnt               += df['reply_all'][row][i].count('ㅜ')   
            yuyu_cnt             += df['reply_all'][row][i].count('ㅠㅠ') 
            yu_cnt               += df['reply_all'][row][i].count('ㅠ')   
            question_cnt         += df['reply_all'][row][i].count('?')   
            questionquestion_cnt += df['reply_all'][row][i].count('??')  
            finaldot_cnt         += 1 if df['reply_all'][row][i][-1] == '.' else 0
            
            
            per_space_cnt            += df['reply_all'][row][i].count(' ')    / len(df['reply_all'][row][i])
            per_dot_cnt              += df['reply_all'][row][i].count('.')    / len(df['reply_all'][row][i])
            per_dotdot_cnt           += df['reply_all'][row][i].count('..')   / len(df['reply_all'][row][i])
            per_z_cnt                += df['reply_all'][row][i].count('ㅋ')   / len(df['reply_all'][row][i])
            per_zz_cnt               += df['reply_all'][row][i].count('ㅋㅋ') / len(df['reply_all'][row][i])
            per_h_cnt                += df['reply_all'][row][i].count('ㅎ')   / len(df['reply_all'][row][i])
            per_smile_cnt            += df['reply_all'][row][i].count('^^')   / len(df['reply_all'][row][i])
            per_wave_cnt             += df['reply_all'][row][i].count('~')    / len(df['reply_all'][row][i])
            per_dasi_cnt             += df['reply_all'][row][i].count('-')    / len(df['reply_all'][row][i])
            per_strong_cnt           += df['reply_all'][row][i].count('!')    / len(df['reply_all'][row][i]) 
            per_strongstrong_cnt     += df['reply_all'][row][i].count('!!')   / len(df['reply_all'][row][i])
            per_wuwu_cnt             += df['reply_all'][row][i].count('ㅜㅜ') / len(df['reply_all'][row][i])
            per_wu_cnt               += df['reply_all'][row][i].count('ㅜ')   / len(df['reply_all'][row][i])
            per_yuyu_cnt             += df['reply_all'][row][i].count('ㅠㅠ') / len(df['reply_all'][row][i])
            per_yu_cnt               += df['reply_all'][row][i].count('ㅠ')   / len(df['reply_all'][row][i])
            per_question_cnt         += df['reply_all'][row][i].count('?')    / len(df['reply_all'][row][i])
            per_questionquestion_cnt += df['reply_all'][row][i].count('??')   / len(df['reply_all'][row][i])

    sentence_len         /= len(df['reply_all'][row])
    space_cnt            /= len(df['reply_all'][row])
    dot_cnt              /= len(df['reply_all'][row])
    dotdot_cnt           /= len(df['reply_all'][row])
    z_cnt                /= len(df['reply_all'][row])
    zz_cnt               /= len(df['reply_all'][row])
    h_cnt                /= len(df['reply_all'][row])
    smile_cnt            /= len(df['reply_all'][row])
    wave_cnt             /= len(df['reply_all'][row])
    dasi_cnt             /= len(df['reply_all'][row])
    strong_cnt           /= len(df['reply_all'][row])
    strongstrong_cnt     /= len(df['reply_all'][row])
    wuwu_cnt             /= len(df['reply_all'][row])
    wu_cnt               /= len(df['reply_all'][row])
    yuyu_cnt             /= len(df['reply_all'][row])
    yu_cnt               /= len(df['reply_all'][row])
    question_cnt         /= len(df['reply_all'][row])
    questionquestion_cnt /= len(df['reply_all'][row])
    finaldot_cnt         /= len(df['reply_all'][row])
    

    per_space_cnt            /= len(df['reply_all'][row])
    per_dot_cnt              /= len(df['reply_all'][row])
    per_dotdot_cnt           /= len(df['reply_all'][row])
    per_z_cnt                /= len(df['reply_all'][row])
    per_zz_cnt               /= len(df['reply_all'][row])
    per_h_cnt                /= len(df['reply_all'][row])
    per_smile_cnt            /= len(df['reply_all'][row])
    per_wave_cnt             /= len(df['reply_all'][row])
    per_dasi_cnt             /= len(df['reply_all'][row])
    per_strong_cnt           /= len(df['reply_all'][row])
    per_strongstrong_cnt     /= len(df['reply_all'][row])
    per_wuwu_cnt             /= len(df['reply_all'][row])
    per_wu_cnt               /= len(df['reply_all'][row])
    per_yuyu_cnt             /= len(df['reply_all'][row])
    per_yu_cnt               /= len(df['reply_all'][row])
    per_question_cnt         /= len(df['reply_all'][row])
    per_questionquestion_cnt /= len(df['reply_all'][row])

    df.loc[row,'sentence_len'] = sentence_len
    df.loc[row,'space_cnt'] = space_cnt
    df.loc[row,'dot_cnt'] = dot_cnt
    df.loc[row,'dotdot_cnt'] = dotdot_cnt
    df.loc[row,'finaldot_cnt'] = finaldot_cnt
    df.loc[row,'z_cnt'] = z_cnt
    df.loc[row,'zz_cnt'] = zz_cnt
    df.loc[row,'h_cnt'] = h_cnt
    df.loc[row,'smile_cnt'] = smile_cnt
    df.loc[row,'wave_cnt'] = wave_cnt
    df.loc[row,'dasi_cnt'] = dasi_cnt
    df.loc[row,'strong_cnt'] = strong_cnt
    df.loc[row,'strongstrong_cnt'] = strongstrong_cnt
    df.loc[row,'wuwu_cnt'] = wuwu_cnt
    df.loc[row,'wu_cnt'] = wu_cnt
    df.loc[row,'yuyu_cnt'] = yuyu_cnt
    df.loc[row,'yu_cnt'] = yu_cnt
    df.loc[row,'question_cnt'] = question_cnt
    df.loc[row,'questionquestion_cnt'] = questionquestion_cnt


    df.loc[row,'per_space_cnt']            =  per_space_cnt           
    df.loc[row,'per_dot_cnt']              =  per_dot_cnt             
    df.loc[row,'per_dotdot_cnt']           =  per_dotdot_cnt          
    df.loc[row,'per_z_cnt']                =  per_z_cnt               
    df.loc[row,'per_zz_cnt']               =  per_zz_cnt              
    df.loc[row,'per_h_cnt']                =  per_h_cnt               
    df.loc[row,'per_smile_cnt']            =  per_smile_cnt           
    df.loc[row,'per_wave_cnt']             =  per_wave_cnt            
    df.loc[row,'per_dasi_cnt']             =  per_dasi_cnt            
    df.loc[row,'per_strong_cnt']           =  per_strong_cnt          
    df.loc[row,'per_strongstrong_cnt']     =  per_strongstrong_cnt    
    df.loc[row,'per_wuwu_cnt']             =  per_wuwu_cnt            
    df.loc[row,'per_wu_cnt']               =  per_wu_cnt              
    df.loc[row,'per_yuyu_cnt']             =  per_yuyu_cnt            
    df.loc[row,'per_yu_cnt']               =  per_yu_cnt              
    df.loc[row,'per_question_cnt']         =  per_question_cnt        
    df.loc[row,'per_questionquestion_cnt'] =  per_questionquestion_cnt

3. 주요 데이터 추출

 

 

4. 상관관계 분석!!!!

 

다음번 포스팅에서는

세대별 글쓰기 차이를 알아보겠습니다!

감사합니다!!^^

 

 

 

 

 

 

 

 

 

 

728x90

댓글