Skip to Content
Bad Data 技術手冊
book

Bad Data 技術手冊

by Q. Ethan McCallum
September 2013
Intermediate to advanced
264 pages
5h
Chinese
GoTop Information, Inc.
Content preview from Bad Data 技術手冊
90
|
第六章:在矛盾的線上評論中偵測謊言以及混亂的狀況
極端化的語言
為了要展示極端化的語言的威力,接下來會有一張表顯示最常被用在
movie_reviews
料庫的極端語言,伴隨著在每個分類中的出現數,以及使用 NLTK
nltk.metrics.
association
模組中的
BigramAssocMeasures.chi_sq()
函式
9
所計算出的卡方資訊獲利
Chi-squared information gain)。
卡方值是 Phi 平方值(Phi-Square)的變更,用來計算兩個變數之間的關係值,在我們
的例子中則是單字與分類之間的關係。給定一個單字出現在
pos
分類中的次數、該字出
現在所有分類中的總數、在
pos
分類中的所有單字數量以及所有分類中的總字數,我們
便能夠得到單字與
pos
分類之間的關聯分數。因為我們只有兩個分類,對某一個單字的
pos
分數與
neg
分數將會相同,因為該字在兩個分類中一樣重要,但重要性的解讀則會
依據單字在每個分類中的相對數量不同而有所不同。
Word Pos Neg Chi-Sq
bad 361 1034 399
worst 49 259 166
stupid 45 208 123
life 1057 529 126
boring 52 218 120
truman 152 11 108
why 317 567 99
great 751 397 76
war 275 94 71
awful 21 111 71
上面有些單字以及數字應該都很顯然,但有些則不然。舉例來說,多數的人可能會認為 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

RxJava反应式编程

RxJava反应式编程

Tomasz Nurkiewicz, Ben Christensen
高效能PYTHON程式設計

高效能PYTHON程式設計

Micha Gorelick, Ian Ozsvald
Kubernetes编程

Kubernetes编程

Michael Hausenblas, Stefan Schimanski

Publisher Resources

ISBN: 9789862768952