• No results found

Blog Post Extraction using Text-to-Tag Ratio and Maximum Scoring Subsequence

N/A
N/A
Protected

Academic year: 2020

Share "Blog Post Extraction using Text-to-Tag Ratio and Maximum Scoring Subsequence"

Copied!
8
0
0

Loading.... (view fulltext now)

Full text

(1)

Blog Post Extraction using Text-to-Tag Ratio and Maximum Scoring Subsequence

985202018 995202017 995202021

[email protected] [email protected] w

[email protected] w

摘 要

部落格主文擷取即是所需的前處理程序。由於

HTML

(2)

使

Text-to-Tag Ratio , Maximum

Scoring Subsequence

F-

Measure 可 89% 。

PDA

的裝置,以及自然語言處理、文件自動摘要...

Content Extraction 、

Blog Post Extraction 、

1. 緒

Web 2.0

(3)

BBS

題、專業知識,完全取決於作者的自我論點,

關研究受到越來越多的關注,例如:意見檢索

(opinion retrieval) 、 (sentiment

analysis) 、 (spam blog post

detection)

(4)

便

使

(5)

或只有簡短的句子和少量的詞彙。除此之外,

部落格網頁擺放主文的位置不固定,並且文章

樣的雜訊,例如:廣告、導覽列、選單列表...

難 複

戰 性

使

(6)

程式產生錯誤,需經常更新維護或重新撰寫,

且 信

DOM tree

HTML

(7)

DOM tree

以人工標記則相當的耗時耗力。因此,我們將

Weninger 等

Text-to-Tag Ratio

步的修改,使其能適用於部落格網頁,並結合 Maximum Scoring Subsequence

法擷取部落格網頁的主要文章。實驗結果顯示

F-Measure

89% ,

率 的

(8)

構 如

Adaptive Text-to-Tag Ratio 演 Naïve

Bayes 分

K-means

Maximum Scoring Subsequence

最 後 篇 論

2. 相 關研究

(Content

Extraction) 的 術 。

集 大 聞 網

Cai 等

Vision-based Page

Segment (VIPS)[1]演算法,不同於傳統基於

(9)

DOM tree

Cao [2]

法擷取部落格網頁的文章和評論。首先,基於 DOM

每一個節點之有效內容機率,並透過網頁中的 CSS

(10)

Pasternack 與 Roth 透 Naïve Bayes

HTML

機 率 並 將 -

0.5 至 0.5 之

分 數 Maximum

Scoring Subsequence

聞 網

練 資

Weninger 等

藉 由 HTML

Text-to-Tag Ratio

維 模 K-means

(11)

練 資

F-Measure平 93.9%。

3. 部 落格主文擷取

使

,此時需要針對部落格網頁進行主文的擷取以

一 步

(12)

除 。 , 將 籤 及

3.1. 辨

識 部 落 格網頁

否為部落格網頁可當作是一個分類問題,2009

Cao

Elgersma Rijke

徵 ,

LibSVM

器 ,

F-measure

90.7%

3.2. 擷 取主要文章

HTML

token

token 可

HTML 標

Text-to-Tag Ratio

Naïve Bayes 計 token

再 分 K-

means 分

Maximum Scoring

Subsequence

(13)

Text-

to-Tag Ratio Maximum Scoring

Subsequence 演

F-

Measure可 89% 。

1. 系

4. Computational Method

Weninger 等

Text-to-Tag

Ratio

(14)

使

作於擷取部落格網頁的主要文章,其結果顯示

F-Measure

80%

使

(15)

4.1. Adaptive Text-to-Tag Ratio

Text-to-Tag Ratio

HTML

考 慮 , 若

HTML

許多重要的資訊,例如:圖片、影音、表格...

字和特殊格式的內容,並間接影響到上下文的 Text-to-Tag Ratio 。

HTML

適當的修改,<p>、 <br> 、 <blockquote>

(16)

(Content Tag)

型 的

Text-to-Tag Ratio

計算表格中的非標籤的字元長度當作每一行的 Text-to-Tag Ratio 。Adaptive Text-to-Tag

Ratio 演 2 所

(17)

2. Algorithm for computing Adaptive Text-to- Tag Ratio

型 的

Adaptive Text-to-Tag Ratio

Adaptive Text-to-Tag

Ratio , 條 圖

圖3. 部

0 100 200 300 400 500 600 700

Line Number

TTR Array

4. AdaptiveText-to-Tag Ratio line by line from the blog page example

4.2.

糊 處理 化

Adaptive Text-to-Tag Ratio

Input: D ← Blog page

Output: T ← Text-to-Tag Ratio

Define α ← text length threshold β ← image width threshold γ ← video width threshold for all i ← 1 to |D| do

x ← nonTagChars (Di) y ← tags (Di)

if (y > 0)

if Content Tag exists then if (y – Content Tag) > 0 then Ti ← x / (y – Content Tag) else

if (x > 0) then Ti ← x else Ti ← max (Ti-1, Ti-2) else Ti ← x / y

if image width > α then

if x > β then Ti ← image width + x / y else Ti ← (image width + x) / y if video width > γ then Ti ← video width if Table Tag exists then Ti ← table length else

if (x > 0) then Ti ← x else Ti ← 0

end for

(18)

、 日期 、 ..

如 下 Ti'=

k=i−r

i+r TTRArrayk

2r +1

Adaptive Text-to-Tag Ratio

化 後

明 顯

0 50 100 150 200 250 300

Line Number

TTR Array

5. Smoothed Adaptive Text-to-Tag Ratio line by line of the blog page example

4.3. Naïve Bayes Classifier

Pasternack 與 Roth

Naïve Bayes

trigram 和 most-recent-

unclosed-tag ,

token

(19)

U = (u1, u2,..., un)

n 個 token ,

i 個 token 的

trigram 特徵為<ui, ui+1, ui+2> 。most-recent-

unclosed-tag 特 (stack)

到相對應的結束標籤則將此起始標籤輸出,第i token most-recent-unclosed-tag

籤 。

trigram 特徵未出現於訓練資料,則將此token

P(t|in )=P(t|out)=0. 5

5. Extraction Method 5.1. Algorithm

Maximum Scoring

Subsequence

。 假設 一 及 目 S = (s1,

s2,..., sn) si

是一個分數。此演算法之目的即是找出在序列 S

中,分數加總最大的一個連續子序列,令其為

T = (sa, sa+1,..., sb) , 1 ≤ a ≤ b ≤

n 。

雜 度 O

(n) 。

(20)

6. Algorithm for finding the maximum scoring subsequence

5.2. Applying Maximum Scoring Subsequence

化 後 Text-to-Tag

Ratio

再 藉 去 此

Text-to-Tag Ratio

進 而 Maximum Scoring

Subsequence

Pasternack與 Roth

, 藉 將每 token 經 Naïve

Bayes 預

值 ,以 減

0.5 的

Maximum Scoring Subsequence

5.3. Applying K-means Clustering

Weninger 等

Text-to-Tag

Ratio ,轉換成二維模型的資料。公式如下:

Gi=

j=0 ω Ti+ j'

ω −Ti' Ti 表示模糊化後的

Text-to-Tag Ratio , ω 於

3 。

的 值代 表 Text-to-Tag

Ratio 增

少 的 勢 。 , 將 Gi

^G=|Gi'|

資 料

token 經

Naïve Bayes

也依照上述方法轉換成二維模型的資料,此時

Ti token

值 。

K-means

Given: S = (s1, s2,...,sn)

Output: maxSS start = 0

sum = 0 maxSS = (-∞) for i = 1 to n do sum = sum + si

if sum > value (maxSS) then maxSS = (sstart, sstart+1,...,si) if sum < 0 then

start = i + 1 sum = 0 end for

(21)

主要文章,剩下的群皆視為包含於主要文章,K

3 。

6. Experimental Setup 6.1. Data Set

Blogspot 、 Technorati 和

Yahoo

個主題的部落格網頁,前五個主題抓取限定在 Blogspot.com

Blogspot.com 部 Wrapper

網頁做為測試資料,並從每一個主題隨機挑選 25

(22)

案 ,

表1. 訓

Topic #pag e applebee 261

batman 582 beige book 512 iphone 522 obama 539

表2. 測

Topic #page #select page

bmw 351 25

phone fake 450 25 red sox 358 25

science

friday 433 25 south park 426 25

6.2. Preprocessing

HTML

割 部

HTML Tidy

HTML

的 標

,再

JavaScript CSS

並讓不常使用或是自行定義的標籤名稱轉換成

<UNKNOWN> ,

comment”

除。上述之前處理程序,其用意皆是避免計算 Text-to-Tag Ratio

(23)

差 。

token

,其前處理程序同上,只需再經過Stemming

時 態 型 ,提 升

Naïve Bayes

訓練模型的效率,本篇論文於實作上採用Porter

Stemming 演

6.3. Performance Metrics

Precision 、 Recall 和 F-

Measure

算 方

如 下

P=|WP∩WL|

|WP| , R=|WP∩WL|

|WL| , F1=2 PR P+R

WP

WL

案 的字 集

7. Results 7.1. Baseline

Weninger

Text-to-Tag Ratio 搭 K-

means 分

Pasternack 與 Roth

以Naïve Bayes 搭 Maximum Scoring

Subsequence演

K-means

資料集為訓練資料加上隨機挑選的測試資料,

3. Baseline

Method Precision Recall F-Measure 2DTR

+ K- means

81.49% 84.79% 80.42%

Naïve Bayes + MSS

90.46% 86.83% 87.26%

Weninger 等

F-Measure 只 80%

右,並不適用於部落格網頁。原因在於,計算

Text-to-Tag Ratio 時只 HTML

Figure

圖 4. Adaptive Text-to-Tag Ratio line by line from the blog page example
圖 5. Smoothed Adaptive Text-to-Tag Ratio line by line of the blog page example
表 n 個 token , 示 有
圖 6. Algorithm for finding the maximum scoring subsequence

References

Related documents

§ Aldehyde 10 Muguet Ylang-Ylang Jasmine Rose Carnation Aldehyde C-11 Aldehyde C-12 Vanilla Sandalwood Musk Floral Aldehydic Woody Powder Representative Ingredients Natural:

The mildly negative -.24 correlation with Years since Change Management Implementation indicates that once one has been practicing Change Management for a long time, the

Physical map construction in silico and candidate gene prediction To construct a physical map of Pi57(t) locus, all molecular markers used for gene mapping.. were landed on the

I think my religious trust approach thus affords theists a viable alternative to skeptical theism in defending the rationality of theism against Rowe‘s evidential

A senior applicant for positions other than those in the maintenance department (excluding line mechanic trainee) or involved in the installation of new equipment who

THAT this Committee recommends to Council that as recommended in a report dated February 29, 2012 from the Director of Parks and Recreation and the Manager of Special Projects,

Risk Prediction for Progression of Macular Degeneration: 10 Common and Rare Genetic Variants, Demographic, Environmental, and Macular Covariates.. Invest Ophthalmol

The primary variables at each element are (1) fluid pressure in fracture, (2) fracture aperture, (3) fracture sliding displacement, and (4) volume fraction of proppant.. The