io.github.crew102:rapidrake

A fast version of the Rapid Automatic Keyword Extraction (RAKE) algorithm

Лицензия

Лицензия

Группа

Группа

io.github.crew102
Идентификатор

Идентификатор

rapidrake
Последняя версия

Последняя версия

0.1.4
Дата

Дата

Тип

Тип

jar
Описание

Описание

io.github.crew102:rapidrake
A fast version of the Rapid Automatic Keyword Extraction (RAKE) algorithm
Ссылка на сайт

Ссылка на сайт

https://github.com/crew102/rapidrake-java
Система контроля версий

Система контроля версий

http://github.com/crew102/rapidrake-java/tree/master

Скачать rapidrake

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/io.github.crew102/rapidrake/ -->
<dependency>
    <groupId>io.github.crew102</groupId>
    <artifactId>rapidrake</artifactId>
    <version>0.1.4</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.crew102/rapidrake/
implementation 'io.github.crew102:rapidrake:0.1.4'
// https://jarcasting.com/artifacts/io.github.crew102/rapidrake/
implementation ("io.github.crew102:rapidrake:0.1.4")
'io.github.crew102:rapidrake:jar:0.1.4'
<dependency org="io.github.crew102" name="rapidrake" rev="0.1.4">
  <artifact name="rapidrake" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.crew102', module='rapidrake', version='0.1.4')
)
libraryDependencies += "io.github.crew102" % "rapidrake" % "0.1.4"
[io.github.crew102/rapidrake "0.1.4"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.apache.opennlp : opennlp-tools jar 1.8.1
org.apache.maven.plugins : maven-javadoc-plugin jar 2.9.1
org.jetbrains : annotations jar RELEASE

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.13.1

Модули Проекта

Данный проект не имеет модулей.

rapidrake

A fast version of the Rapid Automatic Keyword Extraction (RAKE) algorithm

Linux Build Status Maven Central

Installation

Assuming you're using Maven, follow these two steps to use rakidrake in your Java project:

  1. Include a dependency on rapidrake in your POM:
<dependency>
    <groupId>io.github.crew102</groupId>
    <artifactId>rapidrake</artifactId>
    <version>0.1.4</version>
</dependency>
  1. Download the opennlp trained models for sentence detection and part-of-speech tagging. You can find these two models (trained on various languages) on opennlp's model page. For example, you could use the English versions of the sentence detection and POS-tagger models. You'll specify the file paths to these models when you instantiate a RakeAlgorithm object (see below for example).

Basic usage

import io.github.crew102.rapidrake.RakeAlgorithm;
import io.github.crew102.rapidrake.data.SmartWords;
import io.github.crew102.rapidrake.model.RakeParams;
import io.github.crew102.rapidrake.model.Result;

public class Example {

  public static void main(String[] args) throws java.io.IOException {
    
    // Create an object to hold algorithm parameters
    String[] stopWords = new SmartWords().getSmartWords(); 
    String[] stopPOS = {"VB", "VBD", "VBG", "VBN", "VBP", "VBZ"}; 
    int minWordChar = 1;
    boolean shouldStem = true;
    String phraseDelims = "[-,.?():;\"!/]"; 
    RakeParams params = new RakeParams(stopWords, stopPOS, minWordChar, shouldStem, phraseDelims);
    
    // Create a RakeAlgorithm object
    String POStaggerURL = "model-bin/en-pos-maxent.bin"; // The path to your POS tagging model
    String SentDetecURL = "model-bin/en-sent.bin"; // The path to your sentence detection model
    RakeAlgorithm rakeAlg = new RakeAlgorithm(params, POStaggerURL, SentDetecURL);
    
    // Call the rake method
    String txt = "dogs are great, don't you agree? I love dogs, especially big dogs";
    Result result = rakeAlg.rake(txt);
    
    // Print the resulting keywords (not stemmed)
    System.out.println(result.distinct());
    
  }
}

// [dogs (1.33), great (1), big dogs (3.33)]

Learning more

You can learn more about how RAKE works and the various parameters you can set by visiting slowraker's website.

Версии библиотеки

Версия
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0