Class BERT
- java.lang.Object
-
- com.api.sentimentanalysis.externalapi.emotion.BERT
-
- All Implemented Interfaces:
EmotionAnalysisAPI
public class BERT extends java.lang.Object implements EmotionAnalysisAPI
This class contains a method to execute the sentiment analysis with BERT model.- Author:
- Ariadna de Arriba
-
-
Method Detail
-
emotion
public java.lang.String emotion(java.lang.String text) throws java.lang.NullPointerException, java.io.IOExceptionMake a request to BERT for sentiment analysis.- Specified by:
emotionin interfaceEmotionAnalysisAPI- Parameters:
text- Text to analyze.- Returns:
- Returns a string that contains a json with each of six emotions weighted.
- Throws:
java.lang.NullPointerException-caused by an error during a call to the API and returns nothing.java.io.IOException-caused by an error in the API call.
-
-