蔡揚 付小斌
摘要:信息爆炸的時代,大量的新聞每天充斥的我們的生活,海量的新聞總是能夠引導著人們對社會中發生的事件做出自己的判斷。假新聞的錯誤引導將會對社會起到消極的作用,于是該文提出對真假新聞進行分類的方法。該文結合TF-IDF算法和樸素貝葉斯算法,對新聞中的詞條進行加權,之后重新定義樸素貝葉斯分類器,并對新聞進行分類。最后,我們進行了多組實驗,并取得了多組實驗的平均值作為本次實驗的最終結論。
關鍵詞:真假新聞;TF-IDF;樸素貝葉斯; 分類
中圖分類號:TP181 文獻標識碼:A 文章編號:1009-3044(2018)04-0184-03
Fake or Real News Classification Based on Na?ve Bayes and TF-IDF
CAI Yang, FU Xiao-bin
(Southwest Petroleum University School of Computer Science, Chengdu 610500, China)
Abstract:In this era of information explosion, a lot of news full of our lives every day, massive news is always able to guide people to the events of society to make their own judgments. The false guidance of false news will have a negative effect on society, so this paper proposes a method to classify true and false news. In this paper, we combined the TF-IDF algorithm and the naive Bayesian algorithm to weight the entries in the news, and then redefine the naive Bayesian classifier and classify the news. Finally, we conducted a number of experiments, and made the average of multiple sets of experiments as the final conclusion of this experiment.
Key words: Fake or Real News;TF-IDF; Na?ve Bayes; Classification
新聞的真實性是新聞的立命的根本,但是近些年來,假新聞層出不盡,影響了新聞媒體的權威性和公信力;導致錯誤的輿論出現;侵害了公民的權利;浪費了時間和金錢,對社會造成了巨大的影響。假新聞影響了社會秩序和經濟,并且嚴重的侵犯了新聞當事人的權益。所以我們實現了本文提及的方法,用于高效的判斷假新聞。這對我們來說意義重大,對社會來說也能起到一定程度的積極作用。
1 數據預處理
1.1 去停用詞
Hans Peter Luhn創造了這個短語并在他的研究中應用這個概念。在信息檢索中,為節省存儲空間和提高搜索效率,在處理自然語言數據(或文本)之前或者之后會自動過濾掉某些字或詞,這些字或詞即被稱為Stop Words(停用詞)。這些停用詞都是人工輸入、非自動化生成的,生成后的停用詞會形成一個停用詞表。但是,并沒有一個明確的停用詞表能夠適用于所有的工具。……