A Node.js application that demonstrates how to use Gemma3 to process user comments about a fictional AI assistant called Jarvis.
This system processes user comments through a workflow that:
- Generates synthetic user comments
- Categorizes comments as positive, negative, or neutral
- Clusters similar comments together
- Identifies potential product features based on comment content
- Generates polite responses for each comment
ai-reviewer/
├── src/
│ ├── config.js # Configuration settings
│ ├── generator.js # Comment generation logic
│ ├── processor/
│ │ ├── index.js # Main processor
│ │ ├── categorizer.js # Comment categorization
│ │ ├── clusterer.js # Comment clustering
│ │ ├── featureId.js # Feature identification
│ │ └── responder.js # Response generation
│ └── utils.js # Utility functions
├── data/
│ └── comments.json # Generated comments storage
├── index.js # Main entry point
├── package.json
└── .nvmrc
- Node.js v20.10.0 or later (ES Modules support)
- Docker Desktop v4.40.0 or later (includes Docker Model Runner)
- Hardware Requirements:
- Minimum 3.4GB VRAM for Gemma3 model
- Minimum 2.5GB disk space for Gemma3 model
- Clone the repository
- Install dependencies:
npm install
- Enable Docker Model Runner and listen on port 12434:
docker desktop enable model-runner --tcp 12434
- Pull the Gemma3 model:
docker model pull ai/gemma3
- Pull the embeddings model:
docker model pull ai/mxbai-embed-large
Run the application:
node index.js
The application will:
- Generate synthetic user comments about Jarvis (or use existing ones if available)
- Process these comments through the workflow
- Display a summary of the results
- Save detailed results to
data/results.json
You can customize the application behavior by modifying src/config.js
:
- Change the number of comments to generate
- Adjust the Gemma3 model and parameters
- Modify the clustering similarity threshold
- Add or remove comment topics
The system uses Gemma3 to generate synthetic user comments about Jarvis, focusing on various aspects like UI, performance, features, etc. These comments are stored in JSON format with metadata.
- Categorization: Uses sentiment analysis with Gemma3 to classify comments as positive, negative, or neutral.
- Clustering: Implements embedding-based clustering to group similar comments together, even if they belong to different categories.
- Feature Identification: Extracts potential feature requests or improvements from comment clusters using Gemma3.
- Response Generation: Creates contextually appropriate, polite responses for each comment.
The system generates a summary that includes:
- Comment category distribution
- Number of clusters found
- Identified features with priority levels
- Sample comments and responses
Detailed results are saved to data/results.json
for further analysis.