AI engine for classifying market sentiment, topics, and trustworthiness from raw data using OpenAI and Redis.
- Market Sentiment Analysis: Classifies posts and data for positive, negative, or neutral sentiment.
- Topic Classification: Identifies and groups posts by relevant topics.
- Trustworthiness Scoring: Evaluates the reliability of content.
- OpenAI Integration: Uses OpenAI models for advanced NLP tasks.
- Redis Support: Caches and deduplicates processed data for efficiency.
src/
— Main source codeanalyzeSentiment.ts
— Sentiment analysis logicclassifyWithOpenAI.ts
— OpenAI classification integrationcompletePostAnalysis.ts
— Full post analysis pipelineredisClient.ts
,redisDedupeListener.ts
— Redis utilitieslib/utils.ts
— Utility functions
data/
— Sample and seed datarun-classifier.ts
— Entry point for running the classifier
- Node.js (v18 or later recommended)
- npm or yarn
- Access to OpenAI API (API key required)
- Redis server (for caching/deduplication)
- Clone the repository:
git clone https://github.com/Sentiopulse/classifier.git cd classifier
- Install dependencies:
npm install # or yarn install
Set your OpenAI API key and Redis connection details as environment variables:
export OPENAI_API_KEY=your_openai_api_key
export REDIS_URL=redis://localhost:6379
You can also use a .env
file with dotenv if preferred.
To run the classifier on sample data:
npx ts-node run-classifier.ts
Or build and run with Node.js:
npm run build
node dist/run-classifier.js
- Source code is in TypeScript (
src/
) - Lint, test, and format code before submitting PRs
npm run build
— Compile TypeScriptnpm run lint
— Lint codenpm test
— Run tests (if available)
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
- Fork the repo
- Create your feature branch (
git checkout -b feature/your-feature
) - Commit your changes
- Push to the branch (
git push origin feature/your-feature
) - Open a pull request
See the LICENSE file for details.