[carrot2] simple doubt

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[carrot2] simple doubt

I started a little while with a carrot and I'm doubtful that I think is simple.
I realized that when clustering documents that appear clustered in more than one cluster.
How can I make this not happen? I want each document belongs to one and only one cluster.

Ops, i forgot .This is my cluster method:

public List<Cluster> clustering(Bloco bloco) {
                StringTokenizer st = new StringTokenizer(bloco.getTextos().toString(),BlocoMySqlDao.SEPARATOR);
                ArrayList<Document> documents = new ArrayList<Document>();
                while (st.hasMoreTokens()) {
                        String s = st.nextToken();
                        documents.add(new Document(null,s,LanguageCode.PORTUGUESE));
                /* A controller to manage the processing pipeline. */
                Controller controller = ControllerFactory.createSimple();

                /* Input data for clustering, list of Documents in this case. */
                Map<String, Object> attributes = new HashMap<String, Object>();
                attributes.put(AttributeNames.DOCUMENTS, documents);
                /* Perform clustering */
                ProcessingResult result = controller.process(attributes, LingoClusteringAlgorithm.class);
                /* Clusters created by Carrot2. */
                List<Cluster> clusters = result.getClusters();

                return clusters;