public ActionResult TestAlgorithm(TestAlgorithmModel model)
        {
            var list = _taiLieuVanBanService.GetDocuments().Take(model.Amount).ToList();

            list.Add(model.Name);

            var docCollection = new DocumentCollection()
            {
                DocumentList = list
            };

            List <DocumentVector> vSpace    = VectorSpaceModel.ProcessDocumentCollection(docCollection);
            List <Centroid>       resultSet = DocumnetClustering.DocumentCluster(model.Cluster, vSpace, model.Name);
            string docNear = DocumnetClustering.FindClosestDocument();

            var mode = new TestAlgorithmModel
            {
                Name         = model.Name,
                Amount       = model.Amount,
                Cluster      = model.Cluster,
                Centroids    = resultSet,
                DocumentNear = docNear
            };

            return(View(mode));
        }
        public ActionResult StorageSuggestion(string document, string type)
        {
            string local = "Không tìm thấy tài liêu/văn bản có cùng nội dung! Tạo hồ sơ mới.";

            var hosos = AutoCompleteTextHoSos(GetHoSos());

            var list = _taiLieuVanBanService.GetDocuments();

            list.Add(document);

            var docCollection = new DocumentCollection()
            {
                DocumentList = list
            };

            var cluster = _taiLieuVanBanService.CountDocumentType(type);

            List <DocumentVector> vSpace    = VectorSpaceModel.ProcessDocumentCollection(docCollection);
            List <Centroid>       resultSet = DocumnetClustering.DocumentCluster(cluster, vSpace, document);

            string documentNeedSearch = DocumnetClustering.FindClosestDocument();

            if (!string.IsNullOrEmpty(documentNeedSearch))
            {
                var taiLieuVanBan = _taiLieuVanBanService.Get(p => p.NoiDung == documentNeedSearch);

                local = hosos.FirstOrDefault(p => p.Id == taiLieuVanBan.HoSoId).Text;
            }

            return(Json(new { da = local }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Test()
        {
            var list = _taiLieuVanBanService.GetDocuments();

            var docCollection = new DocumentCollection()
            {
                DocumentList = list
            };

            var cluster = _taiLieuVanBanService.CountDocumentType("Thông Báo");

            List <DocumentVector> vSpace    = VectorSpaceModel.ProcessDocumentCollection(docCollection);
            List <Centroid>       resultSet = DocumnetClustering.DocumentCluster(cluster, vSpace, "thông báo chính phủ mới");

            return(View(resultSet));
        }