1. Trang chủ
  2. » Cao đẳng - Đại học

Chuyên đề lập trình ứng dụng demo

10 6 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Cấu trúc

  • Tên đề tài: NGHIÊN CỨU RÚT TRÍCH THÔNG TIN DỰA TRÊN CƠ SỞ PHÂN TÍCH CẢM XÚC

  • Mã số:

  • Lập trình ứng dụng demo

    • Mục lục

    • 3. Danh mục chữ viết tắt

    • 1. Đặt vấn đề

    • 2. Phương pháp nghiên cứu, cách tiếp cận

    • 3. Kết quả đạt được

    • 4. Kết luận và kiến nghị

    • 5. Tài liệu tham khảo

Nội dung

TRƯỜNG ĐẠI HỌC THỦ DẦU MỘT KHOA KỸ THUẬT CÔNG NGHỆ Tên đề tài: NGHIÊN CỨU RÚT TRÍCH THƠNG TIN DỰA TRÊN CƠ SỞ PHÂN TÍCH CẢM XÚC Mã số: Chuyên đề: Lập trình ứng dụng demo Chủ nhiệm đề tài : ThS.Nguyễn Tấn Lộc Người chủ trì thực chuyên đề : ThS.Nguyễn Tấn Lộc Bình Dương, 08/01/2018 Mục lục Danh mục chữ viết tắt TF: term frequency IDF: inverse document frequency TF.IDF: term frequency inverse document frequency DTM: document term matrix Logistic: hồi quy logistic P(A): Xác xuất kiện A 10 NER: Named Entity Recognition 11 SoA: Sentiment analysis - Phân tích cảm xúc Đặt vấn đề Dựa vào lý thuyết mơ hình logistic, ngơn ngữ lập trình python với IDE jupyter notebook chúng tơi xây dựng mơ hình xếp hạng bình luận trích xuất bình luận Sau thực phân tích đánh giá mức độ ảnh hưởng từ cho loại ẩm thực quốc gia kết phân tích ẩm thực quốc gia phản ánh thực tiễn : Món ăn phổ biến Việt Nam phở, Nhật Bản với ẩm thực sushi tươi sống, số ăn Thái có hương vị cay, nhà hàng Ý tiếng với bánh pizza 12 Phương pháp nghiên cứu, cách tiếp cận - Sử dụng ngơn ngữ lập trình python với IDE jupyter notebook 13 14 - Dựa vào lý thuyết mơ hình logistic v2 tối ưu hóa hàm mát, chuẩn hóa mơ hình L2-norm Kết đạt - Đọc liệu nhà hàng từ tập tin excel 15 16 17 18 import pandas as Pd import numpy as np reviews = pd.read_csv('Resfull.csv',encoding = "ISO-8859-1") 19 - Trong phần thực nghiệm này, chúng tơi rút trích thơng tin hữu ích bình luận nằm nhóm đầu 10 bình luận tốt nhất, nhóm 10 bình luận hàng đầu theo quốc gia: 20 name 21 sta 22 24 Kai 25 26 28 Cain's Saloon 29 took 32 Olive Garden Italian Restaurant 36 Olive Garden Italian Restaurant 40 NYPD Pizza 44 Sunup Brewing 48 Murphy's Pub 52 Randy's Restaurant & Ice Cream 56 Filibertos Mexican Food 60 65 Hiro Sushi 64 30 This is a belated review for a meal that Great beer list always changing it up Follows 33 34 In the last few years Ive tried my best to lik 37 38 I dont know what is happening to Olive Garden 41 42 My favorite lunch spot in the area Im from NJ 45 46 Nice cozy neighborhood brewery Friendly staff 49 50 Well its an institution here at the u of I You 53 54 I go here when i am working and want to get aw 57 58 After hearing a few individuals talk about Fil 61 62 This IS as good as it gets for sushi in Arizon Bảng 1.Các bình luận tích cực cho doanh nghiệp 23 textclean 27 catego Ameri can (New) 31 Ameri can (New) 35 Italian 39 Italian 43 Italian 47 Ameri can (New) 51 Ameri can (New) 55 Ameri can (New) 59 Mexic an 63 Japan ese 66 #top 10 positive reviews for Vietnamese restaurant Vietnamese=reviews_subset_test[reviews_subset_test.categories=-Vietnamese'] Vietnamese[['review_id', 'name','stars', 'text_clean', 'categories','sentiment']] test_matrix_vn = vectorizer.transform(Vietnamese['text_clean'].values.astype('U')) predict_prob_vn = sentiment_model.predict_proba(test_matrix_vn)[:,1] predict_score_vn = sentiment_model.decision_function(test_matrix_vn) df_viet = {'Probabilties': predict_prob_vn, 'Scores': predict_score_vn, 'Predictions': se ntiment_model.predict(test_matrix_vn)} sentiment_model_predictions = pd.DataFrame(df_viet).sort_values(by-Scores', ascen ding=False) sentiment_model_predictions head( 10) top20posreviews=Vietnamese[['review_id', 'name','stars', 'text_clean', 'categories','senti ment']].iloc[sentiment_model_predictions.index[0:100]] top10posreviews['text_clean'] 67 name 68 sta 72 ca textclean 70 tegories 73 We love this place Th is is gonna be a long rev 74 76 77 Yummmmmmm Best vegetarian restaurant in 78 Phoen 71 Loving Hut 75 Loving Hut 79 Tram's Kitchen 80 83 Saigon Pho & 84 Seafood 69 82 It might be a holeinthewall but its a pretty n 85 Fast service delicious food and excellent pric 89 Im giving Tea Light Cafe an extra star well de 93 Ive been driving by Tea Lite for awhile but ne 94 97 This is a great little spot casual and quick a 98 88 86 90 91 Tea Light Cafe 92 95 Savor Flavor Asia 96 99 Pho Minh 100 101 Best place for in the city have tried th 102 103 Saigon Pho & 104 105 Saigon is by far my favorite stop come h 106 108 109 We really like this place love the owners 110 Seafood 107 5 Cyclo Vietnamese Cuisine 111 Bảng Các bình luận cảm xúc tích cực cho doanh nghiệp Việt Nam 112 Vie tnamese Tea Light Cafe Vie tnamese 87 Vie tnamese 81 Vie tnamese Vie tnamese Vie tnamese Vie tnamese Vie tnamese Vie tnamese Vie tnamese 113 - Nhóm 10 bình luận cảm xúc tiêu cực cho nhà hàng Việt Nam, liệu phản ánh hợp lý với xếp hạng đến 114 chuoi2='' 115 for titlel in top20negatives['text_clean'].values.tolist(): chuoi2= chuoi2+ titlel +'' 116 wordcloud = WordCloud().generate(chuoi2) plt.imshow(wordcloud, interpolation-bilinear') plt.axis("off") 117 118 119 120 # lower maxfont size wordcloud = WordCloud(max,max_font_size=40).generate(chuoi2) plt.figure() plt.imshow(wordcloud, interpolation-'bilmear") plt.axis("off") plt.show() 121 name 122 sta 123 126 127 125 Phu Thanh 129 Saigon Pho & Seafood textclean 124 ca tegories Being a huge fan of Vietnamese food and how he 128 130 131 Dont go to this restaurant The employees are 132 Tea Light Cafe 134 135 First and foremost this fastfood Vietnam rest 136 137 Pho Minh 138 139 Maybe I went on a bad day but the food was pre 140 142 143 Theres a reason why this place has no reviews 144 146 147 Very VERY disappointed in the service This was 148 150 151 I really dont understand what the fuss is abou 152 141 My Ngoc Restaurant 145 Saigon Pho & Seafood 149 Cyclo Vietnamese Cuisine 1 1 157 Saigon Pho & 158 159 We always eat here when we crave Saigon Pho 160 Saigon Pho & Seafood 165 166 167 162 163 We had dinner and had the worst experience we Bảng 3.Nhóm bình luận cảm xúc tiêu cực cho doanh nghiệp Việt Nam Vie tnamese 156 161 Vie tnamese Absolutely terrible and slow service They are To Vie tnamese 154 155 Vie tnamese Loving Hut Seafood Vie tnamese 153 Vie tnamese 133 Vie tnamese Vie tnamese Vie tnamese 164 Vie tnamese Kết phân loại cảm xúc tích cực tiêu cực ảnh hưởng mạnh đến kết rút trích thơng tin Nếu kết phân loại xác, truy vấn rút trích thơng tin có độ xác cao 168 169 3.1 Kết thực nghiệm Dữ liệu với mơ hình logistic cho kết với độ xác cao accuracy=90%, recall=89.8%, precision=96.9% hệ số chuẩn hóa cho mơ hình tối ưu với hệ số chuẩn hóa C=0.2154 170 171 Hình Đánh giá mô hỉnh huấn luyện kiểm thử liệu 172 173 Bảng 4.Ma trân đánh giá phân loại cảm xúc Trích xuất xác cảm xúc giúp doanh nghiệp định hình xu hướng phát triển, đồng thời nắm bắt quan điểm cảm xúc khách hàng ăn, chất lượng dịch vụ khách hàng 174 Nhóm 10 từ cảm xúc mạnh tích cực tiêu cực 175 176 Tích cực - hệ số 179 excellent: 1.14614924052 180 delicious: 1.1119727885 r rrir/K ■ amazing: 1.03514286548 181 awesome: 0.872256805683 perfect: 0.838463244404 great: 0.806499315192 best: 0.744851346902 fantastic: 0.734042587596 love: 0.731300119008 reasonable: 0.72016372024 183 184 185 Bảng Nhóm 177 178 Tiêu cực-hệ số 182 worst: -1.13781905968 r rri*/K ■* horrible: -1.0873361229 terrible: -1.04677190115 mediocre: -1.04432799702 bland: -0.874645601756 awful: -0.836073920222 tasteless: -0.821659220617 rude: -0.820886331069 disgusting: -0.805035172104 overpriced: -0.803561081306 10 từ cảm xúc rút từ kết phân tích - Nhóm 20 từ phổ biến trích từ bình luận hàng đầu thể cảm xúc tích Các từ có tần số xuất cao phù hợp với thực tế Món ăn phổ biến Việt Nam phở 186 187 Hình Phân phối từ có tần suất cao ẩm thực Việt 188 - Đoạn chương trình thể wordcloud 189 from wordcloud import WordCloud import matplotlib.pyplot as plt chuoi='' 190 for title in top20posreviews['text_clean'].values.tolist(): chuoi= chuoi+ title +'' 191 wordcloud = WordCloud().generate(chuoi) plt.imshow(wordcloud, interpolation='bilinear') plt.axis("off") 192 193 194 195 # lower max_font_size wordcloud = WordCloud(max_font_size=40).generate(chuoi) plt.figure() plt.imshow(wordcloud, interpolation="bilinear") plt.axis("off") plt.show() 196 197.198 Hình 3.Các từ ảnh hưởng mạnh ẩm thực Việt - Kết phân loại rút trích cảm xúc xác cho nhà hàng Nhật bản, ăn phổ biến Sushi tươi sống 199 200 blacklist = ["the","The","and",,also,,"a","is",,out,,,just,,"in",,all',,or,,"to","be","it" ,"I","was","wer e","of^,,"ofĩ^,,,up,,,on', "are", "for", "this'Vabouf 201 ,above\ 202 according,, 203 ,accordingly,, 204 Across,, 'actually','any','only',"Time","My",'ouf,'Ouf,'which','whaf,'who', 'after','me','about', 205 'afterwards','too','got','can','from','back','than','other',rWe','They','get','if1,'go ', ,again,, 206 'againsf,'thaf,'my','would','will','we','you','have','has','buf,'with','as','af,'they' ,'so' ,'its','some','here','there','their','very','had'] # Blacklist of words to be filtered out chuoi=chuoi lower() for word in blacklist: 207 chuoi = chuoi.replace(" " + word + " ", " ") 208 word_list = chuoi.split() counts = Counter(word_list) 209 labels, values = zip(*counts.items()) 210 [:20] # sort your values in descending order indSort = np.argsort(values)[::-1] 211 212 # rearrange your data labels = np.array(labels)[indSort] values = np.array(values)[indSort] 213 indexes = np.arange(len(labels)) 214 215 bar_width = 0.1 plt.bar(indexes, values) # add labels plt.xticks(indexes + bar_width, labels, rotation-vertical') plt.show() 216 217 Hình Phân phối từ có tần suất cao ẩm thực Nhật 218 219 220 Hình Các từ ảnh hưởng mạnh ẩm thực Nhật 4.Kết luận kiến nghị 221 Trong nghiên cứu này, Tôi thực khảo sát so sánh hướng tiếp cận phân loại cảm xúc dựa vào thuật toán học máy, từ điển ontology đánh giá kỹ thuật rút trích thông tin dựa sở phân loại cảm xúc Trên tảng lý thuyết đó, Tơi tiền hành xây dựng mơ hình thực nghiệm với phương pháp hồi quy logistic để phân loại cảm xúc sau tiến hành rút trích thơng tin Và thử nghiệm thuật tốn rút trích thơng tin có cảm xúc cho câu truy vấn Cụ thể đề tài đạt số cột mốc quan sau 222 - Nghiên cứu tổng quan phân tích cảm xúc, ứng dụng thực tế sống 223 - Nghiên cứu phương pháp rút trích thơng tin phương pháp phân tích cảm xúc 224 - Xây dựng mơ hình thử nghiệm trích thơng tin theo câu truy vấn từ liệu 225 - Đánh giá thử nghiệm liệu thuật toán hồi quy logistic lựa chọn tham số tối ưu để nâng cao độ xác thuật tốn 226 Thời gian tới đề tài tiếp tục phát triển : 227 - Xây dựng nhiều mơ hình phân loại cảm xúc với nhiều thuật toán mở rộng hướng tiếp cận ngữ nghĩa ontology, phương pháp từ điển, học máy từ so sánh kết thực nghiệm để so sánh đánh giá ưu khuyết phương pháp cho trường hợp cụ thể 228 - Xây dựng mơ hình rút trích thơng tin sở phân tích cảm xúc trang tiếng việt dịch vụ du lịch tripadvisor, Lazada 5.Tài liệu tham khảo [1] B Agarwal and N Mittal, “Optimal feature selection for sentiment analysis,” in Proceedings of the 14th International Conference on Intelligent Text Processing and Computational Linguistics (CICLing 13), vol 7817, pp 13-24, 2013 [2] A Basant, M Namita, B Pooja, Sonal Garg “Sentiment Analysis Using Common-Sense and Context Information” Hindawi Publishing Corporation Computational Intelligence and Neuroscience (2015) [3] RuiXia, FengXu, JianfeiYu,” Polarity shift detection, elimination and ensemble: A three stage model for document-level sentiment analysis” Information Processing and Management 52 (2016) 36- 45 [4] Y Ainur, Y Yisong, C Claire “Multi-level structured models for document-level sentiment classification”.Proceedings of the 2010 Conference on Empirical Methods in Natural Language Processing, MIT, Massachusetts, Association for Computational Linguistics, USA (2010), pp 1046-1056 [5] F Noura, C Elie, A.A Rawad, H Hazem “Sentence-level and documentlevel sentiment mining for arabic texts”.Proceeding IEEE International Conference on Data Mining Workshops (2010) [6] Hao chen Zhou and Fei Song.(2015) “Aspect-level sentiment analysis based on a generalized probabilistic topic and syntax model” Proceedings of the TwentyEighth International Florida Artificial Intelligence Research Society Conference, Association for the Advancement of Artificial Intelligence (2015) [7] Ariyasriwatana, W., Buente, W., Oshiro, M., & Streveler, D (2014) Categorizing health-related cues to action: using Yelp reviews of restaurants in Hawaii New Review of Hypermedia and Multimedia, 20(4), 317-340 [8] Hicks, A., Comp, S., Horovitz, J., Hovarter, M., Miki, M., & Bevan, J L (2012) Why people use Yelp com: An exploration of uses and gratifications Computers in Human Behavior, 28(6), 2274-2279 [9] Huang, J., Rogers, S., & Joo, E (2014) “Improving restaurants by extracting subtopics from yelp reviews” iConference 2014 (Social Media Expo) [10] Ruhui Shen, Jialiang Shen, Yuhong Li & Haohan Wang (2016), ” Predicting usefulness of Yelp reviews with localized linear regression models ”, 2016 7th IEEE International Conference on Software Engineering and Service Science (ICSESS) [11] Solov'ev A N., Antonova A Ju., Pazel'skaia A G., (2012), Using sentiment- analysis for text information extraction I-Teco (Moscow) [12] Wanxiang Che, Yanyan Zhao, Honglei Guo, Zhong Su, and Ting Liu,” Sentence Compression for spect-Based Sentiment Analysis” IEEE/ACM 229 TRANSACTIONS ON AUDIO, SPEECH, AND LANGUAGE PROCESSING, VOL 23, NO 12, DECEMBER 2015 [13] P.D Turney,(2000), “Learning algorithms for keyphrase extraction” Information Retrieval vol 2, no 4, pp 303 - 336 [14] I.H Witten, G.W Paynter, E Frank, C Gutwin and C.G Nevill- Manning (1999) “KEA: Practical automatic Keyphrase Extraction.” The proceedings of Digital Libraries '99: The Fourth ACM Conference on Digital Libraries, pp 254255 [15] Huong Nguyen Thi Xuan, Anh Cuong Le ; Le Minh Nguyen, (2012) ”Linguistic Features for Subjectivity classification“ Asian Language Processing (IALP), 2012 International Conference 230 Xác nhận thực chuyên đề Chủ nhiệm đề tài ... Entity Recognition 11 SoA: Sentiment analysis - Phân tích cảm xúc Đặt vấn đề Dựa vào lý thuyết mơ hình logistic, ngơn ngữ lập trình python với IDE jupyter notebook chúng tơi xây dựng mơ hình xếp hạng... vị cay, nhà hàng Ý tiếng với bánh pizza 12 Phương pháp nghiên cứu, cách tiếp cận - Sử dụng ngơn ngữ lập trình python với IDE jupyter notebook 13 14 - Dựa vào lý thuyết mơ hình logistic v2 tối... rút trích thơng tin có cảm xúc cho câu truy vấn Cụ thể đề tài đạt số cột mốc quan sau 222 - Nghiên cứu tổng quan phân tích cảm xúc, ứng dụng thực tế sống 223 - Nghiên cứu phương pháp rút trích

Ngày đăng: 02/09/2021, 16:51

w