Skip to content

Commit

Permalink
Synced v0.1 to Maven Central.
Browse files Browse the repository at this point in the history
  • Loading branch information
vinhkhuc committed Feb 6, 2017
1 parent 4ce4a2a commit b1a035e
Show file tree
Hide file tree
Showing 2 changed files with 144 additions and 3 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ This library provides full fastText's command line interface. It also provides t
into memory for label prediction. Model training is only done via the command line interface. Hence, JFastText
is ideal for building Java Web applications for text classification using the model trained offline.

## Maven dependency
```xml
<dependency>
<groupId>com.github.vinhkhuc</groupId>
<artifactId>jfasttext</artifactId>
<version>0.1</version>
</dependency>
```


## Building
Maven 3.x and C++ compiler (g++ on Mac/Linux or cl.exe on Windows) are required to build the Jar package.

Expand Down Expand Up @@ -34,8 +44,10 @@ jft.runCmd(new String[] {
"-output", "src/test/resources/models/supervised.model"
});

# Load model from file and do label prediction
# Load model from file
jft.loadModel("src/test/resources/models/supervised.model.bin");

# Do label prediction
String text = "What is the most popular game in the US ?";
JFastText.ProbLabel predictedProbLabel = jft.predictProba(text);
System.out.printf("\nThe label of '%s' is '%s' with probability %f\n",
Expand Down
133 changes: 131 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,151 @@
<groupId>com.github.vinhkhuc</groupId>
<artifactId>jfasttext</artifactId>
<version>0.1</version>
<packaging>jar</packaging>

<name>Java interface for fastText</name>
<description>
JFastText is a Java interface for fastText, a library for efficient learning of
word representations and sentence classification.
</description>
<packaging>jar</packaging>
<url>http://maven.apache.org</url>

<licenses>
<license>
<name>BSD License</name>
</license>
</licenses>

<developers>
<developer>
<id>vinhkhuc</id>
<name>Vinh Khuc</name>
<url>http://github.com/vinhkhuc</url>
<roles>
<role>architect</role>
<role>developer</role>
</roles>
</developer>
</developers>

<scm>
<connection>scm:git:https://github.com/vinhkhuc/JFastText.git</connection>
<developerConnection>scm:git:[email protected]:vinhkhuc/JFastText.git</developerConnection>
<url>https://github.com/vinhkhuc/JFastText</url>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.c.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<!-- Avoid Java 8's strict doc generator-->
<profiles>
<profile>
<id>disable-java8-doclint</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<properties>
<additionalparam>-Xdoclint:none</additionalparam>
</properties>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.3</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<id>enforce</id>
<configuration>
<rules>
<requireUpperBoundDeps />
<dependencyConvergence />
</rules>
</configuration>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
Expand Down

0 comments on commit b1a035e

Please sign in to comment.