Skip to content

Using JATE as a library

ziqizhang edited this page Apr 6, 2018 · 1 revision

JATE can be used as a library for term extraction. Note that it relies on Solr to index and store documents and metadata/features. Thus, you have to include Solr and related libraries as dependencies in your project. Example maven configuration of dependencies are as follows:

... 

<properties>
   <jate.version>2.0-beta.6</jate.version>
   <dragontool.version>1.3.3</dragontool.version>
   <tika.version>1.10</tika.version>
   <gson.version>2.3.1</gson.version>
   <solr.version>5.3.1</solr.version>
   <opennlp-tools.version>1.6.0</opennlp-tools.version>
</properties>

<dependencies>
      <dependency>
         <groupId>uk.ac.shef.dcs</groupId>
         <artifactId>jate</artifactId>
         <version>2.0-beta.6</version>
         <scope>system</scope>
         <systemPath>${basedir}/lib/jate-2.0-beta.6.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>org.apache.solr</groupId>
         <artifactId>solr-core</artifactId>
         <version>${solr.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.tika</groupId>
         <artifactId>tika-parsers</artifactId>
         <version>${tika.version}</version>
      </dependency>

      <dependency>
         <groupId>edu.drexel</groupId>
         <artifactId>dragontool</artifactId>
         <version>${dragontool.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.solr</groupId>
        <artifactId>solr-core</artifactId>
        <version>${solr.version}</version>
        <exclusions>
            <exclusion>
               <groupId>org.slf4j</groupId>
               <artifactId>slf4j-log4j12</artifactId>
            </exclusion>
            <exclusion>
               <groupId>log4j</groupId>
               <artifactId>log4j</artifactId>
            </exclusion>
            <exclusion>
               <groupId>org.slf4j</groupId>
               <artifactId>slf4j-jdk14</artifactId>
            </exclusion>
          </exclusions>
        </dependency>

        <!-- Needed for embeded solr -->
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-cell</artifactId>
            <version>${solr.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- test embeded solr if language detection is configured in core
            Needed for embeded solr
         -->
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-langid</artifactId>
            <version>${solr.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-solrj</artifactId>
            <version>${solr.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-jdk14</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.6.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.opennlp</groupId>
            <artifactId>opennlp-tools</artifactId>
            <version>${opennlp-tools.version}</version>
        </dependency>

        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <version>1.4.01</version>
        </dependency>

        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>

    </dependencies>

    <resources>
            <!-- include  your log configuration file -->
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
        </resources>
       
    </build>

  ...

Clone this wiki locally