Class SentimentAnalysisController

java.lang.Object
com.esprit.controllers.cinemas.SentimentAnalysisController

public class SentimentAnalysisController extends Object
Is designed to analyze text sentiment using Stanford CoreNLP pipeline. It takes a text input and returns a sentiment result as a string. The class configures the pipeline properties, initializes the StanfordCoreNLP pipeline, creates an annotation with the input text, and analyzes the text to extract sentiment annotations.
  • Constructor Details

    • SentimentAnalysisController

      public SentimentAnalysisController()
  • Method Details

    • analyzeSentiment

      public String analyzeSentiment(String text)
      Analyzes a given text using Stanford CoreNLP pipeline to extract sentiment annotations, such as positive, negative or neutral. It returns the extracted sentiment in a string format.
      Parameters:
      text - text to be analyzed for sentiment using the Stanford CoreNLP pipeline.