Class EmotionController
- java.lang.Object
-
- com.api.sentimentanalysis.controller.EmotionController
-
@RestController @RequestMapping("/api") public class EmotionController extends java.lang.ObjectController for /emotion endpoint in sentiment analysis API.- Author:
- Ariadna de Arriba
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEmotionController.ToolsAvailable Machine Learning tools.
-
Constructor Summary
Constructors Constructor Description EmotionController()
-
Method Summary
Modifier and Type Method Description org.springframework.http.ResponseEntity<java.lang.String>getEmotion(TextToAnalyze text, java.lang.String token, EmotionController.Tools tool)POST - Find the emotion in a block of text.
-
-
-
Method Detail
-
getEmotion
@PostMapping(value="/emotion", produces="application/json") public org.springframework.http.ResponseEntity<java.lang.String> getEmotion(@RequestBody TextToAnalyze text, @RequestHeader(name="Authorization",required=true) java.lang.String token, @RequestParam EmotionController.Tools tool) throws java.io.IOException, org.json.simple.parser.ParseExceptionPOST - Find the emotion in a block of text.- Parameters:
text- Text to analyze.token- Bearer token for authorization.tool- Machine learning tool for sentiment analysis.- Returns:
- Returns a ResponseEntity that contains the result of calling this POST method.
- Throws:
java.io.IOException-causedorg.json.simple.parser.ParseException- ParseException caused by parsing the json.
-
-