Documentation
¶
Overview ¶
Package pipeline provides implementation for a multi-stage sentiment analysis pipeline. The analysis is based on the PANAS-t paper, using Twitter data. It also provides a mechanism to perform parallel processing in the pipeline, and a mechanism to load-balance while achieving parallelism.
Index ¶
- func ComputeAndSave(in []chan TweetText, db database.DataStore)
- func ComputeSentimentAndSave(in chan TweetText, db database.DataStore)
- func ConsumeVTPubPT(in []chan TweetText, out []chan TweetText, indexRR *MemRR)
- func MemPartitions(num int, buffer int) []chan TweetText
- func NextIndex(m *MemRR, max int) int
- func PubProcessedText(in chan TweetText, out []chan TweetText, indexRR *MemRR)
- func PubValidText(vt TweetText, chansArray []chan TweetText, indexRR *MemRR)
- type MemRR
- type TweetText
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeAndSave ¶
ComputeAndSave triggers goroutines, each of which starts consuming a specific channel, and perform computeSentimentAndSave operation on DB.
func ComputeSentimentAndSave ¶
ComputeSentimentAndSave consumes processed TweetText from a channel, saves the text to DB, and updates the corresponding sentiments.
func ConsumeVTPubPT ¶
ConsumeVTPubPT triggers goroutines, each of which starts consuming a specific channel, and produce the processed data to a channel from a collection of channels.
func MemPartitions ¶
MemPartitions returns a slice of buffered channels, based on the partition count and buffer value.
func NextIndex ¶
NextIndex consumes the in-memory RoundRobin object, increases its Index value by 1, if it is less than the specified max value, and returns the Index value. If the Index reaches the max, it resets it to 0, and returns the Index.
func PubProcessedText ¶
PubProcessedText consumes from a channel of TweetText, process the data, and publishes to an appropriate channel from a collection of channels. The selection of a channel happens via round-robin mechanism.
func PubValidText ¶
PubValidText publishes valid TweetText data to an appropriate partition (channel) from a collection of channels. The selection of a channel happens via round-robin mechanism.