Download the PHP package tinyporo/tf_idf without Composer
On this page you can find all versions of the php package tinyporo/tf_idf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package tf_idf
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
- α 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.
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.
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.
Lưu ý : Để có hiệu quả tốt
- Chỉ tính tf.idf với các danh từ
- Cộng thêm điểm cho các câu có chứa từ trong title.
- Á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
All versions of tf_idf with dependencies
PHP Build Version
Package Version
No informations.
The package tinyporo/tf_idf contains the following files
Loading the files please wait ....