GithubHelp home page GithubHelp logo

shirsho-12 / rakejava Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 25 KB

A self-contained Java15 implementation of the Rapid Automatic Keyword Extraction Framework ( RAKE ) for keyword extraction.

License: MIT License

Java 100.00%
rake-nltk rake keyword-extraction nlp java

rakejava's Introduction

RAKEJava

A Java15 Implementation of the Rapid Automatic Keyword Extraction Framework ( RAKE ) for keyword extraction. This is a completely self-contained implementation not using any external models such as the Illinois POS tagger.

The Rapid Automatic Keyword Extraction (RAKE) algorithm is as described in: Rose, S., Engel, D., Cramer, N., & Cowley, W. (2010). Automatic Keyword Extraction from Individual Documents. In M. W. Berry & J. Kogan (Eds.), Text Mining: Theory and Applications: John Wiley & Sons.

The implementation follows from https://github.com/aneesha/RAKE 's Python3 model. The source code is released under the MIT License.

Example code

import src.rake;

public void run(){
  // make new model object
  RakeModel model = new RakeModel();
  
  // configurable options directly accessible from model object
  model.minKeywordFrequency = 2;   // Setting minimum number of times keyword has to appear in text to 2 (default 1)
  // Uses the Jsoup library to extract all paragraph text from Wikipedia's entry on Cheese
  String text = Jsoup.connect("https://www.wikipedia.org/wiki/Cheese")..getElementsByTag("p").text();
  // Get a reverse-sorted array (in order of decreasing scores) of keywords 
  ArrayList<String> keywords = model.run(text);  
  int i = 0;
  // Get top 10 results
  for (String keyword: keywords) {
      System.out.println(keyword + ": " + model.candidateScores.get(keyword));
      i++;
      if (i >= 10) break;
  }
}

rakejava's People

Contributors

shirsho-12 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.