lib-nlp


License

License

GroupId

GroupId

com.gilt
ArtifactId

ArtifactId

lib-nlp_2.10
Last Version

Last Version

0.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

lib-nlp
lib-nlp
Project URL

Project URL

https://github.com/gilt/lib-nlp
Project Organization

Project Organization

com.gilt
Source Code Management

Source Code Management

https://github.com/gilt/lib-nlp.git

Download lib-nlp_2.10

How to add to project

<!-- https://jarcasting.com/artifacts/com.gilt/lib-nlp_2.10/ -->
<dependency>
    <groupId>com.gilt</groupId>
    <artifactId>lib-nlp_2.10</artifactId>
    <version>0.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.gilt/lib-nlp_2.10/
implementation 'com.gilt:lib-nlp_2.10:0.0.2'
// https://jarcasting.com/artifacts/com.gilt/lib-nlp_2.10/
implementation ("com.gilt:lib-nlp_2.10:0.0.2")
'com.gilt:lib-nlp_2.10:jar:0.0.2'
<dependency org="com.gilt" name="lib-nlp_2.10" rev="0.0.2">
  <artifact name="lib-nlp_2.10" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.gilt', module='lib-nlp_2.10', version='0.0.2')
)
libraryDependencies += "com.gilt" % "lib-nlp_2.10" % "0.0.2"
[com.gilt/lib-nlp_2.10 "0.0.2"]

Dependencies

compile (6)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.4
com.gilt : gfc-logging_2.10 jar 0.0.2
org.apache.opennlp : opennlp-tools jar 1.5.3
com.typesafe.play : play-json_2.10 jar 2.3.6
com.typesafe.play : play-ws_2.10 jar 2.3.6
edu.mit : jwi jar 2.2.3

test (2)

Group / Artifact Type Version
org.scalatest : scalatest_2.10 jar 2.2.4
org.mockito : mockito-all jar 1.10.8

Project Modules

There are no modules declared in this project.

lib-nlp

A Simple Natural Language Processing Library for Scala.

Word Inflector

The Inflector can be used to generate plural or singular forms for input words.

val word = "world"
val plural = Inflector.pluralize(word)
val singular = Inflector.singularize(plural)

Noun Phrase Extraction

Given some input english text, the Extractor generates relevant Noun Phrases. This is done by processing the input text using the Apache OpenNLP Utilties.

val extractor = new OpenNlpExtractor()

val inputText = "This is a piece of text. There are several sentences. There may be something about a cotton turquoise dress"

extractor.extractInterestingPhrases(inputText).foreach { phrase =>
  println(phrase)
}

Synonyms

This library provides a very simple synonym generator based on WordNet. This requires that the appropriate Wordnet Dictionary files be downloaded, and installed separately.

Synonyms are generated for a given word, when used as a particular Part of Speech.

val synonymProvider = new WordnetSynonymProvider(new java.io.File("./wordnet/dict"))
val synonyms = synonymProvider.getSynonyms("pullover", PartOfSpeech.Noun)

Building on this generator, and in conjunction with Noun Phrase Extraction, a class is provided to generate Synonym Phrases

val synonymPhraseGenerator = new OpenNlpSynonymPhraseGenerator(synonymProvider)
synonymPhraseGenerator.generateSynonyms("cotton summer dress")

License

Copyright 2015 Gilt Groupe, Inc.

Licensed under the MIT License.

com.gilt

Gilt Tech

Versions

Version
0.0.2