You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@lucene.apache.org by PacoPeralta <pa...@hotmail.com> on 2011/06/08 11:16:22 UTC

Solr + DictionaryAnnotator UIMA

Hi.
I'm trying to integrate DictionaryAnnotator into the  UIMA module of Solr
3.1
For this purposes I have rebuild apache-solr-uima-3.2.0.jar with changes
detailed bellow:

1.-Modified OverridingParamsExtServicesAE.xml file as follow:

 Added the next section into <delegateAnalysisEngineSpecifiers>:

<delegateAnalysisEngine key="DictionaryAnnotator">
      <import name="DictionaryAnnotator"/>
</delegateAnalysisEngine>


2.- Modified the <flowConstraints> sections for adding DictionaryAnnotator 
node:
      <fixedFlow>
        <node>AggregateSentenceAE</node>
        <node>OpenCalaisAnnotator</node>
        <node>TextKeywordExtractionAEDescriptor</node>
        <node>TextLanguageDetectionAEDescriptor</node>
        <node>TextCategorizationAEDescriptor</node>
        <node>TextConceptTaggingAEDescriptor</node>
        <node>TextRankedEntityExtractionAEDescriptor</node>
		<node>DictionaryAnnotator</node>
      </fixedFlow>


3.- Added org/apache/uima/desc/DictionaryAnnotator.xml
http://lucene.472066.n3.nabble.com/file/n3038392/DictionaryAnnotator.xml
DictionaryAnnotator.xml 

4.- Added org/apache/uima/desc/dictionary.xml with words for testing
Dictionay Annotators
http://lucene.472066.n3.nabble.com/file/n3038392/dictionary.xml
dictionary.xml 

5.- Generated the file apache-solr-uima-3.2.0.jar


Then I modified solrconfig.xml to add the next FieldMapping:
 <lst name="type">
            <str name="name">org.apache.uima.TokenAnnotation</str>
            <lst name="mapping">
              <str name="feature">tokenType</str>
              <str name="field">dic_field</str>
            </lst>
          </lst>

After these steps I don't get the expected results.

Did I need to take any additional steps?

Thanks
Best Regards pacoperalta@hotmail.com





--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-DictionaryAnnotator-UIMA-tp3038392p3038392.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Re: Solr + DictionaryAnnotator UIMA

Posted by Tommaso Teofili <to...@gmail.com>.
2011/6/10 Elmer Garduno <ga...@gmail.com>

> Hi Paco
>
> It seems that you are compiling in the trunk (Solr 4), I've tested this
> patch on the 3x branch and it seems to work fine.
>
> http://svn.apache.org/repos/asf/lucene/dev/branches/branch_3x/


yes, the only problem with trunk is that some tests are failing at the
moment even if they're not related to contrib/uima.
One can go to contrib/uima and rebuild the apache-solr-uima jar and
shouldn't experience any error in 4.0 too.
Hope this helps,
Tommaso

Re: Solr + DictionaryAnnotator UIMA

Posted by Elmer Garduno <ga...@gmail.com>.
Hi Paco

It seems that you are compiling in the trunk (Solr 4), I've tested this
patch on the 3x branch and it seems to work fine.

http://svn.apache.org/repos/asf/lucene/dev/branches/branch_3x/

Hope this helps.

On Fri, Jun 10, 2011 at 5:36 AM, PacoPeralta <pa...@hotmail.com>wrote:

> Hi.
> I have tried to rebuild  solr-uima module but I get the next error message:
>
>
> BUILD FAILED
> .../contrib/uima/build.xml:55: The following error occurred while executing
> this line:
> ...solr/common-build.xml:252: .../modules/analysis/common does not exist.
>
>
> Regards
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-DictionaryAnnotator-UIMA-tp3038392p3048089.html
> Sent from the Lucene - General mailing list archive at Nabble.com.
>

Re: Solr + DictionaryAnnotator UIMA

Posted by PacoPeralta <pa...@hotmail.com>.
Hi.
I have tried to rebuild  solr-uima module but I get the next error message:


BUILD FAILED
.../contrib/uima/build.xml:55: The following error occurred while executing
this line:
...solr/common-build.xml:252: .../modules/analysis/common does not exist.


Regards

--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-DictionaryAnnotator-UIMA-tp3038392p3048089.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Re: Solr + DictionaryAnnotator UIMA

Posted by PacoPeralta <pa...@hotmail.com>.
Sorry Kojy but I still couldn't test it. I hope to to do it througthout the
day.

Best regards

--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-DictionaryAnnotator-UIMA-tp3038392p3047464.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Re: Solr + DictionaryAnnotator UIMA

Posted by Koji Sekiguchi <ko...@r.email.ne.jp>.
Paco,

How does SOLR-2581.patch work for you? If it is fine, I'm willing to commit.

koji
-- 
http://www.rondhuit.com/en/

(11/06/09 17:43), Tommaso Teofili wrote:
> Hello Paco
>
> 2011/6/9 PacoPeralta<pa...@hotmail.com>
>
>> Hi Tommaso.
>> I had added uima-an-dictionary.jar to the libs. Is that the file that I
>> have
>> to put into libs path?
>>
>
> yes it is
>
>
>>
>> According to the path, excuse my ignorance but How can I to apply it?
>>
>
> you download the patch in a directory on your computer (i.e.
> /home/user/downloads), go to your checked out svn solr directory and run:
>
> patch -p0<  /home/user/downloads/SOLR-2581.patch
>
> then you rebuild the patched solr-uima module.
> If you previously made local modifications to that module you may be asked
> to merge such changes.
>
> Regards,
> Tommaso
>
>
>
>> Thanks
>> Best regards
>>
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/Solr-DictionaryAnnotator-UIMA-tp3038392p3042919.html
>> Sent from the Lucene - General mailing list archive at Nabble.com.
>>
>

Re: Solr + DictionaryAnnotator UIMA

Posted by Tommaso Teofili <to...@gmail.com>.
Hello Paco

2011/6/9 PacoPeralta <pa...@hotmail.com>

> Hi Tommaso.
> I had added uima-an-dictionary.jar to the libs. Is that the file that I
> have
> to put into libs path?
>

yes it is


>
> According to the path, excuse my ignorance but How can I to apply it?
>

you download the patch in a directory on your computer (i.e.
/home/user/downloads), go to your checked out svn solr directory and run:

patch -p0 < /home/user/downloads/SOLR-2581.patch

then you rebuild the patched solr-uima module.
If you previously made local modifications to that module you may be asked
to merge such changes.

Regards,
Tommaso



> Thanks
> Best regards
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-DictionaryAnnotator-UIMA-tp3038392p3042919.html
> Sent from the Lucene - General mailing list archive at Nabble.com.
>

Re: Solr + DictionaryAnnotator UIMA

Posted by PacoPeralta <pa...@hotmail.com>.
Hi Tommaso.
I had added uima-an-dictionary.jar to the libs. Is that the file that I have
to put into libs path?

According to the path, excuse my ignorance but How can I to apply it?

Thanks
Best regards

--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-DictionaryAnnotator-UIMA-tp3038392p3042919.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Re: Solr + DictionaryAnnotator UIMA

Posted by Tommaso Teofili <to...@gmail.com>.
Hello Paco,

you didn't mention adding of the DictionaryAnnotator jar to the libs but I'm
pretty sure you did it.

2011/6/8 PacoPeralta <pa...@hotmail.com>

> Then I modified solrconfig.xml to add the next FieldMapping:
>  <lst name="type">
>            <str name="name">org.apache.uima.TokenAnnotation</str>
>            <lst name="mapping">
>              <str name="feature">tokenType</str>
>              <str name="field">dic_field</str>
>            </lst>
>          </lst>
>
> After these steps I don't get the expected results.
>
> Did I need to take any additional steps?
>

I think you're not getting what you expected due to the above configuration,
you've configured to use the TokenAnnotations as source for your dic_field
field but you should've been set the annotation type defined in the
dictionary.xml (org.apache.uima.DictionaryEntry).
Also, trying to debug your scenario I found an error in the UIMAToSolrMapper
so I opened SOLR-2581 [1].
This is due to the fact that DictionaryAnnotator typeSystem classes have not
be explicitly generated and included in the jar so using reflection leads to
an error, however with the patch provided I was able to make it work with
your same configuration except that for the following:

         <lst name="type">
           <str name="name">org.apache.uima.DictionaryEntry</str>
           <lst name="mapping">
             <str name="feature">coveredText</str>

             <str name="field">dic_field</str>
           </lst>
         </lst>

Hope this helps,
Tommaso

[1] : https://issues.apache.org/jira/browse/SOLR-2581