Giter Site home page Giter Site logo

maaxleq / vader-go-intl Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 13 KB

An extension for vader-go providing lexicons for other languages and a CLI command to generate your own lexicons using the Google Translate API

License: MIT License

Go 100.00%

vader-go-intl's Introduction

vader-go-intl

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.

Features

  1. Compose Multiple Lexicons: Combine multiple lexicons for sentiment analysis into a single, unified lexicon.
  2. Vader Lexicon Internationalization: Generate lexicons for different languages using Google Translate.

Installation

Library

go get github.com/maaxleq/vader-go-intl

Command

go install github.com/maaxleq/vader-go-intl/cmd/vadergointl@latest

Usage

vadergointl Command

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.

compose Package

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")

License

This project is licensed under the MIT license.

vader-go-intl's People

Contributors

maaxleq avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.