AIAS1/5_bigdata_sdks/flink_sentiment_analysis_sdk
2024-11-13 10:21:20 +08:00
..
models update readme. 2024-11-07 16:40:05 +08:00
src/main no message 2023-07-08 22:09:44 +08:00
flink_sentence_encoder_sdk.iml no message 2023-07-08 22:09:44 +08:00
pom.xml no message 2023-07-08 22:09:44 +08:00
README_cn.md 更新模型加载说明 2024-11-13 10:21:20 +08:00
README.md no message 2023-07-08 22:09:44 +08:00

Download the model and place it in the models directory

Sentiment analysis (Sentiment Classification) For text with subjective descriptions, it can automatically determine the sentiment polarity category of the text and give the corresponding confidence level, It can help enterprises understand user consumption habits, analyze hot topics and monitor crisis public opinion, and provide favorable decision support for enterprises.

img

SDK Algorithm:

  • Sentiment polarity is divided into two categories -Negative -Positive

Environment Preparation

Flink connects to the server port and reads data from the port. We use the lightest netcat for testing. NC (netcat) is known as the Swiss Army Knife in network tools, small in size but powerful in function.

1. Linux/Mac

nc -l 9000

2. Windows

nc -l -p 9000

Running Example - SentenceEncoderExample

Click to download test data

Enter the statement on the nc command line

...
CalvindeMacBook-Pro:~ calvin$ nc -l 9000
is alone downstairs...working
I feel bad for doing it
@RyanSeacrest is it just me, or she hates anoop. i mean seriously, she's kinda mean to him.

The corresponding statement sentiment classification result can be seen on the IDE command line

[
	class: "Negative", probability: 0.98781
	class: "Positive", probability: 0.01218
]
[
	class: "Negative", probability: 0.99725
	class: "Positive", probability: 0.00274
]
[
	class: "Negative", probability: 0.99816
	class: "Positive", probability: 0.00183
]

Mac environment install netcat

brew install nc