vader-go-intl
is an extension to the VADER sentiment analysis in Go, offering utilities to compose multiple lexicons and to generate international lexicons using translations.
- Compose Multiple Lexicons: Combine multiple lexicons for sentiment analysis into a single, unified lexicon.
- Vader Lexicon Internationalization: Generate lexicons for different languages using Google Translate.
go get github.com/maaxleq/vader-go-intl
go install github.com/maaxleq/vader-go-intl/cmd/vadergointl@latest
This command-line utility translates and generates Go code for VADER lexicons in multiple languages.
Command:
vadergointl -langs=fr,es,nl -reqs=10 -out=.
Options:
-langs
: Comma-separated list of language codes to generate lexicons for (e.g., fr, es, nl, ...).-reqs
: Number of concurrent requests to run at once for translations. Default is 10.-out
: Path where the translated lexicons folder will be created. Default is the current directory.
The compose
package allows you to combine multiple lexicons for sentiment analysis.
Example:
import (
"github.com/maaxleq/vader-go-intl/compose"
"github.com/grassmudhorses/vader-go/lexicon"
)
// Create two custom lexicons
lexicon1 := ...
lexicon2 := ...
// Combine lexicons into a single lexicon
combined := compose.ComposeLexicons(lexicon1, lexicon2)
// Use the combined lexicon for sentiment analysis
sentiment := combined.Sentiment("your text here")
This project is licensed under the MIT license.