2017 © Pedro Peláez
 

library tf_idf

image

tinyporo/tf_idf

  • Wednesday, August 1, 2018
  • by TinyPoro
  • Repository
  • 0 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Tf_Idf

Sử dụng:

1.Hàm khởi tạo nhận 2 tham số TF_IDF($language, $α = 0.5, ) - Khi tính tf sẽ sử dụng công thức sau để giảm sự ảnh hưởng của các câu dài, (*1)

tf(t, d) = α + (1 − α)(ft,d/max(ft',d))
  • α mặc định sẽ là 0,5. Bạn có thể truyền tham số α vào hàm khởi tạo.

2.Sử dụng hàm addDocText để thêm văn bản, hàm sẽ trả về docId tương ứng với văn bản bạn vừa thêm., (*2)

3.Sử dụng hàm getTfIdf($term, $docId) để lấy giá trị tf.idf của từ trong văn bản có id tương ứng., (*3)

4.Sử dụng hàm getDocTfIdf($docId) để lấy giá trị tf.idf của văn bản có id tương ứng., (*4)

Lưu ý : Để có hiệu quả tốt

  1. Chỉ tính tf.idf với các danh từ
  2. Cộng thêm điểm cho các câu có chứa từ trong title.
  3. Áp dụng trọng số vị trí vào giá trị điểm cho bước 2 theo thang điểm [0,1]
Tham khảo

The Versions

01/08 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Development Requires

by Avatar TinyPoro

01/08 2018

1.0.5

1.0.5.0

  Sources   Download

MIT

The Development Requires

by Avatar TinyPoro

01/08 2018

1.0.4

1.0.4.0

  Sources   Download

MIT

The Development Requires

by Avatar TinyPoro

01/08 2018

1.0.2

1.0.2.0

  Sources   Download

MIT

The Development Requires

by Avatar TinyPoro

01/08 2018

1.0.3

1.0.3.0

  Sources   Download

MIT

The Development Requires

by Avatar TinyPoro

01/08 2018

1.0.0

1.0.0.0

  Sources   Download

MIT

The Development Requires

by Avatar TinyPoro

01/08 2018

1.0.1

1.0.1.0

  Sources   Download

MIT

The Development Requires

by Avatar TinyPoro