Package io.github.crew102.rapidrake
Class RakeAlgorithm
- java.lang.Object
-
- io.github.crew102.rapidrake.RakeAlgorithm
-
public class RakeAlgorithm extends Object
The logic/implementation of the Rapid Automatic Keyword Extraction (RAKE) algorithm. The class's API includes:- A constructor which sets the algorithm's parameters (stored in a
RakeParams
object) and specifies the POS tagging and sentence detection models - The
rake(java.lang.String)
method, which runs RAKE on a string - The
getResult(java.util.ArrayList<io.github.crew102.rapidrake.model.Keyword>)
method, which takes an array ofKeyword
objects and converts their relevant instance variables to primitive arrays
- Author:
- Chris Baker
- A constructor which sets the algorithm's parameters (stored in a
-
-
Constructor Summary
Constructors Constructor Description RakeAlgorithm(RakeParams rakeParams, InputStream taggerStream, InputStream sentDectStream)
Constructor.RakeAlgorithm(RakeParams rakeParams, String taggerModelUrl, String sentDectModelUrl)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Result
getResult(ArrayList<Keyword> keywords)
Convert a list of keywords to aResult
.Result
rake(String txtEl)
Run RAKE on a single string.
-
-
-
Constructor Detail
-
RakeAlgorithm
public RakeAlgorithm(RakeParams rakeParams, String taggerModelUrl, String sentDectModelUrl) throws IOException
Constructor.- Parameters:
rakeParams
- the parameters RAKE will usetaggerModelUrl
- the URL of the trained POS tagging modelsentDectModelUrl
- the URL of the trained sentence detection model- Throws:
IOException
- if either of the URLs are invalid- See Also:
RakeParams
-
RakeAlgorithm
public RakeAlgorithm(RakeParams rakeParams, InputStream taggerStream, InputStream sentDectStream) throws IOException
Constructor.- Parameters:
rakeParams
- the parameters RAKE will usetaggerStream
- the input stream of the POS tagging modelsentDectStream
- the input stream of the sentence detection model- Throws:
IOException
- if either of the input streams are invalid- See Also:
RakeParams
-
-