Skip to content

Instantly share code, notes, and snippets.

View gogi2811's full-sized avatar

Gaurav Lotekar gogi2811

View GitHub Profile
@dorsev
dorsev / sentiment.analysis.service.ts
Last active March 28, 2020 06:42
Sentiment Analysis example - without metrics
let senService: SentimentAnalysisService = new SentimentAnalysisService();
while (true) {
let tweetInformation = kafkaConsumer.consume()
let deserializedTweet: { msg: string } = deSerialize(tweetInformation)
let sentimentResult = senService.calculateSentiment(deserializedTweet.msg)
let seriarliedSentimentResult = serialize(sentimentResult)
sentimentStore.store(sentimentResult);
kafkaProducer.produce(seriarliedSentimentResult, 'sentiment_topic', 0);
}