Ngày thi: 4/9/2021
Thời gian : 60 phút
Xây dựng thư viện Count Vectorizer như mộ hình UML như hình sau
Input
Đầu vào là một tập (corpus) các văn bản
string[] corpus = {
"This I Can't is the first document.",
"This document is the second document.",
"And this is the third one.",
"Is this the first document?"
};
Output
Tạo ra ma trân thống kê tần suất như sau
| this | I | can’t | is | the | first | document | second | and | third | one |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 | 2 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |