moodifyjs
v1.0.1
Published
Moodify-JS is JS library that combines sentiment analysis with music suggestions. Analyze the sentiment of a given text and get the music recommendations that match the detected mood.
Downloads
4
Readme
Moodify-JS
Moodify-JS is a versatile JavaScript library that seamlessly blends sentiment analysis with personalized music recommendations. Elevate user experiences in your applications by gauging the sentiment of provided text and dynamically generating music suggestions that resonate with the detected mood.
Installation
Install Moodify-JS effortlessly using npm:
npm install moodifyjs
Usage
const Moodify = require('moodifyjs'); const moodify = new Moodify();
const text = 'I am feeling great today!'; const sentiment = moodify.analyzeSentiment(text);
console.log(Detected mood: ${sentiment}
);
const musicSuggestions = moodify.getMusicSuggestions(sentiment);
console.log(Music suggestions: ${musicSuggestions.join(', ')}
);
API Reference
analyzeSentiment(text: string): string Analyze the sentiment of the given text and return the detected mood ('happy', 'sad', or 'neutral').
getMusicSuggestions(mood: string): string[] Get music suggestions based on the provided mood.
Examples
const moodify = new Moodify();
const text = 'Feeling the vibes of a sunny day!'; const sentiment = moodify.analyzeSentiment(text);
console.log(Detected mood: ${sentiment}
);
const musicSuggestions = moodify.getMusicSuggestions(sentiment);
console.log(Music suggestions: ${musicSuggestions.join(', ')}
);
Contributing Contributions are welcome! See the Contributing Guidelines for more details.
License This project is licensed under the MIT License - see the LICENSE file for details.