customizing lingo

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

customizing lingo

reinhard
hi,

i would like to know how can i customize lingo. i have checked
http://download.carrot2.org/stable/manual/
but i dont find a suitable approach for my needs.
i know chapter 6.4, 6.5 and 6.6.
my requirement is not to use the workbench, not to redeploy, not to
restart the webapp.

i have carrot2 clustering and other cluster algorithms embedded into a
webapp and i would like to change the
cluster treshold by a slider.
by changing the slider i want to change the cluster treshold in lingo.

i use this code for clustering

        final Controller controller = ControllerFactory.createSimple();
        final ProcessingResult byTopicClusters =
controller.process(documents,
                "", LingoClusteringAlgorithm.class);
        final List<org.carrot2.core.Cluster> clustersByTopic =
byTopicClusters
                .getClusters();


thanks,

reinhard

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: customizing lingo

reinhard
i just have found a sample code

reinhard@thord:>vi
./applications/carrot2-examples/src/org/carrot2/examples/core/LoadingAttributeValuesFromXml.java

and some sample configuration files

 reinhard@thord:>find . -name "*utes.xml" -print  | grep lingo
./core/carrot2-component-suites/suites/suites/algorithm-lingo-attributes.xml
./core/carrot2-component-suites/tmp/eclipse/suites/algorithm-lingo-attributes.xml
./applications/carrot2-examples/src/org/carrot2/examples/core/algorithm-lingo-attributes.xml
./applications/carrot2-examples/tmp/eclipse/org/carrot2/examples/core/algorithm-lingo-attributes.xml

i guess this is what i have searched for to customize lingo at runtime?

regards
reinhard


Am 12.12.2010 13:45, schrieb reinhard schwab:

> hi,
>
> i would like to know how can i customize lingo. i have checked
> http://download.carrot2.org/stable/manual/
> but i dont find a suitable approach for my needs.
> i know chapter 6.4, 6.5 and 6.6.
> my requirement is not to use the workbench, not to redeploy, not to
> restart the webapp.
>
> i have carrot2 clustering and other cluster algorithms embedded into a
> webapp and i would like to change the
> cluster treshold by a slider.
> by changing the slider i want to change the cluster treshold in lingo.
>
> i use this code for clustering
>
>         final Controller controller = ControllerFactory.createSimple();
>         final ProcessingResult byTopicClusters =
> controller.process(documents,
>                 "", LingoClusteringAlgorithm.class);
>         final List<org.carrot2.core.Cluster> clustersByTopic =
> byTopicClusters
>                 .getClusters();
>
>
> thanks,
>
> reinhard
>
> ------------------------------------------------------------------------------
> Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
> new data types, scalar functions, improved concurrency, built-in packages,
> OCI, SQL*Plus, data movement tools, best practices and more.
> http://p.sf.net/sfu/oracle-sfdev2dev 
> _______________________________________________
> Carrot2-developers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/carrot2-developers
>
>  


------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: customizing lingo

Stanislaw Osinski
Administrator
In reply to this post by reinhard
Hi Reinhard,

i would like to know how can i customize lingo. i have checked
http://download.carrot2.org/stable/manual/
but i dont find a suitable approach for my needs.
i know chapter 6.4, 6.5 and 6.6.
my requirement is not to use the workbench, not to redeploy, not to
restart the webapp.

i have carrot2 clustering and other cluster algorithms embedded into a
webapp and i would like to change the
cluster treshold by a slider.
by changing the slider i want to change the cluster treshold in lingo.

i use this code for clustering

       final Controller controller = ControllerFactory.createSimple();
       final ProcessingResult byTopicClusters =
controller.process(documents,
               "", LingoClusteringAlgorithm.class);
       final List<org.carrot2.core.Cluster> clustersByTopic =
byTopicClusters
               .getClusters();

When it comes to using the Java API, the best place to start is the overview of the API in the Java docs: http://download.carrot2.org/stable/javadoc/overview-summary.html#overview_description.

For your application it would be best to use a controller that pools the processing components, so that they're not reinitialized for each request as the simple controller does. A complete example is here:


To provide custom values of attributes, you'll need to use a method of the controller that accepts a map of attributes, e.g.:

<a href="http://download.carrot2.org/stable/javadoc/org/carrot2/core/Controller.html#process(java.util.Map, java.lang.Class...)">http://download.carrot2.org/stable/javadoc/org/carrot2/core/Controller.html#process(java.util.Map, java.lang.Class...)
 
A complete code example in a few variants is here:


(but remember to use the pooling (and possibly also caching) controller)

If you use the above examples, you won't need to touch the attribute XMLs, these were mainly meant for static customization of attributes.

Cheers,

S.


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers