Class NLPService

java.lang.Object
com.bluebell.greenhouse.radicle.services.nlp.NLPService

@Service public class NLPService extends Object
Service-layer for nlp services.
Version:
2.0.2
Author:
Stephen Prizio
  • Constructor Details

    • NLPService

      public NLPService(edu.stanford.nlp.pipeline.StanfordCoreNLP nlp)
      Default constructor.
      Parameters:
      nlp - StanfordCoreNLP
  • Method Details

    • sanitize

      public String sanitize(String article)
      Sanitizes an article by removing unwanted elements.
      Parameters:
      article - article to sanitize
      Returns:
      sanitized article
    • summarizeWithTextRank

      public String summarizeWithTextRank(String article, int maxSentences)
      Implementation of the TextRank summarization algorithm.
      Parameters:
      article - article to summarize
      maxSentences - maximum number of sentences to include
      Returns:
      summarized article