SlideShare a Scribd company logo
1 of 19
羅小黒戦記
--ぼくが選ぶ未来
映画コメントを分析してみた
Members data #7
1月22日
名前: Jorey
仕事: 自然言語処理会社の元データアナリストの初心者
ブログ: https://littlevoice-g-string.github.io/Jorey-s-Blog/
Twitter: LittleVoice-g-string(@joreyooooolo)
この映画を見た人しかわか
らない映画の特徴を明らか
にした上でおすすめる
羅小黒戦記 ぼくが選ぶ未来
上映日:2019年09月20日
製作国:中国
シリーズ動画初放送:2011年3月
最新放送:2020年11月21日(28.5
話)
平均放送時間:5分/話
1.映画を紹介させてください
〇〇の人に絶賛
おすすめ!!!
本プロジェクトの目的
ユーザーによるスコアが付
けられていないコメントに
スコアを付けていく
4.2の評価ってホント?
2.データを取ってきました
コメントソース:
https://filmarks.com/movies/86613
2.データを取ってきました
行った処理
1. ページごと自動的にデータを取得する処理
2. ネタバレあり・なしデータの別々取得
3. コメント・スコア・ユーザー名・登録頻度情報の取得
4. 使用モジュール:selenium
def find_texts(times,url):
texts = [] #コメント
scores = [] #スコア
users = [] #ユーザー名
conditions = [] #ユーザー登録頻度
for i in range(1,int(times)):
browser.get(url+str(i))
element_text = browser.find_elements('css
selector','.p-mark__review’)
element_score = browser.find_elements('css
selector','.c-rating__score')
text = [m.text for m in element_text]
score = [l.text for l in element_score]
user = [n.get_attribute('alt') for n in
browser.find_elements_by_tag_name('img')]
condition = [c.get_attribute('loading') for c in
browser.find_elements_by_tag_name('img')]
texts.append(text)
scores.append(score[1:11])
users.append(user[3:13])
conditions.append(condition[3:13])
return texts,scores,users,conditions
3.登場人物と関連テーマ
行った処理
• テーマごとのワードクラウド
• 任意キーワードを入力することで、ワードクラウドを自動生
成してくれる簡易GUI作成
3.登場人物と関連テーマ
シャオヘイ ムゲン フーシー
人間 妖精 ジブリ
A.テーマごとのワードクラウド
3.登場人物と関連テーマ
text_kw=' '.join(' '.join(''.join(df['text'].to_list()).split('、')).split('。')).split()
A.テーマごとのワードクラウド_文書レベルをSentenceレベルに分割
3.登場人物と関連テーマ
シャオヘイ ムゲン フーシー
人間 妖精 ジブリ
A.テーマごとのワードクラウド_文書レベルをSentenceレベルに分割
3.登場人物と関連テーマ
日本 中国 アクション
A.テーマごとのワードクラウド_文書レベルをSentenceレベルに分割
3.登場人物と関連テーマ
app = Tk()
_input=tk.Entry(app,show=None) #入力画面の設定
_input.pack()
app.title('キーワード入力')
screenwidth = app.winfo_screenwidth()
screenheight = app.winfo_screenheight()
dialog_width = 400
dialog_height = 170
app.geometry(
"%dx%d+%d+%d" % (dialog_width, dialog_height, (screenwidth - dialog_width) / 2,
(screenheight - dialog_height) / 2))
btn = Button(text ='search',command = get_data,width = 10)
btn.place(x=155,y = 80)
btn.pack()
app.mainloop()
B.任意キーワードを入力することで、ワードクラウドを自動生成してくれる簡易GUI
4.極性辞書による感情分析
A.単語感情極性対応表でスコアを付く
行った処理
A. 単語感情極性対応表でスコアを付く
B. 極性辞書を生成した上でスコアを付く
参考記事:
• 感情分析でニュース記事のネガポジ度合いをスコア化する
https://qiita.com/g-k/items/e49f68d7e2fed6e300ea
使用極性辞書:
• 単語感情極性対応表
http://www.lr.pi.titech.ac.jp/~takamura/pndic_ja.html
#データからの生成
#単語感情極性対応表
テキスト 累計標準化スコア score_byuser
え好き NaN 4
好きです NaN 5
4.極性辞書による感情分析
参考記事:
• 感情分析に用いる極性辞書を自動生成する
https://qiita.com/g-k/items/1b7c765fa6520297ca7c
使用言語モデル:
• fastTextの学習済みモデル
https://qiita.com/Hironsan/items/513b9f93752ecee9e670
B.極性辞書を生成した上でスコアを付く
#上位5件
1. 戦目新宿バルト戦目t・ジョイプリンス品川戦目新宿バルト戦目新宿バルト戦
目チネチッタ川崎戦目チネチッタ川崎最新字幕版戦目チネチッタ川崎最新字
幕版’,
2. '久しぶりにちゃんとしたアニメーション映画を観たなっていう感じだった’,
3. '期待どおり最高。ストーリー、キャラ、アクション、テンポ感、会話の掛け
合い、声優来場者特典イラストカード。’,
4. '可愛い絵が綺麗可愛いアクションシーンがすごい可愛い面白い可愛い可愛い
可愛い’,
5. '『ドラゴンボールブロリー』並みのアクションバトルシーンに圧巻',
#下位5件
1. ソフト化未定ってどういうことやアニプレックスなんとかしてくれや’,
2. 'アニメーションはすごく迫力がありキャラクターも可愛らしく大変楽しめた
がblm運動や香港のデモのことなどが頭によぎりマイノリティの過激派と穏健
派の対立という物語はもう古いというかマジョリティによるステレオタイプ
の再生産じゃ無いかと思ってしまった’,
3. 'ひたすらかわいい、しかもアクションが楽しい字幕のスピード、大きさ、色
がいつもの映画のそれとは違ってて追えない箇所が多かった’,
4. '森になる森になるしかなかった森になるしかなかった人はどうすればいいの
か’,
5. 'とにかくシャオヘイがかわいい話が進むにつれて変化するムゲンとの関係も
見ていて楽しかった'
〇〇だが、
〇〇
ソフト化希
望→ポジ
シャオヘイ、ム
ゲンという単語
自体はネガと判
定
4.極性辞書による感情分析
B.極性辞書を生成した上でスコアを付く
行った処理:
1. ソフト化希望→ポジ
• 下位に来ているポジ的な単語を辞書に追加。→未改善
2. 〇〇だが、〇〇
• 中盤スコアを除き、極性スコアの高いポジネガスコア
のみの加算。→一部改善あり
3. シャオヘイ、ムゲンという単語自体はネガと判定
• 対策案を今後の課題にする
5.機械学習による感情分析(LSTM)
ネガ ポジ
教師データ
(17:1)
2174件 170件
検証データ 128件 10件
テストデータ 305件
行った処理:
1. Tokenizerを使ってベクトル化
• 教師データ X.shape (2482,1715)
embed_dim = 128
lstm_out = 256
batch_size = 32
from keras.models import Sequential
from keras.layers import Embedding
from tensorflow.keras.layers import Dropout, Dense, LSTM,Flatten
model_1 = Sequential()
model_1.add(Embedding(2000,embed_dim,input_length = X.shape[1]))
model_1.add(LSTM(lstm_out,dropout=0.2,return_sequences=True))
model_1.add(Flatten())
model_1.add(Dense(2,activation='softmax'))
model_1.compile(loss = 'categorical_crossentropy', optimizer='adam',metrics = ['accuracy'])
print(model_1.summary())
5.機械学習による感情分析(LSTM)
ネガ ポジ
教師データ
(17:1)
2174件 170件
検証データ 128件 10件
テストデータ 305件
行った処理:
x_train5,y_train5,x_label5,y_label5 = train_test_split(X_train,y_binary,
train_size=0.8, random_state=234)
history = model_1.fit(x_train5,x_label5,batch_size=batch_size,epochs=
2,validation_data=(y_train5, y_label5),verbose=2)
df_validation['score_new'] = [round((i/0.2),1) for i in y_lstm[:,1].tolist()]
Epoch 1/2
59/59 - 803s - loss: 0.4919 - accuracy: 0.8869 -
val_loss: 0.2605 - val_accuracy: 0.9403
Epoch 2/2
59/59 - 932s - loss: 0.2500 - accuracy: 0.9243 -
val_loss: 0.1981 - val_accuracy: 0.9403
6.引き続き行いたいこと
極性辞書による感情分析:自動生成した極性辞書正確性の向上
機械学習による感情分析:コメント件数の補充
感情分析なら、絵文字といった感情表現を含めて考慮したらどう?
そもそもスコアって人間の主観的なものなので、極性辞書または機
械学習によって付けられたスコアの正確性の評価?
ネガデータ件数少ないなら、異常検知の実施?
キャラクタのネットワーク
詳細コード:
羅小黒戦記の映画コメントを分析してみよう
https://littlevoice-g-string.github.io/Jorey-s-
Blog/2021/01/08/02_luoxiaohei/
6.引き続き行いたいこと
極性辞書による感情分析:自動生成した極性辞書正確性の向上
機械学習による感情分析:コメント件数の補充
感情分析なら、絵文字といった感情表現を含めて考慮したらどう?
そもそもスコアって人間の主観的なものなので、極性辞書または機
械学習によって付けられたスコアの正確性の評価?
ネガデータ件数少ないなら、異常検知の実施?
キャラクタのネットワーク
詳細コード:
羅小黒戦記の映画コメントを分析してみよう
https://littlevoice-g-string.github.io/Jorey-s-
Blog/2021/01/08/02_luoxiaohei/
ご
視
聴
あ
り
が
と
う
ご
ざ
い
ま
し
た
!

More Related Content

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 

Featured (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

[Members data #7_0122]ロシャオヘイ戦記映画コメントを分析してみた