Đề thi học kì môn máy học chuyên ngành công nghệ thông tin - Pdf 28

Bài toán 1. Phân loại văn bản tiếng Việt bằng phương pháp K-NN hoặc Bayes
Training Phase:
Input: D={d1,…dn}: collection of documents that has been assignment in to C.
C={c1, ,ck}: catergories.
Output: Detemining representation of each catergorie
Processing:
- In D segment into 2 word sets: noun set and other word set.
- Calculate F(w
i
) in noun set by:
D
iD
i
N
wN
wF
)(
)(
=
- For each catergories select all word that is noun and threshold s>0. And with each
catergories we have a representation for it.
Testing phase
Input: d: document
Output: d has been assigned by catergories C.
Reprocessing:
- d has been segmented into 2 word sets: noun set and other word set (not noun).
- Calculate I(w
i
) in noun set by:
)(
)(

m
; w
m
>}
Algorithm (Bayes)
with d, we will calculate probability for each catergories C
i
by eq:
Prob(d|C
i
) = Prob(C
i
|D)*Prob(t
1
|C
i
)*Prob(t
2
|C
i
) * * Prob(t
m
|C
i
)
We will predict d in C
k
that have Prob(d|C
k
) max.

i
) in noun set by:
D
iD
i
N
wN
wF
)(
)(
=
Testing phase
Input: d: original document, r: rate of summary.
Output: d’: summary of document
Reprocessing:
- d has been segmented a set of sentences S={s
1
, s
2
, …, s
n
}
- In each sentence:
+ segment into 2 word sets: noun set and other word set (not noun).
+ Calculate I(w
i
) in noun set by:
)(
)(
)(

While (length(d’)< length(d)*r%)
V=V+s
i
;
Arrangements all selected sentence by the original document.
Ví dụ về thuật toán phân cụm văn bản dựa trên phân cấp.
- Input n văn bản đầu vào.
- Coi mỗi đối tượng là 1 cụm. (ví dụ có 3 văn bản thì 3 văn bản là 3 cụm).
- Trong mỗi văn bản tách các danh từ và tính tần suất các danh từ.
- Đo khoảng cách từng đôi một văn bản với nhau theo công thức:
- Đặt ngưỡng khoảng cách d(i,j).
- Output: Gom lại các cụm có khoảng cách d(i,j)<= ngưỡng.
Ví dụ:
Cho 3 văn bản đầu vào như dưới đây
Văn bản 1: Chiều nay, lớp D3tin thực hành máy tính.
Văn bản 2: Chiều nay, phòng máy tính A202 phải để cho lớp D4tin sử dụng.
Văn bản 3: Sáng nay, cô ấy đi xem bóng đá.
So sánh văn bản 1 và văn bản 2:
)|| |||(|),(
22
22
2
11 pp
j
x
i
x
j
x
i

=sqrt(0.1
2
+0.05
2
+0.1
2
+0.12
2
+0.3
2
+0.4
2
).
d(1,3)=sqrt(0.3
2
+0.3
2
+0.6
2
+0.6
2
+0.2
2
).
Tương tự, tính d(2,3).
So sánh d(1,2) có khoảng cách nhỏ, do đó, văn bản 1 và văn bản 2 thuộc cùng 1 cụm.
Khi cho 3 văn bản trên là 3 văn bản đầu vào thì có thể gom lại thành 2 cụm.


Nhờ tải bản gốc

Tài liệu, ebook tham khảo khác

Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status