Languages for sentiment.
Supported languages: ro
, es
, it
, bg
, cs
, hu
.
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" }
);
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 fr
Update const LANGUAGES
in index.js
with the new language.