1.0.0 • Published 3 years ago
sentiment-locale v1.0.0
sentiment-locale
Languages for sentiment.
Supported languages: ro, es, it, bg, cs, hu.
Usage
const Sentiment = require("sentiment");
const { locale, languages } = require("sentiment-locale");
const sentiment = new Sentiment();
sentiment.registerLanguage("ro", locale("ro"));
const result = sentiment.analyze(
"Etanol răsturnat pe o șosea din județul Argeș, după un accident",
{ language: "ro" }
);Adding new languages
1. Generate new languages using ChatGPT (or do it manually)
Required envs: OPENAI_API_KEY, OPENAI_ORG_ID. Use .env file or add them in command line.
Generate 100 words (per sentiment) for the French language:
yarn generate --limit 100 fr2. Updated supported languages
Update const LANGUAGES in index.js with the new language.
1.0.0
3 years ago